liquid-pid
liquid-pid copied to clipboard
Don't think the Proportional band will ever work correctly
Upon exiting the code below, this._P will always be set to this._MaxP for non-zero values of this._P. This doesn't make any sense.
this._e = this._Tref - actualTemperature; // Calculate the actual error
// Calculate the P this._P = this._Kp * this._e;
if (this._P) { // <------------------------------ this will always be true for non-zero values of this._P this._P = this._MaxP; } else if (this._P < (-1 * this._MaxP)) { this._P = -1 * this._MaxP; }
Thanks, good catch I think it should be:
if (!this._P) {
this._P = this._MaxP;
}
right?