Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

synchronizing revelations

I need to control two motors at the same time but different steps numbers but they need to start and stop at the same time.
Say motor 1 needs to travel 1000 steps and 2 travels 2000 steps, then I need motor 1 to run half as fast.
However, when I set the speed of motor 1 to say 50 and the speed of motor 2 to 100 they don't stop at the same time.
Just starting and stopping them at the same time doesn't help, since I need both to do an exact number of steps.
What can I do, or how does speed (setMinSpeed, setMaxSpeed) translate to steps per second for example?

Cheers Arend


  • Hi Arend,

    The parameter for setMinSpeed, setMaxSpeed is steps per second. When the value of MaxSpeed for motor 1 is half of the value for motor 2 then it should run half as fast.
    Please bear in mind that we control individual L6470 devices; we send a start motor command in 2 separate commands, in two different SPI sessions. This latency can cause the difference in start time.

    What is your platform?

    Thanks, Arjan

  • Hey guys,

    Just a quick follow-up after a latency test. It seems that the latency between motor sync is about 900us in Python3 on an RPi3. On the RPi2 we got 2ms which is a bit longer. This isnt bad but could probably be improved.

  • @admin, it would be interested to know what the latency is when the C++ library is used. This library is not using the Linux SPI device driver, but it directly addresses the SPI interface.

  • I actually found out why just setting the speed for the second motor half as low wasn't working.
    I set the min and the max speed both to the same ... apparently this causes the thing to not work, and I ended up with both motors kind of not using
    the speed I set. Once I force minspeed to 0 all is okay.

    Thank you, Cheers Arend

Sign In or Register to comment.

Roboteurs: Technical Forum

@ 2017 Roboteurs
Powered by VanillaForums, Designed by ThemeSteam

Contact us

Get In Touch