CTRE Phoenix 6 C++ 23.10.0-alpha-8
|
Gains for the specified slot. More...
#include <ctre/phoenix6/configs/Configs.hpp>
Public Member Functions | |
std::string | ToString () const |
std::string | Serialize () const |
ctre::phoenix::StatusCode | Deserialize (const std::string &to_deserialize) |
virtual std::string | ToString () const =0 |
virtual ctre::phoenix::StatusCode | Deserialize (const std::string &string)=0 |
virtual std::string | Serialize () const =0 |
Static Public Member Functions | |
static SlotConfigs | From (const Slot0Configs &value) |
static SlotConfigs | From (const Slot1Configs &value) |
static SlotConfigs | From (const Slot2Configs &value) |
Public Attributes | |
double | kP = 0 |
Proportional Gain. More... | |
double | kI = 0 |
Integral Gain. More... | |
double | kD = 0 |
Derivative Gain. More... | |
double | kS = 0 |
Static Feedforward Gain. More... | |
double | kV = 0 |
Velocity Feedforward Gain. More... | |
double | kA = 0 |
Acceleration Feedforward Gain. More... | |
double | kG = 0 |
Gravity Feedforward Gain. More... | |
signals::GravityTypeValue | GravityType = signals::GravityTypeValue::Elevator_Static |
Gravity Feedforward Type. More... | |
int | SlotNumber = 0 |
Chooses which slot these configs are for. More... | |
Gains for the specified slot.
If this slot is selected, these gains are used in closed loop control requests.
|
inlinevirtual |
Implements ctre::phoenix6::configs::ParentConfiguration.
|
static |
|
static |
|
static |
|
inlinevirtual |
Implements ctre::phoenix6::ISerializable.
|
inlinevirtual |
Implements ctre::phoenix6::configs::ParentConfiguration.
signals::GravityTypeValue ctre::phoenix6::configs::SlotConfigs::GravityType = signals::GravityTypeValue::Elevator_Static |
Gravity Feedforward Type.
This determines the type of the gravity feedforward. Choose Elevator_Static for systems where the gravity feedforward is constant, such as an elevator. The gravity feedforward output will always have the same sign. Choose Arm_Cosine for systems where the gravity feedforward is dependent on the angular position of the mechanism, such as an arm. The gravity feedforward output will vary depending on the mechanism angular position. Note that the sensor offset and ratios must be configured so that the sensor reports a position of 0 when the mechanism is horizonal (parallel to the ground), and the reported sensor position is 1:1 with the mechanism.
double ctre::phoenix6::configs::SlotConfigs::kA = 0 |
Acceleration Feedforward Gain.
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested acceleration, the units should be defined as units of output per unit of requested input acceleration. For example, when controlling velocity using a duty cycle closed loop, the units for the acceleration feedfoward gain will be duty cycle per requested rps/s, or 1/(rps/s).
Minimum Value: 0 Maximum Value: 3.4e+38 Default Value: 0 Units:
double ctre::phoenix6::configs::SlotConfigs::kD = 0 |
Derivative Gain.
The units for this gain is dependent on the control mode. Since this gain is multiplied by the derivative of error in the input with respect to time (in units of seconds), the units should be defined as units of output per unit of the differentiated input error. For example, when controlling velocity using a duty cycle closed loop, the derivative of velocity with respect to time is rps/s, which is acceleration. Therefore, the units for the derivative gain will be duty cycle per unit of acceleration error, or 1/(rps/s).
Minimum Value: 0 Maximum Value: 3.4e+38 Default Value: 0 Units:
double ctre::phoenix6::configs::SlotConfigs::kG = 0 |
Gravity Feedforward Gain.
This is added to the closed loop output. The sign is determined by the type of gravity feedforward. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.
Minimum Value: -512 Maximum Value: 511 Default Value: 0 Units:
double ctre::phoenix6::configs::SlotConfigs::kI = 0 |
Integral Gain.
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input integrated over time (in units of seconds), the units should be defined as units of output per unit of integrated input error. For example, when controlling velocity using a duty cycle closed loop, integrating velocity over time results in rps * s = rotations. Therefore, the units for the integral gain will be duty cycle per rotation of accumulated error, or 1/rot.
Minimum Value: 0 Maximum Value: 3.4e+38 Default Value: 0 Units:
double ctre::phoenix6::configs::SlotConfigs::kP = 0 |
Proportional Gain.
The units for this gain is dependent on the control mode. Since this gain is multiplied by error in the input, the units should be defined as units of output per unit of input error. For example, when controlling velocity using a duty cycle closed loop, the units for the proportional gain will be duty cycle per rps of error, or 1/rps.
Minimum Value: 0 Maximum Value: 3.4e+38 Default Value: 0 Units:
double ctre::phoenix6::configs::SlotConfigs::kS = 0 |
Static Feedforward Gain.
This is added to the closed loop output. The sign is determined by target velocity. The unit for this constant is dependent on the control mode, typically fractional duty cycle, voltage, or torque current.
Minimum Value: -512 Maximum Value: 511 Default Value: 0 Units:
double ctre::phoenix6::configs::SlotConfigs::kV = 0 |
Velocity Feedforward Gain.
The units for this gain is dependent on the control mode. Since this gain is multiplied by the requested velocity, the units should be defined as units of output per unit of requested input velocity. For example, when controlling velocity using a duty cycle closed loop, the units for the velocity feedfoward gain will be duty cycle per requested rps, or 1/rps.
Minimum Value: 0 Maximum Value: 3.4e+38 Default Value: 0 Units:
int ctre::phoenix6::configs::SlotConfigs::SlotNumber = 0 |
Chooses which slot these configs are for.