Total beginner / Stepper turns only in one direction and no torque

Hello to all,

First of all, I would like to say that I have already searched this forum for cases similar to mine, but I can't find anything that could help me in any way.

I add to that that I am a complete beginner! Indeed, I came to be interested in Arduino as part of a small project that I found nice, but I realize that it becomes more and more complex !

I will try to provide you with as much information as possible about my problem, and hope to find the help I need here.

So my problem: I need to drive some steppers with my Arduino Uno, equipped with a CNC shield and drivers.
I've been following several tutorials to the letter but nothing helps.
After uploading GRBL correctly, I can't get a single stepper to run correctly.
In absolute terms, I can only turn one counterclockwise. (even if I change the connector direction.

I am sure there is a lot of information missing, but I hope in all humility to be guided here.

Thank you in advance

Jay

Please post data sheets for the motors.

What stepper drivers are you using (usually A4988 or DRV8825 with CNC shield)?

Have you properly set the coil current limits on the motor drivers? What value of Vref is set?

Have you set the microstepping on the drivers? To what value?

How fast are you trying to step the motors?

Post a sample of the g code that you send to the CNC shield to get the motor to run.

Citation
Please post data sheets for the motors.

Nema 17 17HS4401S / 0.9° / 1,3 A

Citation
What stepper drivers are you using (usually A4988 or DRV8825 with CNC shield)?

A4988

Citation
Have you properly set the coil current limits on the motor drivers? What value of Vref is set ?

So not at all! I have a first lead already I guess. I'll do my research on the net for that.

Citation
Have you set the microstepping on the drivers? To what value?

I just followed the video of the guy explaining his setup... I put a jumper on the middle PINs

Citation
How fast are you trying to step the motors?

the default speed given by UGS

Citation
Post a sample of the g code that you send to the CNC shield to get the motor to run.

Here sir :

**** Connected to COM5 @ 115200 baud ****
Grbl 0.9j ['$' for help]
>>> $$
$0 = 10    (step pulse, usec)
$1 = 1    (step idle delay, msec)
$2 = 0    (step port invert mask:00000000)
$3 = 0    (dir port invert mask:00000000)
$4 = 0    (step enable invert, bool)
$5 = 0    (limit pins invert, bool)
$6 = 0    (probe pin invert, bool)
$10 = 3    (status report mask:00000011)
$11 = 0.010    (junction deviation, mm)
$12 = 0.002    (arc tolerance, mm)
$13 = 0    (report inches, bool)
$20 = 0    (soft limits, bool)
$21 = 0    (hard limits, bool)
$22 = 0    (homing cycle, bool)
$23 = 0    (homing dir invert mask:00000000)
$24 = 25.000    (homing feed, mm/min)
$25 = 500.000    (homing seek, mm/min)
$26 = 250    (homing debounce, msec)
$27 = 1.000    (homing pull-off, mm)
$100 = 250.000    (x, step/mm)
$101 = 250.000    (y, step/mm)
$102 = 250.000    (z, step/mm)
$110 = 500.000    (x max rate, mm/min)
$111 = 500.000    (y max rate, mm/min)
$112 = 500.000    (z max rate, mm/min)
$120 = 10.000    (x accel, mm/sec^2)
$121 = 10.000    (y accel, mm/sec^2)
$122 = 10.000    (z accel, mm/sec^2)
$130 = 200.000    (x max travel, mm)
$131 = 200.000    (y max travel, mm)
$132 = 200.000    (z max travel, mm)
ok
>>> $G
[G0 G54 G17 G21 G90 G94 M0 M5 M9 T0 F0. S0.]
ok
>>> G21G91G1X10F5000
>>> G90 G21
ok
ok
>>> G21G91G1X-10F5000
>>> G90 G21
ok
ok

It is imperative that setting the coil current be done and done properly. Set the current to less than or equal to the spec current. To set the current limit you will need to know the value of the sense resistor on the A4988 driver board. Then enter the value of the resistor and the required coil current into the formula Vref = Imot x 8 x Rsen where Imot = the coil current and Rsen = the value of the sense resistor. The Pololu A4988 page covers how to set the Vref but you must use the sense resistor value on YOUR board. This page shows how to locate the sense resistor(s). Set the current to less than or equal to the spec current. To set the current limit you will need to know the value of the sense resistor on the A4988 driver board. Then enter the value of the resistor and the required coil current into the formula Vref = Imot x 8 x Rsen where Imot = the coil current and Rsen = the value of the sense resistor. The Pololu A4988 page covers how to set the Vref but you must use the sense resistor value on YOUR board. This page shows how to locate the sense resistor.
Another page showing how to set coil current.

Setting the coil current to less than the max is OK as long as the motor performs properly and does not miss steps. The motor and driver will run cooler and last longer.

That is good. Some microstepping will help to mitigate resonance effects.

If you want to get the steppers to run, forget about grbl for now. I will post a simple program to test each motor, independent of grbl. Get each motor to work, then try grbl.

After you set the coil currents, try this test code. This removes grbl and its settings from the mix. Tested on real hardware. Try with each motor.

const byte stepPin = 2;  // X= 2, Y = 3, Z = 4
const byte directionPin = 5;  // X= 5, Y = 6, Z = 7
const byte enPin = 8;
const byte ledPin = 13;

char axisName[10];

void setup()
{

   Serial.begin(115200);
   Serial.println("Starting Stepper Test with micros()");
     
   pinMode(directionPin, OUTPUT);
   pinMode(stepPin, OUTPUT);
   
   pinMode(enPin, OUTPUT);
   digitalWrite(enPin, LOW);
   
   pinMode(ledPin, OUTPUT);
   switch(stepPin)
   {
      case 2:
      strcpy(axisName, "X axis");
      break;
      case 3:
      strcpy(axisName, "Y axis");
      break;
      case 4:
      strcpy(axisName, "Z axis");
      break;
      default:
      strcpy(axisName, "error");
      break;
   }
   Serial.print("Testing ");
   Serial.println(axisName);   
}

void loop()
{  
      // step time in us (microseconds)  
      singleStep(800);     
}

void singleStep(unsigned long stepInterval)
{
   static unsigned long stepTimer = 0;
   //unsigned long stepInterval = stepI;
   if (micros() - stepTimer >= stepInterval)
   {
      stepTimer = micros();
      digitalWrite(stepPin, HIGH);
      digitalWrite(stepPin, LOW);
   }
}

Here are my $ settings.


$0=10
$1=25
$2=0
$3=0
$4=0
$5=0
$6=0
$10=1
$11=0.010
$12=0.002
$13=0
$20=0
$21=1
$22=1
$23=3
$24=20.000
$25=600.000
$26=250
$27=2.000
$30=1000
$31=0
$32=1
$100=1600.000
$101=800.000
$102=400.000
$110=800.000
$111=800.000
$112=400.000
$120=50.000
$121=50.000
$122=50.000
$130=300.000
$131=250.000
$132=70.000

Note that these are for NEMA 17 motors but may not be quite the same as yours should be.
Some are dependant on the gearing, lead screws, microstepping jumpers etc.
These are taken directly from a working CNC laser.

As Ground Fungus states the current settings for the driver are CRUCIAL to getting a good working machine.
In my case they are set just fractionally under the required amount.
Failure to set them can result in blown drivers.
Worthwhile having a set on standby for users just getting into any CNC based Arduino work.

Voltage supply to any CNC shield should be at least 24 volts with plenty of current to spare.
Here its 24 volts 30 amp at the moment.

Pictures and schematic's can also be useful ?

Thank you very much for your quick feedback !

I will try to find time to tackle this soon (work at the house next door).
In any case I'll send you a progress report and some photos + schematic.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.