Using 256 microstepping with 1.8 degree motor

382 views
Skip to first unread message

Ser...@pineapplesystems.ca

unread,
Mar 29, 2018, 12:22:26 PM3/29/18
to accelstepper
Hi!

I have a stepper driver capable of 256 micro stepping and I would really like to use those. I am using an Arduino Leonardo.

To achieve a full rotation I need to step 360/1.8*256 = 51,200 steps. How can I control the speed at which the motor rotates accurately? Seems like the max speed with the microstepping I select is very very slow.

This is my setup:

stepperA.setMinPulseWidth(20);
  stepperB.setMinPulseWidth(20);
  stepperC.setMinPulseWidth(20);
  stepperA.setMaxSpeed(51200);
  stepperB.setMaxSpeed(51200);
  stepperC.setMaxSpeed(51200);
  stepperA.setAcceleration(1000);
  stepperB.setAcceleration(1000);
  stepperC.setAcceleration(1000);
  stepperA.setEnablePin(ENABLE_PIN_1);
  stepperB.setEnablePin(ENABLE_PIN_2);
  stepperC.setEnablePin(ENABLE_PIN_3);
  stepperA.disableOutputs();
  stepperB.disableOutputs();
  stepperC.disableOutputs();
stepperA.moveTo(1000000);
stepperB.moveTo(1000000);
stepperC.moveTo(1000000);

This is my loop:

      stepperA.run();
      stepperB.run();
      stepperC.run();


Hugh Gilhespie

unread,
Mar 29, 2018, 12:50:23 PM3/29/18
to accels...@googlegroups.com
Hi,

The Leonardo has a clock speed of 16 MHz, this is the same as the Arduino Uno, Nano etc. Using the Accelstepper stepper library with these chips you are limited to about 4000 pulses per second. So, if you need 51200 steps to make one full revolution, it will take about 12.8 seconds. Your maximum rotation speed will be about 4.7 rpm.

If you do want to use 256 micro stepping the only way I know to get a faster speed is to use a microcontroller with a higher clock speed. I have used Teensy 3.2 boards with a clock rate of 90 MHz very successfully but even this would only give you about 26 rpm.

Hope that helps,

Regards, Hugh




--
You received this message because you are subscribed to the Google Groups "accelstepper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to accelstepper+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ser...@pineapplesystems.ca

unread,
Mar 29, 2018, 6:01:21 PM3/29/18
to accelstepper
I see. Makes sense I thought there could be a work around. Thank you for your reply!
To unsubscribe from this group and stop receiving emails from it, send an email to accelstepper...@googlegroups.com.

Lutz Niggl

unread,
Jun 8, 2018, 3:36:55 PM6/8/18
to accelstepper


Am Donnerstag, 29. März 2018 18:50:23 UTC+2 schrieb Hugh Gilhespie:

If you do want to use 256 micro stepping the only way I know to get a faster speed is to use a microcontroller with a higher clock speed. I have used Teensy 3.2 boards with a clock rate of 90 MHz very successfully but even this would only give you about 26 rpm.


Hi, 

if you need really fast step rates on a Teensy 3.2 you could use TeensyStep (https://github.com/luni64/TeensyStep). You should be able to get about 300000 steps / sec. That would make 300000/51200*60 = 351 rpm. 

Regards Lutz

Yiorgos Theo

unread,
Jul 6, 2018, 7:52:54 PM7/6/18
to accelstepper
You can also use a ESP32 board that only costs $6-$7 and you get about 75000 steps/sec.
AccelStepper runs on it same as on Arduino, no changes needed...

start... runToPosition()
Steps = 1000000
Time1 = 13418ms
Frequency1 = 74526.76
 
start... run()
Steps = 1000000
Time2 = 13465ms
Frequency2 = 74266.62
Reply all
Reply to author
Forward
0 new messages