Brew-Pi Assistance

New member here. I finally finished my brew Pi build using the spark core. I have a chamber I built using a fridge as my cooling source and a light bulb in a can as my heating. I have been tweaking the settings to have it running smoothly but without understanding what each setting actually does I am having a hard time.

I have also moved my interior chamber probe to a different location as well with no real change. Any help on adjusting my settings would be great!

Here are my current settings.

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 23.5781
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 20.8125,
            "connected": true,
            "address": "28A88A36070000AE",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": -0.4297,
      "Kp": 9,
      "Ti": 600,
      "Td": 60,
      "p": 3.8672,
      "i": 0,
      "d": 0.0703,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 3.9375,
        "period": 240,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 640000,
            "waitTime": 639521
          },
          "target": {
            "kind": "ActuatorPin",
            "state": true,
            "pin": 17,
            "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": 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": 640000,
            "waitTime": 639456
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 23.5781
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 20.8125,
            "connected": true,
            "address": "28A88A36070000AE",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": -0.4297,
      "Kp": 50,
      "Ti": 1800,
      "Td": 25,
      "p": 21.4844,
      "i": 0,
      "d": 0.1953,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 1200,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 640000,
            "waitTime": 639381
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 120,
            "minOffTime": 180,
            "maxOnTime": 65535,
            "state": false,
            "target": {
              "kind": "ActuatorPin",
              "state": false,
              "pin": 16,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": 21.1094
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 20.6875,
          "connected": true,
          "address": "28C88B3507000028",
          "calibrationOffset": 0
        }
      },
      "inputError": -0.4883,
      "Kp": 5,
      "Ti": 3600,
      "Td": 1200,
      "p": 2.4414,
      "i": 0.0273,
      "d": 0,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 23.5781
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 20.8125,
            "connected": true,
            "address": "28A88A36070000AE",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": 21.1094
        },
        "output": 2.4688,
        "achieved": -0.2969,
        "minimum": -10,
        "maximum": 10
      }
    }
  ]
}

Your beer temperature is fluctuating a lot and because of this, your fridge setpoint too.

Look for physical explanations for why your beer temp changes so fast:

  • Small volume
  • No thermowell (influenced by fridge air)
  • Beer very close to the wall of the fridge (not cooling via air, but directly)

You could try to find a software solution:

  • Increased filtering in the beer-to-fridge PID (both filters)
  • Lower Td in beer-to-fridge PID

But I would first figure out why your beer temperature is fluctuating so much. If this is 20 liters of beer, it should not drop by a degree from 10 minutes of cooling.

Thanks man. I made those adjustments and it looks great. I am installing a thermowell this week. Do you recommend keeping the settings on default if you install a thermowell?

Try it like this and if you are happy with the results, don’t change a thing.