Hi guys
I am having a problem driving a stepper motor using the A4988 driver and an Arduino
I have set up the wiring using an example I found online (Diagram attached) How To Control a Stepper Motor with A4988 Driver and Arduino - YouTube. However the motor does not seem to turn.
The motor I am using is from an old Hitachi printer which I took apart a while back. Printed on it is 0.9A/ph. It has six wires however I am using it as a bipolar stepper by just leaving the center tap of each winding unconnected.
I have adjusted the VREF on the A4988 board to insure that the current is limited bellow the 0.9A. To do this I used the data sheet of the A4988. As I wanted to run the motor at full step mode, the A4988 data sheet specifies that the winding current could only reach 70 percent of the current limit.
consequently:
Current limit = 0.9 * 0.7 = 0.63A
Current limit = Vref * 2, Therefor Vref = 0.63/2 = 0.315V or 315mV
I have therefor set the current limit using the potentiometer on the A4988 to aprox 315mV
Once the wiring was set up, I applied power and measured the Vref to confirm it is still the same and it was.
Next I disconnected the Power to both the Arduino and the driver and connected in the stepper motor. I then connected the power and uploaded the following code:
// defines pins numbers
const int stepPin = 3;
const int dirPin = 4;
void setup() {
// Sets the two pins as Outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
}
void loop() {
digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
// Makes 200 pulses for making one full cycle rotation
for(int x = 0; x < 200; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(5000); // five second delay
digitalWrite(dirPin,LOW); //Changes the rotations direction
// Makes 400 pulses for making two full cycle rotation
for(int x = 0; x < 400; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(5000);
}
Nothing happened... started off with 5 volts on the power supply and ramped it up to aprox 12vs however still nothing happened. I can feel the heat sink heating up on the A4988 which means power was reaching it. I measured the voltages from the Arduino to the A4988 and the power supply to the driver and the voltages matched the input. I started shaking about the power connections to and suddenly the motor made one step, but that was it. So i thought it was a problem with the breadboard. I checked the connections on the breadboard and all where connected. To be safe i decided to use another breadbord. Again nothing happened. I checked the Aarduino using the 28byj48 and UNL203 driver and stepper that came with it and they worked fine. I confirmed the wiring sequences and layout multiple times and they all matched the tutorial I followed.
My inital thinking was that the stepper motor was broken, so i disconnected it and tried running it using the power supple (5V) by connecting and disconnecting each coil in manually one by one, and it turned one step at a time, which meant that the stepper was working. Finally i decided to see if current was reaching the stepper, I therefore connected the Altimeter in series with one of the coils and it did not read any current, which meant that current was not reaching the coils.
Now i am unsure what to do, or what has gone wrong. The vref still reads aprox 310 - 320 mV, this makes me assume that driver is not fried. I do have another A4988 driver however I started working on that one and now the Vref does not go above 62mV so I'm guessing that it is burnt, however the second one reads fine.
I would really appreciate an opinion on this issue as I have no idea what to do
Many thanks for you time.
Adnan