Why speed of stepper motor between using Arduino Nano and Arduino Uno V3+CNC shield V3 is different so much

Hi Guys ,

I just tested drive stepper motor with Aruino Nano and Arduino Uno V3+ CNC shield V3 but i found with same code , speed of motor when use with Arduino Uno V3 is so fast.

#include <SoftwareSerial.h>
SoftwareSerial BTSerial (0, 1);

const int StepX = 2;
const int DirX = 5;

const int StepY = 3;
const int DirY = 6;


const int En = 8 ;
String state;



void setup() {
  Serial.begin(9600);
  BTSerial.begin(9600);
  pinMode(StepX, OUTPUT);
  pinMode(DirX, OUTPUT);
  pinMode(StepY, OUTPUT);
  pinMode(DirY, OUTPUT);
  pinMode(lstop , INPUT_PULLUP);
  pinMode(En, OUTPUT);
  digitalWrite(En, HIGH);


}

void loop() {
  digitalWrite(DirX, HIGH);
  digitalWrite(DirY, HIGH);
  while (BTSerial.available() > 0) {
    state = BTSerial.readString();
    if (state == "Low_speed") {
      digitalWrite(En, LOW);
      run_step(2000);
      run_step(2000);
      digitalWrite(En, HIGH);
    }
  }
}
void run_step(int q) {
  for(int i=0;i<10000;i++) {
    digitalWrite(StepX , HIGH);
    digitalWrite(StepY , HIGH);
    delayMicroseconds(q);
    digitalWrite(StepX , LOW);
    digitalWrite(StepY , LOW);
    delayMicroseconds(q);
  }
}

When i use arduino Nano , delayMicroseconds(1000) is enough for low speed , but with Aduino Uno V3 , delayMicroseconds(6000) still make motor drive faster and make alot of vibration.

Please help me solve this issue , i need a low speed with low vibration when use Arduino V3 like that use Arduino Nano.

Thank so much

Please also post schematic.

Why use SoftwareSerial on the hardware serial pins?

+1 for the request for wiring diagrams.

What stepper drivers used with Nano and what driver when using CNC shield? What power supplies? What were the microstepping settings when using Nano? Mictostepping when using CNCshield?

Same drive A4988 for arduino nano and Cnc shield v3( with arduino uno r3 ).



I do like above pictures.

You don't show the driver Ground connected to Arduino Ground.

When the A4988 is not plugged into the CNC board it doesn't have the jumpers setting the microsteps. Try connecting the A4988 to the Arduino UNO without the CNC board and see if you get the same results a the Nano. That would show it's the microstepping jumpers under the A4988 that cause the difference.

1 Like

CNC shield V3 need 3 jumper on MS1,MS2,MS3 , it make stepper motor drive slowly , thank you :slight_smile:

If you remove all of the jumpers from the microstepping headers (MS1, MS2, MS3) the stepper driver will be in single step and go the fastest, but there may be problems caused by resonance effects. Using some microstepping (4X or more) can mitigate the resonance effects.

1 Like

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