View Full Version : Discussion how to convert PWM servo signal to DC voltage
sahilkit
Oct 01, 2008, 02:32 AM
hello everyone
i what to convert a normal servo signal or pulse to proportional DC voltage how can i do this ? some thing like a ramp generator with a proportional DC out for given pulse time or length in this case .8 msec to 2.2 msec!!
or is there any simple PWM SIGNAL TO DC CONVERTER CIRCUIT ?
please help and any info is appreciated !
thanks
sahil
sahilkit
Oct 01, 2008, 03:17 AM
sorry for opening a new thread ! i found the answer all i need is integrator and S/
H circuit
vintage1
Oct 01, 2008, 03:19 AM
The trouble is there is no PRF standard..you probably want a two stage thing like a ramp up and a sample-and-hold to hold it.
It gets complex enough that a PIC is probably simpler and cheaper hardware wise.
sahilkit
Oct 02, 2008, 12:56 AM
The trouble is there is no PRF standard.
is 50hz not the standard rate ? and how can i implement this using pic ?
thanks
sahil
AleG
Oct 02, 2008, 03:08 AM
.
is 50hz not the standard rate ? and how can i implement this using pic ?
thanks
sahil
Disclaimer, I'm not a PIC user, I'm an AVR begginer.
Well, from a conceptual point of view you could feed the servo signal to a PIC input, and just measure how long the high pulse lasts without bothering with the overall frequency of the signal. Once you have a measurement of the pulse you could output the corresponding values to a digital potentiometer and leave it like that, or in turn use the pot to control a variable voltage regulator to change the voltage. I don't know if any PIC micro has inbuilt digital potentiometer or voltage regulator...
Another way, probably easier would be to use the pulse length to control the duty cycle of a PWM signal, then you should use a resistor and cap (at least) to even out the ups and downs and get a nice, constant voltage out of it.
vintage1
Oct 02, 2008, 03:51 AM
.
is 50hz not the standard rate ? and how can i implement this using pic ?
thanks
sahil
No. Many tx's will send the pulses and then add a fixed width sync pause, so PRF varies as the sticks do..
Conceptually how to do what you want in software is something like this.
Set up interrupt on level change on the input wire.
On level change
IF level is high, reset counter and start counting up.
ELSE transfer counter value to output memory location, scale as necessary, and write to DAC.
That's basically all you have to do.
The scaling and writing to DAC could be done in the main loop rather than interrupt, if preferred.
THE DAC output will be a series of constant voltage plateaux with steps marking the changes in input value to the unit. Cleverer software could smooth those out.
Acetronics
Oct 02, 2008, 04:08 AM
Hi, Sahil
http://www.sonelec-musique.com/images2/electronique_conv_pwm_tension_001b.gif
Alain
sahilkit
Oct 02, 2008, 11:46 AM
hi alain
thanks for the circuit diagram, after a bit of searching i also found similar circuit diagrams ,both are from EDN !
1. http://www.edn.com/article/CA46255.html
2. http://www.edn.com/article/CA178105.html
the whole point of this exercise was to make a crude servo amplifier system in which i give the output DC voltage to another op-amp comparator circuit whose other pin is connected to the feedback pot and then give op-amp output to the motor directly ! ( small 1-2 gram servos :) something like the one proposed in the given link )
http://www.rcgroups.com/forums/showthread.php?t=160689&page=3
thanks for all the replys
sahil
sahilkit
Oct 02, 2008, 12:16 PM
hi vintage1
No. Many tx's will send the pulses and then add a fixed width sync pause, so PRF varies as the sticks do..
i was referring to the decoder output servo signal ! and if i'm not wrong ur talking about encoder output signal ?? so what i said about 50hz PRF is right or varies some what +- 10hz to 50hz ??
thanks
sahil
jppizhere
Oct 03, 2008, 08:35 PM
50hz is correct (1-2ms pulse with 18 or ms pause), servos really are not all that picky about it by the way, as I have driven them to 100hz before they cooked and down in the 20hz range before there became any real noticable loss of force.
But yeah, with a pic measure pulse high time, interpret and mathmatically convert it to something usuable to output.
vintage1
Oct 04, 2008, 04:30 AM
hi vintage1
i was referring to the decoder output servo signal ! and if i'm not wrong ur talking about encoder output signal ?? so what i said about 50hz PRF is right or varies some what +- 10hz to 50hz ??
thanks
sahil
Its about 50Hz but there is no guarantee its any particular figure, nor that it will stay constant as the other channels are varied.
sahilkit
Oct 04, 2008, 05:54 AM
okay got it ! thanks
nfhill
Oct 04, 2008, 04:41 PM
I assume your circuit in post #8 is simplified? Without an 'H' bridge drive, you need a split +- power supply to run both directions. Std RC servos were that way about 40 years ago. Without some kind of dead-band allowance, the servo will oscillate terribly. In the end, you're redeveloping a linear servo amp which is available as a COTS product. You'll have the pleasure of doing it yourself, but at a higher cost and weight. Why not just scrounge a servo amp from a cheap servo? Even if you buy the servo new, you'll still save money.
Nick
sahilkit
Oct 05, 2008, 02:29 AM
I assume your circuit in post #8 is simplified? Without an 'H' bridge drive, you need a split +- power supply to run both directions.
It is some what simplified diagram accept for few missing parts which can make it a full circuit diagram ! and as far as h-bridge , split power supply goes you don't need it because the op-amp i have selected is an audio amplifier rated 0.5 - 1 watt which is sufficient to drive the motor directly
Std RC servos were that way about 40 years ago. Without some kind of dead-band allowance, the servo will oscillate terribly.
if u can set the gain of the op-amp properly u can reduce the oscillations to a minimum
you're redeveloping a linear servo amp which is available as a COTS product. You'll have the pleasure of doing it yourself, but at a higher cost and weight. Why not just scrounge a servo amp from a cheap servo? Even if you buy the servo new, you'll still save money.
yes this is a linear servo amplifier ! and I'm doing it for fun (plus i wanting to do this for a while almost 4 years and now I'm at stage where i can realize it)
and nick as far as cost and weight go , if and when i mass produce this amp boards i this is doing to weigh .250 grams which includes gear box base , electronics-feed back pot and servo wire ! cost will be 1-2 $ if made in the 10000 batch range !
in hope i have answered all your question , i will post some pictures once i start making the actual servo :)
sahil
sahilkit
Oct 05, 2008, 02:44 AM
wow u guys have to check this out 12mm SMD rotational position sensor similar
to Murata SV01 in dimensions but weight 1/10th of it at 0.0321 grams :eek: :p
and digikey carries it :D
link to data sheet - see the physical characteristics
http://www.bourns.com/pdfs/3382.pdf
nfhill
Oct 05, 2008, 10:23 PM
Please don't think I'm trying to discourage you from the enjoyment of doing your own design. Nor am I saying you can't do it. That said, I do think you're going down the 'reinvent the wheel' path.
Regarding the H-bridge / split power supply: I don't see how your design can drive the motor in both directions regardless of the power capabilities of the amp. Hence the use of H-bridges or split power supplies.
As for dead-band: reducing the comparator gain won't eliminate oscillation, just reduce the amplitude as well as making it hard for the servo to achieve its commanded postion. I'd suggest designing in some hysteresis in it. This would give it a dead-band behavior as well as allow higher gain.
As for weight & cost, consider the Spektrum S75 servo as an example. This servo's amp uses the Xi'an Swip YT5166 IC in a 14 pin SMD package. (an application specific COTS and thus very low cost product) The PCB is roughly 1cm sq. The SMD chip and the necessary wires make a smaller PCB doubtful. True hybrid assembly would be required to reduce the PCB size and even that would not reduce the size much, but would increase production cost quite a bit. Exclusive of the feedback pot and motor, there are 15 descrete components on the PCB to complete the amp. Two of these extras are transistors for half of the H-bridge motor drive. None of these 15 descrete components contribute to increased size of the PCB.
If you can achieve 'smaller-lighter-cheaper' than this, you'll really accomplish something. Please post your progress.
Good luck!
Nick
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.