All of lore.kernel.org
 help / color / mirror / Atom feed
* Board Sensor Calibration
@ 2020-08-19 17:39 Maxim Sloyko
  2020-08-20 16:15 ` Patrick Williams
  2020-08-20 16:23 ` Ed Tanous
  0 siblings, 2 replies; 5+ messages in thread
From: Maxim Sloyko @ 2020-08-19 17:39 UTC (permalink / raw)
  To: OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 792 bytes --]

Hi OpenBMC!

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.

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?

Thank you.

-- 
-MS

[-- Attachment #2: Type: text/html, Size: 1020 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Board Sensor Calibration
  2020-08-19 17:39 Board Sensor Calibration Maxim Sloyko
@ 2020-08-20 16:15 ` Patrick Williams
  2020-08-20 16:17   ` Patrick Williams
  2020-08-20 16:23 ` Ed Tanous
  1 sibling, 1 reply; 5+ messages in thread
From: Patrick Williams @ 2020-08-20 16:15 UTC (permalink / raw)
  To: Maxim Sloyko; +Cc: OpenBMC Maillist, Vijay Khemka

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

On Wed, Aug 19, 2020 at 10:39:15AM -0700, Maxim Sloyko wrote:
> Hi OpenBMC!
> 
> 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.
> 
> 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?
> 
> Thank you.
> 
> -- 
> -MS

There is work being implemented now under phosphor-virtual-sensor[1]
which is intended to cover exactly this case (among others).  We have a
similar situation where sensors need to be calibrated based on values
from one or more other sensors.  An example might be a voltage regulator
which reads high as it gets hotter.  phosphor-virtual-sensor will allow
you to forumlate a secondary sensor (the "virtual" sensor) using math
applied to one or more real sensors.

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Board Sensor Calibration
  2020-08-20 16:15 ` Patrick Williams
@ 2020-08-20 16:17   ` Patrick Williams
  0 siblings, 0 replies; 5+ messages in thread
From: Patrick Williams @ 2020-08-20 16:17 UTC (permalink / raw)
  To: Maxim Sloyko; +Cc: OpenBMC Maillist, Vijay Khemka

[-- Attachment #1: Type: text/plain, Size: 1694 bytes --]

On Thu, Aug 20, 2020 at 11:15:33AM -0500, Patrick Williams wrote:
> On Wed, Aug 19, 2020 at 10:39:15AM -0700, Maxim Sloyko wrote:
> > Hi OpenBMC!
> > 
> > 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.
> > 
> > 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?
> > 
> > Thank you.
> > 
> > -- 
> > -MS
> 
> There is work being implemented now under phosphor-virtual-sensor[1]
> which is intended to cover exactly this case (among others).  We have a
> similar situation where sensors need to be calibrated based on values
> from one or more other sensors.  An example might be a voltage regulator
> which reads high as it gets hotter.  phosphor-virtual-sensor will allow
> you to forumlate a secondary sensor (the "virtual" sensor) using math
> applied to one or more real sensors.
> 
> -- 
> Patrick Williams

Forgot to include the link.

1. https://gerrit.openbmc-project.xyz/q/status:open+project:openbmc/phosphor-virtual-sensor

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Board Sensor Calibration
  2020-08-19 17:39 Board Sensor Calibration Maxim Sloyko
  2020-08-20 16:15 ` Patrick Williams
@ 2020-08-20 16:23 ` Ed Tanous
  2020-08-20 16:54   ` Maxim Sloyko
  1 sibling, 1 reply; 5+ messages in thread
From: Ed Tanous @ 2020-08-20 16:23 UTC (permalink / raw)
  To: Maxim Sloyko; +Cc: OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 2972 bytes --]

On Wed, Aug 19, 2020 at 10:41 AM Maxim Sloyko <maxims@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?  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?



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.

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.

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

[-- Attachment #2: Type: text/html, Size: 3668 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Board Sensor Calibration
  2020-08-20 16:23 ` Ed Tanous
@ 2020-08-20 16:54   ` Maxim Sloyko
  0 siblings, 0 replies; 5+ messages in thread
From: Maxim Sloyko @ 2020-08-20 16:54 UTC (permalink / raw)
  To: Ed Tanous; +Cc: OpenBMC Maillist

On Thu, Aug 20, 2020 at 9:23 AM Ed Tanous <ed@tanous.net> wrote:
>
>
>
> On Wed, Aug 19, 2020 at 10:41 AM Maxim Sloyko <maxims@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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-20 16:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-19 17:39 Board Sensor Calibration Maxim Sloyko
2020-08-20 16:15 ` Patrick Williams
2020-08-20 16:17   ` Patrick Williams
2020-08-20 16:23 ` Ed Tanous
2020-08-20 16:54   ` Maxim Sloyko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.