Package gda.device
Interface Motor
- All Superinterfaces:
Configurable,Device,Findable,gda.observable.IObservable
- All Known Implementing Classes:
DummyMotor,EpicsMotor,EpicsMotorDecorator,EpicsMotorDirect,EpicsReadyMotor,FeedbackControlledEpicsMotor,MotorBase,MotorIocDecorator,PiezoEpicsMotor,SimpleMotor,ThreadlessDummyMotor
Interface to control motors of all types. Operations which need amounts, for example moveTo, are specified in terms
of steps (which can be non-integral for some types of motor).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intMotorBase creates an array of SPEED_LEVELS values to use as preset speeds. -
Method Summary
Modifier and TypeMethodDescriptionvoidDo backlash correctiondoubleGets the maximum or upper soft limits of the motor itself (i.e.doubleGets the minimum or lower soft limits of the motor itself (i.e.doubledoubleGets the current position of the motordoublereturn the position tolerance or accuracydoublegetSpeed()Gets the current speed setting of the motorGets the state of the motordoubleReturns this motor's time to velocity.doublevoidhome()Moves the motor to a repeatable starting locationbooleanReturns whether or not motor can homebooleanisHomed()Returns whether or not motor is already homedbooleanGets initialisition state of the motor with respect to its connection to low level device service e.g.booleanReturns whether or not limits are settable (in the motor itself).booleanisMoving()Returns whether or not motor is actually movingvoidmoveBy(double steps) Moves the motor by the specified number of stepsvoidmoveContinuously(int direction) Moves the motor in a continuous modevoidmoveTo(double steps) Moves the motor to the specified position in stepsvoidBrings the motor to an uncontrolled stop if possiblevoidsetMaxPosition(double maxPosition) Set the upper soft limit of the motorvoidsetMinPosition(double minPosition) Set the lower soft limit of the motorvoidsetPosition(double steps) Sets the current position of the motorvoidsetSoftLimits(double minPosition, double maxPosition) Sets the soft limits of the motor itself (i.e.voidsetSpeed(double speed) Sets the speed of the motorvoidsetSpeedLevel(int level) Sets the speed level of the motorvoidsetTimeToVelocity(double timeToVelocity) Sets this motor's time to velocity.voidstop()Brings the motor to a controlled stop if possibleBlocks while the motors status is BusyMethods inherited from interface gda.factory.Configurable
configure, isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Field Details
-
SPEED_LEVELS
static final int SPEED_LEVELSMotorBase creates an array of SPEED_LEVELS values to use as preset speeds. The fields SLOW, MEDIUM and FAST are used to identify the relevant value.- See Also:
-
SLOW
static final int SLOW- See Also:
-
MEDIUM
static final int MEDIUM- See Also:
-
FAST
static final int FAST- See Also:
-
-
Method Details
-
moveBy
Moves the motor by the specified number of steps- Parameters:
steps- the number of steps to move by- Throws:
MotorException
-
moveTo
Moves the motor to the specified position in steps- Parameters:
steps- the number of steps to move to- Throws:
MotorException
-
moveContinuously
Moves the motor in a continuous mode- Parameters:
direction- direction to move in- Throws:
MotorException
-
setPosition
Sets the current position of the motor- Parameters:
steps- the position to be set as current- Throws:
MotorException
-
getPosition
Gets the current position of the motor- Returns:
- the current position
- Throws:
MotorException
-
setSpeed
Sets the speed of the motor- Parameters:
speed- the speed- Throws:
MotorException
-
setSpeedLevel
Sets the speed level of the motor- Parameters:
level- one of a range of possible levels eg slow, medium, fast- Throws:
MotorException
-
getSpeed
Gets the current speed setting of the motor- Returns:
- the speed in steps per second
- Throws:
MotorException
-
getTimeToVelocity
Returns this motor's time to velocity.- Throws:
MotorException
-
setTimeToVelocity
Sets this motor's time to velocity.- Throws:
MotorException
-
stop
Brings the motor to a controlled stop if possible- Throws:
MotorException
-
panicStop
Brings the motor to an uncontrolled stop if possible- Throws:
MotorException
-
getStatus
Gets the state of the motor- Returns:
- a value from the MotorStatus enum
- Throws:
MotorException
-
correctBacklash
Do backlash correction- Throws:
MotorException
-
isMoving
Returns whether or not motor is actually moving- Returns:
- true if moving
- Throws:
MotorException
-
isHomeable
Returns whether or not motor can home- Returns:
- true if homeable
- Throws:
MotorException
-
isHomed
Returns whether or not motor is already homed- Returns:
- true if homed
- Throws:
MotorException
-
home
Moves the motor to a repeatable starting location- Throws:
MotorException
-
setSoftLimits
Sets the soft limits of the motor itself (i.e. NOT limits in our software)- Parameters:
minPosition- minimum software limitmaxPosition- maximum software limit- Throws:
MotorException
-
getMinPosition
Gets the minimum or lower soft limits of the motor itself (i.e. NOT limits cached in GDA software). By convention return NaN if not set.- Returns:
- the lower soft limit of the motor
- Throws:
MotorException
-
setMinPosition
Set the lower soft limit of the motor- Parameters:
minPosition- the lower limit to set- Throws:
MotorException
-
getMaxPosition
Gets the maximum or upper soft limits of the motor itself (i.e. NOT limits cached in GDA software). By convention return NaN if not set.- Returns:
- the upper soft limit of the motor
- Throws:
MotorException
-
setMaxPosition
Set the upper soft limit of the motor- Parameters:
maxPosition- upper limit to set- Throws:
MotorException
-
isLimitsSettable
Returns whether or not limits are settable (in the motor itself).- Returns:
- true if the limits are settable.
- Throws:
MotorException
-
isInitialised
Gets initialisition state of the motor with respect to its connection to low level device service e.g. EPICS server. This value does not imply that the motors initial values are set (or not set).- Returns:
- return true if motor is already initialised.
- Throws:
MotorException
-
getRetryDeadband
return the position tolerance or accuracy- Returns:
- positioning tolerance
- Throws:
MotorException
-
getMotorResolution
- Throws:
MotorException
-
getUserOffset
- Returns:
- the user offset set on the motor
- Throws:
MotorException
-
waitWhileStatusBusy
Blocks while the motors status is Busy- Returns:
- status after being busy
- Throws:
InterruptedExceptionDeviceException
-
getUnitString
- Returns:
- unit as a String
- Throws:
MotorException
-