63 float Calculate(
float setpoint,
float processVariable,
unsigned long currentMillis);
75 float Calculate(
float setpoint,
float processVariable,
float dT);
Implements a proportional-integral-derivative (PID) controller.
float output
Calculated output value.
float integral
Integral term accumulator.
float Calculate(float setpoint, float processVariable, unsigned long currentMillis)
Calculates the control output based on the setpoint and process variable.
float kp
Proportional gain.
float previousSeconds
Time of the previous calculation in seconds.
float error
Current error value.
float previousError
Previous error value for derivative calculation.
PID()
Default constructor for PID, initializes gains to zero.
~PID()
Destructor for PID.