CNC shield with A4988 not supplying enough current to the stepper motor

Hello,
I'm quite new to arduino, but lately I have been playing around with the CNC shield and A4988 and stepper motor nema 17 (3.3V 1.5A). But I can't get the motor running. When i turn mine arduino uno on the motor doesn't move, but when i measure 1A current and the stepper needs 1.5 A. I have already tried turning the pot on the driver. I even tried setting it to the maximum current, but the highest current that I measured is just 1A. Could it be fault of the CNC shield? I once did short it on accident...

Please post a link to the datasheet of exactly Your stepper. Your post is not good enough.

What instrument did You use? Many DMM will "tell stories" applied to such motor currents as they are switched.
How did You do that measuring? Removing any coil cable when motor power is on will ruin the driver, and then no move takes place.

You made a short. That's bad and could cause serious trouble. Point out the short in schematics.... Sending You a bible of guesses isn't the best way to help You.


This is the datasheet of the stepper i used, unfortunately I didn't find a more detailed one. I was very careful to not remove any cable while power was on as I already knew that it would ruin the driver. I measured the current with a multimeter i connected 3 wires to the stepper and 1 through the multimeter and back to the motor. I kept in mind that the supply is switched so on the multimeter I used a function that only measures maximum current. And the short i mentioned already happened some time ago and between that time and now i didn't do much with my project and i don't remember how the short occurred, but since than I have new driver of the same type. But i think that i accidentaly left the power on and on the shield shorted the B1 and B2 stepper control pins

A stepper is current driven. Use 12V or more for the stepper driver. See here. The stepper driver limit the used current.

Only to achieve the maximum rated torque. But the A4988 can't deliver 1.5A. It can provide about 1 A maximum, steady state. It you set it for more, the driver will overheat and shut down.

For full torque, use a motor driver capable of delivering at least 1.5A. The DRV8825 can do that, but may need forced air cooling.

Don't forget to set the driver current limit correctly, following the instructions in the data sheet.

I'm not sure if i should use DRV8825, because i bought this stepper motor in one package together with the driver A4988

Poor choice.

If you don't take max speed and not too high voltage, it is possible that it works.

For drivers with no problems I use mostly Leadshine DM322 or better.

And by the way, can you run a 3.3V motor with this driver?

The motor voltage specification is irrelevant. The current rating is key.

Why do you think you need more current?

A 1.5A motor will run fine on 1.0A, as long as you have set the driver current limit correctly and have an adequate motor power supply (12 to 30V, at least 2A), but the motor will deliver only 2/3 of the full rated torque.

Please post the specifications of the motor power supply, and describe how you set the current limit on the A4988 driver. To do that, you need to know the value of the current sense resistor on the A4988 board, usually between 50 and 100 milliOhm, so tell us what that is.

Please post the test code.

Please read the forum guidelines to see how to properly post code and some information on making a good post.

Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in a code block.

The CNC shield V3 (and V4) disable the stepper motors by default. You need to either jumper the EN header or set pin 8 as an OUTPUT and set the pin to LOW to enable the motors.


Is this your CNC shield?

The DRV8825 driver is a direct replacement for the A4988. It is a better choice for your 1.5A stepper.

the supply that i use is a switched supply 12V 120w 10A and the resistance on the driver is 100milliOhm. I set the current limit using the following formula Vref=Imax8Rs. Then i turned the pot around till I got the right voltage but even after that the motor didn't move, it just stayed still, but on the other hand when I tried manually turning the shaft, I couldn't turn it.

const int enPin=8;
const int stepXPin = 2; //X.STEP
const int dirXPin = 5; // X.DIR
const int stepYPin = 3; //Y.STEP
const int dirYPin = 6; // Y.DIR
const int stepZPin = 4; //Z.STEP
const int dirZPin = 7; // Z.DIR

int stepPin=stepYPin;
int dirPin=dirYPin;

const int stepsPerRev=200;
int pulseWidthMicros = 100; 	// microseconds
int millisBtwnSteps = 1000;

void setup() {
 	Serial.begin(9600);
 	pinMode(enPin, OUTPUT);
 	digitalWrite(enPin, LOW);
 	pinMode(stepPin, OUTPUT);
 	pinMode(dirPin, OUTPUT);
 
 	Serial.println(F("CNC Shield Initialized"));
}

void loop() {
 	Serial.println(F("Running clockwise"));
 	digitalWrite(dirPin, HIGH); // Enables the motor to move in a particular direction
 	// Makes 200 pulses for making one full cycle rotation
 	for (int i = 0; i < stepsPerRev; i++) {
 			digitalWrite(stepPin, HIGH);
 			delayMicroseconds(pulseWidthMicros);
 			digitalWrite(stepPin, LOW);
 			delayMicroseconds(millisBtwnSteps);
 	}
 	delay(1000); // One second delay

 	Serial.println(F("Running counter-clockwise"));
 	digitalWrite(dirPin, LOW); //Changes the rotations direction
 	// Makes 400 pulses for making two full cycle rotation
 	for (int i = 0; i < 2*stepsPerRev; i++) {
 			digitalWrite(stepPin, HIGH);
 			delayMicroseconds(pulseWidthMicros);
 			digitalWrite(stepPin, LOW);
 			delayMicroseconds(millisBtwnSteps);
 	}
 	delay(1000);
}


And yes, that is my shield. The CNC shield V3. I will consider using the DRV8825 since you say that it should work

You have evidently set the current limit correctly, and this observation indicates that the driver is working correctly, but not getting or carrying out step commands.

This a poor coding, and very misleading:

 			delayMicroseconds(millisBtwnSteps);

You may be commanding the motor to drive too fast. Start with delay() instead of delayMicroseconds().

I copied the code of a webpage, sending the link below

I didn't notice this fact and didn't realize that maybe the motor is just being commanded to turn too fast as you say. I will try to change the code and run it when I find the time to do it, but so far thanks for all the help everyone :smiley:

I have also tried new drivers as you suggested but still the same results... And I also checked if the cable running to the stepper is ok and it is and I've done the same with my stepper (I checked the conductivity aka led diode test using my multimeter) and they both seem fine. Another idea that I had is that i only got the arduino uno that I'm using recently, and could it be that i am using a wrong COM or a wrong programmer? I'm using COM10 and programmer: Arduino as ISP ATmega32U4. Does it even have anything to do with the stepper?
The is the SMD edition, type:ATmega328 and I don't know if I'm using the correct name, but it uses the CH340G translator or conductor or I don't know what it's called and I don't know the translation

I doubt that example will work. It tells the motor to make a full turn in 1/5th of a second.
That's 300 RPM from stand-still. You need code with acceleration for that.
Leo..