Skip to content

Commit 687ddd0

Browse files
committed
Apply documentation improvements from #94
1 parent 20fe8d0 commit 687ddd0

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

lib/src/main/java/com/team2813/lib2813/control/motors/PositionalMotor.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,26 @@
2020
/**
2121
* A wrapper around a motor and a PID controller that supports predefined positions.
2222
*
23-
* <p>When the motor is created, PID control is disabled. To enable PID control, call {@link
24-
* #setSetpoint(P)}; the motor will moving toward the setpoint and maintains position at the
25-
* setpoint under the control of the PID controller. To stop the motor, call {@link #stopMotor()}.
23+
* <p>{@code PositionalMotor} supports a dual operation mode:
24+
*
25+
* <ul>
26+
* <li><b>PID Control Mode</b> - the user set a destination position (aka "setpoint") and the
27+
* motor moves towards the setpoint under the control of the PID controller.
28+
* <li><b>Direct User Input Mode</b> - the subsystem responds to direct input from the user (i.e.,
29+
* voltage or duty cycle).
30+
* </ul>
31+
*
32+
* <p>When the motor is created, PID control is disabled. The current mode of the motor can be
33+
* determined by calling {@link #isPIDControlEnabled()}.
34+
*
35+
* <p>To enable <b>PID Control Mode</b> call {@link #setSetpoint(P)}; the motor will move toward the
36+
* setpoint and then maintain position at the setpoint under the control of the PID controller.
37+
*
38+
* <p>The <b>Direct User Input Mode</b> is activated when the user calls the {@link
39+
* #setDemand(ControlMode, double)}. The PID Mode is interrupted and disengaged, and the provided
40+
* demand will be directly sent to the motor.
41+
*
42+
* <p>To stop the motor, call {@link #stopMotor()}.
2643
*
2744
* @param <P> an enum implementing {@link Supplier<Angle>} used to specify setpoints.
2845
*/

0 commit comments

Comments
 (0)