Appendix A
APPENDIX A — ANALOG FUNCTIONS | THERMISTOR: |
The User Configurable Analog Inputs have several parameters that affect the value interpreted from the A/D reading. In general, the following equation determines the final User Configurable Analog Input result:
Result = Scale (Function (Calibrate (Raw A/D read- ing)))
For functions that require 4 coefficients for a polyno- mial, the calibration factor has to be incorporated in the polynomial coefficients. In this case, the follow- ing equation determines the final User Configurable Analog Input result:
Result = Scale (Function (Raw A/D reading))
The RMS Analog Inputs have a calibration parameter and a scaling parameter that affect the value inter- preted from the A/D reading. The following equation determines the final RMS Analog Input result:
Result = Scale (Calibrate (RMS Function (Raw A/D reading)))
Although the calibration and scaling adjustments exist for the remaining Analog Inputs (i.e. derived channels), it is unlikely they will be used. The remaining Analog Inputs are derived from other ana- log inputs that have already been adjusted. If further adjustment is needed, then the following equation determines the final Analog Input result:
Result = Scale (Calibrate (RMS Function (Raw A/D reading)))
These derived inputs have more complex interactions with the hardware, so care should be taken if adjust- ments are used.
The conversion functions are described below. One of these functions is a 16 bit floating point polynomial
-GEN_FP_POLY. This function should only be used as an extreme last resort as it is processor time inten- sive. The other integer polynomial functions should be sufficient for converting the A/D input data.
The coefficients for the conversion functions need to be adjusted for working in the A/D counts realm as opposed to the voltage realm. Multiply A/D reading voltage by 1023/5 to convert to A/D reading counts. Also, the coefficient scaling is in powers of 2 to expedite processing of math operations using shifts instead of multiply and divide. The following types of Analog Input functions are implemented in the firmware.
PRESSURE:
POLY_3RD:
Third order polynomial with 4 coefficients and a scal- ing factor
X = raw_analog
(AX3 + BX2 + CX + D) * S Where:
A, B, C, D are polynomial coefficients
S is the scaling factor
Coefficient 3 | = A * 10243 |
Coefficient 2 | = B * 10242 |
Coefficient 1 | = C * 1024 |
Calibration | = D |
Scaling | = S * 1024 |
POLY_2ND: |
|
Second order polynomial with 3 coefficients, a scal- ing factor, and a calibration factor
X = M * raw_analog (AX2 + BX + C) * S
Where:
M is the calibration factor
A, B, C are polynomial coefficients
S is the scaling factor
Calibration | = M * 1024 |
Coefficient 3 = A * 10242 | |
Coefficient 2 | = B * 1024 |
Coefficient 1 | = C |
Scaling | = S * 1024 |
LINEAR:
POLY_1ST:
First order polynomial with 2 coefficients, a scaling factor, and a calibration factor
X = M * raw_analog (AX + B) * S
Where:
M is the calibration factor
A, B are polynomial coefficients
S is the scaling factor
Calibration | = M * 1024 |
Coefficient 2 | = A * 1024 |
Coefficient 1 | = B |
Scaling | = S * 1024 |
POLY_1ST_N1:
First order polynomial with 3 coefficients, a scaling factor, and a calibration factor
X = M * raw_analog (A + BX +
38