Connect with us

Bipolar Stepper Troubleshooting need help.....

Discussion in 'Sensors and Actuators' started by Giorgos, Apr 27, 2015.

Scroll to continue with content
  1. Giorgos

    Giorgos

    28
    1
    Apr 6, 2015
    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!
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    9,543
    1,969
    Nov 17, 2011
    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.
     
  3. Giorgos

    Giorgos

    28
    1
    Apr 6, 2015
    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.
     
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    9,543
    1,969
    Nov 17, 2011
    Meaning the motor alone. not mounted to the machine, so it has to turn only its own axle, nothing else. This is for testing the correct implementation of the code only.
     
  5. Giorgos

    Giorgos

    28
    1
    Apr 6, 2015
    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
     
  6. Harald Kapp

    Harald Kapp Moderator Moderator

    9,543
    1,969
    Nov 17, 2011
    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.
     
  7. BobK

    BobK

    7,671
    1,681
    Jan 5, 2010
    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
     
  8. Giorgos

    Giorgos

    28
    1
    Apr 6, 2015
    Problem solved! Actually the problem was in the voltage as you noticed....!

    Have a look


    Thanks a lot for the help!
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-