Maker Pro
Maker Pro

Bipolar Stepper Troubleshooting need help.....

Hello people! I'm about to complete a project -cnc plotter- using bipolar stepper motors. The motors are coming from old dvd/cd-drivers and connected to l293d and arduino.

I tested every motor in separate by using a simple program that turns the motor 25 steps forward and 25 steps backward and no problem appeared..! But when i assembly the project, i have the following problems:

i) The motors seems to have no power to be moved, although i have Vcc2 of the l293d on 12v and so, that gives 10.4v
ii) Motor is taking wrong direction. OR after doing the forward loop, doesn't returns to the backward one but continues with another forward loop.
iii) Sometimes the motor stay in the same position and is moving only one step forward/backward.

You can see in the video what i am talking about


And this is the software (found it on the net):

int nero = 9;
int marrone = 8;
int arancio = 7;
int giallo = 6;


int delayTime = 100;

void setup() {
pinMode(nero, OUTPUT);
pinMode(marrone, OUTPUT);
pinMode(giallo, OUTPUT);
pinMode(arancio, OUTPUT);
}

void loop() {
forward(25);
delay(500);
backward(25);
}

void forward(int steps){
for(int i=0;i<steps;i++){
digitalWrite(nero, LOW);
digitalWrite(marrone, HIGH);
digitalWrite(arancio, HIGH);
digitalWrite(giallo, LOW);
delay(delayTime);

digitalWrite(nero, LOW);
digitalWrite(marrone, HIGH);
digitalWrite(arancio, LOW);
digitalWrite(giallo, HIGH);
delay(delayTime);

digitalWrite(nero, HIGH);
digitalWrite(marrone, LOW);
digitalWrite(arancio, LOW);
digitalWrite(giallo, HIGH);
delay(delayTime);

digitalWrite(nero, HIGH);
digitalWrite(marrone, LOW);
digitalWrite(arancio, HIGH);
digitalWrite(giallo, LOW);
delay(delayTime);
}
}

void backward (int steps){
for(int i=0;i<steps;i++){
digitalWrite(nero, HIGH);
digitalWrite(marrone, LOW);
digitalWrite(arancio, HIGH);
digitalWrite(giallo, LOW);
delay(delayTime);

digitalWrite(nero, HIGH);
digitalWrite(marrone, LOW);
digitalWrite(arancio, LOW);
digitalWrite(giallo, HIGH);
delay(delayTime);

digitalWrite(nero, LOW);
digitalWrite(marrone, HIGH);
digitalWrite(arancio, LOW);
digitalWrite(giallo, HIGH);
delay(delayTime);

digitalWrite(nero, LOW);
digitalWrite(marrone, HIGH);
digitalWrite(arancio, HIGH);
digitalWrite(giallo, LOW);
delay(delayTime);
}

}

I WOULD BE REALLY HAPPY IF YOU COULD HELP ME!
 

Harald Kapp

Moderator
Moderator
Does the motor follow the expected set of rotations using this same code when no load is applied (motor only)?

If so, the speed may be too fast (delayTime too short) for the motor to follow the controlling signals which in turn can lead to skipped pulses and awkward behavior.

Have a look at the stepper library for arduino. For even bettter control you may want to accelerate and decelerate the motor to the set speed using the AccelStepper library.
 
Dear friend can you please explain me what do you mean with your question? What do you mean "when no load is applied"? Sorry, i am not familiar with that.:rolleyes:

I tried the software using different delay each time. I tried short delaytime and even not short delaytime.
 
Yes i did! And that's the weird! I tested the motors before mount them on the construction and i had no problem.

And as i said, the code was going pretty good. Then i soldered longer wires, does it goes the current back and is not enough for the motor??

Any suggestions to look at?

Thanks
 

Harald Kapp

Moderator
Moderator
I don't think the wires are an issue - unless they are very thin and have significant resistance.
The issue is probbaly due to an overload of the motor If the load is too high, the motor can't follow the control voltage properly and may behave unexpectedly. Try a higher supply voltage for the motor to create more torque or use stronger motors.
 
How fast are you trying to spin the motors? The voltage required to operate steppers depends on the speed they are running at. Try slowing it way down, say a few step per second and see what it does.

Bob
 
Problem solved! Actually the problem was in the voltage as you noticed....!

Have a look

Thanks a lot for the help!
 
Top