|
LightHub 4.6.0
Open-source smart home controller firmware
|
PID controller output driver (CH_PID = 13). More...
#include <out_pid.h>
Public Member Functions | |
| out_pid () | |
| Default constructor. | |
| void | link (Item *_item) |
| Attach to an item and grab its persistent PID state. | |
| int | Setup () override |
| Allocate persistent state, load JSON config, initialize the PID controller. | |
| int | Poll (short cause) override |
| Run the PID loop: compute output, apply it to the output item, watch the input-failure timer. | |
| int | Stop () override |
| De-initialize and free the PID controller and persistent state. | |
| int | isActive () override |
| True when the item command is not CMD_OFF. | |
| int | getChanType () override |
| Channel type of the driver. | |
| int | Ctrl (itemCmd cmd, char *subItem=NULL, bool toExecute=true, bool authorized=false) override |
| Handle /val (input), /set (setpoint) and /cmd|/ctrl (ON/OFF/ENABLE/DISABLE/RESET) commands. | |
| void | alarm (bool) |
| Enter (state=true) or leave (state=false) the input-failure alarm; forces the alarmVal output on entry. | |
| Public Member Functions inherited from abstractOut | |
| abstractOut () | |
| virtual bool | isAllowed (itemCmd cmd) |
| virtual itemCmd | getDefaultOnVal () |
| virtual int | Status () override |
| virtual void | setStatus (uint8_t status) override |
| Item * | getItem () |
| Public Member Functions inherited from abstractCh | |
| abstractCh () | |
| virtual | ~abstractCh () |
Protected Member Functions | |
| bool | getConfig () |
| Parse the item argument array, fill store and create the PID controller. | |
| float | getAlarmVal () |
| Get the forced output value used on alarm (alarmVal, or 0/255 by control direction). | |
| Protected Member Functions inherited from abstractOut | |
| int | pubAction (bool state) |
| Protected Member Functions inherited from abstractCh | |
| int | publishTopic (const char *topic, long value, const char *subtopic=NULL) |
| int | publishTopic (const char *topic, float value, const char *subtopic=NULL) |
| int | publishTopic (const char *topic, const char *value, const char *subtopic=NULL, const char *suffix=NULL) |
Protected Attributes | |
| pidPersistent * | store |
| Protected Attributes inherited from abstractOut | |
| Item * | item |
| Item currently linked to this driver. | |
PID controller output driver (CH_PID = 13).
Runs a classic PID loop (PID_v1) and steers an external output item (e.g. a dimmer) with the computed control value.
JSON config (item argument array):
Control (Ctrl) suffixes:
If no /val is received for alarmTO seconds the driver enters the alarm state and forces the output to alarmVal.
|
inline |
Default constructor.
| void out_pid::alarm | ( | bool | state | ) |
Enter (state=true) or leave (state=false) the input-failure alarm; forces the alarmVal output on entry.
|
overridevirtual |
Handle /val (input), /set (setpoint) and /cmd|/ctrl (ON/OFF/ENABLE/DISABLE/RESET) commands.
Control unified PID controller item.
Implements abstractOut.
|
protected |
Get the forced output value used on alarm (alarmVal, or 0/255 by control direction).
|
overridevirtual |
Channel type of the driver.
Reimplemented from abstractOut.
|
protected |
Parse the item argument array, fill store and create the PID controller.
|
overridevirtual |
True when the item command is not CMD_OFF.
Reimplemented from abstractOut.
|
inlinevirtual |
Attach to an item and grab its persistent PID state.
Reimplemented from abstractOut.
|
overridevirtual |
Run the PID loop: compute output, apply it to the output item, watch the input-failure timer.
Reimplemented from abstractCh.
|
overridevirtual |
Allocate persistent state, load JSON config, initialize the PID controller.
Reimplemented from abstractOut.
|
overridevirtual |
De-initialize and free the PID controller and persistent state.
Reimplemented from abstractCh.
|
protected |