Syncing two motors

Would anyone know a efficient way to program two motor to stay in sync? I would think you could take the difference between the two and use a PID controller to compensate. But, should I simply compare the degree readings from the Quad-encoders, or should I calculate the derivative of both and compare those? Thanks.


What are the two motors doing? If they are sharing a task, by far the easiest way to synchronize them is mechanically using a long axle, chain or gears, depending on your configuration. If you are talking about “syncing” drive motors from side to side the best way is using shaft encoders.

If you describe what you are trying to accomplish you will get better-quality answers.

Lets say I wanted to keep two sides of a drive train in sync so that it would drive straighter without mechanically connecting them. If I put quad-encoders on each side would it be better to compare the degrees of each side or degrees-per-second? Or is there an even better way to do so?


There are several other discussions on “drive straight”, as well as EasyC simple example programs.

The usual discussed method is to aim for the same value in both encoders,
so slow down the motor that is ahead, and speed up the motor that is behind.

Ok, so just just the quad-encoder values. Thanks.


Has anyone tried driving “straight” using the Gyro yet ?

We have, and it works great. Our gyro tends to have noise that causes it to add 1/10th of a degree around every second or so, but with only 20 seconds of autonomous, and one minute of driver, it still gets pretty dang accurate results.

I’d definitely recommend other teams using it, if you can afford one.