Index: firmware/App/Drivers/ConductivityTeensy.h =================================================================== diff -u -rfea37ad4659d4162d43f3e343cd5b266c2757ea9 -r4954a58fad7d100068baed367ae074ca6c132813 --- firmware/App/Drivers/ConductivityTeensy.h (.../ConductivityTeensy.h) (revision fea37ad4659d4162d43f3e343cd5b266c2757ea9) +++ firmware/App/Drivers/ConductivityTeensy.h (.../ConductivityTeensy.h) (revision 4954a58fad7d100068baed367ae074ca6c132813) @@ -68,6 +68,7 @@ TEENSY_CMD_STOP_MEASUREMENT, ///< Maps to command "n" TEENSY_CMD_GET_ALL_MEASUREMENTS, ///< Maps to command "g" TEENSY_CMD_GET_SINGLE_MEASUREMENT, ///< Maps to command "h" + TEENSY_CMD_SELECT_SENSOR, ///< Maps to command "u" MAX_NUM_OF_TEENSY_CMDS ///< Total number of commands } TEENSY_CMD_INDEX_T; @@ -120,15 +121,40 @@ COND_MST_STATUS_SUCCESS } COND_UPDATE_MST_STATUS_T; +typedef enum Conductivity_Models +{ + STANDARD, // standard equation for conductivity + ALY_LINEAR, // Aly's high range model for conductivity + UPDATED_STANDARD, // Updated stand equation with a linear transformation. + NUM_OF_MODELS, +} COND_MODELS_T; + /// Coefficients to be applied with raw impedance and rtd values to calculate conductivity and temperature. +/// Coefficients stored into the EEPROM of the sensors contain values for more than one model and each subsystem. typedef struct { - F64 A0; - F64 A1; - F64 B0; - F64 B1; - F64 B2; - F64 B3; + F64 beta; // Temperature scale factor, all models + F64 gamma; // Temperature offset factor, all models + F64 kHighDDUS; // Cell constant, high range ( DD ), Updated standard + F64 alphaHighDDUS; // Temperature correction factor, high range (DD), Updated Standard + F64 etaHighDDUS; // Resistance scale factor, high range (DD), Updated Standard + F64 zetaHighDDUS; // Resistance offset, high range (DD), Updated Standard + F64 kLowFPS; // Cell constant, low range ( IOFP ), Standard + F64 alphaLowFPS; // Temperature correction factor, low range (IOFP), Standard + F32 kHighDDS; // Cell constant, high range (DD), Standard + F32 alphaHighDDS; // Temperature correction factor, high range (DD), Standard + F32 kLowFPUS; // Cell constant, low range (IOFP), Updated Standard + F32 alphaLowFPUS; // Temperature correction factor, low range (IOFP), Updated Standard + F32 etaLowFPUS; // Resistance scale factor, low range (IOFP), Updated Standard + F32 zetaLowFPUS; // Resistance offset, low range (IOFP), Updated Standard + F32 beta0DD; // Beta 0 (DD), Aly Linear + F32 beta1DD; // Beta 1 (DD), Aly Linear + F32 beta2DD; // Beta 2 (DD), Aly Linear + F32 beta3DD; // Beta 3 (DD), Aly Linear + F32 beta0FP; // Beta 0 (IOFP), Aly Linear + F32 beta1FP; // Beta 1 (IOFP), Aly Linear + F32 beta2FP; // Beta 2 (IOFP), Aly Linear + F32 beta3FP; // Beta 3 (IOFP), Aly Linear } COND_COEFF_T; /// Structure to receive Sensor Measurement data from Teensy @@ -174,6 +200,7 @@ typedef struct { F64 Conductivity; + F64 Resistance; F64 Temperature; } COND_CALCULATED_MEASUREMENTS_T;