Update PID_v1.cpp
Don't need ```else output = 0``` because it becomes the default case during variable assignment ```double output = 0;```, if ```(!pOnE)```
This commit is contained in:
parent
9b4ca0e5b6
commit
79e5cc533a
@ -75,9 +75,8 @@ bool PID::Compute()
|
||||
else if(outputSum < outMin) outputSum= outMin;
|
||||
|
||||
/*Add Proportional on Error, if P_ON_E is specified*/
|
||||
double output;
|
||||
double output = 0;
|
||||
if(pOnE) output = kp * error;
|
||||
else output = 0;
|
||||
|
||||
/*Compute Rest of PID Output*/
|
||||
output += outputSum - kd * dInput;
|
||||
|
Loading…
Reference in New Issue
Block a user