#include <SparkClosedLoopController.h>
◆ ArbFFUnits
Units for arbitrary feed-forward
| Enumerator |
|---|
| kVoltage | |
| kPercentOut | |
◆ SparkClosedLoopController() [1/2]
◆ SparkClosedLoopController() [2/2]
◆ ~SparkClosedLoopController()
| rev::spark::SparkClosedLoopController::~SparkClosedLoopController |
( |
| ) |
|
|
default |
◆ operator=()
◆ SetSetpoint()
Set the controller setpoint based on the selected control mode.
- Parameters
-
| setpoint | The setpoint to set depending on the control mode. For:
|
| ctrl | Is the control type |
| slot | The ClosedLoopSlot to use |
| arbFeedforward | A value from -32.0 to 32.0 which is a voltage applied to the motor after the result of the specified control mode. The units for the parameter is Volts. This value is set after the control mode, but before any current limits or ramp rates. |
| arbFFUnits | the units for arbitrary feed-forward |
- Returns
- REVLibError::kOk if successful
◆ SetReference()
Set the controller setpoint based on the selected control mode.
- Parameters
-
| setpoint | The setpoint to set depending on the control mode. For:
|
| ctrl | Is the control type |
| slot | The ClosedLoopSlot to use |
| arbFeedforward | A value from -32.0 to 32.0 which is a voltage applied to the motor after the result of the specified control mode. The units for the parameter is Volts. This value is set after the control mode, but before any current limits or ramp rates. |
| arbFFUnits | the units for arbitrary feed-forward |
- Returns
- REVLibError::kOk if successful
- Deprecated:
- Use SetSetpoint instead.
◆ GetControlType()
Get the selected control type used when SetReference() was called.
- Returns
- The selected control type
◆ SetIAccum()
Set the I accumulator of the closed loop controller. This is useful when wishing to force a reset on the I accumulator of the Closed Loop Controller. You can also preset values to see how it will respond to certain I characteristics
To use this function, the controller must be in a closed loop control mode by calling setReference()
- Parameters
-
| iAccum | The value to set the I accumulator to |
- Returns
- REVLibError::kOk if successful
◆ GetIAccum()
| Signal< double > SparkClosedLoopController::GetIAccum |
( |
| ) |
const |
Get the I accumulator of the closed loop controller. This is useful when wishing to see what the I accumulator value is to help with PID tuning
- Returns
- Signal containing the value of the I accumulator
◆ GetSetpoint()
| Signal< double > SparkClosedLoopController::GetSetpoint |
( |
| ) |
const |
Get the internal setpoint of the closed loop controller.
- Returns
- Signal containing the internal setpoint
◆ IsAtSetpoint()
| Signal< bool > SparkClosedLoopController::IsAtSetpoint |
( |
| ) |
const |
Determine if the setpoint has been reached.
- Returns
- Signal containing true if the setpoint is reached; false otherwise
◆ GetSelectedSlot()
Get the selected closed loop PID slot.
- Returns
- Signal containing the selected closed loop PID slot
◆ GetMAXMotionSetpointPosition()
| Signal< double > SparkClosedLoopController::GetMAXMotionSetpointPosition |
( |
| ) |
const |
Get the MAXMotion internal setpoint position.
This will be 0 if the controller is not in a MAXMotion control mode.
- Returns
- Signal containing the MAXMotion internal setpoint position in rotations or units specified by the conversion factor.
◆ GetMAXMotionSetpointVelocity()
| Signal< double > SparkClosedLoopController::GetMAXMotionSetpointVelocity |
( |
| ) |
const |
Get the MAXMotion internal setpoint velocity.
This will be 0 if the controller is not in a MAXMotion control mode.
- Returns
- Signal containing the MAXMotion internal setpoint velocity in rotations per minute or units specified by the conversion factor.
◆ SparkBase
The documentation for this class was generated from the following files: