Advertisement
IgorKan

OpenTherm Run

Oct 5th, 2022 (edited)
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | Software | 0 0
  1. -- ============ Записываю в init.lua  =================
  2.  
  3. obj.set("pid_setpoint", 25) -- Целевая Температура
  4. obj.set("pid_value", 25.1)  -- Текущая температура
  5.  
  6. --               Уставка     Целевая Темп.   Текущая Темп  ?      ?
  7. thermo.PIDInit("pid_result", "pid_setpoint", "pid_value", 5000, false)
  8.  
  9. thermo.PIDSetOpt(30, 0.02, 0)  -- KP, KI, KD
  10. thermo.PIDSetRange(15, 60)     -- ПРеделы уставки
  11.  
  12. thermo.PIDEnable(true)  -- Разрешаем управление
  13.  
  14.  
  15. -- ================= Вызываю раз в минуту ============= --
  16.  
  17. local insens  = '1w.28-74F8EC090000/temperature' -- Объект 1wire
  18. local intTemp = obj.get(insens) -- Получаю от датчика текущую температуру
  19. obj.set("pid_value", intTemp) -- Втыкаю в PID текущую температуру
  20.  
  21.  
  22.  
Tags: slsys
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement