Big Swings with Thermowell - need to tune!

And mine is in the shed :slight_smile: room temp regularly hits freezing point in the winter.

After setting the dead time to an hour around midnight last night, it’s much improved. Here’s the full and the overnight screenshots.


Yes, that’s how we want it. A flat line! Cheers

All the fluctuations in the fridge setpoint seem to come from the derivative. If you want a smoother fridge setpoint, decrease beer-to-fridge Td. But it seems to be controlling fine now.

Thanks for all your help!

Hi Elco. I still seem to have an issue with the heater coming up to temp…

See the latest graph and the fridge temp dropping while the set point it high. I’ve just checked it and the SSR for heat is flashing, just not very often. Any ideas? I’ve attached the current control algorithm too. I think it has just started creeping back up in temp on the fridge.

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 19.9883
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 18.5,
            "connected": true,
            "address": "28FF7DB26B14030E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": -1.4922,
      "Kp": 10,
      "Ti": 7200,
      "Td": 300,
      "p": 14.9219,
      "i": 16.0625,
      "d": -0.9375,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 30.0469,
        "period": 4,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3599928
          },
          "target": {
            "kind": "ActuatorPin",
            "state": true,
            "pin": 16,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer2set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 14.375,
          "connected": true,
          "address": "28FFDAC86B1403DF",
          "calibrationOffset": 0
        }
      },
      "inputError": null,
      "Kp": 10,
      "Ti": 600,
      "Td": 60,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 4,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3599857
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 19.9883
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 18.5,
            "connected": true,
            "address": "28FF7DB26B14030E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": -1.4922,
      "Kp": 30,
      "Ti": 7200,
      "Td": 20,
      "p": 44.7656,
      "i": 0,
      "d": -0.1172,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 1800,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3599782
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 0,
            "minOffTime": 180,
            "maxOnTime": 65535,
            "state": false,
            "target": {
              "kind": "ActuatorPin",
              "state": false,
              "pin": 10,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": 19
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 18.9375,
          "connected": true,
          "address": "28FFF81420160455",
          "calibrationOffset": 0
        }
      },
      "inputError": -0.0625,
      "Kp": 10,
      "Ti": 14400,
      "Td": 1200,
      "p": 0.625,
      "i": 0.3633,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 19.9883
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 18.5,
            "connected": true,
            "address": "28FF7DB26B14030E",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": 19
        },
        "output": 0.9883,
        "achieved": -0.5,
        "minimum": -5,
        "maximum": 5
      }
    }
  ]
}

Thanks

Your heater1 PID, please increase Kp to 50.

You can think of Kp as this, if your fridge temp is 1 degree to low, which percentage should the heater be on?

1 Like

ok. so only 10% is taking forever to heat. I have set to 50. Thanks