INAV Ground Station PID Controller
About 1 minOther ToolsINAVPID控制器原理调参教程
INAV PID Controller Explanation
✅ General Features
- INAV's PID controller uses floating-point operations (higher precision).
- The rate controller / angular velocity controller uses degrees per second (dps) as its unit.
- P, I, D, and the CD gain for multirotors are numerically similar to Betaflight, but the underlying algorithms differ, which may result in different responses.
- The controller type depends on the aircraft type:
- Fixed-wing aircraft use the PIFF controller;
- multirotors use the PIDCD controller.
Fixed-wing uses PIFF controller:
- Error calculation formula: rateError = rateTarget - gyroRate → The difference between the target angular velocity and the angular velocity measured by the gyroscope.
- P term calculation: P = rateError * kP
- I term calculation: I += rateError * kI * dT
- Iterm Relax is not used;
- Controlled by stick limits, when the stick (roll/pitch/yaw) deflection exceeds the threshold set by the parameter fw_iterm_limit_stick_position, the I term will stop accumulating.
- No D term (derivative term)
- FF term (feedforward term): FF = rateTarget * kFF
Note: This is different from Betaflight's FeedForward; it's a simple proportional value calculated directly from the target angular velocity.
Multirotor uses PIDCD controller: - Error calculation formula: rateError = rateTarget - gyroRate
- P term calculation: P = rateError * kP
- I term calculation: Uses Iterm Relax to dynamically reduce the I term effect during rapid maneuvers.
I term calculation formula: I += (itermErrorRate * kI * antiWindupScaler * dT) + ((newOutputLimited - newOutput) * kT * antiWindupScaler * dT)
When motor output saturates, the I term is limited to prevent "integral windup". - D term calculation: Uses only gyroscope data for derivative calculation; Uses two low-pass filters (LPF) to filter high-frequency noise from the D term; Supports D-Boost feature: Enhances D term response during rapid maneuvers (similar to Betaflight's D_min).
- CD term (control derivative term):
- Derivative calculated from the setpoint to enhance controller response during rapid stick movements;
- Equivalent to Feed Forward in Betaflight;
- Calculation formula: newCDTerm = rateTargetDeltaFiltered * (kCD / dT)
————This article is referenced from the INAV official website: https://github.com/iNavFlight/inav/blob/master/docs/INAV%20PID%20Controller.md