#1 LUA for Base (transferiert aus anderer Themenkette - von Nils zur besseren Übersicht)
Verfasst: Mi 22. Sep 2010, 22:22
Larger example - I'm attaching two files (well, I tired, results below), that should be loaded to scripts directory on the Base. They can later be loaded by "import" call. Latest modules have those files by default.
[warn]pwm.lua ist kein erlaubter Dateityp.
pid.lua ist kein erlaubter Dateityp.[/warn]
Above code configures PWM output on module 110, output 2 with full cycle equal to 6 minutes. It uses temperature from R1 on module 110 as current temperature, and regulator 1 setting on module 110 as setpoint value.
There are more options to setup, like integration and derivation constants. I need to extend pid.lua with regulator autotuning...
Another option, that could have nice results (I will check this winter) would be to use LCN regulator to control temperature of the radiator in the room and then use above PID regulator (with small changes) to vary temperature of the radiator by changing setpoint inside LCN module. This of course would require two temperature sensors per room, one like now and second stuck to the radiator.
Such setup is frequently used in automation, and should make temperature stabilization much better. And get rid of "cool flow" of air from the windows to floor, which for me is major issue with current LCN setup, especially that "standard" way of radiator control doesn't suffer that problem.
[warn]pwm.lua ist kein erlaubter Dateityp.
pid.lua ist kein erlaubter Dateityp.[/warn]
- pwm.lua implements PWM modulation for outputs, that lets use PWM with older LCN modules and simple radiator regulators.
- pid.lua implements PID regulator, I actually use it at home instead of built-in proportional regulators of LCN modules. For now mostly because of PWM
Code: Alles auswählen
import 'pid'
import 'pwm'
pid {
kp = 10, trace=true,
positive = pwm { output = use "LCN.output.0.110.2", period = 360},
value = use "LCN.value.0.110.r1",
regulator = use "LCN.regulator.0.110.1"
}
Above code configures PWM output on module 110, output 2 with full cycle equal to 6 minutes. It uses temperature from R1 on module 110 as current temperature, and regulator 1 setting on module 110 as setpoint value.
There are more options to setup, like integration and derivation constants. I need to extend pid.lua with regulator autotuning...
Another option, that could have nice results (I will check this winter) would be to use LCN regulator to control temperature of the radiator in the room and then use above PID regulator (with small changes) to vary temperature of the radiator by changing setpoint inside LCN module. This of course would require two temperature sensors per room, one like now and second stuck to the radiator.
Such setup is frequently used in automation, and should make temperature stabilization much better. And get rid of "cool flow" of air from the windows to floor, which for me is major issue with current LCN setup, especially that "standard" way of radiator control doesn't suffer that problem.