Compressor not staying on long enough to cool to temp in Fridge Constant

I ran out of space in my beer fridge, so I am using my fermentation fridge to chill a case of homebrew but the system isn’t keeping the compressor on long enough to reach setpoint. Any thoughts as to why the compressor is shutting off before it reaches setpoint?

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 7.2227
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 10.6875,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 3.4336,
      "Kp": 10,
      "Ti": 600,
      "Td": 0,
      "p": -34.3359,
      "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": 3044851
          },
          "target": {
            "kind": "ActuatorPin",
            "state": false,
            "pin": 16,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer2set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "TempSensorDisconnected",
          "value": null,
          "connected": false
        }
      },
      "inputError": null,
      "Kp": 0,
      "Ti": 0,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 0,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3044786
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 7.2227
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 10.6875,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 3.4688,
      "Kp": 10,
      "Ti": 3600,
      "Td": 200,
      "p": -34.6875,
      "i": -2.375,
      "d": -6.7188,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 43.7813,
        "period": 1200,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3044710
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 300,
            "minOffTime": 900,
            "maxOnTime": 65535,
            "state": false,
            "target": {
              "kind": "ActuatorPin",
              "state": false,
              "pin": 17,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": false,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 10.4375,
          "connected": true,
          "address": "288269C00700003B",
          "calibrationOffset": 0
        }
      },
      "inputError": null,
      "Kp": 10,
      "Ti": 14400,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 7.2227
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 10.6875,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": null
        },
        "output": 127.9961,
        "achieved": 127.9961,
        "minimum": -10,
        "maximum": 10
      }
    }
  ]
}

I think what is happening is that integrator anti-windup is triggered when the derivative is high, preventing the integrator from reaching the desired value.

I think the following changes will help:

For cooler1:

  • Longer deeper cycles (set pwm cycle to 40 min (2400) instead of 20.
  • Increase gain Kp from 10 to 20. That means that when 1 degree to high, the compressor will be 20% ON.
  • Reduce the derivative time constant. It doesn’t seem to overshoot at all, change to 20 instead of 200. I think this is the main cause. When the derivative gain causes the output to already be at 100%, the integrator will be reduced. In your case, this is keeping the integrator near zero.
  • Reduce how fast the integrator reacts (3600 to 7200).
  • Perhaps increase derivative filtering.

Thanks, @Elco. I made the following changes at 14:00:
For cooler1:

  • Longer deeper cycles (set pwm cycle to 40 min (2400) instead of 20.
  • Increase gain Kp from 10 to 20. That means that when 1 degree to high, the compressor will be 20% ON.
  • Reduce the derivative time constant. It doesn’t seem to overshoot at all, change to 20 instead of 200. I think this is the main cause. When the derivative gain causes the output to already be at 100%, the integrator will be reduced. In your case, this is keeping the integrator near zero.
  • Reduce how fast the integrator reacts (3600 to 7200).

I didn’t see much change after 3 cooling cycles, so I increased the Cooling PID filter to 18 and the derivative filter to 159. It’s getting closer, but still not cooling to setpoint:

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 7.2227
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 10.75,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 3.4336,
      "Kp": 10,
      "Ti": 600,
      "Td": 0,
      "p": -34.3359,
      "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": 3043953
          },
          "target": {
            "kind": "ActuatorPin",
            "state": false,
            "pin": 16,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer2set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "TempSensorDisconnected",
          "value": null,
          "connected": false
        }
      },
      "inputError": null,
      "Kp": 0,
      "Ti": 0,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 0,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3043888
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 7.2227
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 10.75,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 3.4688,
      "Kp": 10,
      "Ti": 3600,
      "Td": 200,
      "p": -34.6875,
      "i": -2.3672,
      "d": -6.8359,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 43.8906,
        "period": 1200,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3043812
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 300,
            "minOffTime": 900,
            "maxOnTime": 65535,
            "state": false,
            "target": {
              "kind": "ActuatorPin",
              "state": false,
              "pin": 17,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": false,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 10.4375,
          "connected": true,
          "address": "288269C00700003B",
          "calibrationOffset": 0
        }
      },
      "inputError": null,
      "Kp": 10,
      "Ti": 14400,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 7.2227
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 10.75,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": null
        },
        "output": 127.9961,
        "achieved": 127.9961,
        "minimum": -10,
        "maximum": 10
      }
    }
  ]
}

Please share what the control data is when the fridge temp is at the maximum and minimum.

Max:

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 7.2227
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 10.4375,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 3.1328,
      "Kp": 10,
      "Ti": 600,
      "Td": 0,
      "p": -31.3281,
      "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": 3599184
          },
          "target": {
            "kind": "ActuatorPin",
            "state": false,
            "pin": 16,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer2set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "TempSensorDisconnected",
          "value": null,
          "connected": false
        }
      },
      "inputError": null,
      "Kp": 0,
      "Ti": 0,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 0,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3599119
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 7.2227
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 10.4375,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 3.1328,
      "Kp": 20,
      "Ti": 7200,
      "Td": 20,
      "p": -62.6563,
      "i": -0.9375,
      "d": -1.1719,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 64.7656,
        "period": 2400,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3599043
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 300,
            "minOffTime": 900,
            "maxOnTime": 65535,
            "state": true,
            "target": {
              "kind": "ActuatorPin",
              "state": true,
              "pin": 17,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": false,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 10.625,
          "connected": true,
          "address": "288269C00700003B",
          "calibrationOffset": 0
        }
      },
      "inputError": null,
      "Kp": 10,
      "Ti": 14400,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 7.2227
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 10.4375,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": null
        },
        "output": 127.9961,
        "achieved": 127.9961,
        "minimum": -10,
        "maximum": 10
      }
    }
  ]
}

Min:

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 7.2227
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 7.75,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 0.7227,
      "Kp": 10,
      "Ti": 600,
      "Td": 0,
      "p": -7.2266,
      "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": 3590929
          },
          "target": {
            "kind": "ActuatorPin",
            "state": false,
            "pin": 16,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer2set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "TempSensorDisconnected",
          "value": null,
          "connected": false
        }
      },
      "inputError": null,
      "Kp": 0,
      "Ti": 0,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 0,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3590864
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 7.2227
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 7.75,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 0.7227,
      "Kp": 20,
      "Ti": 7200,
      "Td": 20,
      "p": -14.4531,
      "i": -0.7695,
      "d": 3.125,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 12.0977,
        "period": 2400,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3590788
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 300,
            "minOffTime": 900,
            "maxOnTime": 65535,
            "state": false,
            "target": {
              "kind": "ActuatorPin",
              "state": false,
              "pin": 17,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": false,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 9,
          "connected": true,
          "address": "288269C00700003B",
          "calibrationOffset": 0
        }
      },
      "inputError": null,
      "Kp": 10,
      "Ti": 14400,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 7.2227
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 7.75,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": null
        },
        "output": 127.9961,
        "achieved": 127.9961,
        "minimum": -10,
        "maximum": 10

For some reason the integrator is not increasing, but I don’t see why. I’m going to try to recreate this scenario in simulation to try to find a remedy.

What might help you here, is to set the filtering on the fridge temp to maximum. I think it is the fast fluctuations that cause the issue here.

When you say set the filtering on fridge temp to maximum, do you mean the beer-to-fridge derivative filter?

No, you don’t have a beer setpoint and are running in fridge constant mode.
The beer to fridge PID only sets the fridge setpoint.

Only the cooler1 PID settings affect the cooler PWM value.
I am talking about the cooler Input filter delay time.

Hey Elco, my appologies for the silly question. I fired that off before I had my first cup of coffee this AM and didn’t think it through.

I made a couple of tweaks today. At around 12:00 I moved the cooling input filter to max, and that freed it up a bit and it started cooling more.

I am a bit surprised by how much the temps are swinging inside the fridge. I guess the wine fridge doesn’t hold temps very well, anyway at 13:30 I moved the fridge temp sensor from the top of the chamber (where the original thermostat had been) down and back near where the beer is sitting. It seems to have made the swings a bit more gradual, but it is fluctuating a lot.

Here’s an update

