Skip to content

v6.1.1

Latest
Compare
Choose a tag to compare
@bubner bubner released this 13 Dec 12:30
· 14 commits to master since this release
7414282

v6.1.1 (2024-12-13)

PID systems refactoring and improvements.

Breaking changes

  • ProfiledPIDController now extends PIDController, delegating a lot of its methods over to the PIDFController
  • Renamed getPositionError() to getError() on PIDFController
  • Renamed getVelocityError() to getErrorDerivative() on PIDFController
  • For consistency, the setSetPoint and getSetPoint methods that spanned ProfiledPIDController and PIDFController are now simply setSetpoint and getSetpoint
    • To differentiate the double setpoint from the TrapezoidalProfile setpoint, the getSetPoint method still exists on ProfiledPIDController

Additions

  • PIDFController new methods and functionality
    • setClearIntegralOnNewSetpoint, which will erase the integration accumulation whenever the setpoint is changed
    • setIntegrationZone, also known as the IZone from WPILib, which sets a region around the error such that integration is enabled
    • enableContinuousInput, also from WPILib, which allows wrapping of PID outputs for continuous systems like angles
    • See the BunyipsLib wiki (IO section) for more information
  • PIDFController now uses a low-pass filter to smooth derivative readings
    • Comes with the setDerivativeSmoothingGain method, allowing you to set a low-pass gain (0<g<1)
    • Designed to reduce noise and oscillation caused by too noisy of data to get a derivative that can be used effectively
    • Default value of 0.8 in place for all PIDFController instances - set to Double.MIN_VALUE to disable or access/set the DEFAULT_DERIVATIVE_LP_GAIN field
  • New PIDFController getTotalError() method to accompany getError() and getErrorDerivative()

Non-breaking changes

  • New unit tests for the new refactored PID and features
    • These tests are ported from WPILib
    • Some tests, like ones that test derivatives have not been integrated as the controllers do not have constant period
  • Various docs improvements and corrections
  • PIDFController now exposes the fields:
    • clearIOnNewSetpoint
    • minIClamp
    • maxIClamp
    • iZone
    • lowerClamp
    • and upperClamp
  • Various internal restructurings of PIDFController
  • reset() of PIDFController resets all errors now
  • The Filter.LowPass now exposes as a public final field the gain in use
  • Implementations of Filter.LowPass now have checks to stop reassignment on continuous set calls