Motion¶
/**
* Motion API
* @author Andrej Cimperšek
*/
public interface Motion {
/**
* Sets parameters for next motor move
* @param steps
* @param freq
*/
public void SetMove0(int steps, float freq);
/**
* Sets parameters for next motor move
* @param steps
* @param freq
*/
public void SetMove1(int steps, float freq);
/**
* Moves motors according to set moves
*/
public void Run();
/**
* Sets angular velocity in steps / sec
* @param omega0
*/
public void SetInitialAngularVel0(float omega0);
/**
* Sets angular velocity in steps / sec
* @param omega0
*/
public void SetInitialAngularVel1(float omega0);
/**
* Sets angular acceleration in steps / sec^2
* @param accel
*/
public void SetAngularAcceleration0(float accel);
/**
* Sets angular acceleration in steps / sec^2
* @param accel
*/
public void SetAngularAcceleration1(float accel);
/**
*
* @param steps
*/
public void SetLackCorrection0(short steps);
/**
*
* @param steps
*/
public void SetLackCorrection1(short steps);
/**
* Sets angular deceleration in steps / sec^2
* @param decel
*/
public void SetAngularDeceleration0(float decel);
/**
* Sets angular deceleration in steps / sec^2
* @param decel
*/
public void SetAngularDeceleration1(float decel);
/**
* Sets position for stepper 0
* @param position
*/
public void SetPosition0(int position);
/**
* Sets position for stepper 1
* @param position
*/
public void SetPosition1(int position);
/**
* Stops motor 0
*/
public void StopMotor0();
/**
* Stops motor 1
*/
public void StopMotor1();
/**
* Disables current on motor 0
*/
public void MotorOff0();
/**
* Disables current on motor 1
*/
public void MotorOff1();
/**
* Gets positions of both motors
* @return Position
*/
public Position GetPosition();
/**
* Set continuous key movement
*/
public void SetContinuousKeyMovement();
/**
* Set single step key movement
*/
public void SetSingleStepKeyMovement();
/**
* Simulate Left Key Press
*/
public void SimulateLeftKeyPress();
/**
* Simulate Left Key Release
*/
public void SimulateLeftKeyRelease();
/**
* Simulate Right Key Press
*/
public void SimulateRightKeyPress();
/**
* Simulate Right Key Release
*/
public void SimulateRightKeyRelease();
/**
* Simulate Up Key Press
*/
public void SimulateUpKeyPress();
/**
* Simulate Up Key Release
*/
public void SimulateUpKeyRelease();
/**
* Simulate Down Key Press
*/
public void SimulateDownKeyPress();
/**
* Simulate Down Key Release
*/
public void SimulateDownKeyRelease();
/**
* Sets automatic position reporting.
* 0..turns off automatic position reporting, 50..9999 autoreport interval in milliseconds
* @param interval
*/
public void AutomaticPositionReporting(short interval);
}
/**
* Motors position
* @author Andrej Cimperšek
*/
public class Position {
public int position0;
public int position1;
}