Pages: [1]   Go Down
Author Topic: Can't Get My Motor and Driver Set Up Again  (Read 942 times)
0 Members and 1 Guest are viewing this topic.
Winston-Salem
Offline Offline
Full Member
***
Karma: 0
Posts: 158
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.youtube.com/watch?v=HljKA6N88uc&feature=youtu.be

I bought a couple of A4983
http://www.pololu.com/catalog/product/1202
 replacement boards and hooked one up to my 1205
http://www.pololu.com/catalog/product/1205
motor. I had this running quite well a few months ago when I last had it all set up. I can’t get it to run right. I don’t know what I have done wrong.

The motor runs smoothly but slowly and it won’t stop. I tried different sets of code and get the same results. I set the for loop to only run 10 steps. I added different delays but they are ignored. I thought that the Arduino wasn’t getting updated so I took out the code void loop except for one integer. The motor reacted by not running and locking up like I thought that it would. When I put the write code back in, it runs as before.

What can I do to fix this?

This is one of the sets of code that I used.
Code:
   #define stepPin 42
    #define dirPin 44
    #define enablePin 46

    void setup()
    {
      // We set the enable pin to be an output
      pinMode(enablePin, OUTPUT);
      // then we set it HIGH so that the board is disabled until we
      // get into a known state.
      digitalWrite(enablePin, HIGH);
      Serial.begin(9600);
      Serial.println("Starting stepper exerciser.");
      pinMode(stepPin, OUTPUT);
      pinMode(dirPin, OUTPUT);
    }

    void loop()
    {
    int j;
    digitalWrite(enablePin, LOW);
    delayMicroseconds(2);
    digitalWrite(dirPin, HIGH);

    for(j=0; j<=10; j++)
      {
       digitalWrite(stepPin, LOW);
       delayMicroseconds(2);
       digitalWrite(stepPin, HIGH);
       delayMicroseconds(1000);
       Serial.println(j);
      }
      digitalWrite(enablePin, HIGH);
      delayMicroseconds(10000);
      //delay(3000);
      //while(j==10000)
      Serial.println(j);
      Serial.println("Loop");
 }
« Last Edit: October 14, 2013, 11:04:51 pm by Asa Herring » Logged

I have an Arduino Mega 2560. I also have a (pH) BNC Sensor Shield,an I2C/SPI/Onewire Shield(I beleive that it an on board clock.)and a Breakout Board Shield, all three are from Andrew Oke. Additionally, I have a Stepping Motor but could certainly buy a Servo Motor instead if it is any better for what I want to do, short term/long term. Trying to read the lable, I guess that it is: Type 57BYG. 12 V/Phase, 20ohm, 0-6A/Phase 1.8 Deg/Step, No. 04052 with a K179 Stepper Driver board attached. I can't confirm that the board is fully funtional

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 44
Posts: 2452
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You only have 10 milliseconds of delay (delayMicroseconds(10000)smiley-wink between each of your loops of 10 steps.

What are your Serial.prints showing?
Logged

Winston-Salem
Offline Offline
Full Member
***
Karma: 0
Posts: 158
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for responding. I tried different time periods and posted the wrong one.

I believe that I found the problem. I think that I have a problem with my pin 44 on the Arduino. When I move the three pin connector from 42, 44 and 46 to 32, 34, and 36, it runs just like before. It also works 43, 45 and 47.

Thanks again.
« Last Edit: October 17, 2013, 01:47:09 pm by Asa Herring » Logged

I have an Arduino Mega 2560. I also have a (pH) BNC Sensor Shield,an I2C/SPI/Onewire Shield(I beleive that it an on board clock.)and a Breakout Board Shield, all three are from Andrew Oke. Additionally, I have a Stepping Motor but could certainly buy a Servo Motor instead if it is any better for what I want to do, short term/long term. Trying to read the lable, I guess that it is: Type 57BYG. 12 V/Phase, 20ohm, 0-6A/Phase 1.8 Deg/Step, No. 04052 with a K179 Stepper Driver board attached. I can't confirm that the board is fully funtional

Pages: [1]   Go Up
Jump to: