liquid-pid icon indicating copy to clipboard operation
liquid-pid copied to clipboard

Don't think the Proportional band will ever work correctly

Open macinna opened this issue 11 years ago • 1 comments

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; }

macinna avatar Nov 22 '14 05:11 macinna

Thanks, good catch I think it should be:

if (!this._P) {
this._P = this._MaxP;
}

right?

hekike avatar Nov 22 '14 08:11 hekike