Help with RC pulse to analog
HI,
I am wondering if anyone is familiar with a propellor object to measure the servo control pulse width out of an rc receiver (usually 1000 to 2000 msec) and convert it to a 0-10v or 4-20ma loop for use with some industrial type drives. Also if there is a Prop board available with analog output onboard.
Many thanks
S
I am wondering if anyone is familiar with a propellor object to measure the servo control pulse width out of an rc receiver (usually 1000 to 2000 msec) and convert it to a 0-10v or 4-20ma loop for use with some industrial type drives. Also if there is a Prop board available with analog output onboard.
Many thanks
S

Comments
http://forums.parallax.com/showthread.php?139341-trying-to-tie-an-r-c-receiver-output-to-pwm-motor-control
Could your analog output be in the form of PWM?
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 INPIN = 0 '<-- pin numbers OUTPIN = 1 PUB Main : puls ctra := %01000<<26 + INPIN 'POS detect mode for pulse in ctrb := %00110<<26 + OUTPIN 'DUTY mode for Analog out frqa := 1 dira |= 1<<OUTPIN repeat phsa := 0 repeat until phsa > 0 'wait for high pulse waitcnt(clkfreq/500 + cnt) 'wait 2ms to get entire pulse puls := phsa 'pulslength in clock ticks puls -= clkfreq/1000 'subtract 1ms puls := puls * 4095 / (clkfreq/1000) 'scale 1ms to 0..4095 frqb := puls << 20 'scale to DUTY range (32bits) 'you get 0..3.3V output at OUTPIN 'add an R-C lowpass with ~10Hz cutoff 'and then an OPAMP with a gain of 3 to get 0..10VThis is absolutely untested!For a first test you can measure the voltage at the OUTPIN with a Multimeter you should get 0..3.3V for 1ms..2ms pulses.
To get a 10V output you need a filter and an OPAMP. Here is a possible circuit:
Andy