Arduino or Duo for stepper project

Hi I have an arduino mega which I am using to control stepper motors
I have a stepper driver that does 128 micro stepping.
If I create a program to control the driver with out the accelstepper library I can get a faster speed than if I use the library.

I would like to use the library but also get a fast top speed so if I use a duo instead will I be able to get a higher amax speed when using the accelstepper library

Thanks Russell

russell_roberts:
If I create a program to control the driver with out the accelstepper library I can get a faster speed than if I use the library.

Simplest way to answer this question is to write a short program and try it.

Assuming your driver takes step and direction signals all you need to produce steps is

digitalWrite(stepPin, HIGH);
digitalWrite(stepPin, LOW);
// delay between steps

And if that is not fast enough you can replace digitalWrite() with direct port manipulation.

I suspect the answer is YES - but at the expense of some of the accelstepper capabilities. And, of course, if the Arduino spends all its time producing step pulses it won't be able to do anything else.

...R

AccelStepper is somewhat limited by using polling - an interrupt-driven stepper
library can perform better, at the expense of dedicating a timer and stealing
a percentage of the CPU.

The raw speed of the Due will give even more speed ups of course, but what kind of
step rate are you needing?

You do realize that most small motors will "max out" around 5,000 SPS (1500 RPM) even with a decent bipolar drive?
With your 128 microstep mode that works out to 192,000. Do you need that much resolution?

Try 1/16th microstepping in the first instance, there's little advantage to more,
its just a marketing thing. Note that you do not get extra positioning accuracy,
or even resolution, especially if the motor has a load attached. The limit
to accuracy in a stepper motor is usually the concentricity error between shaft
and stator coupled with the step-tooth lamination alignment. Microsteps within
a single step are not linearly spaced either, due to the magnetic profile of the teeth.

Loading a stepper towards its limit will pull the rotor upto 1 step away from its
desired position too. So 128 microsteps starts to look stupid...

Try 1/16th microstepping in the first instance, there's little advantage to more,
its just a marketing thing.

Quite true. Microstepping was developed to help steppers run more smoothly through mechanical resonances. Truth of the matter is, it's sort of self defeating because the moment you dial in microstepping, you reduce the average power to the motor. The waveform begins to look like a sine wave and of course there is less energy in a 5V peak sine wave than a square wave of the same voltage.

Thanks Guys for your replies

I actually have an operational system now using the accel stepper library, though hopefully I can improve on it.
Too put it into some context i have a camera motion system

I have 2 trolleys running along a rail which will move vertically. On each trolley is a pan tilt system for a camera

I have:
2 steppers to pan & tilt each camera
2 steppers to move the trolleys
2 steppers, on at each end of the 3metre beam to raise & lower it

That is 8 in total. I also have 8 limit switches

I am using processing via ethernet to control the trolleys & beam movement & 2 hall effect joysticks to control the pan & tilt.

I need to zoom in too a head & shoulder shot at 8 metres so a high resolution is required so the stepping is un noticeable. At this time I am using a 4:1 gear reduction. & 64 step microstepping.

It is perfectly smooth but a little slow I can play around with the gear ratios but I am looking at the code at this time.

So people are suggesting using interrupts. I am also thinking of using these to monitor the end stop switches via a parallel to serial register to one pin.
Not yet decided how to monitor the joy stick pins.

Hi Guys

I wonder which micro stepping drivers you have practical experience of.
I have also read about the disadvantages of micro stepping but I would strongly advise you
purchasing a good one & experimenting as I did. I was pleasently surprised how effective they
are even at 128 micro steps. Total accuracy for each step I don't know. But they are designed for Industry.

If noise or smoothness in rotation are a confer really explore micro stepping.

I am using the drivers from wantai steppers. No doubt they have done some cleaver stuff under the bonnet.