CNC - 3D printer shield Arduino voor aansturing X-Y-Z richtingen


testsoftware

#define EN 8 // stepper motor enable , active low
#define X_DIR 5 // X -axis stepper motor direction control
#define Y_DIR 6 // y -axis stepper motor direction control
#define Z_DIR 7 // z axis stepper motor direction control
#define X_STP 2 // x -axis stepper control
#define Y_STP 3 // y -axis stepper control
#define Z_STP 4 // z -axis stepper control

void step (bool dir, byte dirPin, byte stepperPin, int steps)
{
digitalWrite (dirPin, dir);
for (int i = 0; i < steps; i++) {
digitalWrite (stepperPin, HIGH);
delayMicroseconds (500);
digitalWrite (stepperPin, LOW);
delayMicroseconds (500);
}
}

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);
}
// 200 steps equals to one round
void loop () {
step (false, X_DIR, X_STP, 200);
delay (1000);
step (true, X_DIR, X_STP, 200);
delay (1000);
}

library/ drivers:

https://github.com/grbl/grbl


leverancier:

https://benselectronics.nl/cnc-shield-arduino-uno-set-!!/