Arduino Maximum Stepper Motor Pulse Speed

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

Arduino Maximum Stepper Motor Pulse Speed

Postby Alen.ATLow » Fri Nov 16, 2012 1:06 am

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.
Alen.ATLow
Novice
 
Posts: 17
Joined: Mon Nov 12, 2012 12:53 pm

Re: Arduino Maximum Stepper Motor Pulse Speed

Postby robosang » Fri Nov 16, 2012 9:54 am

There is a build in library for stepper pulses?
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: Arduino Maximum Stepper Motor Pulse Speed

Postby Alen.ATLow » Fri Nov 16, 2012 10:31 am

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.
Alen.ATLow
Novice
 
Posts: 17
Joined: Mon Nov 12, 2012 12:53 pm

Re: Arduino Maximum Stepper Motor Pulse Speed

Postby sich » Fri Nov 16, 2012 5:43 pm

Try to use interrupt?
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

Re: Arduino Maximum Stepper Motor Pulse Speed

Postby shahrul » Sun Nov 18, 2012 4:56 pm

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
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Arduino Maximum Stepper Motor Pulse Speed

Postby Alen.ATLow » Mon Nov 19, 2012 9:18 am

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.
Alen.ATLow
Novice
 
Posts: 17
Joined: Mon Nov 12, 2012 12:53 pm

Re: Arduino Maximum Stepper Motor Pulse Speed

Postby sich » Mon Nov 19, 2012 5:27 pm

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.
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

Re: Arduino Maximum Stepper Motor Pulse Speed

Postby Alen.ATLow » Mon Nov 19, 2012 5:31 pm

worth for a try. better than changing to Arduino Due 32bit. That card looks nice, but 3.3v is so inconvenience.
Alen.ATLow
Novice
 
Posts: 17
Joined: Mon Nov 12, 2012 12:53 pm

Re: Arduino Maximum Stepper Motor Pulse Speed

Postby Alen.ATLow » Sun Nov 25, 2012 12:05 pm

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 ?
Alen.ATLow
Novice
 
Posts: 17
Joined: Mon Nov 12, 2012 12:53 pm


Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 10 guests