15#ifdef PID_CONTROLLER_TUNING_AID_ADDRESS
19#include <sys/socket.h>
32 : proportionalGain(
kp),
81 LOGWARNING(
"pidcontroller: max output value exceeded. Resetting.");
84#ifdef PID_CONTROLLER_TUNING_AID_ADDRESS
104#ifdef PID_CONTROLLER_TUNING_AID_ADDRESS
116void cPidController::SendTuningAidData(
double pTerm,
double iTerm,
double dTerm,
double input,
double output,
double targetValue)
118 static int sock = -1;
134 "{\"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.
void Reset()
Reset the internal state (integral sum and error history).
double maxOutput
Hard limit for output correction.
double maxIntegral
Anti-windup limit for the integral term.
double iTerm
Integral term.
cPidController(double, double, double, double)
Create a PID Controller.
double dTerm
Derivative term.
double proportionalGain
Proportional Gain (Kp) - Reaction strength.
double Update(double, double)
Calculate the new output value.
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.
#define LOGWARNING
log to LOG_WARN
PID (proportional, integral, derivative) Controller Header File.