I had Kp set to 100 when I first observed this, and have been setting it to other large positive numbers to see if there is some logic in the repro. (reason so high: I have a 30-watt mat heater trying to take on 40 gallons of water, admittedly underpowered, and I was trying to cause oscillations around the setpoint so that I could figure out ultimate gain).
Here is a screencast of a repro: https://goo.gl/2UK5pn. In the video I set Kp to 200, verify in the algorithm window and in the log, then come back to advanced settings. If I click “Update from Core” the value has gone negative again. When Kp = 200 the associated negative value = -56, and if Kp = 400 the negative value = -112 (so ironically the behavior is proportional!)
The JSON value in the Control Algorithm tab says the expected value, even when the Advanced Settings box shows a negative value:
{
"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": 22.1875,
"connected": true,
"address": "28A6A273060000B1",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 32.2227
}
},
"output": {
"kind": "ActuatorPwm",
"dutySetting": 100,
"period": 4,
"minVal": 0,
"maxVal": 100,
"target": {
"kind": "ActuatorMutexDriver",
"mutexGroup": {
"kind": "ActuatorMutexGroup",
"deadTime": 1800000,
"waitTime": 1799237
},
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "heater1",
"delegate": {
"kind": "ActuatorPin",
"state": true,
"pin": 11,
"invert": false
}
}
}
},
"inputError": -10.0391,
"Kp": 100,
"Ti": 0,
"Td": 0,
"p": 1003.9063,
"i": 0,
"d": 0,
"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": 1799159
},
"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": 22.1875,
"connected": true,
"address": "28A6A273060000B1",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 32.2227
}
},
"output": {
"kind": "ActuatorPwm",
"dutySetting": 0,
"period": 1200,
"minVal": 0,
"maxVal": 100,
"target": {
"kind": "ActuatorMutexDriver",
"mutexGroup": {
"kind": "ActuatorMutexGroup",
"deadTime": 1800000,
"waitTime": 1799071
},
"target": {
"kind": "ActuatorTimeLimited",
"minOnTime": 180,
"minOffTime": 180,
"maxOnTime": 65535,
"state": false,
"target": {
"kind": "ActuatorDigitalDelegate",
"name": "cooler",
"delegate": {
"kind": "ActuatorPin",
"state": false,
"pin": 16,
"invert": false
}
}
}
}
},
"inputError": -10.0391,
"Kp": 0,
"Ti": 0,
"Td": 0,
"p": 0,
"i": 0,
"d": 0,
"actuatorIsNegative": true
},
{
"kind": "Pid",
"name": "beer2fridgepid",
"enabled": true,
"input": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorDelegate",
"name": "beer1",
"delegate": {
"kind": "OneWireTempSensor",
"value": 18.5,
"connected": true,
"address": "28DF41A9080000C5",
"calibrationOffset": 0
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "beer1set",
"value": 22.2227
}
},
"output": {
"kind": "ActuatorOffset",
"target": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorFallback",
"onBackupSensor": false,
"sensor": {
"kind": "TempSensorDelegate",
"name": "fridge",
"delegate": {
"kind": "OneWireTempSensor",
"value": 22.1875,
"connected": true,
"address": "28A6A273060000B1",
"calibrationOffset": 0
}
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "fridgeset",
"value": 32.2227
}
},
"reference": {
"kind": "SensorSetPointPair",
"sensor": {
"kind": "TempSensorDelegate",
"name": "beer1",
"delegate": {
"kind": "OneWireTempSensor",
"value": 18.5,
"connected": true,
"address": "28DF41A9080000C5",
"calibrationOffset": 0
}
},
"setPoint": {
"kind": "SetPointSimple",
"name": "beer1set",
"value": 22.2227
}
},
"useReferenceValue": false,
"setting": 10,
"achieved": -0.0352,
"minimum": -10,
"maximum": 10
},
"inputError": -3.7266,
"Kp": 5,
"Ti": 14400,
"Td": 3600,
"p": 18.6328,
"i": 0,
"d": -1.5039,
"actuatorIsNegative": false
}
]
}