Board Sensor Calibration

Maxim Sloyko maxims at google.com
Fri Aug 21 02:54:05 AEST 2020


On Thu, Aug 20, 2020 at 9:23 AM Ed Tanous <ed at tanous.net> wrote:
>
>
>
> On Wed, Aug 19, 2020 at 10:41 AM Maxim Sloyko <maxims at google.com> wrote:
>
> >
>
> > Hi OpenBMC!
>
>
>
> Hi!
>
>
>
>
> >
>
> > We would like to have a value reported by a certain sensor changed according to our calibration results. This is a temperature sensor and the calibration has nothing to do with the sensor itself -- so no need to change the driver or anything -- but with a sensor placement on the board. Basically we want to infer the temperature at a different location by calibrating the sensor.
>
>
>
> Do you have more details on what the transfer function is?  Is it a simple offset, or is it a more complicated lookup table?

The calibration has not been done yet, so I don't know how complicated
the transfer function will be. If simple offset will considerably
simplify implementation, I can ask our thermal engineers to check if
we can get away with simple offset.

> Does it include multiple sensors to generate this new value, or is it a single sensor?  Is it intended to "replace" the existing value, or is it intended to complement it?

It is a single sensor and we intend to replace the existing value.


>
>
>
>
> The ideas I've heard before that this might be:
>
> 1. The temp sensor isn't that accurate, so we want to calibrate it to a better transfer function that we determined empirically.

We think that the sensor itself is OK.

>
> 2. The temp sensor is adjacent to the thing we really want to measure, so we want to create an offset including the CFM that approximates the temperature of the thing we can't measure directly.

Yes, this is closer to the case that we have. I don't know what CFM is though.

>
> 3. I want to transform the value of the sensor into different units, (Power + CFM to exit air air, or power + time to energy)
>
>
>
>
> >
>
> > Are there any tools in OpenBMC that would allow us to add the calibration curve to, say, phosphor-hwmon and have it report the value different from the one reported by the underlying sensor? Did anybody else have to deal with something like this and what was your solution? Do people more familiar with sensor architecture have any recommendations on how best to handle this?
>
>
>
> The closest examples that come to mind for dbus-sensors type architectures are:
>
> CFM sensor and Exit air temp sensor.  Both pull in a number of other sensors, and run them through a math transform to come up with a "new" sensor value derived from the other inputs.  This sounds similar to what you want, although it's probably more complex than you're looking for.
>
> The "virtual sensor" proposal currently in review, which I personally have technical issues with, and have left comments as such.  I don't believe there's a working implementation of this yet, but there are those working on it.
>
>
>
> If it were me, and I wanted to add a simple lookup table to dbus sensors, I'd probably model it in an entity manager config for the temperature sensor, similar to how the stepwise controller models it, and add that into the Hwmon temp sensor daemon.  The below example adds a +5 celcius offset to the bmc temp sensor as an example.  Bear in mind, this wouldn't work today, you'd have to adjust hwmontempsensor to take this into account.
>
>
>
> {
>
>     "Address": "0x4A",
>
>     "Bus": 6,
>
>     "Name": "BMC Temp",
>
>     "Thresholds": [],
>
>     "Type": "TMP75",
>
>     "CalibrationOutput": [
>
>         5.0,
>
>         105.0
>
>     ],
>
>     "CalibrationReading": [
>
>          0.0,
>
>         100.0
>
>     ],
>
> }
>
> --
> -Ed

Thanks, this sounds promising, I'll look into it.

-- 
-MS


More information about the openbmc mailing list