Go Down

Topic: Stepper Motor Inconsistancies (Read 716 times) previous topic - next topic

Trig

I'd think that this is a common question however I didn't find any posts describing my difficulties.


I've got a stepper motor:
https://www.sparkfun.com/products/10847

An Arduino Uno and the ArduinoMotorShield.

I can get the stepper to move with accuracy at a "speed" of 30.  However changing that speed will lead to the stepper not going to the correct position.  And it seems to be directly related to the difference from 30.  i.e. a speed of 60 makes the motor only go half it's expected distance.

I've got it power from the onboard power, also tried a 12v 1a power supply.  I'm connecting the motor directly to the shield, no resistors in line (as I don't think the power supply is strong enough to overpower the board or the motor).

Another issue I'm seeing is that the LEDs on the motor shield appear to be getting feedback.  i.e. when the motor isn't connected, the leds light up in a clear order.  However when connected all the lights will flash making me think power is feeding back in off every coil...is that normal?


Questions:
1: Why when I change the speed does the accuracy of the stepper falter?

2: Why do all LED's on the MotorShield light up at the same time?


Here's the code I've been using:

Code: [Select]

#include <Stepper.h>

const int stepsPerRevolution = 200;  // change this to fit the number of steps per revolution
                          // for your motor

// initialize the stepper library on the motor shield
Stepper myStepper(stepsPerRevolution, 13,12);   

// give the motor control pins names:
const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
const int dirA = 12;
const int dirB = 13;

int x = 0;

void setup() {
     
     Serial.begin(9600);
     // set the PWM and brake pins so that the direction pins  // can be used to control the motor:
     
    pinMode(pwmA, OUTPUT);
    pinMode(pwmB, OUTPUT);
    pinMode(brakeA, OUTPUT);
    pinMode(brakeB, OUTPUT);
    digitalWrite(pwmA, HIGH);
    digitalWrite(pwmB, HIGH);
    digitalWrite(dirA, HIGH);
    digitalWrite(dirB, HIGH);
   
    digitalWrite(brakeA, LOW);
    digitalWrite(brakeB, LOW);
     
     // initialize the serial port:
     //Serial.begin(9600);
     // set the motor speed (for multiple steps only):

     myStepper.setSpeed( 30 );
     
     myStepper.step(200);
}


void loop() {
}


Thanks for any thoughts!

MarkT


I'd think that this is a common question however I didn't find any posts describing my difficulties.


I've got a stepper motor:
https://www.sparkfun.com/products/10847

An Arduino Uno and the ArduinoMotorShield.

I've got it power from the onboard power, also tried a 12v 1a power supply.  I'm connecting the motor directly to the shield, no resistors in line (as I don't think the power supply is strong enough to overpower the board or the motor).


Firstly lets clarify the power situation.  The motor is 3V 2A - commonly this would be driven from a chopper driver since its low impedance windings.

When you say "onboard power" what is the actual power supply ratings?

When you try to run a 3V 2A motor from 12V 1A power supply you expect things to work? Really?

[Oh yes, and which motor shield exactly?  IE there's no link for that]
[ I won't respond to messages, use the forum please ]

Trig

The motor is rated to 3V 2A, but from what I've read on many forms/sites they should be run higher, 12 - 24V even.  Bad idea?

The onboard power is from the Arduino Uno, so that's at 3V .5mA. The Uno has the Ardunio Motor Shield on it: http://arduino.cc/en/Main/ArduinoMotorShieldR3

I've moved away from the onboard power since that's not going to get us enough torque. I'm got a cheapie 12V 1A power supply connected to the terminals on the Motor Shiled (Vin, Gnd).  And I cut the power jumper under the Vin pin on the side of the board.

Everything runs nice an cool, the shield and motor are both room temp.

I found through trial and error that putting a resistor on one lead per each channel that drives the coils that I no longer get power feedback into the board.  I was using 200 ohm resistors since those were handy. The stepper works great now.  However it's really weak, very little torque.

I've tried balancing the circuit as best possible - or so I think.

Attempting the little circuitry knowledge that I remember: Voltage * Amperage = Resistance

12v * 1a = 12 ohm resistor. (Correct?)  I've got a 10 ohm on it now (just roll with it) and the motor is still not strong enough. Is there anything that I could improve upon? Or is this about the limit?

MarkT


The motor is rated to 3V 2A, but from what I've read on many forms/sites they should be run higher, 12 - 24V even.  Bad idea?


Hopeless idea.  The windings are 1.5 ohm and want 2A for full torque.  24V would mean 16A and a small explosion and fire.

Perhaps you are thinking about using a bipolar motor chopper drive, which provides constant current drive for a low-impedance motor from a high voltage supply?  In that case you'll need a driver that does this, such as the A4988, L6208 among many others.

This method allows much faster stepping since the whole voltage of the supply is available, if required, to overcome back-EMF.
[ I won't respond to messages, use the forum please ]

Trig

Go info. So I think my solution is a different question.

Using the Arduino Uno and Arduino motor shield.  What kind of stepper motor can I use to pull 6 lbs. The goal is to fairly accurately raise it to different levels.  It's currently able to pull the weight up about 1/2 the needed distance. This is for a one day activity, crude, not intended to run more than a few hours so nothing to fancy/expensive.

Any ideas?

MarkT

(Rotary) motors are rated in torque, not force.  You'll have to work out what torque you need given the geometry of the setup you have.
[ I won't respond to messages, use the forum please ]

Go Up