This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

PID algorithm questions
#2
1. Your PID library is incomplete. Copy it from here: https://openrb.com/example-pid-thermostat-with-lm2/
Don't put quotes around numbers, only around group addresses. You can remove min/max/kp/ki/kd settings from PID configuration if you are using the default values.

2. You can add an extra if into the script to check whether heating is enabled and window is closed. Remove manual = '1/1/4', from PID configuration.
Code:
if grp.getvalue('1/1/3') and grp.getvalue('1/1/4') then
  p:run()
else
  grp.checkwrite(p.params.output, 0)
end

3. You can have multiple PIDs in a single script (use different variable names for each). Or you can make separate script for each PID. There's no big difference unless you need more than 10-20 PIDs. See this: https://forum.logicmachine.net/showthread.php?tid=2920

4. The manual mode does not turn off the output. It just stops the PID algorithm. Script in nr.2 sets output to 0 when either the heating is disabled or a window is open.
Reply


Messages In This Thread
PID algorithm questions - by Novodk - 15.04.2023, 12:34
RE: PID algorithm questions - by admin - 17.04.2023, 07:52

Forum Jump: