Simple Servo Driver

When it comes to driving a servo you typically have to send a PWM signal to the servo input. The frequency of this signal is about 50 Hz and the duty cycle is variable. The duty cycle is usually between about 5 and 10%, corresponding with a pulse width of about 1 to 2 ms. The conversion of a resistance value into a PWM signal is fairly straightforward when a variable RC time constant circuit is used. Converting a voltage into a PWM signal is a bit more difficult, but it does offer some useful advantages.

Simple Servo Driver Circuit Diagram



When the position of a servo can be controlled via a voltage, it can be implemented via a potentiometer acting as a voltage divider. However, you could also use the output of a sensor such as a Hall sensor, an LDR or an NTC. That way you could easily create a feed-back loop that takes account of the position, light intensity or the temperature, and use this to control the servo. This can in turn be used to open or close a gas or water valve, for example. The circuit can therefore be said to be reasonably versatile.

There are special purpose PWM modulator ICs available, but it’s just as easy to use a quad op amp such as an LM324. In the circuit op amp C is configured to output a bias signal of half the supply voltage. Op amp D is set up as a square-wave oscillator, with its frequency set to about 50 Hz, which is the frequency required by the servo. The duty cycle is fixed and set to a value slightly higher than the maximum 10%.

This is followed by an integrator that changes the waveform of the pulse into a triangular form. Op amp B is configured as a comparator that compares this triangular wave with the DC voltage Uin. The output of the comparator is a PWM signal that is suitable to drive the servo directly. The frequency is about 50 Hz and the duty cycle can be varied from just under 5% to a good 10% when Uin varies from 0.5 to 4 V. The servo, an RS-2 in our prototype, reacts to this with an angular rotation of about 200 degrees. The transfer function in this case is therefore 200 / (4–0.5) = 57 degrees per volt.

Author: Gert Baars - Copyright: Elektor

Post a Comment