Drive 6 stepper motors and make the motion smooth

I want to build a robotic arm and need to drive 6 stepper motors let them move at different speeds but in a synchronized way, just like fdm 3d printers. I guess the key is synchronization. I would like to make the motion fast and smooth.

I did some research and found that one way is getting the high frequency pulses from the timer and then generating the driving signals for all the motors by multiplying this high frequency one by different integers and do this in the ISR if necessary. Is this the way those CNC, robots or 3d printers do?

Or in short, how do those professional projects(3d printers) do to drive the motors?

Any better ideas?

In what way will they be synchronized?

The second paragraph makes no sense to me. Perhaps you could draw out a diagram (graph) showing the step timing for 2 to 3 motors.

The goal is same as those 3d printers-- PC sends xyz alpha theta omega coordinates to arduino, and arduino drives the motors to move the head there, just like a 3d printer does. those motors might move at different speeds but must start and stop at the same time for a given command sent by PC. In short, how do those professional projects(3d printers) do to drive the motors? I tried to understand their code but failed ....

The AccelStepper MultiStepper class may be of interest.

A disadvantage of the Multisrtepper library is that it does not use acceleration so the stepper speeds are limited.

It is no problem to have N motors all moving at the same time, at different speeds. To have a motor take one step, you send the driver a "step" pulse a few microseconds in duration. Likewise for the next motor.

I am still not sure what you mean by synchronized, but if it simply means "start and stop at the same time", then just start or stop sending step pulses.

The term synchronized here I used means it is not a "take turns" ways. I do see someone implements this by letting x motor move several pulses first and then y motor.

Thanks. I will have a closer look at this lib. Maybe I can add some acceleration to it.

One way to do it is a Digital Differential Analyzer. At each time step you add a fraction of 0x800000ul to a 32-bit unsigned accumulator. If the top bit gets set, pulse the stepper.

For example, if the 'A' stepper is moving 100 steps and the 'B' stepper is moving 27 steps you would use an increment of 0x80000000ul for the 'A' accumulator and 0x228F5C28ul (27/100 * 0x80000000ul) for the 'B' accumulator.

AAccumulator += AIncrement;
if (AAccumulator >= 0x80000000ul)
{
   Pulse Stepper A;
   AAccumulator -= 0x80000000ul;
}

BAccumulator += BIncrement;
if (BAccumulator >= 0x80000000ul)
{
   Pulse Stepper B;
   BAccumulator -= 0x80000000ul;
}

For 6 steppers you should probably put everything in an array.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.