I am attempting to control a Nema 17 step motor using the Arduino Uno through the stop motion software Dragonframe, and cannot get any motors to move.
I have the Arduino Uno loaded up with the the sketch provided through Dragonframe located at the bottom.
Attached to that I have the CNC V3 shield you see in tutorials all over the internet. I have an A4988 driver and Nema 17 motor all running through that.
When I run the program, the green light on the Arduino comes on, and when I run a move, the orange light flashes so I'm sure I'm sending signal. I've tried swapping out the shield, drivers, and motor, as well as trying multiple channels both on the shield and in the software. I've double checked the polarity on the polarity and voltage to the motor, and the voltage through the driver potentiometer. When everything is powered, the motor holds firm to a light touch so I know the motor is receiving power, but I can't get anything to move. I've tried using another simple motor move sketch that I found on another thread on here, but that doesn't work either...
Any thoughts? Is there a step I'm missing or a piece I'm not troubleshooting?
Much Thanks
// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// this version uses delay() to manage timingbyte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20; // microseconds
int millisbetweenSteps = 250; // milliseconds - or try 1000 for slower stepsvoid setup() {
Serial.begin(9600);
Serial.println("Starting StepperTest");
digitalWrite(ledPin, LOW);delay(2000);
pinMode(directionPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(ledPin, OUTPUT);digitalWrite(directionPin, HIGH);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulseWidthMicros); // this line is probably unnecessary
digitalWrite(stepPin, LOW);delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}delay(3000);
digitalWrite(directionPin, LOW);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
// delayMicroseconds(pulseWidthMicros); // probably not needed
digitalWrite(stepPin, LOW);delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
}void loop() {
}