Hey, I recently ran into some problems with my set up and ended up resetting my brew pi.
I’m pretty much all back up and running now, however with a fermenter full of water as a test run, it seems that my beer temperature ends up sitting about 0.5 to 0.6 degrees above the set temperature (currently running in beer constant) see graphs below.
I noticed that the heater was kicking quite a lot in so I tried adjusting the dead time between actuators (image 3). but this didn’t change much.
Currently I have the advanced settings as follows:
Beer-to-Fridge proportional gain (Kp) = 2
Beer-to-Fridge integral time constant (Ti) = 7200
Beer-to-Fridge derivative time constant (Td) = 1200
Maximum difference between fridge and beer set point (= output of PID) = 10
Beer-to-Fridge Input filter delay time = 18 seconds
Beer-to-Fridge Derivative filter delay time = 159 seconds
Cooler proportional gain (Kp) = 5
Cooler integral time constant (Ti) = 2400
Cooler derivative time constant (Td) = 60
Cooler PWM period (seconds) = 1200
Cooler minimum OFF time = 180
Cooler minimum ON time = 120
Cooler Input filter delay time = 18 seconds
Cooler Derivative filter delay time = 159 seconds
Heater 1 proportional gain (Kp) = 5
Heater 1 integral time constant (Ti) = 2400
Heater 1 derivative time constant (Td) = 60
Heater 1 PWM period (seconds) = 4
Heater 1 Input filter delay time = 18 seconds
Heater 1 Derivative filter delay time = 159 seconds
I don’t have a second heater but this is what its set at anyway.
Heater 2 proportional gain (Kp) = 10
Heater 2 integral time constant (Ti) = 600
Heater 2 derivative time constant (Td) = 60
Heater 2 PWM period (seconds) = 4
Heater 2 Input filter delay time = 18 seconds
Heater 2Derivative filter delay time = 159 seconds
Dead time when switching between actuators = 360
My set up is:
Spark photon V2 running 0.5.2 with a Rpi 2B
120L bar fridge, 25 watt heat matt, fridge temp sensor, beer temp sensor installed in a thermowell.
Controll Algorithm as follows:
{
"kind": "Control",
"pids": [
{
"kind": "Pid",
"name": "heater1pid",
"enabled": true,
"input": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorFallback",
"onBackupSensor": false,
"sensor": {
"kind": "TempSensorDelegate",
"name": "fridge",
"delegate": {
"kind": "OneWireTempSensor",
"value": 23.5625,
"connected": true,
"address": "286471360700009A",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 23.293
}
},
"output": {
"kind": "ActuatorPwm",
"dutySetting": 0,
"period": 4,
"minVal": 0,
"maxVal": 100,
"target": {
"kind": "ActuatorMutexDriver",
"mutexGroup": {
"kind": "ActuatorMutexGroup",
"deadTime": 360000,
"waitTime": 308736
},
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "heater1",
"delegate": {
"kind": "ActuatorPin",
"state": false,
"pin": 16,
"invert": true
}
}
}
},
"inputError": 0.1094,
"Kp": 5,
"Ti": 2400,
"Td": 60,
"p": -0.5469,
"i": 0.5313,
"d": -1.9336,
"actuatorIsNegative": false
},
{
"kind": "Pid",
"name": "heater2pid",
"enabled": true,
"input": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorDelegate",
"name": "beer2",
"delegate": {
"kind": "TempSensorDisconnected",
"value": null,
"connected": false
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "beer2set",
"value": null
}
},
"output": {
"kind": "ActuatorPwm",
"dutySetting": 0,
"period": 4,
"minVal": 0,
"maxVal": 100,
"target": {
"kind": "ActuatorMutexDriver",
"mutexGroup": {
"kind": "ActuatorMutexGroup",
"deadTime": 360000,
"waitTime": 308733
},
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "heater2",
"delegate": {
"kind": "ActuatorNop",
"state": false
}
}
}
},
"inputError": null,
"Kp": 10,
"Ti": 600,
"Td": 60,
"p": 0,
"i": 0,
"d": 0,
"actuatorIsNegative": false
},
{
"kind": "Pid",
"name": "coolerpid",
"enabled": true,
"input": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorFallback",
"onBackupSensor": false,
"sensor": {
"kind": "TempSensorDelegate",
"name": "fridge",
"delegate": {
"kind": "OneWireTempSensor",
"value": 23.5625,
"connected": true,
"address": "286471360700009A",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 23.293
}
},
"output": {
"kind": "ActuatorPwm",
"dutySetting": 15.9883,
"period": 1200,
"minVal": 0,
"maxVal": 100,
"target": {
"kind": "ActuatorMutexDriver",
"mutexGroup": {
"kind": "ActuatorMutexGroup",
"deadTime": 360000,
"waitTime": 308730
},
"target": {
"kind": "ActuatorTimeLimited",
"minOnTime": 120,
"minOffTime": 180,
"maxOnTime": 65535,
"state": false,
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "cooler",
"delegate": {
"kind": "ActuatorPin",
"state": false,
"pin": 17,
"invert": false
}
}
}
}
},
"inputError": 0.1094,
"Kp": 5,
"Ti": 2400,
"Td": 60,
"p": -0.5469,
"i": -13.5078,
"d": -1.9336,
"actuatorIsNegative": true
},
{
"kind": "Pid",
"name": "beer2fridgepid",
"enabled": true,
"input": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorDelegate",
"name": "beer1",
"delegate": {
"kind": "OneWireTempSensor",
"value": 26.3125,
"connected": true,
"address": "287D093607000004",
"calibrationOffset": 0
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "beer1set",
"value": 26
}
},
"output": {
"kind": "ActuatorOffset",
"target": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorFallback",
"onBackupSensor": false,
"sensor": {
"kind": "TempSensorDelegate",
"name": "fridge",
"delegate": {
"kind": "OneWireTempSensor",
"value": 23.5625,
"connected": true,
"address": "286471360700009A",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 23.293
}
},
"reference": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorDelegate",
"name": "beer1",
"delegate": {
"kind": "OneWireTempSensor",
"value": 26.3125,
"connected": true,
"address": "287D093607000004",
"calibrationOffset": 0
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "beer1set",
"value": 26
}
},
"useReferenceValue": false,
"setting": -2.707,
"achieved": -2.4375,
"minimum": -10,
"maximum": 10
},
"inputError": 0.3125,
"Kp": 2,
"Ti": 7200,
"Td": 1200,
"p": -0.625,
"i": -2.2461,
"d": 0.1641,
"actuatorIsNegative": false
}
]
}
Connected devices as below:
Any help/advice would be most appreciated.
Cheers
Coop.