diff --git a/tcl/drivers/ccu4he.tcl b/tcl/drivers/ccu4he.tcl index 287dfcf..f6119e7 100644 --- a/tcl/drivers/ccu4he.tcl +++ b/tcl/drivers/ccu4he.tcl @@ -20,6 +20,9 @@ proc stdConfig::ccu4he {} { node hefull alias /cc/hh node helow alias /cc/hl node smooth upd + node undershoot par 30 + node minfillminutes par 3.0 + node maxfillminutes par 30.0 } } @@ -69,7 +72,7 @@ proc ccu4he::readCmd {} { updateval [sct]/state manual_fill$stxt return idle } - set level [hval /cc/h] + set level [hvali /cc/h] if {[sctval [sct]] == 1} { # filling set full_level [hval /cc/hh] if {$level < $full_level} { # else CCU4 will stop @@ -77,18 +80,15 @@ proc ccu4he::readCmd {} { set delta [expr min(30, $now - [silent $now sct last_time])] sct last_time $now set smooth [silent $level sct smooth] - # minimum fill speed: 1 % / 36 sec = 100 % / 60 min - set smooth [expr $smooth + $delta / 36.0] + # minimum fill speed + set smooth [expr $smooth + $delta / 0.6 / [hval [sct]/maxfillminutes]] if {$level > $smooth} { - # maximum fill speed 1/18 %/sec + 1/9 %/sec = 100 % / 10 min - set smooth [expr $smooth + $delta / 9.0] + # maximum fill speed + set smooth [expr $smooth + $delta / 0.6 / [hval [sct]/minfillminutes]] } sct smooth $smooth - catch { - # test on running system: [sct]/smooth does not yet exist - hupdate [sct]/smooth $smooth - } - if {$smooth > min($full_level, $level + 30)} { + hupdate [sct]/smooth $smooth + if {$smooth > min($full_level, $level + [hval [sct]/undershoot])} { if {$smooth > $full_level} { sct update 0 # watching cc hcd 0 @@ -106,9 +106,13 @@ proc ccu4he::readCmd {} { } } elseif {[sctval [sct]] == 0} { # watching sct smooth $level + hupdate [sct]/smooth [sct smooth] if {[hval [sct]/status] ne ""} { hupdate [sct]/status "" } + } else { + sct smooth $level + hupdate [sct]/smooth [sct smooth] } switch -- [hvali /cc/hv] { 0 {