public interface LinearActuator extends Encoder
move() and moveTo() methods.
Stall detection must be provided to avoid motor damage due to running against the end stops, etc.
Motor regulation is not specified in this interface as it may be difficult to determine the accurate length per time
(ie. mm/sec) rate due to encoder tick granularity of the linear actuator. It is up to the implementor to decide if the
move() and moveTo() methods should produce regulated movement.
LnrActrFirgelliNXT| Modifier and Type | Method and Description |
|---|---|
int |
getPower()
Returns the current actuator motor power setting.
|
int |
getTachoCount()
Returns the absolute tachometer (encoder) position of the actuator shaft.
|
boolean |
isMoving()
Return
true if the actuator is in motion due to a move() or moveTo() order. |
boolean |
isStalled()
Returns true if a
move() or moveTo() order ended due to a stalled motor. |
void |
move(int distance,
boolean immediateReturn)
The actuator should retract (negative
distance value) or extend (positive distance value)
in encoder ticks distance. |
void |
moveTo(int position,
boolean immediateReturn)
The actuator should move to absolute
position in encoder ticks. |
void |
resetTachoCount()
Reset the tachometer (encoder) count to zero at the current actuator position.
|
void |
setPower(int power)
Set the power level 0%-100% to be applied to the actuator motor where 0% is no movement and 100% is full speed.
|
void |
stop()
Cause the actuator to stop immediately and resist any further motion.
|
void setPower(int power)
power - new motor power 0-100%int getPower()
void move(int distance,
boolean immediateReturn)
distance value) or extend (positive distance value)
in encoder ticks distance. The distance is specified to be relative to the actuator shaft position
at the time of calling this method. The absolute unit per encoder tick is device-dependent and should be specified in the
implementation documentation.
Stall detection needs to be implemented to stop the actuator in the event of an actuator motor stall condition.
If immediateReturn is true, this method should not block and return immediately. The actuator stops when the
stroke distance is met or a stall is detected.
distance - The distance to move the actuator shaftimmediateReturn - true returns immediately, false waits for the action to complete (or a stall)void moveTo(int position,
boolean immediateReturn)
position in encoder ticks. The position of the actuator
shaft on startup should be zero. The position of the actuator shaft should be set to zero when
resetTachoCount() is called.position - The absolute shaft position in encoder ticks.immediateReturn - true returns immediately, false waits for the action to complete (or a stall)boolean isMoving()
true if the actuator is in motion due to a move() or moveTo() order.true if the actuator is in motion. false otherwise.boolean isStalled()
move() or moveTo() order ended due to a stalled motor. This should
behave like a latch where the
reset of the stall status is done on a new move() or moveTo() order.true if actuator motor stalled during an move() or moveTo() order.
false otherwise.void stop()
move() or
moveTo()orders in progress.int getTachoCount()
resetTachoCount() was last called or the position of the shaft when instantiated.getTachoCount in interface Encodervoid resetTachoCount()
resetTachoCount in interface Encoder