Common Radio Control hobby servos are easily controlled via a microprocessor. Articles in this thread will show you how.
Part 1. Servo Basics
An RC servo is simply a small DC motor with some gears, a potentiometer attached to the gears, and feedback control circuitry to make sure the motor is in the right position.
The servo has three wires attached: Red is 6V (can run down to about 3V), Black is ground, and the third (typically white) is a Pulse Width Modulated (PWM) position input. I've tested some common Futaba servos to draw between 70 and 120mA of current at 4.8V. Your mileage will of course vary.
The PWM input has a period of 20ms and a pulse width of between 1ms and 2ms. 1.5ms would put the servo arm attached to the gears right in the middle of its range. That's it! A very simple means of control.
As the motor turns, the POT moves and the resistance changes, changing the voltage drop across it. The present servo arm position (encoded in a voltage from the POT) is fed to a pulse generator that generates a pulse of the width expected for the present arm position. This present arm position pulse is then sent to a pulse width comparator along with the input pulse. The difference between the current and desired pulses is fed to a pulse stretcher/amplifier. The stretcher/amp has two outputs that go to the H-Bridge driver: a clockwise pulse and a counter-clockwise pulse. The outputs of the H-Bridge are connected to the motor.
Servos do not have a very long lifetime when used continuously. Many people modify servos to turn them into drive motors for robots - this is a mistake. Not only are servos more expensive than most small motors, speed control is not possible without crazy modifications. If you want to do this please don't! That $15 servo has too much intellgence to use it as a workhorse. Just buy the H-Bridge and control a small DC motor (see All Electronics Corp. for cheap surplus DC motors) directly with a PWM.
|