Closed-Loop Control =================== Phoenix 6 enhances the experience of using onboard closed-loop control through the use of standardized units and a variety of control output types. .. note:: For more information about closed-loop control in Phoenix 6, see :doc:`/docs/api-reference/device-specific/talonfx/closed-loop-requests`. .. raw:: html Closed-Loop Setpoints --------------------- Phoenix 6 uses canonical units for closed-loop setpoints. .. note:: This calculator assumes the ``RotorToSensorRatio`` and ``SensorToMechanismRatio`` configs are both set to 1. If this is not the case in your robot program, **divide** the resulting values by both ratios. .. raw:: html
Setpoint Conversion | ||||
---|---|---|---|---|
Name | Value | Units | Formula | |
Position | Original | \(\mathrm{raw\_units}\) | \(x_{\mathrm{old}}\) | |
New | \(\mathrm{rotations}\) | \(x_{\mathrm{new}}=x_{\mathrm{old}} \cdot \frac{1}{2048} \frac{\mathrm{rot}}{\mathrm{raw\_unit}}\) | ||
Velocity | Original | \(\frac{\mathrm{raw\_units}}{\mathrm{100ms}}\) | \(v_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{rot}}{\mathrm{second}}\) | \(v_{\mathrm{new}}=v_{\mathrm{old}} \cdot \frac{1}{2048} \frac{\mathrm{rot}}{\mathrm{raw\_unit}} \cdot 10 \frac{\mathrm{100ms}}{\mathrm{second}} \) | ||
Acceleration | Original | \(\frac{\mathrm{raw\_units}}{\mathrm{100ms} \cdot \mathrm{second}}\) | \(a_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{rot}}{\mathrm{second}^2}\) | \(a_{\mathrm{new}}=a_{\mathrm{old}} \cdot \frac{1}{2048} \frac{\mathrm{rot}}{\mathrm{raw\_unit}} \cdot 10 \frac{\mathrm{100ms}}{\mathrm{second}} \) |
Position without Voltage Compensation | ||||
---|---|---|---|---|
Name | Value | Units | Formula | |
kP | Original | \(\frac{\mathrm{raw\_output}}{\mathrm{unit}}\) | \(kP_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{duty\_cycle}}{\mathrm{rot}}\) | \(kP_{\mathrm{new}}=kP_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}}\) | ||
kI | Original | \(\frac{\mathrm{raw\_output}}{\mathrm{unit} \cdot \mathrm{millisecond}}\) | \(kI_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{duty\_cycle}}{\mathrm{rot} \cdot \mathrm{second}}\) | \(kI_{\mathrm{new}}=kI_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot 1000 \frac{\mathrm{millisecond}}{\mathrm{second}}\) | ||
kD | Original | \(\frac{\mathrm{raw\_output}}{\mathrm{unit} / \mathrm{millisecond}}\) | \(kD_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{duty\_cycle}}{\mathrm{rot} / \mathrm{second}}\) | \(kD_{\mathrm{new}}=kD_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot \frac{1}{1000} \frac{\mathrm{second}}{\mathrm{millisecond}}\) |
Position with Voltage Compensation | ||||
---|---|---|---|---|
Name | Value | Units | Formula | |
kP | Original | \(\frac{\mathrm{\mathrm{raw\_output}}}{\mathrm{unit}}\) | \(kP_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{V}}{\mathrm{rot}}\) | \(kP_{\mathrm{new}}=kP_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot \mathrm{V\_comp} \frac{\mathrm{V}}{\mathrm{duty\_cycle}}\) | ||
kI | Original | \(\frac{\mathrm{\mathrm{raw\_output}}}{\mathrm{unit} \cdot \mathrm{millisecond}}\) | \(kI_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{V}}{\mathrm{rot} \cdot \mathrm{second}}\) | \(kI_{\mathrm{new}}=kI_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot 1000 \frac{\mathrm{millisecond}}{\mathrm{second}} \cdot \mathrm{V\_comp} \frac{\mathrm{V}}{\mathrm{duty\_cycle}}\) | ||
kD | Original | \(\frac{\mathrm{\mathrm{raw\_output}}}{\mathrm{unit} / \mathrm{millisecond}}\) | \(kD_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{V}}{\mathrm{rot} / \mathrm{second}}\) | \(kD_{\mathrm{new}}=kD_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot \frac{1}{1000} \frac{\mathrm{second}}{\mathrm{millisecond}} \cdot \mathrm{V\_comp} \frac{\mathrm{V}}{\mathrm{duty\_cycle}}\) |
Velocity without Voltage Compensation | ||||
---|---|---|---|---|
Name | Value | Units | Formula | |
kP | Original | \(\frac{\mathrm{raw\_output}}{\mathrm{unit} / \mathrm{100ms}}\) | \(kP_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{duty\_cycle}}{\mathrm{rot} / \mathrm{sec}}\) | \(kP_{\mathrm{new}}=kP_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot \frac{1}{10} \frac{\mathrm{sec}}{\mathrm{100ms}}\) | ||
kI | Original | \(\frac{\mathrm{raw\_output}}{(\mathrm{unit} / \mathrm{100ms}) \cdot \mathrm{millisecond}}\) | \(kI_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{duty\_cycle}}{\mathrm{rot}}\) | \(kI_{\mathrm{new}}=kI_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot 1000 \frac{\mathrm{millisecond}}{\mathrm{second}} \cdot \frac{1}{10} \frac{\mathrm{sec}}{\mathrm{100ms}}\) | ||
kD | Original | \(\frac{\mathrm{raw\_output}}{(\mathrm{unit} / \mathrm{100ms}) / \mathrm{millisecond}}\) | \(kD_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{duty\_cycle}}{\mathrm{rot} / \mathrm{second}^{2}}\) | \(kD_{\mathrm{new}}=kD_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot \frac{1}{1000} \frac{\mathrm{second}}{\mathrm{millisecond}} \cdot \frac{1}{10} \frac{\mathrm{sec}}{\mathrm{100ms}}\) | ||
kF kV |
Original | \(\frac{\mathrm{raw\_output}}{\mathrm{unit} / \mathrm{100millisecond}}\) | \(kF_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{duty\_cycle}}{\mathrm{rot} / \mathrm{second}}\) | \(kV_{\mathrm{new}}=kF_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot \frac{1}{10} \frac{\mathrm{second}}{\mathrm{100ms}}\) |
Velocity with Voltage Compensation | ||||
---|---|---|---|---|
Name | Value | Units | Formula | |
kP | Original | \(\frac{\mathrm{\mathrm{raw\_output}}}{\mathrm{unit} / \mathrm{100ms}}\) | \(kP_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{V}}{\mathrm{rot} / \mathrm{sec}}\) | \(kP_{\mathrm{new}}=kP_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot \frac{1}{10} \frac{\mathrm{second}}{\mathrm{100ms}} \cdot \mathrm{V\_comp} \frac{\mathrm{V}}{\mathrm{duty\_cycle}}\) | ||
kI | Original | \(\frac{\mathrm{\mathrm{raw\_output}}}{(\mathrm{unit} / \mathrm{100ms}) \cdot \mathrm{millisecond}}\) | \(kI_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{V}}{\mathrm{rot}}\) | \(kI_{\mathrm{new}}=kI_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot 1000 \frac{\mathrm{millisecond}}{\mathrm{second}} \cdot \frac{1}{10} \frac{\mathrm{second}}{\mathrm{100ms}} \cdot \mathrm{V\_comp} \frac{\mathrm{V}}{\mathrm{duty\_cycle}}\) | ||
kD | Original | \(\frac{\mathrm{\mathrm{raw\_output}}}{(\mathrm{unit} / \mathrm{100ms}) / \mathrm{millisecond}}\) | \(kD_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{V}}{\mathrm{rot} / \mathrm{second}^{2}}\) | \(kD_{\mathrm{new}}=kD_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot \frac{1}{1000} \frac{\mathrm{second}}{\mathrm{millisecond}} \cdot \frac{1}{10} \frac{\mathrm{second}}{\mathrm{100ms}} \cdot \mathrm{V\_comp} \frac{\mathrm{V}}{\mathrm{duty\_cycle}}\) | ||
kF kV |
Original | \(\frac{\mathrm{\mathrm{raw\_output}}}{\mathrm{unit} / \mathrm{100ms}}\) | \(kF_{\mathrm{old}}\) | |
New | \(\frac{\mathrm{V}}{\mathrm{rot} / \mathrm{second}}\) | \(kV_{\mathrm{new}}=kF_{\mathrm{old}} \cdot 2048 \frac{\mathrm{unit}}{\mathrm{rot}} \cdot \frac{1}{1023} \frac{\mathrm{duty\_cycle}}{\mathrm{raw\_output}} \cdot \frac{1}{10} \frac{\mathrm{second}}{\mathrm{100ms}} \cdot \mathrm{V\_comp} \frac{\mathrm{V}}{\mathrm{duty\_cycle}}\) |