Updated file - better movement. No noise. Z axis problem rectified. Serial print for current and new positions - can be commented out

This commit is contained in:
tp2043
2023-03-23 09:44:12 +00:00
parent e25a2ff231
commit 02f5bd18a3

View File

@@ -29,7 +29,7 @@ So the GUI needs to take care of step size to um conversion
short T = 1; // Time Period/2 for PWM signal. Need to be made 2 when in Full Step mode
// updating for getting CDS data
long xFoV = 1100, yFoV = 1000; //2000 1600//
long xFoV = 1504, yFoV = 1200; //2000 1600//
bool XmotorEnabled = false, YmotorEnabled = false, ZmotorEnabled = false;
long XMaxStep = 300000L, YMaxStep = 150000L, ZMaxStep = 200000L;
@@ -148,9 +148,9 @@ void loop() {
break;
// case ('V') : debug();
// break;
case ('Q') : gohome(); Serial.println(T);
case ('Q') : gohome();
break;
case ('F') : slideIO(); Serial.println(T);
case ('F') : slideIO();
break;
// case ('q') : changeMode();
// break;
@@ -178,12 +178,12 @@ void gotoXYZSetStep(long XsetStep, long YsetStep, long ZsetStep)
{
long Xstepstodo = 0, Ystepstodo = 0, Zstepstodo = 0;
//Serial.print("Current X, Y, Z = ");
//Serial.print(XcurrStep);
//Serial.print(", ");
//Serial.print(YcurrStep);
//Serial.print(", ");
//Serial.println(ZcurrStep);
Serial.print("Current X, Y, Z = ");
Serial.print(XcurrStep);
Serial.print(", ");
Serial.print(YcurrStep);
Serial.print(", ");
Serial.println(ZcurrStep);
if (XsetStep != XcurrStep) {
// if (XsetStep > XMaxStep)
@@ -376,12 +376,12 @@ void doXYZSteps(long numX, long numY, long numZ)
}
}
// Serial.print("New X, Y, Z = ");
//Serial.print(XcurrStep);
//Serial.print(", ");
//Serial.print(YcurrStep);
//Serial.print(", ");
//Serial.println(ZcurrStep);
Serial.print("New X, Y, Z = ");
Serial.print(XcurrStep);
Serial.print(", ");
Serial.print(YcurrStep);
Serial.print(", ");
Serial.println(ZcurrStep);
}
int isXbumpHit()
@@ -467,7 +467,7 @@ void disableMotors() {
void changeMode(){
digitalWrite(8, HIGH); digitalWrite(9, HIGH); digitalWrite(10, LOW); // Probably due to voltage issues it won't go for steps larger than 1/8. So 1/8, 1/16, 1/32 all work.
digitalWrite(8, LOW); digitalWrite(9, HIGH); digitalWrite(10, LOW); // Probably due to voltage issues it won't go for steps larger than 1/8. So 1/8, 1/16, 1/32 all work.
digitalWrite(14, HIGH); digitalWrite(2, LOW); digitalWrite(3, LOW);
digitalWrite(32, HIGH); digitalWrite(30, LOW); digitalWrite(28, LOW);
T = 2;