How do I convert a sensor voltage into a physical value with a characteristic curve?¶
Put the sensor’s characteristic curve into the document as a normal dataset and
add the filter function characteristic_curve() to the measured signal.
UniPlot looks up every measured value in the characteristic curve and plots the
physical value, for example bar instead of volt. The raw signal stays
unchanged.
Left: characteristic curve of a pressure sensor (bar over volt). Right:
measured sensor voltage and the physical value calculated with
characteristic_curve.¶
How it works¶
Import or plot the measured signal, for example the voltage of a pressure sensor over time.
Create a dataset with the characteristic curve: x = sensor value (volt), y = physical value (bar). It can be on the same page or on another page of the document. Give it a clear name in Data=>1D- and 2D-Dataset….
Right-click the measured signal, choose Edit Filter Functions…, select
characteristic_curveand click =>.Click Edit and enter the characteristic curve as
Page:Name, for exampleSensors:p_rail. If the curve is on the same page, the dataset name alone is enough.Click OK. The diagram now shows the physical value.
In a script:
XYSetFilterFunctions(hData, "characteristic_curve(Sensors:p_rail)");
Why it helps¶
No lookup tables in a spreadsheet for every new measurement file.
The characteristic curve and the result stay linked: correct the curve and every diagram that uses it is recalculated.
The raw signal is kept; the conversion can be changed or removed at any time.
Good to know¶
Values between two points of the characteristic curve are interpolated linearly, so non-linear sensors are handled as well as linear ones.
If the page or the dataset name is not found, the filter is not applied. Rename the characteristic curve only together with the filter.
If a sensor is basically right but deviates at some operating points, use
correction_factor()instead, see How do I correct a sensor whose error changes over the measuring range?.The filter is available since UniPlot R2024.3.