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!
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!