Introduction - If you have any usage issues, please Google them yourself
{ interface }
type TPIDController =
record
PID_Kp, PID_Ki, PID_Kd: real;
PID_Integrated : real;
PID_Prev_Input: real;
PID_MinOutput, PID_MaxOutput: real;
PID_First_Time, PID_Int_Improvement, PID_Diff_Improvement: boolean;
PID_Prev_AbsError: real;
end;
procedure Init_PID(var Controller: TPIDController; Kp, Ki, Kd, MinOutput, MaxOutput: real);
// Initialises the PID engine of "Controller"
// Kp = the "proportional" error multiplier
// Ki = the "integrated value" error multiplier
// Kd = the "derivative" error multiplier
// MinOutput = the minimal value the output value can have (should be < 0)
// MaxOutput = the maximal value the output can have (should be > 0)