Commit c305ce42 authored by Andrey Filippov's avatar Andrey Filippov

corrected wait time for short movements

parent bd593f60
...@@ -30,6 +30,7 @@ public class GoniometerMotors{ ...@@ -30,6 +30,7 @@ public class GoniometerMotors{
public int motorStuckTolerance=5; // steps - disregard error less than that public int motorStuckTolerance=5; // steps - disregard error less than that
public double coefficientETA=1.5; // allow moving 1.5 longer than at maximal speed public double coefficientETA=1.5; // allow moving 1.5 longer than at maximal speed
private long nanoETA; private long nanoETA;
private long nanoReferenceTime; // last time the position was checked private long nanoReferenceTime; // last time the position was checked
...@@ -110,6 +111,8 @@ public class GoniometerMotors{ ...@@ -110,6 +111,8 @@ public class GoniometerMotors{
commandElphel10364Motors("http://"+this.ipAddress+"/10364.php?m"+(motorNumber+1)+"="+this.targetPosition[motorNumber]+"sleep=1"); commandElphel10364Motors("http://"+this.ipAddress+"/10364.php?m"+(motorNumber+1)+"="+this.targetPosition[motorNumber]+"sleep=1");
enableMotors(true); enableMotors(true);
nanoETA=System.nanoTime()+((long)(1E9*(Math.abs(this.targetPosition[motorNumber]-this.curpos[motorNumber])*(this.coefficientETA/this.stepsPerSecond)))); nanoETA=System.nanoTime()+((long)(1E9*(Math.abs(this.targetPosition[motorNumber]-this.curpos[motorNumber])*(this.coefficientETA/this.stepsPerSecond))));
nanoETA += (long)(1E9*this.motorsStuckTestTime); // =5.0; // seconds
return true; return true;
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment