|
CTRE Phoenix 6 C++ 26.0.0-beta-1
|
Configs that affect general behavior during closed-looping. More...
#include <ctre/phoenix6/configs/ClosedLoopGeneralConfigs.hpp>
Public Member Functions | |
| constexpr | ClosedLoopGeneralConfigs ()=default |
| constexpr ClosedLoopGeneralConfigs & | WithContinuousWrap (bool newContinuousWrap) |
| Modifies this configuration's ContinuousWrap parameter and returns itself for method-chaining and easier to use config API. | |
| constexpr ClosedLoopGeneralConfigs & | WithDifferentialContinuousWrap (bool newDifferentialContinuousWrap) |
| Modifies this configuration's DifferentialContinuousWrap parameter and returns itself for method-chaining and easier to use config API. | |
| constexpr ClosedLoopGeneralConfigs & | WithGainSchedErrorThreshold (units::angle::turn_t newGainSchedErrorThreshold) |
| Modifies this configuration's GainSchedErrorThreshold parameter and returns itself for method-chaining and easier to use config API. | |
| constexpr ClosedLoopGeneralConfigs & | WithGainSchedKpBehavior (signals::GainSchedKpBehaviorValue newGainSchedKpBehavior) |
| Modifies this configuration's GainSchedKpBehavior parameter and returns itself for method-chaining and easier to use config API. | |
| std::string | ToString () const override |
| std::string | Serialize () const final |
| ctre::phoenix::StatusCode | Deserialize (std::string const &to_deserialize) final |
Public Member Functions inherited from ctre::phoenix6::configs::ParentConfiguration | |
Public Member Functions inherited from ctre::phoenix6::ISerializable | |
Public Attributes | |
| bool | ContinuousWrap = false |
| Wrap position error within [-0.5, +0.5) mechanism rotations. | |
| bool | DifferentialContinuousWrap = false |
| Wrap differential difference position error within [-0.5, +0.5) mechanism rotations. | |
| units::angle::turn_t | GainSchedErrorThreshold = 0.0_tr |
| The position closed-loop error threshold for gain scheduling. | |
| signals::GainSchedKpBehaviorValue | GainSchedKpBehavior = signals::GainSchedKpBehaviorValue::Continuous |
| The behavior of kP output as the error crosses the GainSchedErrorThreshold during gain scheduling. | |
Configs that affect general behavior during closed-looping.
Includes Continuous Wrap features.
|
constexprdefault |
|
finalvirtual |
Implements ctre::phoenix6::configs::ParentConfiguration.
|
finalvirtual |
Implements ctre::phoenix6::ISerializable.
|
overridevirtual |
Implements ctre::phoenix6::configs::ParentConfiguration.
|
inlineconstexpr |
Modifies this configuration's ContinuousWrap parameter and returns itself for method-chaining and easier to use config API.
Wrap position error within [-0.5, +0.5) mechanism rotations. Typically used for continuous position closed-loops like swerve azimuth.
This uses the mechanism rotation value. If there is a gear ratio between the sensor and the mechanism, make sure to apply a SensorToMechanismRatio so the closed loop operates on the full rotation.
| newContinuousWrap | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's DifferentialContinuousWrap parameter and returns itself for method-chaining and easier to use config API.
Wrap differential difference position error within [-0.5, +0.5) mechanism rotations. Typically used for continuous position closed-loops like a differential wrist.
This uses the differential difference rotation value. If there is a gear ratio on the difference axis, make sure to apply a SensorToDifferentialRatio so the closed loop operates on the full rotation.
| newDifferentialContinuousWrap | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's GainSchedErrorThreshold parameter and returns itself for method-chaining and easier to use config API.
The position closed-loop error threshold for gain scheduling. When the absolute value of the closed-loop error is within the threshold (inclusive), the PID controller will automatically switch gains according to the configured GainSchedBehavior of the slot.
When this is zero (default), no gain scheduling will occur. Additionally, this does not take effect for velocity closed-loop controls.
This can be used to implement a closed-loop deadband or, less commonly, to switch to weaker gains when close to the target.
| newGainSchedErrorThreshold | Parameter to modify |
|
inlineconstexpr |
Modifies this configuration's GainSchedKpBehavior parameter and returns itself for method-chaining and easier to use config API.
The behavior of kP output as the error crosses the GainSchedErrorThreshold during gain scheduling. The output of kP can be adjusted to maintain continuity in output, or it can be left discontinuous.
| newGainSchedKpBehavior | Parameter to modify |
| bool ctre::phoenix6::configs::ClosedLoopGeneralConfigs::ContinuousWrap = false |
Wrap position error within [-0.5, +0.5) mechanism rotations.
Typically used for continuous position closed-loops like swerve azimuth.
This uses the mechanism rotation value. If there is a gear ratio between the sensor and the mechanism, make sure to apply a SensorToMechanismRatio so the closed loop operates on the full rotation.
| bool ctre::phoenix6::configs::ClosedLoopGeneralConfigs::DifferentialContinuousWrap = false |
Wrap differential difference position error within [-0.5, +0.5) mechanism rotations.
Typically used for continuous position closed-loops like a differential wrist.
This uses the differential difference rotation value. If there is a gear ratio on the difference axis, make sure to apply a SensorToDifferentialRatio so the closed loop operates on the full rotation.
| units::angle::turn_t ctre::phoenix6::configs::ClosedLoopGeneralConfigs::GainSchedErrorThreshold = 0.0_tr |
The position closed-loop error threshold for gain scheduling.
When the absolute value of the closed-loop error is within the threshold (inclusive), the PID controller will automatically switch gains according to the configured GainSchedBehavior of the slot.
When this is zero (default), no gain scheduling will occur. Additionally, this does not take effect for velocity closed-loop controls.
This can be used to implement a closed-loop deadband or, less commonly, to switch to weaker gains when close to the target.
| signals::GainSchedKpBehaviorValue ctre::phoenix6::configs::ClosedLoopGeneralConfigs::GainSchedKpBehavior = signals::GainSchedKpBehaviorValue::Continuous |
The behavior of kP output as the error crosses the GainSchedErrorThreshold during gain scheduling.
The output of kP can be adjusted to maintain continuity in output, or it can be left discontinuous.