Pages: [1]   Go Down
Author Topic: Steppermotor library or arduino limitations?  (Read 1155 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im wondering how fast i can drive a stepper motor with arduino? My test bed contains arduino uno, L298N based dual H-birdge and various bibolar steppermotors.

Am I doing something wrong because in not gettin more than about 1000 steps/sec? First I used steppermotor libary and I thought that library ads some extra complexity to stepping but when exploring that library I found that library isnt complex at all. Then I decided to do same whitout library but that library wont simplify much by doing same things other way. I ended up somewhere same limit about 1000 steps/sec.

Whith that speed cant get enough rpms to my project. Im asking what kind of stepping speeds is possible with arduino when using 4 wire bibolar steppermotor?
Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Get a proper chopper driver chip (built-in phase current control) and increase the supply voltage.
Logged

• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Two issues you need to be aware of when running stepper motors at high speed:

1. You need to increase the speed gradually, not try to go from 0 to 1000 steps/sec or more immediately.

2. At high speeds, the current doesn't have time to build up or decay in the windings because of their inductance. The best solution is a higher voltage supply and a chopper driver chip as madworm suggests (e.g. the L297, which partners well with the L298 - see http://www.technologicalarts.com/myfiles/data/AN470.pdf). If you only need a little more speed, then you can try doubling the supply voltage and putting a resistor in series with each stepper motor winding, where the value of the resistor is equal to the resistance of the winding (this is of course an inefficient way to drive high-power stepper motors). Or you can increase the supply voltage and pwm the windings yourself, although you risk damaging the stepper and/or the L298 if you get it wrong.
« Last Edit: January 07, 2012, 05:58:36 pm by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1023
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1000 steps / sec ... For full stepping that is 300 rpm, half stepping is 150 rpm, Pretty good speed for a stepper.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok. Because Im not familiar with stepper motors i wondered low rpms compared to other type of dc motors.  I done some testing and max steps/sec rises almost directly proportional to input voltage.I think In this case speed was limited by motor and/or motordriver and powersource. Of course had to be carefull to not exceed motor and driver max values.

Im interested in what kind of stepping speeds Arduino is capable of? Stepper library itself is quite lightweight, timerinterrupt driven an basicly doin only dosen of digital io writes. Dont know might that be significantly faster in pure avr platform without arduino?

Knowing HWs capapilities might save lot of lab time.   
Logged

Offline Offline
Edison Member
*
Karma: 6
Posts: leet
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.aliexpress.com/fm-store/315419/211153727-497598231/DC-5V-Gear-Stepper-Motor-4-Phase-Reduction-Step-Motor-Mini-Step-Motor-for-PIC-MCU.html

Can I full step to increase the RPM?
When I step 5.625/64 what is that called?
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1023
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It would look like your final number is 4096 steps per revolution of the output shaft.

5.625 degrees = 64 steps. 64 steps / rev * 64:1 gear ratio = 4096 steps. Every 4096 steps fed to the motor should give you 1 rotation of the output shaft.

Steppers are not used as much for rotational speed as for positioning. If you are looking for a fast rotation you should use a DC motor, but you won't have position control.
Logged

0
Offline Offline
Sr. Member
****
Karma: 3
Posts: 323
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have had no issue -sending step signals- at 5,000 steps/second with easing (quadratic or linear), and 10,000 steps/second without easing.  Of course, I have no motors on-hand that can come close to that speed at the 12V I tend to work with.  The primary difference was that instead of using digitalWrite(), I fixed my pins in hardware and used the pin register directly, and used timerone to drive the stepping asynchronously so that I could do other things.  The motion is a little different in that the minimum off-period between steps is fixed (i.e. one cycle of the timer), but to get asynchronous stepping (so I can do other stuff), was more valuable than trying to achieve off periods smaller than the interrupt period.

Of course, it only supports a single motor, so you'd slow down a bit supporting more motors, but for an example of how to do it up to 10,000 steps/second see: http://openmoco.org/docs/OMLibraries/class_o_m_motor.html  The source code can be downloaded from http://openmoco.svn.sourceforge.net/viewvc/openmoco/OpenMocoComponents/nanoMoCo/trunk/Libraries/OMMotor/

It is possible to get quite fast code if you profile your solution and test where the slow parts are.  

If you're not able to go faster than 1,000 steps/second, it's likely not a code problem and you should be running a proper chopping driver with the correct voltage and current for your application.

!c
« Last Edit: January 10, 2012, 09:43:16 am by drone » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That was my first time with stepper motors and by increasing source voltage igot quite easily 3-5000 steps/sec wit random motor. I think motor or L298N based controller was limitin factor. I Measured that arduino is capable of somewere 7-10KHz what is quite alot!
Logged

Pages: [1]   Go Up
Jump to: