PMElogo.jpg (16797 bytes)
                                                                     Precision Measurement Engineering, Inc.


Calculation of Engineering Units

OVERVIEW

An explanation of the way that engineering units are calculated from SCAMP's raw data is useful for two reasons. First, it may happen that the customer needs to perform the calculation using a customer-written program. Second, and most important, it is necessary to understand how engineering units are calculated so that the effects of the NOFF, NPOLAR, and NGAIN parameters can be understood.

SCAMP's electrical block diagram and the Hardware Overview  sections of this manual show how the sensor information is processed within SCAMP's various circuits. SCAMP records a measurement by the following process: as SCAMP travels through the water column its sensors respond to environmental parameters such as temperature or electrical conductivity. Sensing methods vary, but every sensor, together with its electrical circuit, produces a voltage that is in some way related to the parameter sensed. These voltages are produced continually as SCAMP travels.

Every 1/100 second interval the SCAMP's digital electronics records a scan of all active channels. There are two multiplexors (electronic switches) shown on the block diagram and there are thus two paths by which channel voltages arrive at the A/D converter. Voltages from channels 0 to 15 arrive at the A/D converter after being processed by a programmable offset and gain circuit. Voltages from channels 16 to 31 are directly routed to the A/D converter. Channels are scanned in ascending numerical order. The A/D output, a 16 bit integer, is stored within SCAMP's memory by the digital electronics. This scanning process continues while SCAMP travels.

When data collection is completed, SCAMP's MultiMedia Card memory normally contains a great number of A/D integer values in sequential order. PME's SCAMP Control Dialog is used to upload these data via SCAMP's  USB port onto the host computer's hard disk drive.   Two files are created, a  *.RAW file and a  *.TXT file. The *.RAW file contains SCAMP parameters and raw data in binary format. The *.TXT file is a simple ASCII file and contains information about the profile and also calibration information.

CALIBRATION AND ENGINEERING UNITS

SCAMP's environmental measurements flow from sensor to disk drive through the above path. The  *.RAW file contains all the information needed to translate the raw A/D integers to the actual engineering unit values that were present at the sensor when the data were measured. The *.RAW file contains data that was acquired at the time of the measurement and also SCAMP parameters such as calibration coefficients. This information was not acquired at the time of the measurement, but was instead acquired when the SCAMP was calibrated. Normally calibration is done before using SCAMP for measurements, but it is also possible to provide calibration information from calibrations done after the measurements. The calculation of engineering units depends upon both the A/D integers and also upon the calibration so it is useful here to discuss calibrations.

Calibration is the activity of exposing SCAMP's sensors to known values of the environmental parameters being sensed and recording the A/D integers that occur. Sets of these observations are recorded over the expected range of the environmental parameters. A 16 bit A/D can resolve about 65000 different values of the environmental parameter. However, it is convenient to calibrate the SCAMP at a very limited number of these possible points. Since any of the 65000 values may occur in the measured data, a numerical function is found (a "least square fit") that can produce an estimate of the engineering unit associated with any of the 65000 points.

Calculation of the engineering unit associated with any integer from the *.RAW file should thus be quite simple: read the integer from the file, read the numerical function from the SCAMP parameters, evaluate the function using the integer, and save the resulting engineering unit.

Things are not this simple however, due to the presence of the programmable offset and gain circuit that processes channels 0 to 15.

In order to incorporate offsets and gains for channels 0 to 15 the calibration concept presented above is modified somewhat. Calibrations are considered to be relations developed between sensed environmental parameters and the channel voltages produced by the associated circuits and delivered to the multiplexors. At this stage all channels 0 to 31 are the same. The channel output voltage is, for computational convenience, not expressed in volts but rather as a ratio of the output voltage to the SCAMP internal reference (+3 volts), times 256.

CR = 256 * (Vb/Vref)

This makes sense because many channels have ratiometric outputs, the A/D converts its inputs ratiometrically, and all channels can be treated the same no matter if their signal paths include the offset and gain or not.

Of course during a calibration the only information available from SCAMP is the A/D converter output. If the calibration will be parameter-vs.-CR, then CR must be computed from the A/D output. Thus the effect of the A/D conversion and also of the offset and gain block must be approximated. Note that the accuracy of the approximations used is unimportant (if the offset and gains aren't changed for actual measurements) since they will be canceled out in the final calibration path.

The A/D is modeled by:

Nad=32768*(Vad/Vref)

The offset and gain for channels 0 to 15 is modeled by:

Vad=G*(Vb+Voff) ;NOFFPOLAR=0
Vad=G*(Vb-Voff) :NOFFPOLAR=1

or for channels 16 to 31 by:

Vad=Vb

A CR for a given calibration point is obtained by taking the Nad at that point and finding Vad. The offset and gain equation is used to convert Vad into Vb, and the channel ratio relation used to find the final channel ratio from Vb. An entire set of parameter-vs.-CR is used to find a numerical equation that estimates the environmental parameter from CR. HOST software presently supports only one form of this estimation:

EU=C0+C1*CR+C2*CR^2+C3*CR^3

So the final computation of engineering units is somewhat more complex: Convert the Nad into the corresponding Vad. Find Vb. Find CR. Find EU.

Note that the approximate equations for A/D response and for offset and gain effectively cancel themselves out since they appear in the same way in the path from Nad to CR for both calibration and for measurement. This is not the case if NOFF, NGAIN, or NPOLAR are changed. If any of these values are different for measuring from the values used for calibration, then the engineering unit computation will still work but its accuracy will depend upon how accurately the Vad to Vb relation models the actual effect of the offset and gain block.

CALCULATION METHODS

PME provides several means to convert the information in these files into the corresponding engineering units for each channel (i.e. temperature in degrees C, conductivity in mS/cm and so on).

There should be no need to create additional programming for finding engineering units from raw data.