I have my arduino and the motor running in fullstepmode currently, successfully. I want it to run in microstepping now.
Ok i know that for beeing able to use microstepping i have to set M1 M2 M3 LOW/High. Already found that info and table on the web.
Does that actually mean i have to connect M3 M1 M2 to the arduino digitalPins and then just send the appropriate combination? I think so, but i need some confirmation.
So as soldering is already neccessary, i think i will directly solder them to the digital pins instead of directly to GND/5V.
That way has more advantages as i have lot of digitalPins unused.
Because with my current code the motor is not moving at all. In fullstepmode it was. I just added the three cables/pins.
Here is the function that worked with fullstep, i added the microstep code now
//--------------------------NORMAL button
if ((y >= 10) && (y <= 60) && (x >= 10) && (x <= 210) ) {
touchBorder(10, 10, 210, 60);
updateStr("Start Motor");
//mircostepping
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(A2, INPUT);
digitalWrite(A0, LOW);
digitalWrite(A1, HIGH);
digitalWrite(A2, LOW);
//das geht so nur mit setmaxspeed und acceleration
//enable disable power manuelly
digitalWrite(ENABLE_PIN, LOW);
stepper.setCurrentPosition(0); //must be set to 0 because manual moving START/BACKW/HOME may have changed the position and normal must always begin at start/0
stepper.moveTo(slider_length);
//300 = 9cm, ausgemesssen = 4000
while (stepper.currentPosition() != slider_length) {
Serial.print("START");
Serial.print(stepper.currentPosition());
Serial.print("\r\n");
// Full speed up to 300
stepper.setSpeed(speed_set);
stepper.run();
}
//after the run move back to position 0. that happens with acceleration
Serial.print("END");
stepper.runToNewPosition(0);
digitalWrite(ENABLE_PIN, HIGH);
}
Motor does not move. I also have tried setting them all to LOW. That should enable fullstep. But still the code, that worked before is not working.
Are there any other wires that need to be modified when switching from a simple fullstep A4988 setup to a microstep setup?
Maybe i forgot something
The code i run is. I have set all to LOW to try if fullstep works first.
//--------------------------NORMAL button
if ((y >= 10) && (y <= 60) && (x >= 10) && (x <= 210) ) {
touchBorder(10, 10, 210, 60);
updateStr("Start Motor");
//mircostepping
pinMode(A0, OUTPUT);
pinMode(A1, OUTPUT);
pinMode(A2, OUTPUT);
digitalWrite(A0, LOW);
digitalWrite(A1, LOW);
digitalWrite(A2, LOW);
//das geht so nur mit setmaxspeed und acceleration
//enable disable power manuelly
digitalWrite(ENABLE_PIN, LOW);
stepper.setCurrentPosition(0); //must be set to 0 because manual moving START/BACKW/HOME may have changed the position and normal must always begin at start/0
stepper.moveTo(slider_length);
//300 = 9cm, ausgemesssen = 4000
while (stepper.currentPosition() != slider_length) {
Serial.print("START");
Serial.print(stepper.currentPosition());
Serial.print("\r\n");
// Full speed up to 300
stepper.setSpeed(speed_set);
stepper.run();
}
//after the run move back to position 0. that happens with acceleration
Serial.print("END");
stepper.runToNewPosition(0);
digitalWrite(ENABLE_PIN, HIGH);
}