Configure PID modes and anti-windup
masterQuickPID allows fine-grained control over how the proportional, derivative, and integral terms are calculated.
Proportional Mode (pMode)
Determines if the proportional term is based on error, measurement, or a combination:
pOnError: Based on error (default).pOnMeas: Based on measurement.pOnErrorMeas: A mix (0.5 error + 0.5 measurement).
Derivative Mode (dMode)
Determines if the derivative term is based on error or measurement:
dOnError: Based on error.dOnMeas: Based on measurement (default).
Anti-Windup Mode (iAwMode)
Controls how the integral term handles saturation:
iAwCondition: Uses PI terms to provide integral correction, prevent deep saturation, and reduce overshoot (default).iAwClamp: Clamps the summation of thepTermandiTerm.iAwOff: Disables all anti-windup.
// Example of setting modes after construction
pid.SetProportionalMode(pMode::pOnMeas);
pid.SetDerivativeMode(dMode::dOnError);
pid.SetAntiWindupMode(iAwMode::iAwClamp);