Photon temp calibration issue

Hi!

I am having some issues trying to tune my brand new Spark Photon BrewPi:-)

The temp probes disagrees slightly on the chamber temp. One probe is 0.25º above and the other is 0.5º above the beer temp. I can see that there is a calibration issue as the temps go stable when the chamber and room probes are hotter than the beer.

I have tried to calibrate the probes using old info on the site. I have tried sending input like:

sudo echo -ne 'U{i:0,j:-0.3}' > /dev/ttyACM0

to the spark. The only thing that happens is that the probe stops sending temperatures (the device config shows temp as null).

sudo echo -ne 'E\' > /dev/ttyACM0

resets the devices but I have yet not found any way to set the calibration to something.

With 0.5° diff in meassures, the temp fluctates a bit after spark reset but with 0.25º it is more stable. I will shitch the room and the chamber probes but it whould have been great to be able to calibrate:-)

Thanks for supplying such a great product!

PS! I am correct in using the brewpi-photon-0.4.3.bin as my firmware?

Hi Espen,

You are correct that this doesn’t work anymore. I changed that installed devices could not be changed after being installed, only uninstalled and installed again with new settings. I’ll look into it.

Now for your point that such small difference in sensor value could cause instability, I don’t think that this is true. This should be easily corrected by the PID. Such temperature difference a normal, for example the back of a fridge is colder than the front. If the beer is close to the back, it will respond more directly to cooling instead of being cooled only by the fridge air.

If you share a chart showing the beer and fridge temperature and settings, I can help you find what is causing it, but I doubt it is the sensor calibration.

Yes, I know this is not a major instability:blush:

It it just that I am so impressed by the technolgy that I would like it to be perfect.

Is it possible to install the probes with calibration?

Can you share the graph again with the fridge setting enabled?
And also please share the JSON output on the control algorithm tab.

Surround it with 3 backticks to paste it as code.
```
JSON here
```

And your beer temp is within 0.12 degrees of the set point, so I’d say it is working okay. I would like to see a bit more regular actuator activity, but cannot judge that before I see your fridge setpoint.

{
  "kind": "Control",
  "pids": [
    {
      "kind": "Pid",
      "name": "heater1",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 26
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 15.9375,
            "connected": true,
            "address": "2820E5C0070000E3",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": -10.0625,
      "Kp": 10,
      "Ti": 600,
      "Td": 60,
      "p": 100.625,
      "i": 3.2227,
      "d": 4.8828,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 100,
        "period": 4,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 1800000,
            "waitTime": 1799241
          },
          "target": {
            "kind": "ActuatorOneWire",
            "state": true,
            "pio": 1,
            "invert": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "heater2",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer2set",
        "value": null
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer2",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 16.0625,
          "connected": true,
          "address": "28E75EC107000049",
          "calibrationOffset": 0
        }
      },
      "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": 1800000,
            "waitTime": 1799170
          },
          "target": {
            "kind": "ActuatorNop",
            "state": false
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "cooler",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "fridgeset",
        "value": 26
      },
      "inputSensor": {
        "kind": "TempSensorFallback",
        "onBackupSensor": false,
        "sensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 15.9375,
            "connected": true,
            "address": "2820E5C0070000E3",
            "calibrationOffset": 0
          }
        }
      },
      "inputError": -10.0625,
      "Kp": 10,
      "Ti": 1800,
      "Td": 200,
      "p": 100.625,
      "i": 0,
      "d": 16.1719,
      "actuatorIsNegative": true,
      "outputActuator": {
        "kind": "ActuatorPwm",
        "value": 0,
        "period": 1200,
        "minVal": 0,
        "maxVal": 100,
        "target": {
          "kind": "ActuatorMutexDriver",
          "mutexGroup": {
            "kind": "ActuatorMutexGroup",
            "deadTime": 1800000,
            "waitTime": 1799094
          },
          "target": {
            "kind": "ActuatorTimeLimited",
            "minOnTime": 120,
            "minOffTime": 180,
            "maxOnTime": 65535,
            "state": false,
            "target": {
              "kind": "ActuatorOneWire",
              "state": false,
              "pio": 0,
              "invert": false
            }
          }
        }
      }
    },
    {
      "kind": "Pid",
      "name": "beer2fridge",
      "enabled": true,
      "setPoint": {
        "kind": "SetPointSimple",
        "name": "beer1set",
        "value": 16
      },
      "inputSensor": {
        "kind": "TempSensor",
        "name": "beer1",
        "sensor": {
          "kind": "OneWireTempSensor",
          "value": 16,
          "connected": true,
          "address": "28EE66C916160180",
          "calibrationOffset": 0
        }
      },
      "inputError": -0.0117,
      "Kp": 2,
      "Ti": 7200,
      "Td": 1200,
      "p": 0.0234,
      "i": 0,
      "d": 18.7266,
      "actuatorIsNegative": false,
      "outputActuator": {
        "kind": "ActuatorSetPoint",
        "targetSetPoint": {
          "kind": "SetPointSimple",
          "name": "fridgeset",
          "value": 26
        },
        "targetSensor": {
          "kind": "TempSensor",
          "name": "fridge",
          "sensor": {
            "kind": "OneWireTempSensor",
            "value": 15.9375,
            "connected": true,
            "address": "2820E5C0070000E3",
            "calibrationOffset": 0
          }
        },
        "referenceSetPoint": {
          "kind": "SetPointSimple",
          "name": "beer1set",
          "value": 16
        },
        "output": 10,
        "achieved": -0.0625,
        "minimum": -10,
        "maximum": 10
      }
    }
  ]
}

And yes. I do agree, 0.12 off is pretty good. :beers:

Ah, okay, there was a reset when the temperature dropped. The integrator value is not saved in non-volatile memory.
There is not much you can do about that small drop there.

You can get a smoother fridge setting by increasing the filtering on the beer-to-fridge PID.
It seems like you have set it to a low value, so at a bitflip of th beer sensor, you get a fluctuation in the setpoint. Try setting it to 639s.

OK. After starting to cool for lagering I can only say that I am impressed :+1: