mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-25 17:43:35 +05:00
ouch!
This commit is contained in:
@@ -44,15 +44,16 @@ public:
|
|||||||
private:
|
private:
|
||||||
unsigned short _minOut = 20, _maxOut = 90;
|
unsigned short _minOut = 20, _maxOut = 90;
|
||||||
|
|
||||||
datatype getResultN() {
|
datatype getResultN()
|
||||||
float tempDiff = targetTemp - outdoorTemp,
|
{
|
||||||
|
float tempDelta = targetTemp - outdoorTemp,
|
||||||
maxPoint = targetTemp - (_maxOut - targetTemp) / Kn,
|
maxPoint = targetTemp - (_maxOut - targetTemp) / Kn,
|
||||||
sf = (_maxOut - targetTemp) / pow(targetTemp - maxPoint, 1.0 / Ke),
|
sf = (_maxOut - targetTemp) / pow(targetTemp - maxPoint, 1.0 / Ke),
|
||||||
T_rad = targetTemp + sf * pow(tempDiff, 1.0 / Ke);
|
T_rad = targetTemp + sf * (tempDelta >= 0 ? pow(tempDelta, 1.0 / Ke) : -pow(-tempDelta, 1.0 / Ke));
|
||||||
return T_rad > _maxOut ? _maxOut : T_rad;
|
return T_rad > _maxOut ? _maxOut : T_rad;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Расчет поправки (ошибки) термостата
|
// Реакция на разницу с целевой температурой
|
||||||
datatype getResultT() {
|
datatype getResultT() {
|
||||||
return constrain((targetTemp - indoorTemp), -3, 3) * Kt;
|
return constrain((targetTemp - indoorTemp), -3, 3) * Kt;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user