Increasing the speed of a stepper

Hi,

I am using a NEMA17 motor (it is a 24V motor) with the A-CSD 02.V stepper driver from Stepping motor drive open-frame A-CSD 02.V ( ADVANCED ) - A-CSD - STEPPING MOTOR DRIVES AND SWITCHING POWER SUPPLIES - RTA - Motion Control Systems.

I am using the Arduino Mega to operate the motor. I want to increase the speed of the stepper.

  1. I have checked the power supply. It is providing 24V as required.
  2. I am sure that the motor can be run at a higher speed as I have seen a demo of the same motor with a demo setup where the speed was higher. So it is not that the stepper is incapable.
  3. I am attaching the code I have used. To increase the speed, the delay between the HIGH-LOW transition can be reduced to influence the speed, from what I understand. I used the asm_nop command to reduce the delay below microsecond ranges as the speed with that too wasn’t sufficient. Then I wondered if the problem could be that the digitalWrite is slow. I tried direct port manipulation. The motor now doesn’t run. Am I doing the direct port manipulation wrong?
    Also, in the program where I use digitalWrite and run the stepper, the motor runs only if there is the print statement in the for loop. I am unsure as to why this is happening.

What do I do to increase the speed? Is my approach right?

Stepper_Test.ino (1.29 KB)

For stepper motors there are two parameters, pull in rate, and I think, pull out rate. To reach the very top speed the stepper must be accelerated properly. Starting from 0 RPM there is a maximum speed that can be applied directly. That speed depends on the mechanucal load of the stepper. Running at this speed the stepper speed can be raised, accelerated. Those data are stepper parameters. If the driver is intellegent it can be setup for this. Else the Arduino will have to keep track of the pulsrate.

I’m sorry but I can’t be bothered to:

  • download your sketch to my PC
  • save it to a folder with the correct name
  • open it up in the Arduino IDE
  • See if I am able to answer your question
  • delete your sketch from my hard drive afterwards
when I could have just read it on the site if you had posted it using the Code tags </>.

There may be others who feel the same way.

abhir24:
What do I do to increase the speed? Is my approach right?

You have not told us how many steps per second you are actually achieving or what step rate you would like to achieve.

If you are using a single nop as a timer then IMHO that is much too short - it is just 62.5 nanosecs. I would expect a stepper driver to require a pulse width of the order of 2 to 10 microsecs but I could not find that info on the website you linked to. And the interval between steps would need to be very much greater than that. You certainly won't get a step rate of 1 million per second. For one thing the value of micros() increments in steps of 4.

Have a look at the second example in this Simple Stepper Code. Get it working and then experiment by reducing the interval between steps.

For high step rates you will need to accelerate the motor so have a look at the code in this link

...R
Stepper Motor Basics

JohnLincoln:

when I could have just read it on the site if you had posted it using the Code tags </>.

There may be others who feel the same way.

I will remember this the next time I put up a query.

Robin2:
You have not told us how many steps per second you are actually achieving or what step rate you would like to achieve.

If you are using a single nop as a timer then IMHO that is much too short - it is just 62.5 nanosecs. I would expect a stepper driver to require a pulse width of the order of 2 to 10 microsecs but I could not find that info on the website you linked to. And the interval between steps would need to be very much greater than that. You certainly won’t get a step rate of 1 million per second. For one thing the value of micros() increments in steps of 4

I will check the links you provided. I tried it using another stepper driver and the motor worked faster with the same input parameters. The one I used was the R1025 step motor drive from http://www.farnell.com/datasheets/1732004.pdf?_ga=2.149573110.1569125807.1545288407-245369406.1543211878

Could it be that the earlier driver I was using is incapable?

Regarding the steps per second, I am trying to achieve, I want it to be 400. This would mean that a nop would be way too less for my needs.

abhir24:
Regarding the steps per second, I am trying to achieve, I want it to be 400.

The simple code in my link will easily do 400 steps per second.

…R