Code: Alles auswählen
! PI-Regler (Heizung)
! Raum als Bestandteil des Kanalnamens bzw. des Namens der Systemvariablen
! Raum.Sensor Raum.Regler Raum.Ventil Raum.I-Anteil Raum.Autosollwert
string raum = "Wohnen";
! lokale Variablen
real tz = 30.0; ! Zykluszeit in s
real xp = 4.0; ! P-Band
real tn = 600.0; ! Nachstellzeit in s
real x; ! Istwert
real w; ! Sollwert
real y; ! Reglerausgang
real p; ! P-Anteil
real i; ! I-Anteil
! Wandthermostat einlesen
x = dom.GetObject(raum+".Sensor").DPByHssDP("TEMPERATURE").Value();
w = dom.GetObject(raum+".Regler").DPByHssDP("SETPOINT").Value();
! Sollwert
if ((w >= 6.0) && (w <= 30.0))
{dom.GetObject(raum+".Autosollwert").State(w);}
else
{w = dom.GetObject(raum+".Autosollwert").Value();}
! P-Regler
y = (100.0 / xp) * (w - x);
p = y + 50.0;
if (p > 100.0) {p = 100.0;}
if (p < 0.0) {p = 0.0;}
! I-Regler bei Auslösung alle z Sekunden
i = dom.GetObject(raum+".I-Anteil").Value();
i = i + ((tz / tn) * y);
! PI-Regler
y = p + i;
if (y > 100.0)
{ y = 100.0;
i = 100.0 - p;
}
if (y < 0.0)
{ y = 0.0;
i = 0.0 - p;
}
! I-Anteil speichern
dom.GetObject(raum+".I-Anteil").State(i);
! Stellsignal ausgeben
dom.GetObject(raum+".Ventil").DPByHssDP("LEVEL").State(y / 100);
Eine weitere Anwendungsmöglichkeit ist die Raum-/Zuluftkaskaden-Regelung bei einer Luftheizung.