Yesterday afternoon I stuck a growler full of water in the fridge to get a proxy for the beer temp, and last night before bed I flipped it to beer constant mode to see what would happen. It looks to be controlling spot on now with the same settings so I think we can consider this one closed

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 6.6719
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 7.75,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 1.1406,
      "Kp": 10,
      "Ti": 600,
      "Td": 0,
      "p": -11.4063,
      "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": 3599929
          },
          "target": {
            "kind": "ActuatorPin",
            "state": false,
            "pin": 16,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer2set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "TempSensorDisconnected",
          "value": null,
          "connected": false
        }
      },
      "inputError": null,
      "Kp": 0,
      "Ti": 0,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 0,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3599864
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 6.6719
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 7.75,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 1.6523,
      "Kp": 20,
      "Ti": 7200,
      "Td": 20,
      "p": -33.0469,
      "i": -18.6992,
      "d": -0.9375,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 52.6836,
        "period": 2400,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3599788
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 300,
            "minOffTime": 900,
            "maxOnTime": 65535,
            "state": true,
            "target": {
              "kind": "ActuatorPin",
              "state": true,
              "pin": 17,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": 7.2227
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 7.3125,
          "connected": true,
          "address": "288269C00700003B",
          "calibrationOffset": 0
        }
      },
      "inputError": 0.1016,
      "Kp": 10,
      "Ti": 14400,
      "Td": 0,
      "p": -1.0156,
      "i": 0.4648,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 6.6719
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 7.75,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": 7.2227
        },
        "output": -0.5508,
        "achieved": 0.5273,
        "minimum": -10,
        "maximum": 10
      }
    }
  ]
}

Great to hear! Once you have 20+ liters of beer inside, the beer temp will be a flat line.

Hi Elco, the system worked well during the point of fermentation when I held a steady temperature (beer temp was a flat line as you predicted). However, once I started increasing temperature to finish off fermentation I started getting some overshoot and now it is oscillating +/- 0.5F and sometimes a bit more. The units also calls for heating ~10 minutes after it has reached setpoint, which increases the overshoot. I tried a couple of adjustments like increasing heater filters, reducing heater Kp and increasing heater Td but nothing is changing. If anything, it may be getting a bit worse. Any help would be appreciated.

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 20.6563
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 18.4375,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": -3.4766,
      "Kp": 1,
      "Ti": 600,
      "Td": 300,
      "p": 3.4766,
      "i": 0,
      "d": -0.5078,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 2.9688,
        "period": 4,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 1901646
          },
          "target": {
            "kind": "ActuatorPin",
            "state": false,
            "pin": 16,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer2set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "TempSensorDisconnected",
          "value": null,
          "connected": false
        }
      },
      "inputError": null,
      "Kp": 0,
      "Ti": 0,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 0,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 1901581
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 20.6563
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 18.4375,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": -3.4766,
      "Kp": 20,
      "Ti": 7200,
      "Td": 20,
      "p": 69.5313,
      "i": 0,
      "d": -0.625,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 2400,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 1901505
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 300,
            "minOffTime": 900,
            "maxOnTime": 65535,
            "state": false,
            "target": {
              "kind": "ActuatorPin",
              "state": false,
              "pin": 17,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": 18.4609
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 18.3125,
          "connected": true,
          "address": "288269C00700003B",
          "calibrationOffset": 0
        }
      },
      "inputError": -0.1484,
      "Kp": 10,
      "Ti": 14400,
      "Td": 0,
      "p": 1.4844,
      "i": 0.7109,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 20.6563
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 18.4375,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": 18.4609
        },
        "output": 2.1953,
        "achieved": -0.0234,
        "minimum": -10,
        "maximum": 10
      }
    }
  ]
}

Hmm, your beer seems to react fast to the fridge cooling.

Can you try:

Cooler Kp = 10
Fridge temp filtering: max (639)
Dead time: 40 min (instead of 20 to prevent alternating between heating and cooling).

EDIT: I now realize that you were likely referring to cooler input filter, but since I already had that set to 639 when I posted I was thrown off. At least I now know what happens when I change BtF filter to max!

