Let's Make Robots!

Motor Problem

I recently built the start here robot and was succesful and everything seems to work. I have one problem though that I don't know what the cause would be. The right motor (a solarbotics gear motor 9) runs slightly faster than the left motor and causes th robot to continually turn slightly to the left. Does anyone know how I could fix it or even add to the program to correct this?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Use pulse-width modulation to decrease the average voltage to the faster motor to slow it down.  PWM the appropriate enable input of your H-bridge.

I don't know how to do PWM on a Picaxe, but in Arduino is as simple as writing:

analogWrite(pin, 255); // max speed for the slow motor
analogWrite(pin, 250); // test out the value that will slow down the fastest motor to the speed of the slower one 

But this depends on the battey voltage. You may want to use a voltage sensor to measure the battery voltage (2 resistors in series from ground to the measured voltage, and the middle between the resistors connected to an analog input pin) and add a compensating factor to the faster motor to adjust the speed depnding on he voltage. You can also use this technique for timed distance measurement and timed turning. No encoders needed.

Another option is to wrap tape (or something) around the 'slower' wheel.  This makes the diameter larger and hence 'speeds up' the motion on that side.  Downside is grip may be reduced.

This is a typical problem. Search this site (if the search is working) and you'll see it mentioned. I have/am having the same issue. The motors are not 100% identical, so they may run a little off.  Answers I have seen posted included:

  • Live with it, who needs a robot that can drive straight anyway?
  • Take apart the motors, inspect all gears and shave/file any rough manufacturing defects, and grease gears
  • Small DC motors run faster in one direction than the other; try reversing the wiring of the slow motor (can't with the GM9, since it is a right angle gear motor)
  • Use Pulse Width Modulation (PWM) to compensate (I may tackle this one at some point, but is is overkill for the Start Here Robot.)
  • Use encoder wheels to monitor the relative speeds and compensate in software (with PWM or other technique)
  • Buy/make a differential gearbox

In my case the motors were just a little off at first, but later they were very off, and the bot kept turning right instead of going forward.  It turned out I had a faulty connection on one motor.  So if they are WAAAY off, you might check that you have firm connections to each motor contact.  If they are just a little off, that is a normal problem in robotics.

  • Take apart the motors, inspect all gears and shave/file any rough manufacturing defects, and grease gears

That's what my GM17s were/are dealing with. The cases are not quite the same and fully tightening one of them makes the internals bind. Some greasing helps but not quite 100%. I've relegated them to the parts bin till I'm forced to modify/fix them.