Hello, I am rather new to arduino coding and stepper motors, so bear with me here.
I have an Arduino Uno hooked up to a Big Easy Driver which is then hooked up to my 68 oz.in stepper motor. I've managed to get it to rotate only for a set amount of revolutions and it's great, but I cannot seem to make it hold. It is near impossible to stop the motor while it is turning (showing it does have a great amount of torque) but when it is "stopped" or on a delay() it seems very easy to turn the motor by hand. Is there any way to make the motor use it's holding torque and just lock? I am guessing it has something to do with my code. I have attached it:
int Distance = 0; // Record the number of steps we've taken
void setup() {
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
}
void loop() {
digitalWrite(9, HIGH);
delayMicroseconds(17);
digitalWrite(9, LOW);
delayMicroseconds(17);
Distance = Distance + 1; // record this step
// Check to see if we are at the end of our move
if (Distance == 7200)
{
Distance = 0;
delay(1000000);
}
}
My setup is attached as well, although instead of the Easy Driver shown, I am using the Big Easy Driver. I have a 7.2 V rechargeable battery hooked up to the driver.
For a stepper motor to remain in position when stopped, you must leave it powered. With no power, it will turn fairly easily. How you do that depends on the exact driver you're using.
PaulS:
The motor driver, motor, Arduino AND Stepper library are meant to work together. Why are you not using the Stepper library?
Measure the voltage at the pins while the delay() is happening. What is it?
Well, I tried using the Stepper library as well as many other setups with the driver, arduino, and motor. Maybe I can use it, I just don't really know how. How would that help?
Also, measure the voltage where? At the coil pins going into the driver? I'm not sure what you are referring to.
MarkT:
Sending 30000 steps a second from standstill is rather ambitious - how much microstepping
are you using? Have you tried the AccelStepper library?
30000? Where do you see that? Are you referring to the microsecond delay maybe? Idk haha
Also, yes I have tried the AccelStepper library. How would that help though? And when I did use it, it will vibrate while it accelerates and decelerates.
@InfiniBro, post a link to the datasheet for your stepper motor. Without that we are all flying blind. The important parameter is the current the motor requires - not the voltage.
What have you set the current limit on your BigEasydriver at?
No, that kind of stepper is rated for current, not voltage. You would normally be
using a high voltage supply like 24 or 36V to get performance out of it.
30000? Where do you see that? Are you referring to the microsecond delay maybe? Idk haha
Of course - your code in loop() is running at about that rate. Or have you posted the wrong code?
You need the AccelStepper library, not the Stepper library to drive a step+direction stepper
driver, the Stepper library supports only unipolar and H-bridge drive, not step+direction. (Well
the version I have is like that, it might be out of date).
Robin2: @InfiniBro, post a link to the datasheet for your stepper motor. Without that we are all flying blind. The important parameter is the current the motor requires - not the voltage.
What have you set the current limit on your BigEasydriver at?
MarkT:
No, that kind of stepper is rated for current, not voltage. You would normally be
using a high voltage supply like 24 or 36V to get performance out of it.Of course - your code in loop() is running at about that rate. Or have you posted the wrong code?
You need the AccelStepper library, not the Stepper library to drive a step+direction stepper
driver, the Stepper library supports only unipolar and H-bridge drive, not step+direction. (Well
the version I have is like that, it might be out of date).
I believe it is 1.7A per phase. I didn't use any library and I am able to accurately control the steps and direction. I have found a way to make the motor hold it's torque for a second or two after it turns the given number of steps, but it does not hold.
InfiniBro:
I have found a way to make the motor hold it's torque for a second or two after it turns the given number of steps, but it does not hold.
That 1.7 amp motor is close to the limit for a BigEasydriver even with a heat sink and fan-cooling. I wonder if the problem is caused by the driver going into thermal shutdown when there is a constant current while the motor is stationary.
As a test reduce the allowed current to (say) 1 amp and see if the problem goes away. I do realize that this will not give full motor torque but it may help to isolate the cause of the problem.
Robin2:
That 1.7 amp motor is close to the limit for a BigEasydriver even with a heat sink and fan-cooling. I wonder if the problem is caused by the driver going into thermal shutdown when there is a constant current while the motor is stationary.
As a test reduce the allowed current to (say) 1 amp and see if the problem goes away. I do realize that this will not give full motor torque but it may help to isolate the cause of the problem.
...R
Are you sure the reason it only holds the torque for a second is because of my code? I will try changing the pot on the driver to adjust the current.
The Big Easy Driver has an Enable input, a Sleep input and a Reset input. Check if those are active high or active low and make sure you haven't disable the board. This will keep current going to the stepper coils even without stepping pulses being sent; that's your holding torque.