How to program a synchronized move for two EV3 Motors

| | ,

This article describes how to let two LEGO MINDSTORMS EV3 motors do the exact same movement in total harmony and synchronization. Even when the motors have different friction and load they will still synchronize. When you know how to do it, it’s simple. It requires only a little math. Here’s some mathematical background after seeing my windscreen wiper motor synchronising video tutorial on YouTube. First, here’s the video:

In the video, after using the regular motor blocks, I first show some kind of block wave. It is generated by alternating the value of a variable and waiting one second in between. Because motors don’t have infinite acceleration it takes a while before the motor is at the requested position. That’s what the green line shows. Because the green line has flat horizontal bits, the movement still looks jerky.

Synchronised motor movement programming block wave

To avoid the horizontal bits in the motor curve I then move to a sine wave. The numbers it generates are visible in the picture below. Because the movement is smooth, the motor has no difficulty of following it more or less exactly. This gives us the nice windscreen wiper movement. If you build this at home, try to play with the different numbers in the advanced math block to get a feel for what they do.

Previous

NXTPad: Revive or leave it dead?

Adding wires to the LEGO MINDSTORMS vertical plotter

Next

3 thoughts on “How to program a synchronized move for two EV3 Motors”

    • Because it’s simpler. Under the hood it does nothing but set the duty cycle (voltage) of the motor. The green move blocks have magics under the hood. Intelligence that might interfere with the closed loop feedback system and lead to unclear behavior.

Leave a Comment