PID Mixing Valve Temperature control

After testing the PID for 2 weeks I found the system to be working good with PB8 I500

Thanks Colin for your help and the great PID node

Here is my flow if somebody needs to do a similar setup

[
    {
        "id": "a6ee5f70.096cf",
        "type": "tab",
        "label": "PID Kotlarnica",
        "disabled": false,
        "info": ""
    },
    {
        "id": "ec330aa8.b59f88",
        "type": "PID",
        "z": "a6ee5f70.096cf",
        "name": "",
        "setpoint": "60",
        "pb": "8",
        "ti": "500",
        "td": "0",
        "integral_default": "0",
        "smooth_factor": "0",
        "max_interval": 600,
        "enable": "1",
        "disabled_op": "0",
        "x": 607,
        "y": 78,
        "wires": [
            [
                "9c0ca922.2658d8"
            ]
        ]
    },
    {
        "id": "9c0ca922.2658d8",
        "type": "range",
        "z": "a6ee5f70.096cf",
        "minin": "0",
        "maxin": "1",
        "minout": "64",
        "maxout": "21",
        "action": "scale",
        "round": true,
        "property": "payload",
        "name": "Scale power",
        "x": 745,
        "y": 79,
        "wires": [
            [
                "ef3d89a8.a68a08"
            ]
        ]
    },
    {
        "id": "581c2099.5b745",
        "type": "mqtt out",
        "z": "a6ee5f70.096cf",
        "name": "MQTT",
        "topic": "",
        "qos": "1",
        "retain": "true",
        "broker": "ca0557c2.d52418",
        "x": 1365,
        "y": 84,
        "wires": []
    },
    {
        "id": "8e0f869d.3f1b88",
        "type": "mqtt in",
        "z": "a6ee5f70.096cf",
        "name": "Boiler Sensors",
        "topic": "sokomm/tele/kot/SENSOR",
        "qos": "1",
        "datatype": "auto",
        "broker": "ca0557c2.d52418",
        "x": 426.25000381469727,
        "y": 187.00000190734863,
        "wires": [
            [
                "25186461.aa728c"
            ]
        ]
    },
    {
        "id": "25186461.aa728c",
        "type": "json",
        "z": "a6ee5f70.096cf",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 430,
        "y": 140,
        "wires": [
            [
                "75a49fe7.e79cd"
            ]
        ]
    },
    {
        "id": "4fcaaf1d.3e893",
        "type": "change",
        "z": "a6ee5f70.096cf",
        "name": "Position Topic",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "sokomm/cmnd/mventil/Dimmer",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1192.7500190734863,
        "y": 67,
        "wires": [
            [
                "581c2099.5b745"
            ]
        ]
    },
    {
        "id": "1fed989e.973627",
        "type": "trigger",
        "z": "a6ee5f70.096cf",
        "op1": "OFF",
        "op2": "ON",
        "op1type": "str",
        "op2type": "str",
        "duration": "4",
        "extend": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "name": "Delay OFF",
        "x": 1026,
        "y": 106.25,
        "wires": [
            [
                "4cd64d25.3c2c34"
            ]
        ]
    },
    {
        "id": "4cd64d25.3c2c34",
        "type": "change",
        "z": "a6ee5f70.096cf",
        "name": "ON OFF Topic",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "sokomm/cmnd/mventil/Power1",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1194.500015258789,
        "y": 105.25000190734863,
        "wires": [
            [
                "581c2099.5b745"
            ]
        ]
    },
    {
        "id": "653cb467.8f3e6c",
        "type": "delay",
        "z": "a6ee5f70.096cf",
        "name": "",
        "pauseType": "delay",
        "timeout": "1",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "minute",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": true,
        "x": 1034.5,
        "y": 65.75,
        "wires": [
            [
                "4fcaaf1d.3e893"
            ]
        ]
    },
    {
        "id": "75a49fe7.e79cd",
        "type": "function",
        "z": "a6ee5f70.096cf",
        "name": "Split Data",
        "func": "var msgBoilerIN = {};\nvar msgBuffer = {};\nvar msgPump = {};\nvar msgPID = {};\nmsgBoilerIN.payload = msg.payload.DS18x20.S28FF3C29001704ED; //Temp Sensor on the Boiler Inlet\nmsgBuffer.payload = msg.payload.DS18x20.S28FF4BB7311703D3; // Buffer Tnak Bottom Temperatue\nmsgPump.payload = msg.payload.Switch1; //Reads the state of the Buffer Tnak Pump,ON and OFF are inverted\n\n\n\nif ((msgBuffer.payload > 63 && msgPump.payload === \"OFF\") || msgPump.payload === \"ON\") {msgPID.payload=false;\n    msgPID.topic = 'enable';\n    return [msgPID];\n}\nelse;\n    {msgPID.payload=true;\n    msgPID.topic = 'enable';\n    return [msgBoilerIN,msgPID];\n    }   \n\nnode.status({fill:\"black\",shape:\"dot\",text:msgPump.payload });\n\n\n\n\n\n",
        "outputs": 2,
        "noerr": 0,
        "x": 439,
        "y": 77,
        "wires": [
            [
                "ec330aa8.b59f88"
            ],
            [
                "ec330aa8.b59f88"
            ]
        ],
        "outputLabels": [
            "Temp Ventil",
            "PID on off"
        ]
    },
    {
        "id": "ef3d89a8.a68a08",
        "type": "rbe",
        "z": "a6ee5f70.096cf",
        "name": "",
        "func": "rbe",
        "gap": "",
        "start": "",
        "inout": "out",
        "property": "payload",
        "x": 886.5,
        "y": 78,
        "wires": [
            [
                "653cb467.8f3e6c",
                "1fed989e.973627"
            ]
        ]
    },
    {
        "id": "ca0557c2.d52418",
        "type": "mqtt-broker",
        "z": "",
        "name": "",
        "broker": "localhost",
        "port": "1883",
        "clientid": "",
        "usetls": false,
        "compatmode": true,
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "closeTopic": "",
        "closePayload": "",
        "willTopic": "",
        "willQos": "0",
        "willPayload": ""
    }
]
1 Like