Position Control Mode
Last updated
Last updated
January 4, 2025 Update -
Documentation for REVLib 2025 can now be found at: https://docs.revrobotics.com/revlib
Please bookmark our new page as we transition over and add more information there!
Position Control is used to point the motor in a specific direction. It takes a setpoint in rotations and uses the PID loop to move to that position. The Position control mode pipes directly into a PID controller with the configured encoder.
Position Control is a great tool for simple but consistent motions, and can be paired with a WPILib TrapezoidalProfile to create smoother, more complex motions.
A properly tuned Position control loop should respond quickly and accurately to a setpoint change and should not oscillate around the target.
To run the motor in Position control mode, set the PID Controller setpoint as shown below.
API Docs: setReference