Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ============ Записываю в init.lua =================
- obj.set("pid_setpoint", 25) -- Целевая Температура
- obj.set("pid_value", 25.1) -- Текущая температура
- -- Уставка Целевая Темп. Текущая Темп ? ?
- thermo.PIDInit("pid_result", "pid_setpoint", "pid_value", 5000, false)
- thermo.PIDSetOpt(30, 0.02, 0) -- KP, KI, KD
- thermo.PIDSetRange(15, 60) -- ПРеделы уставки
- thermo.PIDEnable(true) -- Разрешаем управление
- -- ================= Вызываю раз в минуту ============= --
- local insens = '1w.28-74F8EC090000/temperature' -- Объект 1wire
- local intTemp = obj.get(insens) -- Получаю от датчика текущую температуру
- obj.set("pid_value", intTemp) -- Втыкаю в PID текущую температуру
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement