Page 1 of 1

Arduino Maximum Stepper Motor Pulse Speed

PostPosted: Fri Nov 16, 2012 1:06 am
by Alen.ATLow
Hi, Any idea on the maximum stepper motor pulse output speed for built in stepper library ? I write my own stepper motor control (pulse + direction) which capable to run concurrent with serial port listening, but the highest pulse speed that I manage to get is just 2.5kHz.

Re: Arduino Maximum Stepper Motor Pulse Speed

PostPosted: Fri Nov 16, 2012 9:54 am
by robosang
There is a build in library for stepper pulses?

Re: Arduino Maximum Stepper Motor Pulse Speed

PostPosted: Fri Nov 16, 2012 10:31 am
by Alen.ATLow
i guess there are a third part library for that. but no position referencing feature. thats why i develop my own function for that. but 2.5k pulse rate is far too low than industrial standard. I am expecting at least 50kHz performance. this make my project not practical. :(
Hope 32 bit Due can solve my problem.

Re: Arduino Maximum Stepper Motor Pulse Speed

PostPosted: Fri Nov 16, 2012 5:43 pm
by sich
Try to use interrupt?

Re: Arduino Maximum Stepper Motor Pulse Speed

PostPosted: Sun Nov 18, 2012 4:56 pm
by shahrul
The rate slow because the instruction digitalWrite() is slow compare to direct instruction to the pin.
I have testing using Hi-Tech vs Pinguino with same device.

Hi-Tech = 800ns (for 2 instruction high and low)
Pinguino = 24.4us (for 2 instruction high and low)

If 24.4us, maximum freq you get is 41kHz, that is if don't have any other instruction between the pulse.
Video

Re: Arduino Maximum Stepper Motor Pulse Speed

PostPosted: Mon Nov 19, 2012 9:18 am
by Alen.ATLow
shahrul WROTE:The rate slow because the instruction digitalWrite() is slow compare to direct instruction to the pin.
I have testing using Hi-Tech vs Pinguino with same device.

Hi-Tech = 800ns (for 2 instruction high and low)
Pinguino = 24.4us (for 2 instruction high and low)

If 24.4us, maximum freq you get is 41kHz, that is if don't have any other instruction between the pulse.
Video


Thanks for your advice.
The stepper motor controller is aimed to used to control stepper motor by using serial communication or ethernet TCP. there will sure be other other coding to take care of those communication and some other calculation, such as motor referencing sequences, motion profiles, motor working area monitoring etc. I guess my best choice is wait for faster controller.

Re: Arduino Maximum Stepper Motor Pulse Speed

PostPosted: Mon Nov 19, 2012 5:27 pm
by sich
You can have a look at this nicely written Arduino Timer1 library. It is able to select different timer prescale value based on your desired frequency. I can generate pulse up to 50kHz with little error using this library.

How to use it? Just download the zip file, unzip and paste the folder (eg: TimerOne) to your Arduino libraries directory (eg: "D:\Software\arduino-1.5\libraries"). Then you will be able to use the library or try out the example given.

Re: Arduino Maximum Stepper Motor Pulse Speed

PostPosted: Mon Nov 19, 2012 5:31 pm
by Alen.ATLow
worth for a try. better than changing to Arduino Due 32bit. That card looks nice, but 3.3v is so inconvenience.

Re: Arduino Maximum Stepper Motor Pulse Speed

PostPosted: Sun Nov 25, 2012 12:05 pm
by Alen.ATLow
ISR is a nice try. manage to increase the pulse to 4.8k max. but i face another new problem. the ISR loop will drop for 6-8% on very 10s. and it is quite consistence. any one face this problem before ?