# How to make two motors spin at the same speed?

I am currently using two identical motors to drive a robot. The motors are both controlled using relays but one of the motors is spinning faster than the other. How can I slow down the faster motor to turn the same speed as the slow one?

• By measuring its speed and adjusting its drive accordingly. But note that this won't make your robot drive in a straight line because your wheels won't be exactly the same (and there's also slip that will be different). – Wouter van Ooijen May 9 '14 at 18:52
• Sure, in that case you will be needing special sensors like those found in optical mice. This will certainly depend on the type of surface the robot will move, speed and of course accuracy needed. – JuanΠ May 9 '14 at 19:17
• Read Wouter's comment it makes total sense. Look at the big picture not half way along - why do you need two motors to turn at exactly the same speed? Ask yourself that and re-read Wouter's wisdom. – Andy aka May 9 '14 at 20:09
• Can you put them both on the same drive shaft? – pjc50 May 9 '14 at 21:16
• I don't think OP wants to put them on the same shaft since he is probably trying to use differential drive – JuanΠ May 9 '14 at 23:09

The motors are mechanically different, so you can not get them to move at the same speed at the same voltage. This is a problem if you're driving them with relays since relays tolerate a very slow frequency, so they can not be PWM'ed.

However, if you're willing to change your design and switch to power mosfets you can basically split the problem in three:

• Measure the speed of each of the motors
• Determine which of the two is moving faster

For the first part, you will be needing a rotary encoder. There are plenty of types and can be home made.

If you're using an Arduino, reading the information from the rotary encoder and determining which is faster and which is slower should not be a problem.

Lastly, you can adjust the speed of the motors using PWM.

• The motors I am using have a 133A stall current. Are there power mosfets that could handle that high of a current? – brad123664 May 9 '14 at 20:56
• That's a lot, but it can be done with IGBTs; various people have built DIY electric cars with that kind of current through the motor controller. – pjc50 May 9 '14 at 21:15
• @brad: Yes, you can use MOSFETs to switch 133 A. That's a lot, but doable with a few FETs in parallel. IGBTs are appropriate for high voltage, not high current. Unless your voltage is also high (in which case that's a lot of power, even at just 200 V that would be 27 kW!), IGBTs are not appropriate here. – Olin Lathrop May 9 '14 at 21:40

You have not described your needs sufficiently. Wouter's comment makes what seems to be the reasonable assumption that you're driving two wheels, one on each side, each with a different motor. In that case, his comment is correct.

Depending on your physical setup, you may be better served by mechanically linking the two shafts, using gears and a timing belt.

If you must go electronic, you'll need a rather sophisticated setup. You'll need an encoder on each shaft to measure position, then a position-zeroing loop to equalize one to the other. Note that a simple velocity loop will not guarantee that the shafts, and hence the wheels, turn exactly the same amount over time. When you start up, if one wheel starts driving before the other, when the shafts equalize the first one to move will still be ahead of the other.

You need to implement a control loop. Either a speed feedback, position feedback, limit switch (in case of a limited travel movement) or any combination of the above. As for how to implement such a loop, it is a very design dependent.

If you want too change the design little bit you can actually use a high rated motor and use a crankshaft between the wheels and rotate it with the same speed motor with an gearing arrangements i hope you like my solution i will glad to hear more about it.

• Note that the question was asked four years ago. He has probably given up. Your answer is very short on details and it is not clear how a "crankshaft" would solve the problem. Welcome to EE.SE. – Transistor Feb 4 '18 at 8:36
• @Transistor: I assume the use of a crankshaft is meant to make the second motor dispensable. It is of course not a direct answer to the question, nevertheless it is kind of a solution. – Ariser - reinstate Monica Feb 4 '18 at 8:58