Pages created and updated by Terry Sturtevant Date Posted: May 12, 2017

Robot's Servo Drive Motors

Introduction to Servos

What is a servo?
How do servos work?

The Futaba S3003 servos have been modified to run in continuous mode or free running mode. The servo has three wires,

To drive the motors, a pulse width modulated signal must be sent every 20ms. The width of the pulse will indicate direction and speed:

Driving Servo Motors from VHDL

In VHDL, you need a clock based counter to time the 20ms and to provide the basis for the pulse width modulation. The clock speed selected, i.e. 1KHz or 10KHz, will determine the precision of your control ability. The following two sample programs servo_tune.vhd and simple_ctl.vhd can be downloaded to provide you with a starting point. Remember, you have two motors moving in opposite directions to move the robot forward or back. Movement will be in a straight line if the speeds are the same. If the motors move in the same direction, the robot will spin in place assuming the speeds are the same.

Suggestions for Investigation and Calibration of Servo Motors

  1. Either end of the robot can be the "front", however, the end with the most space (usually used to mount sensors) is typically considered the front. Select a "front" for your robot. Name your two motors appropriately, i.e. left/right, port/starboard, and make sure the entire design team understands the convention. For each servo, determine the direction of spin, i.e. which signal, e.g. <1.5ms or > 1.5ms, is required to move the wheel in a forward or reverse rotation.

  2. Develop a counter design to find the neutral or dead zone of each servo motor; do not assume that they are the same. The neutral zone will be approximately 1.5ms and the motor will stop moving in the neutral zone. Send a pulse every 20ms; note that the period is always 20ms. The program should have a starting pulse width, some mechanism for increasing/decreasing the pulse width, and a mechanism for selecting the motor to examine. For the pulse width you will need a resolution of at least 0.01ms to find the dead zone; for example, neutral may be at 1.53ms not 1.50ms.

  3. Remember, the closer you are to neutral, the slower the speed of the motor. The farther you are away from neutral, the faster the speed of the motor. Design a motor speed controller based on proportional control with two speeds in both forward and reverse. See if you can get the robot to move forward in a straight line at both speeds.

  4. A motor speed controller can be designed by pulsing the the servos on and off. The motors are sent either a full speed forward or a full speed reverse signal. If the motor is then sent no signal, it will stop. Compared to a motor receiving consecutive full speed forward pulses (F-F-F-F...), a motor receiving alternate full speed and stop pulses (F-S-F-S...) will be slower and (F-S-S-F-S-S-F...) will be slower still. Design a motor speed controller based on on/off control. See if you can get the robot to move forward in a straight line at both speeds.
Creative Commons License

Information on this site which is produced by Terry Sturtevant is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Canada License.

Resources

To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.0 Strict

Valid CSS!

Wilfrid Laurier University