Pages: [1]   Go Down
Author Topic: Stepper Motor Accuracy  (Read 1701 times)
0 Members and 1 Guest are viewing this topic.
US
Offline Offline
Newbie
*
Karma: 0
Posts: 27
What does this button do?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Doing some testing using a Pololu stepper controller:
http://www.pololu.com/catalog/product/1202

and SparkFun stepper motor:
http://www.sparkfun.com/products/9238

Connected to a 12V, 12 amp power supply.

I calibrated the amps going into the motor. (basically 70% of the motors rated amps)

There is no weight load on the motor.

But when I feed it this code about every 20 seconds:

Code:
int j;
digitalWrite(3, HIGH); //direction

for(j=0; j<=200; j++) {
digitalWrite(stepPin, LOW);
delayMicroseconds(500);
digitalWrite(stepPin, HIGH);
delayMicroseconds(500);
}


After a very few rotations the stop point is always shifting farther and farther. Like it's adding steps each rotation.

200 steps should end in the same place every time I call this code. But it never does.

Am I doing something wrong?

Thanks for any help  : )


Side questions. Is there any documentation on how the combination of delay times between the HIGH/LOWs affect the speed/torque/motion?

Are there example sketches for using this controller board? Or do I have to substitute? For example dir/step code for the EasyDriver should work on the Pololu?


Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5589
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Am I doing something wrong?

Yes - you are assuming that a stepper motor a) has no mass, and therefore no inertia, and b) has no need for any kind of encoder to ensure repeatability in positioning.

Both of these assumptions are false; the rotor of a stepper has mass, and inertia once you have it moving. It takes time to stop such a moving mass, possibly enough time to overshoot the stopping point. A way around this would be to ramp up and down the speed as you approach end-points. With that said, a better way of determining shaft position is with an encoder of some sort.

Finally - even with all the encoders and careful stepping in the world, you're still possibly going to end up with some form of error in positioning. Welcome to the world of mechatronics.

 smiley-lol
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

j=0; j<=200
that is 201 steps!!
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 495
Posts: 19015
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quite right. If it was not advancing one step per execution of that code, then there would be something wrong.
Logged


Pages: [1]   Go Up
Jump to: