Logic Machine Forum
pid heating cooling - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: pid heating cooling (/showthread.php?tid=4142)



pid heating cooling - stavros - 08.07.2022

Hello to everynone,
I have completed a project using 13 pid control in one script. Everything is working except from the invert function in pid. for example one pid control is the following

if not p then
    p = PID:init({
      current = '0/0/1',
      setpoint = '0/0/2',
      manual = '32/1/1',
      inverted = true,
      output = '32/1/2',
      min=0,
      max=100,
      kp=1,
      ki=1,
      kd=1
    })
  end


p:run()

but when i an writhing false in the field inverted nothing is happened.
how i will invert the logic (heating cooling)?
Thank you in advance


RE: pid heating cooling - admin - 08.07.2022

Restart the script via disable/enable.


RE: pid heating cooling - stavros - 08.07.2022

(08.07.2022, 13:22)admin Wrote: Restart the script via disable/enable.

Thank you for your answer,
I intend to have a group adress in this field, But if the disable/ enable is necessary everytime the system goes from heating to cooling and the opposite, what i have to do? is there any way to make this via another script?
Thank you


RE: pid heating cooling - admin - 08.07.2022

You can attach an event script to the heating/cooling mode change and then restart resident PID script like this:
Code:
script.disable('scriptname')
script.enable('scriptname')