Subscribe To Robotics | IntroDuction | History | Home

Friends Dont Forget To check the archieve at the left end of the page

Make Your Own Robot Tutoials

Simple Beetle Bot | Wired Robot | Combat Robot | Solar Engine |

Beam Symet | Photopopper | Beam Trimet | Line Follower |

Latest Updates
Driver Less Car | I-Sobot | MotherBoard | MicroController | Artificial Brain |

Camera Sensors Hardware | Remote Control Working


Wednesday, February 13, 2008

Robotics Tutorials - Motors

DC Motors

The beginners tutorial explained how DC motors worked and how to control them with a micro controller or the Robocore. This intermediate tutorial will look a bit more closely at the DC motor and its characteristics.

We learned that reversing the polarity of the supply current controls the direction the motor rotates. This is not the only technique that can be used to control the motor. Changing the voltage supplied to the motor can also vary its speed. But your motor controller only has 2 settings, on and off, so how can the voltage be temporarily changed? Enter a technique called pulse width modulation.

Pulse Width Modulation:

This is a technique where pulses of electricity are fed into the motor at a fairly fast rate to produce an average voltage effect. To help us understand this lets look at a few examples.

Lets say that for our pulse we'll turn on 10 volts for 40mS (40 thousandths of a second) and then we'll turn the voltage off for 10mS. If we repeat this cycle over and over the voltage is changing so quickly that the on's and off's become an average voltage. In this case the voltage is off for 20% of the time, so the average voltage to the motor is 80% of 10 volts, which is 8 volts. This will cause the motor to run slower than at 10 volts.

Therefore the speed of the motor can be changed by varying the amount of time the current is on and the current is off.

The DACPin command can be used with the motor drivers on the Robocore. Full syntax for the command can be found in the document files supplied with the Basix X software but the basic command is:

Call DACpin(Pin, Voltage, DACcounter)

Pin = The output pin
Voltage = Byte value between 0 and 255
DACcounter = The function must return a value in this variable. If more than one pin is using DACPin then each pin must use a differently names variable.

The actual results obtained once the pulse has run through the motor driver chips will vary depending on the voltage used but typically a 25% reduction in power can be achieved. With most DC motors any further reductions will not supply the motor with enough power to operate.


At this point I would like to say a little bit about torque. Torque is a measurement of the motors power. The higher the torque of the motor the more weight it can move. DC motors provide different amounts of torque depending on their running speed, which is measured in RPM (revolutions per minute). At low RPM DC motors produce poor torque, and generally the higher the RPM, the better the motors torque.

So what does this mean in practical robotics terms? Lets say that a robot is propelled by 2 DC motors. Using gears to reduce the overall speed of the robot and running the motors at top speed will result in the most power being delivered to the wheels. Using pulse width modulation too slow the motor will result in the motors not delivering less torque to drive your robot forward.

Pulse width modulation is still a very useful technique to use as it gives the programmer control over the robots speed purely using software. Sometimes you might want to slow your robot down a little, for reversing away from obstacles or turning on the spot for example.

The beginners section generally talked about what servos are and what they can do. This section is going to look more closely at how servos work and how we can program them.

How Servos Work:

To help us to understand how to control servos it may be helpful to take a closer look at how they work. Inside the servo is a control board, a set of gears, a potentiometer (a variable resistor) and a motor. The potentiometer is connected to the motor via the gear set. A control signal gives the motor a position to rotate to and the motor starts to turn. The potentiometer rotates with the motor, and as it does so its resistance changes. The control circuit monitors its resistance, as soon as it reaches the appropriate value the motor stops and the servo is in the correct position.

Controlling Servos:

Servos are positioned using a technique called pulse width modulation. This is a continuous stream of pulses sent to the servo. The pulse normally lasts for between 1ms and 2ms, depending on the positioning of the servo. The pulse has to be continually repeated for the servo to hold its position, usually around 50 to 60 times a second. It is the actual pulse that controls the position of the servo, not the number of times it's repeated every second.

A 1ms pulse will position the servo at 0 degrees, where as a 2ms pulse will position the servo at the maximum position that it can rotate to. A pulse of 1.5ms will position the servo half way round its rotation. The diagram below shows 3 typical pulses.

The diagram is not to scale but hopefully demonstrates that each pulse must be the same length. That is the combined time that the pulse is on and off.

1 comment:

Arun said...

HI I am Arun Vijay .Your blog is very good .I especially love your template.And love your articles too .

I've started a blog about robotics .

I've linked you in my blog .Can you please link me back ?