# Stepper motor or driver problem or i don't know what is happening anymore..

#### Bogdan.m

Joined Apr 20, 2019
57
I am trying to build a laser engraver with the arduino nano, the cnc shield V4, and the A4988 drivers and i have reached a point where i have everything and i am testing out the stepper motors. The motors are nema17, and i have watched EVERY youtube video and i have read every forum post related to this topic, but still, my motors are not working and are only making a humming noise and stop. I adjusted the pot on the driver board to 0.952V, i have uploaded the grbl firmware on the arduino nano, i have connected with laserGRBL and it all works fine, but when i try to move with the arrows from the laserGRBL software the motors are just screaming and then stop... i do not know what to check, and what to test anymore, i tried removing the jumpers, tried every combination of micro stepping, i am out of ideas...please help me.

#### AlbertHall

Joined Jun 4, 2014
11,402
Are the steppers wired corretly (don't just say yes - check!)
Try stepping them very slowly.

#### ericgibbs

Joined Jan 29, 2010
13,274
hi B,
What is the power supply specification are you using for the stepper motor.?
Do you have any Scope waveforms of the driver input signals you could post.?
E

#### Attachments

• 36.4 KB Views: 9
• 111.5 KB Views: 5

#### Bogdan.m

Joined Apr 20, 2019
57
Yes, they are wired ok, and i checked a few times i use 30V 5A PSU, i will try to get a trace of the input.

#### jpanhalt

Joined Jan 18, 2008
11,088
You have not said whether they are bipolar, unipolar or hybrid. You have not shown how they are wired. Please either give datasheets or model numbers for the motors and show us how they are wired.

From another perspective, that shield and driver have been used by thousands without the problem you describe. Perhaps what you consider "correct" is not correct.

#### Bogdan.m

Joined Apr 20, 2019
57
I know they are used by a lot of people, and that is driving me mad....

#### Attachments

• 73.5 KB Views: 20
• 731.2 KB Views: 19

#### jpanhalt

Joined Jan 18, 2008
11,088
Apparently there are two different configurations for the driver BOB's:

It is not clear which you have. The Red board suggests maybe a Sparkfun driver.

Have you tried reversing the connections to one coil, e.g., swap the 1A and 1B connections?

#### AlbertHall

Joined Jun 4, 2014
11,402
Have you tried reversing the connections to one coil, e.g., swap the 1A and 1B connections?
I think that would just reverse the motor direction.

#### DNA Robotics

Joined Jun 13, 2014
603
Try stepping them very slowly.
Arduino can send steps A LOT faster than the motor can move. It will just sit there vibrating.
Try one step at a time until it works. Then you can increase speed until you know the upper limit.

If “tried everything” until your wiring sequence is out of whack, start from scratch.

#### Bogdan.m

Joined Apr 20, 2019
57
yes. i have tried reversing the connections, both coils, one coil, every combinations. I have tried with a delay of 3500 micros... my head hurts.

#### AlbertHall

Joined Jun 4, 2014
11,402
Add a button to the arduino so it does just one step for each button press and measure the two coil voltages for each step, then we will know just what is happening.

Joined Jul 18, 2013
23,385
How is the correct continuous rated running current set with that driver unit?
The winding current has to be maintained exactly over the whole RPM range.
Max.

#### Bogdan.m

Joined Apr 20, 2019
57
I made some time to test it out with a scope, and i found some interesting stuff, i see nothing on the scope...
I took out everything, i have only the arduino nano with an oscilloscope, looked for a simple code, upload it and tested it to see nothing, i made sure the output of the arduino is not damaged, so it works ok. here is the code. On the dirPin i see a high, than a low, and then that is it, it stops.
Code:
const int stepPin = 12;
const int dirPin = 11;

void setup() {
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
}
void loop() {

digitalWrite(dirPin, HIGH);
for (int x = 0; x < 200; x++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(1000);
digitalWrite(stepPin, LOW);
delayMicroseconds(1000);
delay(2000);

digitalWrite(dirPin, LOW);
for (int x = 0; x < 200; x++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(1000);
digitalWrite(stepPin, LOW);
delayMicroseconds(1000);
delay(2000);

}
}
}

#### AlbertHall

Joined Jun 4, 2014
11,402
Try this version:
Code:
const int stepPin = 12;
const int dirPin = 11;

void setup() {
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
}
void loop() {

digitalWrite(dirPin, HIGH);

digitalWrite(stepPin, HIGH);
delayMicroseconds(1000);
digitalWrite(stepPin, LOW);
delayMicroseconds(1000);

digitalWrite(dirPin, LOW);
digitalWrite(stepPin, HIGH);
delayMicroseconds(1000);
digitalWrite(stepPin, LOW);
delayMicroseconds(1000);
}

#### Bogdan.m

Joined Apr 20, 2019
57
This works, finally i got some movement. So my motors and drivers are ok, any ideas where can be the problem ? in the laser engraver software ? in the grbl library ?

Code:
const int stepPin = 5;
const int dirPin = 2;

void setup() {
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
}
void loop() {

digitalWrite(dirPin, HIGH);
digitalWrite(stepPin, HIGH);
delayMicroseconds(1000);
digitalWrite(stepPin, LOW);
delayMicroseconds(1000);

}

#### AlbertHall

Joined Jun 4, 2014
11,402
So now run it so you get the humming and tell us what you see on step and dir with the 'scope.