The statement
pinMode (DIR, OUTPUT)conds(50);
violates the rules for C. Look at this: pinMode() - Arduino Reference
That stepper looks a bit small. I wonder if it will handle 6 Amps more than momentarily. The driver looks like a 3.5 Amp driver.
The statement
pinMode (DIR, OUTPUT)conds(50);
violates the rules for C. Look at this: pinMode() - Arduino Reference
That stepper looks a bit small. I wonder if it will handle 6 Amps more than momentarily. The driver looks like a 3.5 Amp driver.
It's small alright. Apprx a 1"x cube.
In fact, I think the label on it is a mis-print because when I go to specs on the page I bought it from, it say 0.6 amps, not 6 amps.
Good! Maybe I missed the dot. 0.6 Amp must be safe.
To what does the code conds(50) belong? Supposed to do what?
OK, all I want this thing to do is 2 settings.
Back and forth apprx. 1/4" in 1-2 seconds, and apprx. 7/16" back and forth in 2-4 seconds. Of course I can change those numbers anytime, these are just for starters to get things in motion and judge/adjust it from there. Once I get it right, it's good to go for another 15-20 years... lol
I apologize. The test code on that page is way to fast a speed. Try this code with longer delays. Get the stepper to work with the test code, first. To get the higher speeds that you want (if the stepper and driver are capable) you will have to use acceleration. See the AccelStepper library and the library examples to see how to use it.
0.6A (600mA) sounds a lot better for the coil current of that motor.
better test code:
int PUL=5; //define Pulse pin
int DIR=6; //define Direction pin
int ENA=7; //define Enable Pin
void setup() {
pinMode (PUL, OUTPUT);
pinMode (DIR, OUTPUT);
pinMode (ENA, OUTPUT);
}
void loop() {
for (int i=0; i<6400; i++) //Forward 5000 steps
{
digitalWrite(DIR,LOW);
digitalWrite(ENA,HIGH);
digitalWrite(PUL,HIGH);
delay(50);
digitalWrite(PUL,LOW);
delay(50);
}
for (int i=0; i<6400; i++) //Backward 5000 steps
{
digitalWrite(DIR,HIGH);
digitalWrite(ENA,HIGH);
digitalWrite(PUL,HIGH);
delay(50);
digitalWrite(PUL,LOW);
delay(50);
}
}
jimwag:
OK, all I want this thing to do is 2 settings.
Back and forth apprx. 1/4" in 1-2 seconds, and apprx. 7/16" back and forth in 2-4 seconds. Of course I can change those numbers anytime, these are just for starters to get things in motion and judge/adjust it from there. Once I get it right, it's good to go for another 15-20 years... lol
This line of code gives a compiler error and no code loaded to the controller. Correct it! pinMode (DIR, OUTPUT)conds(50);
groundFungus:
I apologize. The test code on that page is way to fast a speed. Try this code with longer delays. Get the stepper to work with the test code, first. To get the higher speeds that you want (if the stepper and driver are capable) you will have to use acceleration. See the AccelStepper library and the library examples to see how to use it.0.6A (600mA) sounds a lot better for the coil current of that motor.
better test code:
int PUL=5; //define Pulse pin
int DIR=6; //define Direction pin
int ENA=7; //define Enable Pin
void setup() {
pinMode (PUL, OUTPUT);
pinMode (DIR, OUTPUT);
pinMode (ENA, OUTPUT);
}
void loop() {
for (int i=0; i<6400; i++) //Forward 5000 steps
{
digitalWrite(DIR,LOW);
digitalWrite(ENA,HIGH);
digitalWrite(PUL,HIGH);
delay(50);
digitalWrite(PUL,LOW);
delay(50);
}
for (int i=0; i<6400; i++) //Backward 5000 steps
{
digitalWrite(DIR,HIGH);
digitalWrite(ENA,HIGH);
digitalWrite(PUL,HIGH);
delay(50);
digitalWrite(PUL,LOW);
delay(50);
}
}
**Now a little reaction. It is either moving so slow I can't see it, or just chattering in place ( extremely lightly, almost un noticable ).** **Definitely progress !** **So what numbers do I change to speed it up ? I can see the distance would be changing the 5000 step number, correct ?** **When I change the delay numbers, it just increases or decreases the chatter speed. Screw does not turn....**
Decrease the delays.
What is your micrsteps setting?
Check that the pins are wired according to the code. Make sure dir and step are not switched.
Put a tape flag on the shaft to better see motion.
Disconnect at least one of each coil cables, take a DMM and verify that the coils "are there". I once got a stepper having one cable broken!
groundFungus:
Decrease the delays.What is your micrsteps setting?
Check that the pins are wired according to the code. Make sure dir and step are not switched.
Put a tape flag on the shaft to better see motion.
OK, decreasing or increasing the delay just changes the speed of the chatter. No rotation.
I don't know my microstep settings, where is that so I can tell you ? lol
Railroader:
Disconnect at least one of each coil cables, take a DMM and verify that the coils "are there". I once got a stepper having one cable broken!I will, thanx !
Do you know for sure how the motor is wired? I mean do you know which wires go to which motor coil? If you don't know measure them with your Ohmmeter.
On your motor, what color wires go the A+, A-, B+ and B-?
Make sure to power the driver down before changing any wires. You might try reversing one coil. Swap the red and blue wires. Did that help?
Microstepping is controlled by the DIP switch. Micro steps set according to the huge table on the side of the driver.
OK, swapped the red and blue, chatter ( which was nearly silent) got a little louder, almost "singing" like they do, but still no motion. Same if I flipped the green and gray.
Here is how I have it wired, if you can't tell from my pix:. I am told the motor is 200 steps per revolution. 1.8 degrees.
I also checked the motor wires continuity. Red and Blue are paired, Green and Grey are paired.
?
Looks okey.
What's the last code You use?
POst #24
Thanx.
Up and running now?
No, same results....
Can You disconnect the mechanical load and run the steppers on their own?
Testing and running plenty of steppers I never faced Your problems, except for one stepper having a broken off cable.
Have You tried disconnecting the pair of cable for each coil and verified a low resistance, some Ohm or two?
No load on it, just trying to get it to work at all.. Did the meter check, all is well there.
Frustrating. The program loads just fine, no errors.