Hello everyone I am trying to run NEMA 17 Stepper Motor 4 Wire Bipolar connected to the X axis of cnc board.I am using a REES52 GRBL CNC Shield Expansion Board V3.0 +UNO R3 Board + A4988 Stepper Motor Driver powered by a DC OUTPUT 12V 1Amp power supply. Power supply is working and connection is also ok .
To drive the motors I load up GRBL code into Arduino Uno with 'Arduino Create WEB IDE'.
#define EN 8
//Direction pin
#define X_DIR 5
#define Y_DIR 6
#define Z_DIR 7
//Step pin
#define X_STP 2
#define Y_STP 3
#define Z_STP 4
//DRV8825
int delayTime=30; //Delay between each pause (uS)
int stps=6400;// Steps to move
void step(boolean dir, byte dirPin, byte stepperPin, int steps)
{
digitalWrite(dirPin, dir);
delay(100);
for (int i = 0; i < steps; i++) {
digitalWrite(stepperPin, HIGH);
delayMicroseconds(delayTime);
digitalWrite(stepperPin, LOW);
delayMicroseconds(delayTime);
}
}
void setup(){
pinMode(X_DIR, OUTPUT); pinMode(X_STP, OUTPUT);
pinMode(Y_DIR, OUTPUT); pinMode(Y_STP, OUTPUT);
pinMode(Z_DIR, OUTPUT); pinMode(Z_STP, OUTPUT);
pinMode(EN, OUTPUT);
digitalWrite(EN, LOW);
}
void loop(){
step(false, X_DIR, X_STP,stps); //X, Clockwise
step(false, Y_DIR, Y_STP,stps); //Y, Clockwise
step(false, Z_DIR, Z_STP,stps); //Z, Clockwise
delay(100);
step(true, X_DIR, X_STP,stps); //X, Counterclockwise
step(true, Y_DIR, Y_STP,stps); //Y, Counterclockwise
step(true, Z_DIR, Z_STP,stps); //X, Counterclockwise
delay(100);
}
However, when I run it, the steppers will not rotate.
I get this message everytime
System wide configuration file is "C:/Users/MODHU BAGANI/.arduino-create/arduino/avrdude/6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM4
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "C:/Users/MODHUB~1/AppData/Local/Temp/arduino-create-agent235966744/Blink.hex"
avrdude: writing flash (924 bytes):
Writing | ################################################## | 100% 0.16s
avrdude: 924 bytes of flash written
avrdude: verifying flash memory against C:/Users/MODHUB~1/AppData/Local/Temp/arduino-create-agent235966744/Blink.hex:
avrdude: load data flash data from input file C:/Users/MODHUB~1/AppData/Local/Temp/arduino-create-agent235966744/Blink.hex:
avrdude: input file C:/Users/MODHUB~1/AppData/Local/Temp/arduino-create-agent235966744/Blink.hex contains 924 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.12s
avrdude: verifying ...
avrdude: 924 bytes of flash verified
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done. Thank you.
I used this website for reference though : Click here
Please help , Thank you