- Enclosing class:
protected class NXTRegulatedMotor.Regulator
- extends Object
Inner class to regulate velocity; also stop motor at desired rotation angle.
This class uses a very simple movement model based on simple linear
acceleration. This model is used to generate ideal target positions which
are then used to generate error terms between the actual and target position
this error term is then used to drive a PID style motor controller to
regulate the power supplied to the motor.
If new command are issued while a move is in progress, the new command
is blended with the current one to provide smooth movement.
If the requested speed is not possible then the controller will simply
drop move cycles until the motor catches up with the ideal position. If
too many consecutive dropped moves are required then the motor is viewed
to have stalled and the move is terminated.
Once the motor stops, the final position is held using the same PID control
mechanism (with slightly different parameters), as that used for movement.
Initiate a new move and optionally wait for it to complete.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public int power
public void newMove(float speed,
- Initiate a new move and optionally wait for it to complete.
If some other move is currently executing then ensure that this move
is terminated correctly and then start the new move operation.