I need some help with the results showing in the chart. Is there any tuning in the advanced settings necessary?
Yes, you don’t want it to alternate between heating and cooling continuously.
I can’t tell much based on this chart. You need to zoom in more and tell me your current settings.
It looks like you are running on our old version on Arduino. Please note that this is no longer supported and you’re not running the latest algorithms. If you are running on the Spark, you should update.
I’m running the Spark v3 and did the upgrade. Are this the settings you need?
{
"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": 21.4375,
"connected": true,
"address": "289A3A04090000D9",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 26.7891
}
},
"output": {
"kind": "ActuatorPwm",
"dutySetting": 100,
"period": 4,
"minVal": 0,
"maxVal": 100,
"target": {
"kind": "ActuatorMutexDriver",
"mutexGroup": {
"kind": "ActuatorMutexGroup",
"deadTime": 1800000,
"waitTime": 1799994
},
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "heater1",
"delegate": {
"kind": "ActuatorPin",
"state": true,
"pin": 24,
"invert": false
}
}
}
},
"inputError": -4.8633,
"Kp": 30,
"Ti": 1800,
"Td": 60,
"p": 145.8984,
"i": 0,
"d": -24.7266,
"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": 1800000,
"waitTime": 1799991
},
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "heater2",
"delegate": {
"kind": "ActuatorNop",
"state": false
}
}
}
},
"inputError": null,
"Kp": 30,
"Ti": 1800,
"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": 21.4375,
"connected": true,
"address": "289A3A04090000D9",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 26.7891
}
},
"output": {
"kind": "ActuatorPwm",
"dutySetting": 0,
"period": 1200,
"minVal": 0,
"maxVal": 100,
"target": {
"kind": "ActuatorMutexDriver",
"mutexGroup": {
"kind": "ActuatorMutexGroup",
"deadTime": 1800000,
"waitTime": 1799987
},
"target": {
"kind": "ActuatorTimeLimited",
"minOnTime": 120,
"minOffTime": 180,
"maxOnTime": 65535,
"state": false,
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "cooler",
"delegate": {
"kind": "ActuatorPin",
"state": false,
"pin": 25,
"invert": false
}
}
}
}
},
"inputError": -4.8633,
"Kp": 20,
"Ti": 3600,
"Td": 300,
"p": 97.2656,
"i": 1.9063,
"d": -82.6563,
"actuatorIsNegative": true
},
{
"kind": "Pid",
"name": "beer2fridgepid",
"enabled": true,
"input": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorDelegate",
"name": "beer1",
"delegate": {
"kind": "OneWireTempSensor",
"value": 20.625,
"connected": true,
"address": "28F564030900008F",
"calibrationOffset": 0
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "beer1set",
"value": 21.7891
}
},
"output": {
"kind": "ActuatorOffset",
"target": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorFallback",
"onBackupSensor": false,
"sensor": {
"kind": "TempSensorDelegate",
"name": "fridge",
"delegate": {
"kind": "OneWireTempSensor",
"value": 21.4375,
"connected": true,
"address": "289A3A04090000D9",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 26.7891
}
},
"reference": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorDelegate",
"name": "beer1",
"delegate": {
"kind": "OneWireTempSensor",
"value": 20.625,
"connected": true,
"address": "28F564030900008F",
"calibrationOffset": 0
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "beer1set",
"value": 21.7891
}
},
"useReferenceValue": false,
"setting": 5,
"achieved": -0.3516,
"minimum": -6,
"maximum": 6
},
"inputError": -1.1445,
"Kp": 5,
"Ti": 10800,
"Td": 600,
"p": 5.7227,
"i": 0,
"d": -0.7227,
"actuatorIsNegative": false
}
]
}
It looks like your heater is pretty weak. Can you try setting heater Kp to 100 and Ti to 3600?
I’m using a 50 W ceramic infrared light bulb (for reptiles). The results setting heater Kp to 100 and Ti to 3600:
Okay, as you can see, the fridge temperature is now raised to setpoint correctly, but the fridge setpoint fluctuates a lot.
This is because your beer temperature also fluctuates quickly.
- Do you have a thermowell?
- Where have you placed the beer sensor?
If you can reduce the direct effect of the heater on your beer temperature, so you can get a smoother fridge setting, that would help.
To get a smoother fridge setting, try reducing beer-to-fridge Td, I think it would be best to even disable it in your case. Set it to 0. Now the derivative of the beer temp is causing a huge fluctuation in fridge setpoint.
The beer sensor is in a thermowell. I’ve placed the light bulb with the fan in top of the fridge (not enough space at the bottem…see picture). I’ve set the beer-to-fridge to 0. See the results in the graph…
Which beer-to-fridge parameter?
Did you set Ti to zero on the heater and beer-to-fridge?
Ti corrects for steady state errors and you’re not reaching setpoint.
Beer-to-Fridge derivative time constant (Td) set to 0 and Heater 1 integral time constant (Ti) to 3600
Can you post your full settings from the control tab again so I can suggest changes (surround it with 3 backticks)?
{
"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": 21.375,
"connected": true,
"address": "289A3A04090000D9",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 26.8086
}
},
"output": {
"kind": "ActuatorPwm",
"dutySetting": 100,
"period": 4,
"minVal": 0,
"maxVal": 100,
"target": {
"kind": "ActuatorMutexDriver",
"mutexGroup": {
"kind": "ActuatorMutexGroup",
"deadTime": 1800000,
"waitTime": 1799996
},
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "heater1",
"delegate": {
"kind": "ActuatorPin",
"state": true,
"pin": 24,
"invert": false
}
}
}
},
"inputError": -4.9258,
"Kp": 30,
"Ti": 1800,
"Td": 60,
"p": 147.7734,
"i": 0,
"d": -24.375,
"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": 1800000,
"waitTime": 1799992
},
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "heater2",
"delegate": {
"kind": "ActuatorNop",
"state": false
}
}
}
},
"inputError": null,
"Kp": 30,
"Ti": 1800,
"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": 21.375,
"connected": true,
"address": "289A3A04090000D9",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 26.8086
}
},
"output": {
"kind": "ActuatorPwm",
"dutySetting": 0,
"period": 1200,
"minVal": 0,
"maxVal": 100,
"target": {
"kind": "ActuatorMutexDriver",
"mutexGroup": {
"kind": "ActuatorMutexGroup",
"deadTime": 1800000,
"waitTime": 1799988
},
"target": {
"kind": "ActuatorTimeLimited",
"minOnTime": 120,
"minOffTime": 180,
"maxOnTime": 65535,
"state": false,
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "cooler",
"delegate": {
"kind": "ActuatorPin",
"state": false,
"pin": 25,
"invert": false
}
}
}
}
},
"inputError": -4.9258,
"Kp": 20,
"Ti": 3600,
"Td": 300,
"p": 98.5156,
"i": 1.9063,
"d": -81.5625,
"actuatorIsNegative": true
},
{
"kind": "Pid",
"name": "beer2fridgepid",
"enabled": true,
"input": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorDelegate",
"name": "beer1",
"delegate": {
"kind": "OneWireTempSensor",
"value": 20.625,
"connected": true,
"address": "28F564030900008F",
"calibrationOffset": 0
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "beer1set",
"value": 21.7891
}
},
"output": {
"kind": "ActuatorOffset",
"target": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorFallback",
"onBackupSensor": false,
"sensor": {
"kind": "TempSensorDelegate",
"name": "fridge",
"delegate": {
"kind": "OneWireTempSensor",
"value": 21.375,
"connected": true,
"address": "289A3A04090000D9",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 26.8086
}
},
"reference": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorDelegate",
"name": "beer1",
"delegate": {
"kind": "OneWireTempSensor",
"value": 20.625,
"connected": true,
"address": "28F564030900008F",
"calibrationOffset": 0
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "beer1set",
"value": 21.7891
}
},
"useReferenceValue": false,
"setting": 5.0195,
"achieved": -0.4141,
"minimum": -6,
"maximum": 6
},
"inputError": -1.1445,
"Kp": 5,
"Ti": 10800,
"Td": 600,
"p": 5.7227,
"i": 0,
"d": -0.7031,
"actuatorIsNegative": false
}
]
}
Please try these settings:
Heater 1:
- Kp = 30
- Ti = 3600
- Td = 0
Cooler 1:
- Kp: 20
- Ti: 3600
- Td: 0
Beer-to-fridge:
- Kp: 5
- Ti: 10800
- Td: 0
I think the problem was the high Td of the cooler. This caused the steep increase in temperature to cause a high value for the cooler and as soon as the cooler is higher than the heater, the heater turns off. Due to the minimum dead time for switching, the cooler never actually turns on and it switches back to heating soon. But it does cause this situation where the heating stops prematurely.
I just don’t get it. Can we talk on Skype and can you give me access to the system remotely so I can monitor it?
Might the fridge output be inverted given it looks like the heater is on most of the time but it keeps getting colder? Fridge is just about overpowering the heater?
It’s not inverted. The heater switches on and off but temperature of the beer doesnt’s reach the 22 degrees. The fridge is inactive.