Version 2.0.3 Preliminary Documentation – May be Subject to Change 19-36
Input Measurement Accuracy and Filtering
All inputs, except for frequency inputs, are sampled every 1ms.
The user can select the type
of filter that is applied to the measured data, before it is transmitted to the bus. The available filters
are:
•
Filter Type 0 = No Filter
•
Filter Type 1 = Moving Average
•
Filter Type 2 = Repeating Average
Calculation with no filter:
Value = Input
When the message is sent to the bus, the data is simply a ‘snapshot’ of the value after the latest
measurement taken by the AtoD converter or interrupt function.
Calculation with the moving average filter:
Value
N
= Value
N-1
+
‘Filter Constant’ is another setpoint that can be adjusted by the user.
When the message is sent to the bus, the data is what was calculated in Value
N
after the latest
measurement taken by the AtoD converter or interrupt function. Selecting the appropriate Filter
Constant can reduce the effect of noise on the accuracy of the input measurements.
Calculation with the repeating average filter:
Value =
At every reading of the input value, it is added to the sum. At every N
th
read, the sum is divided by
N, and the result is saved for transmission to the bus. The value and counter will be set to zero for
the next read. The value of N is stored in the ‘Filter Constant’ setpoint.
When the message is sent to the bus, the data is what was calculated in Value after the latest
measurement taken by the AtoD converter or interrupt function.
Frequency and Counter Inputs
Frequency and counter inputs are measured based on the value in the ‘Measuring Window’
setpoint. Filters are not available for these types of inputs, and the data in ‘Filter Type’ is ignored.
For frequency inputs, the sampling period should be selected to get the best resolution of the input,
and thus more accurate measurements of the frequency. For example, a gear with 100 teeth
rotating a 1200 RPM will have a high frequency of 2000 Hz, so sampling every 100ms will give an
‘ideal’ value of 200 pulses. If a couple of pulses are missed, and only 198 pulses are counted, the
calculated RPM will be 1188, which is only a 1% error. However, that same gear rotating at only
300 RPM would give a 4% error if two pulses were missed in the 100ms measuring window.
(Input – Value
N-1
)
FilterConstant
Σ
Input
N
N