Product Overview

Table Of Contents
FlexStat (General) 12 Application Guide, Rev S
In the median lter example above, the value of our rst cycle of the
median lter was 47241. If the IIR lter had a value of 47239.7329 in
its previous calculation, and the lter weight is 6, then when the new
median lter output of 47241 is calculated, the new IIR lter’s value is:
47239.7527 = (1–1/64)47239.7329 + 47241(1/64).
In this example, a value of
47239.7527 comes out of the IIR lter.
Final Scaling
After the ltering is done, the rmware determines the voltage scalar
(which may be a device table lookup), does the multiplier, and nally
adds the oset to make the nal value from the input.
If a device table is congured for the input, the rmware uses the
output of the IIR as an index into the table (with some interpolation).
Device tables have only 128 values, which means the index into the table
ranges 1–128. The output of the IIR lter ranges between 0–65536. The
rmware uses the Device Tables as follows:
1. Divide the current IIR value by 512 (called decimation).
2. Truncate this to use as an index into the Device Table (but remem-
bering the remainder). In the example, 47239.7527/512 = 92 with a
remainder of 0.265142.
3. Add one to the whole part (92 + 1 = 93) because the IIR values start at
0 but the table indices start at 1.
4. If this is a Type II thermistor table, the value in the table at index 93
is 4.879391.
5. To interpolate, go to the next table value, which is index 94, and get
its value (4.094612).
6. Calculate the dierence between these two table values (–0.784779)
and multiply this by the remainder in Step 2 (0.265142), which
equals –0.208078.
7. Add this to the rst table value looked up in Step 4 (4.879391), which
equals 4.671313. This is the input’s value before the multiplier and
oset.
If a device table is not being used, the input’s value depends on the
input pull-up switch position:
For 10K Ohm: Input Value = 3•IIR/65535
For 12 VDC: Input Value = 12•IIR/65535
NOTE: The IIR value here is what came out as a result of the IIR lter-
ing, which is a digital value that goes up to 65535.
Whether the Input Value is from the Device Table or the simpler calcula-
tion, multiply it by the multiplier. From Step 7 (4.671313) of the example,
the multiplier is 1.8 (for Fahrenheit) and the result is 8.40836.
The last step is to add the oset, which is 32.0 for Fahrenheit. For the
example then, the temperature reading is 40.40836.
NOTE: Filtering out noise does not necessarily mean you are reading
the whole input and nothing but the input. If noise has a very
slow frequency component, for instance, an error will still be in
the input values reported even after ltering.
Response Time Examples
Adding a weighted factor to the current input in the IIR delays the re-
sponse in the output. The larger the Filter Weight value, the longer is the
delay as shown in Response to Door Opening and Closing on page 13.
In this example, a heated shop with a large door is being maintained at
a comfortable level. The door opens, allowing cold outside air in. After
about a minute, the door closes.
In Response to FlexStat Reset and Rapid Random Signal Noise on page
13., extreme, rapid, random noise from a wiring problem aects the
signal. (In this case, smoothing out the noise is helpful, but it does not
necessarily mean you are reading the whole input and nothing but the
input.) Time delay is also shown in the responses after the reset (at 0).
Larger ltering values (with slower responses) might appear to be a
problem after the reset, but room temperature would never jump instan-
taneously from 0° to 70° in real life. Hence, wide discrepancies from true
temperature are not a lter weight issue in normal operation.