Skip to content

Commit

Permalink
Further correction of the comments on PIDController.setIntegratorRang…
Browse files Browse the repository at this point in the history
…e and PIDController::SetIntegratorRange
  • Loading branch information
chauser committed Mar 28, 2024
1 parent 709aef8 commit 2b2416a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,18 @@ public boolean isContinuousInputEnabled() {
}

/**
* Sets the minimum and maximum values for the integrator.
* Sets the minimum and maximum contributions of the integrator.
*
* <p>If the integrator value is outside the range [minimumIntegral..maximumIntegral] the integral
* gain times the corresponding limit is added to the controller output rather than the integral
* <p>If the integrator value is outside the range [minimumIntegral/ki..maximumIntegral/ki] either
* minimumIntegral or maximumIntegral is added to the controller output instead of the integral
* gain times the integrator value.
*
* @param minimumIntegral The minimum value of the integrator.
* @param maximumIntegral The maximum value of the integrator.
* <p>Additionally, the integrator value is set to minimumIntegral/ki or maximumIntegral/ki
* whenever the integrator value would fall outside the range
* [minimumIntegral/ki..maximumIntegral/ki].
*
* @param minimumIntegral The minimum contribution of the integral term
* @param maximumIntegral The maximum contribution of the integral term
*/
public void setIntegratorRange(double minimumIntegral, double maximumIntegral) {
m_minimumIntegral = minimumIntegral;
Expand Down
14 changes: 8 additions & 6 deletions wpimath/src/main/native/include/frc/controller/PIDController.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,16 @@ class WPILIB_DLLEXPORT PIDController
bool IsContinuousInputEnabled() const;

/**
* Sets the minimum and maximum values for the integrator.
* Sets the minimum and maximum contributions of the integrator.
*
* If the integrator value is outside the range [minimumIntegral..maximumIntegral]
* the integral gain times the corresponding limit is added to the controller output
* rather than the integral gain times the integrator value.
* <p>If the integrator value is outside the range [minimumIntegral/Ki..maximumIntegral/Ki]
* either minimumIntegral or maximumIntegral is added to the controller output
* instead of the integral gain times the integrator value.
* <p>Additionally, the integrator value is set to minimumIntegral/Ki or maximumIntegral/Ki whenever
* the integrator value would fall outside the range [minimumIntegral/Ki..maximumIntegral/Ki].
*
* @param minimumIntegral The minimum value of the integrator.
* @param maximumIntegral The maximum value of the integrator.
* @param minimumIntegral The minimum contribution of the integral term
* @param maximumIntegral The maximum contribution of the integral term
*/
void SetIntegratorRange(double minimumIntegral, double maximumIntegral);

Expand Down

0 comments on commit 2b2416a

Please sign in to comment.