Stack Data Format
Stack System 800 Scaling Definitions
SCALINGS
All data
monitoring Systems need a mechanism for converting raw measurements to
engineering units. The ST800 uses the SCALING definition to perform all numeric
conversions consistently, accurately and efficiently. Each scaling represents
three conversion steps between the raw sensor measurement and the displayed
engineering value -- sensor, hardware and units scalings.
Sensor scaling
Each Sensor will measure a range of values and output a
signal representing that range e.g A temperature transducer would measure a
range from 0 to 200 degrees C and output a range of resistances. Some sensors
will convert the analogue measurement to a frequency modulated pulse train which
is fed into the period counter of the ST800.
Hardware scaling
The
outputs of analogue sensors are measured by the Analogue to Digital converter on
the ST800 and converted into binary numbers in the range 0 to 255 for the S
module and 0 to 1623 for the H module. The outputs of pulse sensors are timed by
the pulse input port of the ST800 and returned as times in units of system clock
ticks in the range 0 to 65535.
Units scaling
The hardware and sensor scalings taken together will provide
the measurement in a standard units for the parameter. This might then need to
be converted to some other engineering units.
e.g.
cm/s to km/h
The SCALING definition syntax is relatively straightforward
but is complicated by two constraints imposed by the system -- Integer math, and
processor power.
Integer Maths
The ST800 uses only integer maths, there are no floating
point numbers in the system. This means that scalings are not only responsible
for numeric conversions but must also be carefully designed to maintain
precision and accuracy. This leads to scalings for sensors producing units like
0.1 BAR rather than pure Bar.
Processor Power
Ideally we
would scale the sensor reading as soon as it is read to convert the raw reading
to a base engineering units. This would leave only the choice of engineering
unit conversions at display time. However the overhead of performing these
scalings on every measurement would be too great for. the system as would
performing three separate scalings on each reading. Currently all scalings used
in the system act as a single conversion step between the raw value read and the
display value required. As each scaling definition thus contains all the gory
details of the internal measurement they may seem rather complex and obscure.
However a basic understanding of the processes involved will make their
construction clear. The following sections describe the types of raw values
obtained by the various sensor inputs, the scaling definition itself with detail
on various scaling types and some worked examples.
SENSOR INPUTS
The sources of all ST800 measurements are the sensors and the
INPUT types. These determine the range of raw values that will be placed into
channels. On the ST800 Measurement types fall into five main groups
S Module Analogue Sensors
These sensors are connected to an 8 bit Analogue to Digital
Converter (ADC). This means that the full range of the sensor is mapped onto a
binary number in the range 0 to 255. The sensor Inputs are described to the
system as either VOLTS, LOHMS or HOHMS inputs. VOLTS sensors usually output a
voltage reading in the range 0 to 5V for the full range of the sensor. The 0 to
5V range is broken up into 255 19milliVolt divisions. LOHMS and HOHMS measure a
range of resistances e.g from a potentiometer. The Low and High alternatives
represent the different ranges of resistance readings available. The S module
has 5 ADC inputs plus 2 internal ADC inputs used to measure Supply Voltage and
backup battery voltage.
S Module Period or Pulse Sensors
Tachometer and wheel speed sensors produce a train of pulses
proportional to the speed of the engine or wheel. The ST800 system accurately
measures the time between each pulse (the Period) in order to be able to
calculate the Frequency (11 Period) of the input. Period measurements are made
in units of time called Ticks. One tick on the S module is equal to 8.68
microseconds; there are 115200 ticks per second. Ticks are counted into 16 bit
values so the largest period of time that can be measured is
65535*8.68usec=0.5688 seconds. This 8.68 us to 568ms range translates into a
frequency range of 115200 Hz to 2 Hz
S Module HFREQ Sensors
The ST600 sensors convert their raw reading to a Frequency
modulated pulse train before sending them to the ST800. This gives the signal
high grade noise immunity. The FM signal for normal values lies between 20 to 40
KHz although it may operate correctly up to 80 KHz. The S module measures this
signal by counting the number of pulses received in a fixed. time period of 50
ms, this number is therefore in the range 1000 to 2000 and corresponds to 10
bits of resolution. The S module can only scan one HFREQ sensor at a time and
gives each new sensor 50 ms of warm-up time. Thus 5 sensors will take 500 ms to
scan completely.
H module Analogue sensors
The H module APC gives 8 channels of 12 bits of resolution
that is numbers in the range 0.½4095.; As for the S module VOLTS, LOHMS
and -- Sensors are supported as well as a 25VOl TS input.
H module Pulse Measurement
The
ST600-HI type of input is used for the same sensors as the S module HFREQ but
has the ability to scan all 8 inputs simultaneously. In addition the input
statement allows the user to set the scan time over which pulses are counted.
Setting the scan time to 1000 ms (1 second) will give readings in the range
20000 to 40000 or about 15 bits of resolution. The long scan times can be traded
off against the resolution to obtain the resolution and sample rate required.
SCALINGS--SYNTAX
A scaling statement has the following format:
SCALING
<description> <Linear part> [<Inverse Part>]
Where:
<description> :-
<name> <type> <mm> <max>
The description part identifies the scaling by name, sets a
range of legal values and specifies the type of function used to perform the
scaling.
<name>
The name by which the scaling is used. It should be descriptive of the function
of the scaling. e.g RPM.
<type>
Is one of the following scaling types: AX+B A/X AB/X A/XB
<mm> <max>
The range of output values regarded as valid by the scaling. This range is not
currently checked or imposed but provides a indication of the expected range of
result values produced by the scaling. e.g. 0 200
<Linear part>
<count> <points table>
This describes
the AX+B part of the scaling the Slope and Offset by giving a set of
corresponding pairs of input and output values. e.g. 2 00 255500
<count>
number of pairs in points table - from 2 to 255
<points table>
<pair1> <pair2> <pair3> <pairn>
<pair>
<Input value> <output value>
<value>
Any signed or unsigned 16 bit integer value. i.e either 0. .65535 or –32768 ..
32767
<inverse_part>
n1 n2
where a/x
scalings = y= 1520*n1/n2*x and abix scallngs n1*n2/x
Here are some example scalings:
SCALING
5VoltBattery AX+B 0 500 2 0 0 255 5000
This scales
a simple 8 bit volts input (0 to 255) linearly into a 0.5000 milliVolt range.
SCALING
Steering% AX+B -100 100 2 0 –100 255 100
This scales a simple 8 bit
volts input (0 to 255) linearly into + or -100 % The result is signed because
the first output value is signed.
SCALING
S670-MPH A/X 0 200 2 0 0 16093 1800 360 1
This scales a period
measurement to mph using an 1800 mm wheel circumference.
SCALING
S664-C AX+B 0 2000 6 2 0 0 200 241 400 282 600 324 800 363 1000 400 1200
This scales a non linear
temperature sensor to Celsius using a 6 point table.
SCALING FUNCTIONS
Linear scalings AX+B
A Linear scaling is used when the output value is directly
proportional to the input value. If the relationship between the input and
output values are graphed then a straight line will result (Ax+B linear graph).
Linear Scalings can be described in two ways.
1)
As a slope and offset e.g. y = mx+c where m and care constants e.g.
m=60/255 c=30
2) By giving
the position of two points on the line. e.g. 030 25590
Method (2) is used in the ST800 as it avoids the use of small
fractions like 60/255 = 0.235 and can be easily calculated by taking real
measurements from the sensor. It is also easily extrapolated to non-linear
scalings requiring several points. The linear part of the scaling statement
consists of a count of pairs followed by the input and output values of two or
more points on the graph of the sensor. The only rule is that successive input
values must be in sequence and be of increasing value. i.e. they must go from
left to right on the graph. When the scaling is used the position of the raw
value is found on the input axis a vertical line drawn up until it meets the
graph of the scaling then a horizontal line taken across to the output axis and
the result value read off. In mathematical terms:
[ (input2 - input1) x (output2 - output1) ] / (input2-input1) =
output
Non-linear Scalings AX+B
A Non-Linear scaling is used when the output value is not
directly proportional to the input value but can be approximated by a series of
linear segments. This scaling type can be used for sensors which are mainly
proportional but show drift errors at the ends of the range, sensors which have
a polynomial functional or logarithmic relationship and those whose input output
relationship is completely arbitrary.
Function given
by the scaling
SCALING NONLIN AX+B 0 250 6 0 1 6 5022
10035 15060 200 110 250 210
Using a table
to describe the curve has the following advantages;-
·
Small floating point fractions such as 250/210
are avoided.
·
Calculation time is fast equivalent to linear
AX+B plus the table search time.
·
Up to 255 points may be entered giving very
accurate scalings .Complex functions and functions that cannot easily be
described such as those with discontinuities may be entered.
·
Table can be easily calculated by taking real
measurements from the sensor.
Frequency Scalings A/X
ST600 series sensors, engine speed and wheel speed sensors
all provide their measurement as a train of pulses. The signal is proportional
to the frequency of the pulses. The ST8OO constantly measures the period of time
between each pulse or over a specified group of pulses and stores this value in
the channel. The interval value is in units of time called system clock ticks -
or just ticks. This tick value is dependant on the frequency of the system
clock. On the S module a tick equals 8.68 microseconds, there are 115200 ticks
per second. On the H module there are 200000 ticks per second. In order to
convert a period in ticks, into a frequency in Hz it has to be divided into the
number of ticks per second. The A/X (also A/BX and AB/X) functions allow this to
take place. The structure of the scaling definition is the same as for AX+B
scalings with two more values tagged on the end n1 and n2.
A/X &
A/BX
These scaling functions take the raw
value X and perform the function:
( n1 x 11520 ) / (n2 x X)
The A/X value is then passed through the normal AX+B part of
the scaling in order to get the final display value. 11520 is the number of
ticks in 100ms; this is implicit in the definition of the S module. H modules
require the explicit use of the frequency value and an AB/X function. When n1
and n2 are both 1 the function returns the value in 0.1 revs/sec units. However
for many measurements this value is too large and n1 might be set to a larger
value in order to maintain resolution or convert units. e.g. in S-RPM the Hz
value is converted to RPM by multiplying by 600.
AB/X
Sometimes the implicit 11520 ticks numerator is not required,
either the scaling is not related to the internal clock or, as in the H module,
the clock is different. In this case ni and n2 both represent numerators.
( n1 x n2 ) / X = Y
both n1 and n2 are restricted to 16 bit numbers i.e. ± 32768.
However when used in the function their product is held in a 32 bit product
which allows very large numbers to be used. The result of this part of the
function must still be 16 bit.
H module scalings
The H modules requires different scalings from the S module
due to several reasons;
·
The UPP analogue inputs have a 10 bit rather
than 8 bit range, i.e. 0 to 1 023 rather than 0 to 255 raw values.
·
The faster system clock means that the tick
rate is 200000 rather than 115200.
·
The ST600 sensors produce pulse outputs
of 20 to 40 Khz but the actual count values measured depends on the sample time
for each channel.
The
following example scaling shows the latter two features;
SCALING
H631-INH20 AB/X 0 200 2 20000 0 40000 141 20000 10000
n1 and n2 are 20000 and 10000 which represent 200000 * 1000
where 200000 is the ticks/second and 1000 converts from Hz to Khz. This part
converts the reading into 20 to 40 Khz values. The Linear part then maps 20000
Hz onto zero pressure and 40000 Hz onto 141 inches of water . Note that as all
parts of the scaling are positive 40000 is acceptable as an input value even
though it is above 32768.
Speed Scalings
Of all the scalings used in the system the most complex is
that for speed. This is because of the desire to express the wheel circumference
explicitly in the scaling in order to make changes easy. The basic formula is;
speed = ( tickrate x
wheel_circ ) / period
where tickrate is 115200, period is the raw reading in ticks
and wheel_circumference is the distance travelled for one revolution of the
wheel. To obtain speed in mph with a wheel circumference measured in inches the
formula becomes;
( 115200 x wheel_circ x 3600 ) / ( period x 63360 ) = mph
Where;
3600 = seconds in 1 hour
63360 = inches in 1 mile.
This can be re-arranged into two equations;
Eq 1:
( 11520 x 360 ) / ( period ) = a
Eq 2:
( a x wheel_circ x 10 ) / 6336 = mph
The 115200 * 3600 is divided by 100 to keep the numerator in
range. The second equation is multiplied by 100 which cancels one zero from
63360 and leaves the wheel_circ to be entered as 0.1 inches. This arrangement
allows the key variable -the wheel circumference to be entered in accurate
units.
The resultant scaling with wheel_circ = 40 inches is;
SCALING S670-0.1in-MPH A/X 0 200 2 0 0
6336 400 360 1
For speed in mph with wheel circumference = 1800 mm we simply
convert the inches to mm. 0.1 inch = 2.54 mm 6336 * 2.54 = 16093
SCALING S670-mm-MPH A/X 0 300 2 0 0 16093
1900 360 1
For speed in kph with wheel circumference in mm the case is
similar. 115200
( 11520 x wheel_circ x 3600 ) (
period x 1000 x 1000 ) = mph
This also cancels down to the scaling;
SCALING S670-KPH A/X 0 500 2 0 0 10000
1800 360 1
|