the fridge temp filtering to max does not appear to be working, as it is still calling for heating after the beer has passed setpoint. I reduced cooler Kp to 10. Deadtime was already set to 60 mins, so I’m good there.

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 21.4492
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 21.0625,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": -0.5156,
      "Kp": 1,
      "Ti": 600,
      "Td": 300,
      "p": 0.5156,
      "i": 16.8125,
      "d": -0.1719,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 17.1563,
        "period": 4,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3598261
          },
          "target": {
            "kind": "ActuatorPin",
            "state": false,
            "pin": 16,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer2set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "TempSensorDisconnected",
          "value": null,
          "connected": false
        }
      },
      "inputError": null,
      "Kp": 0,
      "Ti": 0,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 0,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3598196
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 21.4492
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 21.0625,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": -0.5156,
      "Kp": 10,
      "Ti": 7200,
      "Td": 20,
      "p": 5.1563,
      "i": 0,
      "d": -0.0781,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 2400,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 3600000,
            "waitTime": 3598120
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 300,
            "minOffTime": 900,
            "maxOnTime": 65535,
            "state": false,
            "target": {
              "kind": "ActuatorPin",
              "state": false,
              "pin": 17,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": 19.6289
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 19.6875,
          "connected": true,
          "address": "288269C00700003B",
          "calibrationOffset": 0
        }
      },
      "inputError": -0.0156,
      "Kp": 10,
      "Ti": 14400,
      "Td": 0,
      "p": 0.1563,
      "i": 1.6641,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 21.4492
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 21.0625,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": 19.6289
        },
        "output": 1.8203,
        "achieved": 1.4336,
        "minimum": -10,
        "maximum": 10
      }
    }
  ]
}

I set some time aside last night to try to optimize the loop and I’ve gotten pretty close. Cooling overshoot has bee corrected, and heating is much better. One thing I did was move the fan in the ferm chamber. It had been pushed back next to the cooling coil and was pointing straight at the carboy so I think that was causing some of the cooling overshoot as I suspect the coil was still cold for a while after the compressor turned off but the fan was still blowing cold air on the carboy.

However, the heater is still staying on after setpoints have been reached. I don’t think adjusting heater Kp orTd will solve this as the setpoints look fine, maybe adjust the filtering? If the heater would turn off sooner I think the graph would be pretty spot on…

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 20.4063
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 21.0625,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 0.6563,
      "Kp": 0.5,
      "Ti": 600,
      "Td": 100,
      "p": -0.3281,
      "i": 0.3672,
      "d": 0.0039,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0.043,
        "period": 4,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 1800000,
            "waitTime": 834094
          },
          "target": {
            "kind": "ActuatorPin",
            "state": false,
            "pin": 16,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer2set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "TempSensorDisconnected",
          "value": null,
          "connected": false
        }
      },
      "inputError": null,
      "Kp": 0,
      "Ti": 0,
      "Td": 0,
      "p": 0,
      "i": 0,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 0,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 1800000,
            "waitTime": 834029
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 20.4063
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 21.0625,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": 0.6563,
      "Kp": 10,
      "Ti": 7200,
      "Td": 20,
      "p": -6.5625,
      "i": -0.7461,
      "d": -0.0781,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 7.3867,
        "period": 2400,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 1800000,
            "waitTime": 833953
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 300,
            "minOffTime": 900,
            "maxOnTime": 65535,
            "state": false,
            "target": {
              "kind": "ActuatorPin",
              "state": false,
              "pin": 17,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": 20.2969
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 20.375,
          "connected": true,
          "address": "288269C00700003B",
          "calibrationOffset": 0
        }
      },
      "inputError": 0.0664,
      "Kp": 10,
      "Ti": 14400,
      "Td": 0,
      "p": -0.6641,
      "i": 0.7734,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 20.4063
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 21.0625,
            "connected": true,
            "address": "280B5CC10700009E",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": 20.2969
        },
        "output": 0.1094,
        "achieved": 0.7656,
        "minimum": -10,
        "maximum": 10
      }
    }
  ]
}

You have your heater1 Kp set to 0.5.

That means that when the fridge temp is 1 degree below setpoint, the heater is only on for 0.5%!
In other words, the heater is doing almost nothing. The integrator will rise to increase the heating to try to reach the setpoint and it will not suddenly drop to zero after the setpoint has been reached. That is what the proportional part is for.

Set your heater Kp to at least 10. Your graph shows no sign of the heater doing anything significant. The fridge temp just free rises.