Home Chapter 10 Servomotors
Servomotors


Those who have played with radio control cars or planes might be familiar with servomotors. They are used in the special effects industry and they are popular with artists, puppeteers, and inventors for their ease of use in the creation of interactive sculpture, inventions, and environments. Servomotors are motors that you can be easily positioned because they possess a simplified feedback-mechanism that allows them to have a sense of their rotational location in space. They consist of plastic case, DC motor, output shaft bearing, potentiometer, electronics, and a gear train. There are varieties of servos with metal gears and some with plastic gears, and, of course, the metal gear servos will last longer and be more robust.

 

 Servomotor 

 

The intelligence of a servomotor is the feedback from the potentiometer, which allows the microcontroller to tell the motor where to go with a command. The motor will go to that position and stay there as long as that position command exists and is asserted by your microprocessor.

 

Servo motor deconstructed showing the potentiometer and gears. The POT is the encoder for the motor.

 

The common servomotor will rotate from 0--180°, and using the microcontroller you can turn it rapidly in either direction, as well as step it degree by degree. Servos use a voltage in the range of 4--6 volts. To make a servo hold its position, a pulse must be sent to instruct it to stay in that desired spot.

You can communicate the angle that the servo rotates by the duration of the pulse that is sent to the servo control circuit from your BS2.

In robotics, this is called pulse width modulation. A servomotor needs a stream of pulses in order to move. The BS2 has a special command called PULSOUT, which allows you to create an accurate pulse width. Every 20 ms, the Stamp sends a pulse that is between 1 and 2 ms in length. The length of the pulse allows the motor to turn to exact locations in relation the width of this pulse. If the servo receives a pulse that is 1 ms in length, it will rotate to one extreme, and as the pulse width increases to 2 ms in length, it will move toward the other extreme.

For example, a 1.5 ms pulse causes the motor to turn to a 90° position. When the pulse is shorter than 1.5 ms, then the control circuit will turn the shaft towards the 0° position. When the length of the pulse is longer than 1.5 ms, it communicates to the control circuitry to turn the shaft towards the 180º position.

 

Pulse Width Modulation (PWM) is the process of changing the width of a pulse so it can control a device looking for that coded pulse.

 

You can also purchase servos that have been modified to turn 360° in either direction and these are used extensively in smaller mobile robotic platforms.

 

 
 

Servomotor. The pulse duration is proportional to the angle of the output shaft.

 

Servos are marvelous because they have high torque for their low cost. The more torque you get in a servo generally the price will go up. It is also very easy to control many servos at the same time as there are also dedicated servomotor controllers, which allow you to control up to 16 servomotors from a single microprocessor or you can connect multiple servo controllers together to allow control of 32 servo motors.

Using a dedicated servomotor controller could be roughly analogous to the autonomic nervous system in that these servo controllers can function in the background.