Skip to content

Explanation for cold/warm switch in pid_loop #25

Open
@elf02

Description

@elf02

Can you please explain the warm/cold logic:

silvia-pi/silvia-pi.py

Lines 152 to 168 in 54de212

if avgtemp < 100 :
lastcold = i
if avgtemp > 200 :
lastwarm = i
if iscold and (i-lastcold)*conf.sample_time > 60*15 :
pid = PID.PID(conf.Pw,conf.Iw,conf.Dw)
pid.SetPoint = state['settemp']
pid.setSampleTime(conf.sample_time*5)
iscold = False
if iswarm and (i-lastwarm)*conf.sample_time > 60*15 :
pid = PID.PID(conf.Pc,conf.Ic,conf.Dc)
pid.SetPoint = state['settemp']
pid.setSampleTime(conf.sample_time*5)
iscold = True

iswarm will always be false. Should the pid values for the warm state be set only once when avgtemp >= 100?

Thank you :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions