Set Output
The Thrifty Nova provides various ways to set the output of the motor, percent, positional, and velocity control. The following examples highlight various applications of these three control modes.
Percent Output Control
Simplest control mode - directly sets motor power:
Position Control
Moves to specific encoder positions using PID control:
Velocity Control
Maintains specific speeds using PID control:
Control Flow Summary
Configure encoder type with
useEncoderType()
(Optional) Set initial position with
setEncoderPosition()
Use control methods:
setPercent()
for direct power controlsetPosition()
for position control (requires PID)setVelocity()
for velocity control (requires PID)
Read feedback with:
getPosition()
for current positiongetVelocity()
for current speed
Important Notes
Position and velocity units are always in encoder-native units
Use the
Conversion
class to convert between encoder units and real-world unitsPosition/velocity control require properly configured PID
setPosition()
sets a target for closed-loop controlgetPosition()
reads the actual measured positionCurrent readings are always in amps
All encoder readings are relative to the last
setEncoderPosition()
call
Last updated