Arduino Due and the AccelStepper library, how to reach max speed

Hi guys,

This is my first post so I hope I'm at the right place.

I'm working on a project where I control a stepper motor using an Arduino. The stepper needs to run at high speeds so I'm using the AccelStepper library for acceleration and decceleration. I'm also using a seperate stepper motor driver instead of the Adafruit shield.

First I used an Arduino Uno which worked fine. The only problem is that with the Arduino Uno I can't make the stepper run fast enough because of the computations that the AccelStepper library has to make with every pulse it sends. So I started looking for an alternative and found that the Arduino Due was suitable to bump up the speed and keep using the AccelStepper library.

The weird thing is that if I upload the exact same sketch to the Due I'm still not able to get to a higher speed. I get the exact same result as on the Arduino Uno. I've tested the stepper motor with a simple sketch that I wrote myself and it is capable of running nearly 5 times faster then it is running now.

So my question in short... Is there something I need to configure in the Arduino Due sketch to make use of its full computation power. Or is there something else that is limiting the speed?

I don't have a lot of experience with Arduino so I might be overseeing something simple.

All help is welcome!

jeroenvdbergh:
Hi guys,

This is my first post so I hope I'm at the right place.

I'm working on a project where I control a stepper motor using an Arduino. The stepper needs to run at high speeds so I'm using the AccelStepper library for acceleration and decceleration. I'm also using a seperate stepper motor driver instead of the Adafruit shield.

First I used an Arduino Uno which worked fine. The only problem is that with the Arduino Uno I can't make the stepper run fast enough because of the computations that the AccelStepper library has to make with every pulse it sends. So I started looking for an alternative and found that the Arduino Due was suitable to bump up the speed and keep using the AccelStepper library.

The weird thing is that if I upload the exact same sketch to the Due I'm still not able to get to a higher speed. I get the exact same result as on the Arduino Uno. I've tested the stepper motor with a simple sketch that I wrote myself and it is capable of running nearly 5 times faster then it is running now.

So my question in short... Is there something I need to configure in the Arduino Due sketch to make use of its full computation power. Or is there something else that is limiting the speed?

I don't have a lot of experience with Arduino so I might be overseeing something simple.

All help is welcome!

Which version of the Arduino IDE are you using?
What operating system are you using?
Linux, MacOSX, MS Windows, other
What version of the AccelStepper Library are you using?

Make and model of stepper motor

What are you using for the stepper motor driver?

Without more information and a circuit diagram it is difficult to provide any help.

I use this shield:
https://store.arduino.cc/usa/arduino-motor-shield-rev3

I am curious as to why the stepper motor must run at high speeds.

Thanks for your reply.

Which version of the Arduino IDE are you using?

1.8.2

What operating system are you using?

Windows 7 Professional

What version of the AccelStepper Library are you using?

1.57

Make and model of stepper motor

kinco 2s86q-051f6

What are you using for the stepper motor driver?

MSD-230-8 which is a 230 voltage stepper motor driver for large stepper motors.

I attached a schematic view of the wiring, the terminals in there are from the driver.

The stepper motor needs to move a lot of weight. So a worm gearbox will be attached to it in the future. This is why I need to make it run so fast. And it should be perfectly capable of doing that.

artisticforge:
Which version of the Arduino IDE are you using?
What operating system are you using?
Linux, MacOSX, MS Windows, other
What version of the AccelStepper Library are you using?

Make and model of stepper motor

What are you using for the stepper motor driver?

Without more information and a circuit diagram it is difficult to provide any help.

I use this shield:
https://store.arduino.cc/usa/arduino-motor-shield-rev3

I am curious as to why the stepper motor must run at high speeds.

Not sure if I replied on the correct way. Please see my post

jeroenvdbergh:
Thanks for your reply.

Which version of the Arduino IDE are you using?

1.8.2

What operating system are you using?

Windows 7 Professional

What version of the AccelStepper Library are you using?

1.57

Make and model of stepper motor

kinco 2s86q-051f6

What are you using for the stepper motor driver?

MSD-230-8 which is a 230 voltage stepper motor driver for large stepper motors.

I attached a schematic view of the wiring, the terminals in there are from the driver.

The stepper motor needs to move a lot of weight. So a worm gearbox will be attached to it in the future. This is why I need to make it run so fast. And it should be perfectly capable of doing that.

I would suggest that you upgrade the Arduino IDE to 1.8.5.

The last time I used a stepper motor that large was doing a old Bridgeport Mill conversion to CNC.
Used large stepper motors for the table with acme screws and ball nuts.

Worked well after we were done. Probably been replaced by modern equipment by now.

I may have to borrow a large stepper motor from a friend who runs a machine shop.
I will have to look at AccelStepper Library to become familiar with it.
Give me a day or two.

artisticforge:
I would suggest that you upgrade the Arduino IDE to 1.8.5.

The last time I used a stepper motor that large was doing a old Bridgeport Mill conversion to CNC.
Used large stepper motors for the table with acme screws and ball nuts.

Worked well after we were done. Probably been replaced by modern equipment by now.

I may have to borrow a large stepper motor from a friend who runs a machine shop.
I will have to look at AccelStepper Library to become familiar with it.
Give me a day or two.

Thank you for your help, I messed around with the stepper motor some more and somehow it's working now..

The Arduino Due can make the stepper run crazy fast :smiley:

Still not sure why it wasn't working at first..

artisticforge:
Which version of the Arduino IDE are you using?
What operating system are you using?
Linux, MacOSX, MS Windows, other
What version of the AccelStepper Library are you using?

Make and model of stepper motor

What are you using for the stepper motor driver?

Without more information and a circuit diagram it is difficult to provide any help.

I use this shield:
https://store.arduino.cc/usa/arduino-motor-shield-rev3

I am curious as to why the stepper motor must run at high speeds.

I am curious, are you actually saying there is not enough information there to answer this question at all? And that the make and model number (or even the operating system) are relevant? IMHO the OP has put together a perfectly formed question and you have posted a perfectly formed irrelevant response. That is the kindest way I can put it. To be blunt would be to say that your response is condescending and insulting. If you are so desperate to build up your response tally try finding another way is my advice, because this way is just rude and more than a bit silly. I know you are not alone, yours is the standard format response from some veterans on here and it comes out just as badly when they do it as well. It is a bad habit as well as poor form.

To the OP: it may be irrelevant to you now but it sounds to me like maybe the clock of the DUE wasn't set up to run at the full 84MHz. It is adjustable I believe but I don't know how. Others may have experience there. Good luck.
PE

PedantEngineer:
I am curious...

...to know why you believe the rest of your first paragraph is...

  1. On-topic.

  2. Helpful to the original poster.

PedantEngineer:
To the OP...

...is an excellent choice. Try sticking to that.