Hi
I am trying to drive a Nema 17 stepper motor whose model number is 17HS4401S with an A4988 module but the motor doesn't spin. I only feel very little vibration while holding the motor with my hand. Also when trying to adjust the current limit I'm not getting anything. The connection is as follows:
VMOT -----> +12V (from adapter)
GND -----> Ground (from adapter)
2B -------> Black wire of motor
2A -------> Green wire of motor
1A -------> Blue wire of motor
1B -------> Red wire of motor
VDD -----> +5V (from Arduino Uno)
GND -----> Ground (from Arduino Uno)
DIR ------> Pin 2 (from Arduino Uno)
STEP -----> Pin 3 (from Arduino Uno)
SLEEP and RESET pins are shorted together.
Here is the code I uploaded to the Arduino board.
/*
Stepper Motor Demonstration 4
Stepper-Demo4.ino
Demonstrates NEMA 17 Bipolar Stepper with A4988 Driver
DroneBot Workshop 2018
https://dronebotworkshop.com
*/
// Define Constants
// Connections to A4988
const int dirPin = 2; // Direction
const int stepPin = 3; // Step
// Motor steps per rotation
const int STEPS_PER_REV = 200;
void setup() {
// Setup the pins as Outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
}
void loop() {
// Set motor direction clockwise
digitalWrite(dirPin,HIGH);
// Spin motor one rotation slowly
for(int x = 0; x < STEPS_PER_REV; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin,LOW);
delayMicroseconds(2000);
}
// Pause for one second
delay(1000);
// Set motor direction counterclockwise
digitalWrite(dirPin,LOW);
// Spin motor two rotations quickly
for(int x = 0; x < (STEPS_PER_REV * 2); x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(1000);
digitalWrite(stepPin,LOW);
delayMicroseconds(1000);
}
// Pause for one second
delay(1000);
}
HassanAli23:
I want to test the current limit but the problem is I get 0 and no value appears.
I don't understand that. The setting of the current is measured with a multimeter. Be VERY CAREFUL never to connect or disconnect the wires between the motor and the stepper driver while the driver is powered up. The driver will be instantly destroyed.
The Pololu A4988 web page has information about setting the current limit.
Your motor can take 1.7 Amps but the A4988 will struggle to provide more than about 1.2 or 1.4 amps without overheating and shutting down to protect itself. The DRV8825 would be a more suitable driver for your motor if you need the full torque.
Robin2:
I don't understand that. The setting of the current is measured with a multimeter. Be VERY CAREFUL never to connect or disconnect the wires between the motor and the stepper driver while the driver is powered up. The driver will be instantly destroyed.
The Pololu A4988 web page has information about setting the current limit.
Your motor can take 1.7 Amps but the A4988 will struggle to provide more than about 1.2 or 1.4 amps without overheating and shutting down to protect itself. The DRV8825 would be a more suitable driver for your motor if you need the full torque.
...R
Yes, I am using the multimeter to measure the current but probably the driver is damaged since no current is sensed during the operation process. I will try the DRV8825. Thanks Robin.