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

Thread Starter

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.
 

Thread Starter

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,087
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.
 

jpanhalt

Joined Jan 18, 2008
11,087
Apparently there are two different configurations for the driver BOB's:
1607170660102.png1607170700052.png

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?
 

DNA Robotics

Joined Jun 13, 2014
647
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.
 

Thread Starter

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
12,345
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.
 

Thread Starter

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
12,345
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);
}
 

Thread Starter

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);

}
 

Thread Starter

Bogdan.m

Joined Apr 20, 2019
57
Thanks guys, reading the scope was pretty helpful, it made me realize that the pins for step and direction are inverted...Took me long enough. So now i have 2 options that come to my mind, can i invert the pins in the grbl library, or do i have to make my own pcb from scratch ?
 
Top