15#ifdef PID_CONTROLLER_TUNING_AID_ADDRESS
19#include <sys/socket.h>
37 : proportionalGain(
kp),
86 LOGWARNING(
"pidcontroller: max output value exceeded. Resetting.");
89#ifdef PID_CONTROLLER_TUNING_AID_ADDRESS
109#ifdef PID_CONTROLLER_TUNING_AID_ADDRESS
121void cPidController::SendTuningAidData(
double pTerm,
double iTerm,
double dTerm,
double input,
double output,
double targetValue)
123 static int sock = -1;
139 "{\"bufferFillLevelMs\":%g,\"targetBufferFillLevelMs\":%g,\"pTerm\":%g,\"iTerm\":%g,\"dTerm\":%g,\"outputPpm\":%g}",
double integralGain
Integral Gain (Ki) - Drift correction.
double targetValue
The desired buffer fill level in frames.
double integralSum
Accumulator for the I-term.
double maxOutput
Hard limit for output correction.
double maxIntegral
Anti-windup limit for the integral term.
double iTerm
Integral term.
double dTerm
Derivative term.
double proportionalGain
Proportional Gain (Kp) - Reaction strength.
double pTerm
Proportional term.
bool firstRun
Flag for first run.
double previousError
Error from the previous step (for D-term)
double derivativeGain
Derivative Gain (Kd) - Dampening.
void Reset()
Reset the internal state (integral sum and error history).
cPidController(double, double, double, double)
Create a PID Controller.
double Update(double, double)
Calculate the new output value.
#define LOGWARNING
log to LOG_WARN
PID (proportional, integral, derivative) Controller Header File.