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:
@@ -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
|
short T = 1; // Time Period/2 for PWM signal. Need to be made 2 when in Full Step mode
|
||||||
|
|
||||||
// updating for getting CDS data
|
// 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;
|
bool XmotorEnabled = false, YmotorEnabled = false, ZmotorEnabled = false;
|
||||||
|
|
||||||
long XMaxStep = 300000L, YMaxStep = 150000L, ZMaxStep = 200000L;
|
long XMaxStep = 300000L, YMaxStep = 150000L, ZMaxStep = 200000L;
|
||||||
@@ -148,9 +148,9 @@ void loop() {
|
|||||||
break;
|
break;
|
||||||
// case ('V') : debug();
|
// case ('V') : debug();
|
||||||
// break;
|
// break;
|
||||||
case ('Q') : gohome(); Serial.println(T);
|
case ('Q') : gohome();
|
||||||
break;
|
break;
|
||||||
case ('F') : slideIO(); Serial.println(T);
|
case ('F') : slideIO();
|
||||||
break;
|
break;
|
||||||
// case ('q') : changeMode();
|
// case ('q') : changeMode();
|
||||||
// break;
|
// break;
|
||||||
@@ -178,12 +178,12 @@ void gotoXYZSetStep(long XsetStep, long YsetStep, long ZsetStep)
|
|||||||
{
|
{
|
||||||
|
|
||||||
long Xstepstodo = 0, Ystepstodo = 0, Zstepstodo = 0;
|
long Xstepstodo = 0, Ystepstodo = 0, Zstepstodo = 0;
|
||||||
//Serial.print("Current X, Y, Z = ");
|
Serial.print("Current X, Y, Z = ");
|
||||||
//Serial.print(XcurrStep);
|
Serial.print(XcurrStep);
|
||||||
//Serial.print(", ");
|
Serial.print(", ");
|
||||||
//Serial.print(YcurrStep);
|
Serial.print(YcurrStep);
|
||||||
//Serial.print(", ");
|
Serial.print(", ");
|
||||||
//Serial.println(ZcurrStep);
|
Serial.println(ZcurrStep);
|
||||||
|
|
||||||
if (XsetStep != XcurrStep) {
|
if (XsetStep != XcurrStep) {
|
||||||
// if (XsetStep > XMaxStep)
|
// if (XsetStep > XMaxStep)
|
||||||
@@ -376,12 +376,12 @@ void doXYZSteps(long numX, long numY, long numZ)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// Serial.print("New X, Y, Z = ");
|
Serial.print("New X, Y, Z = ");
|
||||||
//Serial.print(XcurrStep);
|
Serial.print(XcurrStep);
|
||||||
//Serial.print(", ");
|
Serial.print(", ");
|
||||||
//Serial.print(YcurrStep);
|
Serial.print(YcurrStep);
|
||||||
//Serial.print(", ");
|
Serial.print(", ");
|
||||||
//Serial.println(ZcurrStep);
|
Serial.println(ZcurrStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
int isXbumpHit()
|
int isXbumpHit()
|
||||||
@@ -467,7 +467,7 @@ void disableMotors() {
|
|||||||
|
|
||||||
|
|
||||||
void changeMode(){
|
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(14, HIGH); digitalWrite(2, LOW); digitalWrite(3, LOW);
|
||||||
digitalWrite(32, HIGH); digitalWrite(30, LOW); digitalWrite(28, LOW);
|
digitalWrite(32, HIGH); digitalWrite(30, LOW); digitalWrite(28, LOW);
|
||||||
T = 2;
|
T = 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user