The basics of a servo motor
Before you begin, you'll need some background on servo motors. Servo motors are somewhat similar to DC motors; however, there is an important difference. While DC motors are generally designed to move in a continuous way—rotating 360 degrees at a given speed—servos are generally designed to move within a limited set of angles. In other words, in the DC motor world, you generally want your motors to spin with continuous rotation speed that you control. In the servo motor world, you want your motor to move to a specific position that you control.
Controlling servos is fairly simple. The device has three wires connected to it: one for the ground connection, one for the drive voltage, and the third is a control signal that expects a pulse-width modulated (PWM) signal. The signal is a square wave that is turned on and off at a set rate, normally at around 500 Hz. The ratio of the length of the time the signal is on to the time the signal is off determines the desired...