PID Mixing Valve Temperature control

ok
I'll try tonight with integral of 600 and PB 4 and start doubling PB.

By stable I mean that the temperature is not oscillating wildly. In particular the PID output should settle out in the middle somewhere rather than bouncing off one end or the other.

Tuning is ongoing
PB4 I600

PB8 I600

Should I increase PB more or lower i?

What happened at the start of the second one?
Experiment and see. If you decrease it too much it will start ringing and eventually go unstable, but it doesn't look too far off at the moment. Since you don't want the servo moving too much and you don't need super accurate control then you might be better to leave the PB fairly wide as the servo won't move about as much.
Once you are happy with it then you can reduce the Integral time which will pull it onto the setpoint more quickly. If you make it too short again it will start ringing or go unstable.
Make sure you keep notes on what you did so you can look back at the charts and know what the response was like for the various settings.
Finally you could try a bit of derivative which might allow for snappier response, but it will make the servo jump about a lot more so probably you don't want to do that.

Oh, I see, you increased the PB and the re-deploy kicked it. I don't think you needed to increase it, it looked pretty good at 4 didn't it?

Yes at PB4 it got there real fast but I noticed pid was often changing, at PB8 Its slover but the servo moves less. The Buffer has now gone over 60C so for tonight i'm done.
Tomorrow I'll let it run longer at PB4 and see how often does it adjust when it gets to the setpoint.
I'll leave the integral at 600 for now

Notes for tonight's run

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

@sokomm
Can you provide more information and pictures about the servo, wiring with nodemcu and valve mounting?
Unable to send private messages.

3d

STL Files For Servo mount