0

# Incorrect Relational Function

Chris Litwin 6 months ago in IQANdesign updated by Gustav Widén (System support) 6 months ago

Why does the below relational function evaluate incorrectly? sensorInput of 37.50 should evaluate to a result of 60. It does the same when I try using Object List.

+1

Perhaps the real (raw)value of the sensor is for example 37.501 and shows only rounded number (37.50)?

My first thought was it has to do with digits past the 2 decimal pts. The sensor input is actually mapped directly to static values and then that is run through a filter channel. It appears the filter channel is the problem. When I set the filter value to 54 or higher it appears to never reach the "37.50", or any of the other values.

Here is an example project to show what is happening.

Example Project

I put the filter on the Sensor V-IN instead of the mapped math, then to mapped math, then to output

To me it seems to work ok then

Yeah, that makes sense as the mapped values are defined values. It still seems to be a bug to me that the output of a filter channel when filter value is above 53 never really reaches the limit.

The channels are 32-bit real, giving 7 significant digits.

But as Jan pointed out, only 2 decimals are shown when measuring in IQANdesign.

To see more decimal points in order to understand what is going on, you can put MD4 value controls with up to 5 decimal points on a display page.

Why does it never reach 50.0000 when the filter value is 54, but it does at 53?

If the filter input is held constant, the filter output should eventually reach the same value. That is the problem I see here.

With this filter in the SFC, the update between cycles is calculated from the previous input, current input and the filter value.

The result of this calculation may be so small that there is no update. You can try a higher filter value to see the effect even more.

If you want a filter where numerical accuracy of small steps is less of an issue, an alternative you could try is the moving average filter.

+1

Ok, that makes more sense. Thank you.