Pages: [1]   Go Down
Author Topic: Trouble with stepper and L293D  (Read 1245 times)
0 Members and 1 Guest are viewing this topic.
Croatia
Offline Offline
Sr. Member
****
Karma: 11
Posts: 443
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I've just received my shiny new Uno and I'm attempting to run a stepper.

I'm using a L293D to drive a bipolar, 12V, 4 wire, 400 step/rotation motor  (it looks just like this one: http://www.ebay.com/itm/Applied-Motion-Products-Stepper-Motor-12VDC-5016-852-/260508343789)

Wiring is according to datasheet and a few tutorials I've found around:
Enable pins 1 and 2 and pin 16 connected to arduinos 5V
8 hooked up to positive lead of a rather old 9V adapter
2, 7, 10 and 15 connected to 8, 9, 10 and 11 on arduino
3 and 6 connected to one pair of motor wires
11 and 14 to the other pair
4, 5, 12 and 13 connected to negative of 9V adapter and GND on arduino.

Running the example code found in Examples/Stepper/stepper_oneRevolution turns the motor one way and then the other, however, increasing the RPM makes the motor not turn the full revolution. Maximum is around 30 RPM, anything higher makes the motor not turn 360 degrees.
Another thing is lack of any serious torque. It could be that's it's a weak motor (I believe it's from a very old HDD), but what about lost steps at not-so-high RPMs?

Thanks for any help.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes that is how a stepping motor works. You are running it too fast for the torque it has.
Increasing the torque is possible by increasing the current through the winding by increasing the voltage drive.

If this exceeds the current rating of the motor then you need a chopping regulated driver.
Logged

Croatia
Offline Offline
Sr. Member
****
Karma: 11
Posts: 443
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks,
So if I hook it up to a decent 12V (the motor is rated for 12V, 0,3A) I can expect higher rpm and torque, with less steps missed?

I'm pretty new to this, could you give me some general figures about achievable speeds?

Also I've noticed that the motor runs smoothly for a couple of cycles but every now and then has a hiccup where it appears to stall for fraction of a second, only to continue spinning. I'll happily attribute all of this to a crappy power supply.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm pretty new to this, could you give me some general figures about achievable speeds?
No it depends on the motor, the driver and the power supply.

Quote
but every now and then has a hiccup where it appears to stall for fraction of a second
Sounds more like the software than the power supply.

Note you also loose a bit of voltage with that chip so your 9V is probbly closer to 6V. Upping the supply to 14V would give you more.
Logged

Croatia
Offline Offline
Sr. Member
****
Karma: 11
Posts: 443
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well the software runs in a loop so wouldn't it show every time it passes over that bit of code?
Also, it's the code that comes with the environment, not something I wrote.
I'm letting it spin for a while in my own program, keeping an eye on it.

I'll try with a better psu when I find it and report back.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33371
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Well the software runs in a loop so wouldn't it show every time it passes over that bit of code?
No.
The arduino is running under background interrupts and so a loop will not run the same time all the time.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6593
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

To get more torque, you need to drive the stepper from a higher voltage, as Mike says. You're driving it from a 9v adapter, and the L293D is probably dropping around 2V (maybe even 3V). So even if the supply is maintaining 9V output under load, the motor will be getting around 7v when it is designed for 12v.

To get it to step reliably at higher speeds, you need to either increase the voltage to get more torque, or change the code to accelerate and decelerate the motor more gradually, instead of trying to go immediately from stationary to full speed.
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.

Pages: [1]   Go Up
Jump to: