|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectMotionController
class MotionController
The class MotionController contains methods to perform various operations upon the Galil Motion Controller Card. Most MotionController methods calls then invoke the native methods provided by the af2motioncontroller library, which communicates through the Galil API library to the Galil PCI card.
Field Summary | |
---|---|
private static MotionController |
_instance
|
private int |
AXIS_WAIT_PERIOD
The polling period for axis motion complete |
private long |
AXIS_WAIT_TIMEOUT
The axis movement wait timeout (2 mins) |
(package private) static java.lang.String |
E_DMC_AXIS_NAME
|
(package private) static boolean |
ENCODER_SIMULATION
|
(package private) static java.lang.String |
F_DMC_AXIS_NAME
|
(package private) static java.lang.String |
G_DMC_AXIS_NAME
|
(package private) static java.lang.String |
H_DMC_AXIS_NAME
|
private java.lang.String |
MAX_POSITION_LIMIT
|
private java.lang.String |
MIN_POSITION_LIMIT
|
(package private) static java.lang.String |
S_DMC_AXIS_NAME
|
(package private) static java.lang.String |
W_DMC_AXIS_NAME
|
(package private) static java.lang.String |
X_DMC_AXIS_NAME
|
(package private) static java.lang.String |
Y_DMC_AXIS_NAME
|
(package private) static java.lang.String |
Z_DMC_AXIS_NAME
|
Constructor Summary | |
---|---|
private |
MotionController()
The MotionController's private constructor. |
Method Summary | |
---|---|
private java.lang.String |
axisParameters(java.util.List axes,
java.util.List parameters)
Create an axis parameter list string |
private void |
close()
Close communications with the DMC card |
(package private) void |
defineAuxiliaryEncoderPosition(MotionControllerAxis theAxis,
long Position)
Define the axis' auxiliary encoder position |
(package private) void |
defineEncoderPosition(MotionControllerAxis theAxis,
long Position)
Define the axis' encoder position |
(package private) void |
disablePositionLimits(MotionControllerAxis theAxis)
Disable position limits |
private long |
DMCClose()
Galil DMC18x0 native method to close comms with the motion controller |
private MotionControllerResult |
DMCCommand(java.lang.String Command)
Galil DMC18x0 native method to send a command to the motion controller |
private long |
DMCGetAnalogInputFromDR(int DMCAnalogInputPort)
|
private long |
DMCGetAxisAuxiliaryPositionFromDR(int DMCAxisNumber)
|
private long |
DMCGetAxisMotorPositionFromDR(int DMCAxisNumber)
|
private long |
DMCGetGeneralInputFromDR(int DMCGeneralInputPortBlock)
|
private long |
DMCGetGeneralOutputFromDR(int DMCGeneralOutputPortBlock)
|
private long |
DMCOpen()
Galil DMC18x0 native method to open comms with the motion controller |
private long |
DMCRefreshDataRecord()
|
private long |
DMCReset()
Galil DMC18x0 native method to reset the motion controller |
(package private) void |
findEdge(MotionControllerAxis theAxis)
Find the home switch edge of an axis |
(package private) void |
findEdge(MotionControllerAxis theAxis1,
MotionControllerAxis theAxis2)
Find the home switch edges of 2 axes |
(package private) void |
findIndex(MotionControllerAxis theAxis)
Find the index pulse of an axis |
(package private) long |
getAcceleration(MotionControllerAxis theAxis)
Get the acceleration of an axis |
(package private) double |
getADCReading(int theADCPort)
Get the value of an a/d port |
(package private) long |
getAnalogInputFromDR(int DMCAnalogInputPort)
|
(package private) long |
getAuxiliaryEncoderPosition(MotionControllerAxis theAxis)
Get the auixiliary encoder position |
(package private) long |
getAxisAuxiliaryPositionFromDR(int DMCAxisNumber)
|
(package private) long |
getAxisMotorPositionFromDR(int DMCAxisNumber)
|
(package private) long |
getDeceleration(MotionControllerAxis theAxis)
Get the deceleration of an axis |
(package private) int |
getDigitalInputs(int digitalInputBlockNumber)
Get the state of a digital input block |
(package private) int |
getDigitalOutputs(int digitalOutputBlockNumber)
Get the state of a digital output block |
(package private) long |
getGeneralInputFromDR(int DMCGeneralInputPortBlock)
|
(package private) long |
getGeneralOutputFromDR(int DMCGeneralOutputPortBlock)
|
(package private) MotionControllerResult |
getPosition()
Get the positions of all of the main encoders |
(package private) long |
getPosition(MotionControllerAxis theAxis)
Get the main encoder position of an axis |
(package private) long |
getPositionError(MotionControllerAxis theAxis)
Get the position error of an axis |
(package private) MotionControllerResult |
getReferencePosition()
Get the reference positions of all of the main encoders |
(package private) long |
getReferencePosition(MotionControllerAxis theAxis)
Get the main encoder reference position of an axis |
(package private) long |
getSpeed(MotionControllerAxis theAxis)
Get the speed of an axis |
(package private) void |
home(MotionControllerAxis theAxis)
Find and define the home position of an axis |
(package private) void |
home(MotionControllerAxis theAxis1,
MotionControllerAxis theAxis2)
Find and define the home position of two axes |
static MotionController |
instance()
The instance class method |
(package private) boolean |
isDigitalInputPortHigh(int theInputPort)
Get the condition of a digital input port |
(package private) boolean |
isDigitalOutputPortHigh(int theOutputPort)
Get the condition of a digital output port |
(package private) boolean |
isInForwardLimit(MotionControllerAxis theAxis)
Check the forward limit of an axis |
(package private) boolean |
isInHomeSwitch(MotionControllerAxis theAxis)
Is the axis in it's home switch |
(package private) boolean |
isInReverseLimit(MotionControllerAxis theAxis)
Check the reverse limit of an axis |
(package private) void |
jog(MotionControllerAxis theAxis,
long Speed)
Jog an axis |
(package private) void |
move(MotionControllerAxis theAxis,
long Position)
Move an axis to the required position |
(package private) void |
move(MotionControllerAxis theAxis1,
MotionControllerAxis theAxis2,
long Position1,
long Position2)
Move 2 axes to the required positions - this does not produce a linear motion |
(package private) void |
moveVector(MotionControllerAxis theAxis1,
MotionControllerAxis theAxis2,
long Position1,
long Position2,
long VectorSpeed,
long VectorAcceleration)
Move 2 axes in a linear motion |
(package private) void |
moveVector(MotionControllerAxis theAxis1,
MotionControllerAxis theAxis2,
MotionControllerAxis theAxis3,
long Position1,
long Position2,
long Position3,
long VectorSpeed,
long VectorAcceleration)
Move 3 axes in a linear motion |
(package private) void |
offset(MotionControllerAxis theAxis,
long Offset)
Offset an axis |
(package private) void |
offset(MotionControllerAxis theAxis1,
MotionControllerAxis theAxis2,
long Offset1,
long Offset2)
Offset 2 axes - this does not produce a linear motion |
(package private) void |
offsetVector(MotionControllerAxis theAxis1,
MotionControllerAxis theAxis2,
long Offset1,
long Offset2,
long VectorSpeed,
long VectorAcceleration)
Offset 2 axes in a linear motion |
private void |
open()
Open communications with the DMC card |
(package private) void |
refreshDataRecord()
Refresh the data record |
private void |
reset()
Reset the DMC card |
(package private) MotionControllerResult |
sendCommand(java.lang.String Command)
Send a command to the motion controller |
(package private) void |
setAcceleration(MotionControllerAxis theAxis,
int Acceleration)
Set the acceleration of an axis |
(package private) void |
setDeceleration(MotionControllerAxis theAxis,
int Deceleration)
Set the deceleration of an axis |
(package private) void |
setDigitalOutputPortHigh(int theDigitalOutputPort)
Set a digital port output high |
(package private) void |
setDigitalOutputPortLow(int theDigitalOutputPort)
Set a digital output port low |
(package private) void |
setDualLoop(MotionControllerAxis theAxis,
boolean state)
Set the axis to use the dual loop method |
(package private) void |
setErrorLimit(long errorLimit)
Set the error limit on all axes |
(package private) void |
setMotorOff(MotionControllerAxis theAxis)
Set an axis motor off |
(package private) void |
setMotorServoHere(MotionControllerAxis theAxis)
Set an axis motor servoing |
(package private) void |
setMotorsOff()
Set all of the motors to the off condition |
(package private) void |
setMotorsServoHere()
Set all of the motors servoing |
(package private) void |
setPID(MotionControllerAxis theAxis,
double ProportionalConstant,
double Integrator,
double DerivativeConstant)
Set the gain (PID) parameters of an axis |
(package private) void |
setPositionLimits(MotionControllerAxis theAxis,
long ReversePositionLimit,
long ForwardPositionLimit)
Set the reverse and forward position limits for an axis |
(package private) void |
setSmoothing(MotionControllerAxis theAxis,
double Smoothing)
Set the smoothing of an axis |
(package private) void |
setSpeed(MotionControllerAxis theAxis,
int Speed)
Set the speed of an axis |
(package private) void |
setTorqueLimit(MotionControllerAxis theAxis,
double torque)
Set the torque limit |
(package private) void |
stop()
Stop motion on all axes |
private void |
test()
|
(package private) void |
wait(MotionControllerAxis theAxis)
Wait for an axis to complete it's motion |
(package private) void |
wait(MotionControllerAxis theAxis1,
MotionControllerAxis theAxis2,
MotionControllerAxis theAxis3)
Wait for 3 axes to complete motion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final boolean ENCODER_SIMULATION
static final java.lang.String X_DMC_AXIS_NAME
static final java.lang.String Y_DMC_AXIS_NAME
static final java.lang.String Z_DMC_AXIS_NAME
static final java.lang.String W_DMC_AXIS_NAME
static final java.lang.String E_DMC_AXIS_NAME
static final java.lang.String F_DMC_AXIS_NAME
static final java.lang.String G_DMC_AXIS_NAME
static final java.lang.String H_DMC_AXIS_NAME
static final java.lang.String S_DMC_AXIS_NAME
private final int AXIS_WAIT_PERIOD
private final long AXIS_WAIT_TIMEOUT
private final java.lang.String MIN_POSITION_LIMIT
private final java.lang.String MAX_POSITION_LIMIT
private static MotionController _instance
Constructor Detail |
---|
private MotionController()
Method Detail |
---|
public static MotionController instance()
private MotionControllerResult DMCCommand(java.lang.String Command)
Command
- Command to send to DMC
private long DMCOpen()
private long DMCClose()
private long DMCReset()
private long DMCRefreshDataRecord()
private long DMCGetGeneralInputFromDR(int DMCGeneralInputPortBlock)
private long DMCGetGeneralOutputFromDR(int DMCGeneralOutputPortBlock)
private long DMCGetAnalogInputFromDR(int DMCAnalogInputPort)
private long DMCGetAxisMotorPositionFromDR(int DMCAxisNumber)
private long DMCGetAxisAuxiliaryPositionFromDR(int DMCAxisNumber)
private void open()
private void close()
private void reset()
MotionControllerResult sendCommand(java.lang.String Command)
Command
- The command to send
void setDigitalOutputPortHigh(int theDigitalOutputPort)
theDigitalOutputPort
- The number of the digital output portvoid setDigitalOutputPortLow(int theDigitalOutputPort)
theDigitalOutputPort
- The number of the digital output portboolean isDigitalInputPortHigh(int theInputPort)
theInputPort
- The number of the input port
boolean isDigitalOutputPortHigh(int theOutputPort)
theOutputPort
- The number of the output port
int getDigitalInputs(int digitalInputBlockNumber)
digitalInputBlockNumber
- The input block number
int getDigitalOutputs(int digitalOutputBlockNumber)
digitalOutputBlockNumber
- The output block number
double getADCReading(int theADCPort)
theADCPort
- The number of the a/d port
void setPID(MotionControllerAxis theAxis, double ProportionalConstant, double Integrator, double DerivativeConstant)
theAxis
- The axisProportionalConstant
- The proportional constant PIntegrator
- The integrator IDerivativeConstant
- Thye derivative constant Dvoid setAcceleration(MotionControllerAxis theAxis, int Acceleration)
theAxis
- The axisAcceleration
- The required accelerationvoid setDeceleration(MotionControllerAxis theAxis, int Deceleration)
theAxis
- The axisDeceleration
- The required decelerationvoid setSmoothing(MotionControllerAxis theAxis, double Smoothing)
theAxis
- The axisSmoothing
- The required smoothing factor (0=maximum smoothing, 1=no smoothing)void setSpeed(MotionControllerAxis theAxis, int Speed)
theAxis
- The axisSpeed
- The required speedvoid setPositionLimits(MotionControllerAxis theAxis, long ReversePositionLimit, long ForwardPositionLimit)
theAxis
- The axisReversePositionLimit
- The reverse position limitForwardPositionLimit
- The forward position limitvoid disablePositionLimits(MotionControllerAxis theAxis)
theAxis
- The axisvoid setErrorLimit(long errorLimit)
errorLimit
- The error limit in encoder countsvoid setMotorsOff()
void setMotorOff(MotionControllerAxis theAxis)
theAxis
- The axisvoid setTorqueLimit(MotionControllerAxis theAxis, double torque)
theAxis
- The axistorque
- The torque limitvoid setMotorsServoHere()
void setMotorServoHere(MotionControllerAxis theAxis)
theAxis
- The axisvoid setDualLoop(MotionControllerAxis theAxis, boolean state)
theAxis
- MotionControllerAxisstate
- booleanvoid defineEncoderPosition(MotionControllerAxis theAxis, long Position)
theAxis
- The axisPosition
- The position the axis is to be defined atvoid defineAuxiliaryEncoderPosition(MotionControllerAxis theAxis, long Position)
theAxis
- The axisPosition
- The position the axis is to be defined atvoid home(MotionControllerAxis theAxis)
theAxis
- The axis to be homedvoid home(MotionControllerAxis theAxis1, MotionControllerAxis theAxis2)
theAxis1
- The first axis to be homedtheAxis2
- The second axis to be homedvoid jog(MotionControllerAxis theAxis, long Speed)
theAxis
- The axisSpeed
- The jogging speedvoid move(MotionControllerAxis theAxis, long Position)
theAxis
- The axis to be movedPosition
- The position to which the axis is to be movedvoid move(MotionControllerAxis theAxis1, MotionControllerAxis theAxis2, long Position1, long Position2)
theAxis1
- Axis 1 to be movedtheAxis2
- Axis 2 to be movedPosition1
- The demand position for axis 1Position2
- The demand position for axis 1void offset(MotionControllerAxis theAxis, long Offset)
theAxis
- The axis to be offsetOffset
- The offsetvoid offset(MotionControllerAxis theAxis1, MotionControllerAxis theAxis2, long Offset1, long Offset2)
theAxis1
- The first axistheAxis2
- The second axisOffset1
- The first axis offsetOffset2
- The second axis offsetvoid moveVector(MotionControllerAxis theAxis1, MotionControllerAxis theAxis2, long Position1, long Position2, long VectorSpeed, long VectorAcceleration)
theAxis1
- The first axistheAxis2
- The second axisPosition1
- The first axis positionPosition2
- The second axis positionVectorSpeed
- The speed of the linear motionVectorAcceleration
- The acceleration of the linear motionvoid moveVector(MotionControllerAxis theAxis1, MotionControllerAxis theAxis2, MotionControllerAxis theAxis3, long Position1, long Position2, long Position3, long VectorSpeed, long VectorAcceleration)
theAxis1
- The first axistheAxis2
- The second axistheAxis3
- The third axisPosition1
- The first axis positionPosition2
- The second axis positionPosition3
- The third axis positionVectorSpeed
- The speed of the linear motionVectorAcceleration
- The acceleration of the linear motionvoid offsetVector(MotionControllerAxis theAxis1, MotionControllerAxis theAxis2, long Offset1, long Offset2, long VectorSpeed, long VectorAcceleration)
theAxis1
- The first axistheAxis2
- The second axisOffset1
- The first axis offsetOffset2
- The second axis offsetVectorSpeed
- The speed of the linear motionVectorAcceleration
- The acceleration of the linear motionlong getPosition(MotionControllerAxis theAxis)
theAxis
- The axis
MotionControllerResult getPosition()
long getReferencePosition(MotionControllerAxis theAxis)
theAxis
- The axis
MotionControllerResult getReferencePosition()
long getPositionError(MotionControllerAxis theAxis)
theAxis
- The axis
long getAuxiliaryEncoderPosition(MotionControllerAxis theAxis)
theAxis
- The axis
long getAcceleration(MotionControllerAxis theAxis)
theAxis
- The axis
long getDeceleration(MotionControllerAxis theAxis)
theAxis
- The axis
long getSpeed(MotionControllerAxis theAxis)
theAxis
- The axis
void findIndex(MotionControllerAxis theAxis)
theAxis
- The axisvoid findEdge(MotionControllerAxis theAxis)
theAxis
- The axisvoid findEdge(MotionControllerAxis theAxis1, MotionControllerAxis theAxis2)
theAxis1
- The axis 1theAxis2
- The axis 2void wait(MotionControllerAxis theAxis)
theAxis
- The axisvoid wait(MotionControllerAxis theAxis1, MotionControllerAxis theAxis2, MotionControllerAxis theAxis3)
theAxis1
- Axis 1theAxis2
- Axis 2theAxis3
- Axis 3void stop()
boolean isInHomeSwitch(MotionControllerAxis theAxis)
theAxis
- The axis
boolean isInForwardLimit(MotionControllerAxis theAxis)
theAxis
- The axis
boolean isInReverseLimit(MotionControllerAxis theAxis)
theAxis
- The axis
void refreshDataRecord()
long getGeneralInputFromDR(int DMCGeneralInputPortBlock)
long getGeneralOutputFromDR(int DMCGeneralOutputPortBlock)
long getAnalogInputFromDR(int DMCAnalogInputPort)
long getAxisMotorPositionFromDR(int DMCAxisNumber)
long getAxisAuxiliaryPositionFromDR(int DMCAxisNumber)
private java.lang.String axisParameters(java.util.List axes, java.util.List parameters)
axes
- A list of axesparameters
- A list of parameters
private void test()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |