8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b4ca0e commit ef7438eCopy full SHA for ef7438e
PID_v1.cpp
@@ -65,8 +65,8 @@ bool PID::Compute()
65
/*Compute all the working error variables*/
66
double input = *myInput;
67
double error = *mySetpoint - input;
68
- double dInput = (input - lastInput);
69
- outputSum+= (ki * error);
+ double dInput = Sampletime*(input - lastInput)/timechange;
+ outputSum+= timechange*(ki * error)/Sampletime;
70
71
/*Add Proportional on Measurement, if P_ON_M is specified*/
72
if(!pOnE) outputSum-= kp * dInput;
0 commit comments