Index: firmware/App/Drivers/ConductivitySensors.h =================================================================== diff -u -r43ceadd4e906f44579de2a15d1201c5e7f7024ed -r6a5f0a5c76ae840ef58e695b5602f9d3bb89f65d --- firmware/App/Drivers/ConductivitySensors.h (.../ConductivitySensors.h) (revision 43ceadd4e906f44579de2a15d1201c5e7f7024ed) +++ firmware/App/Drivers/ConductivitySensors.h (.../ConductivitySensors.h) (revision 6a5f0a5c76ae840ef58e695b5602f9d3bb89f65d) @@ -76,16 +76,16 @@ /// Conductivity sensor calibration struct typedef struct { - F32 K_high; ///< (cell coefficient, high range), default = 4, range = [3, 6] - F32 alpha_high; ///< (temperature correction, high range), default = 0.02, range = [0.005, 0.04] - F32 eta_high; ///< (resistance scale factor, high range), default = 1, range = [0.5, 3] - F32 zeta_high; ///< (resistance offset, high range), default = 0, range = [-1000, 1000] - F32 K_low; ///< (cell coefficient, low range), default = 4, range = [3, 6] - F32 alpha_low; ///< (temperature correction, low range), default = 0.02, range = [0.005, 0.04] - F32 eta_low; ///< (resistance scale factor, low range), default = 1, range = [0.5, 3] - F32 zeta_low; ///< (resistance offset, low range), default = 0, range = [-1000, 1000] - F32 beta; ///< (Temperature scale factor), default = 1, range = [0.5, 2] - F32 delta; ///< (Temperature offset), default = 0, range = [-10, 10] + F32 K_high; ///< Cell coefficient, high range, default = 4, range = [3, 6] + F32 alpha_high; ///< Temperature correction, high range, default = 0.02, range = [0.005, 0.04] + F32 eta_high; ///< Resistance scale factor, high range, default = 1, range = [0.5, 3] + F32 zeta_high; ///< Resistance offset, high range, default = 0, range = [-1000, 1000] + F32 K_low; ///< Cell coefficient, low range, default = 4, range = [3, 6] + F32 alpha_low; ///< Temperature correction, low range, default = 0.02, range = [0.005, 0.04] + F32 eta_low; ///< Resistance scale factor, low range, default = 1, range = [0.5, 3] + F32 zeta_low; ///< Resistance offset, low range, default = 0, range = [-1000, 1000] + F32 beta; ///< Temperature scale factor, default = 1, range = [0.5, 2] + F32 delta; ///< Temperature offset, default = 0, range = [-10, 10] F32 reserved1; ///< Reserved cal slot. F32 reserved2; ///< Reserved cal slot. } CONDUCTIVITY_COEFFICIENTS_T; Index: firmware/App/Drivers/ConductivityTeensy.c =================================================================== diff -u -r94a98f376c6c8c3785f05f5a1b19cc1108fe336e -r6a5f0a5c76ae840ef58e695b5602f9d3bb89f65d --- firmware/App/Drivers/ConductivityTeensy.c (.../ConductivityTeensy.c) (revision 94a98f376c6c8c3785f05f5a1b19cc1108fe336e) +++ firmware/App/Drivers/ConductivityTeensy.c (.../ConductivityTeensy.c) (revision 6a5f0a5c76ae840ef58e695b5602f9d3bb89f65d) @@ -1791,6 +1791,7 @@ memcpy( &condRawMeasurement[ tempSensor.sensorNum - 1 ], &tempSensor, sizeof( COND_SENSOR_DATA_T ) ); // Calculate and store Temperature from raw values. + // Temperature is needed for Conductivity calculation. calculateTemperature( tempSensor.sensorNum - 1 ); // Calculate and store Conductivity from raw values Index: firmware/App/Drivers/ConductivityTeensy.h =================================================================== diff -u -r279a41c031010740e5121ea978d8f069a4b7deb7 -r6a5f0a5c76ae840ef58e695b5602f9d3bb89f65d --- firmware/App/Drivers/ConductivityTeensy.h (.../ConductivityTeensy.h) (revision 279a41c031010740e5121ea978d8f069a4b7deb7) +++ firmware/App/Drivers/ConductivityTeensy.h (.../ConductivityTeensy.h) (revision 6a5f0a5c76ae840ef58e695b5602f9d3bb89f65d) @@ -59,7 +59,7 @@ /// Enumeration of Initialization status of all the sensors connected to Teensy typedef enum Conductivity_Init_Status { - COND_INIT_STATUS_UNINITIALIZED = 0, ///< The initialization process has not started. + COND_INIT_STATUS_UNINITIALIZED = 0, ///< The initialization process has not started. COND_INIT_STATUS_IN_PROGRESS, ///< The initialization process has started. COND_INIT_STATUS_INITIALIZED, ///< Initialization process completed and all the sensors were initialized successfully. COND_INIT_STATUS_FAILED ///< Initialization process completed but one or more sensor was not initialized properly. @@ -89,7 +89,7 @@ /// Enumeration of update EEPROM status typedef enum Conductivity_Update_Eeprom_Status { - COND_UPDATE_EEPROM_STATUS_UNINITIALIZED = 0, ///< The initialization process has not started. + COND_UPDATE_EEPROM_STATUS_UNINITIALIZED = 0, ///< The initialization process has not started. COND_UPDATE_EEPROMSTATUS_IN_PROGRESS, ///< The initialization process has started. COND_UPDATE_EEPROM_STATUS_INITIALIZED, ///< Initialization process completed and all the sensors were initialized successfully. COND_UPDATE_EEPROM_STATUS_FAILED ///< Initialization process completed but one or more sensor was not initialized properly. @@ -109,7 +109,7 @@ /// Enumeration of Conductivity models typedef enum Conductivity_Models { - STANDARD, ///< standard equation for conductivity + 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, ///< Number of models used for conductivity calculation. @@ -171,7 +171,7 @@ F32 SinFreq; ///< SinFreq : Frequency of excitation signal F32 DacVoltPP; ///< DacVoltPP : DAC output voltage in mV peak to peak. Maximum value is 800mVpp. Peak to peak voltage F32 BiasVolt; ///< BiasVolt : The excitation signal is DC+AC. This parameter decides the DC value in mV unit. 0.0mV means no DC bias. - U32 HstiaRtiaSel; ///< HstiaRtiaSel : Valid param values ( 0, 1, 2, 3, 4, 5, 6, 7 ) + U32 HstiaRtiaSel; ///< HstiaRtiaSel : TIA (Transimpedance Amplifier) feedback resistor value. Valid param values ( 0, 1, 2, 3, 4, 5, 6, 7 ) U32 AdcPgaGain; ///< AdcPgaGain : Valid param values ( 1, 1.5, 2, 4, 9 ) i.e interpreted as ( 0, 1, 2, 3, 4 ) respectively in Teensy. U32 DftNum; ///< DftNum : DFT number Valid param values ( 4096, 2048, 1024, 512, 256 ) i.e interpreted as ( 10, 9, 8, 7, 6 ) respectively in Teensy. U32 ADCAvgNum; ///< ADCAvgNum : Valid param values ( 2, 4, 8, 16 )i.e interpreted as ( 0, 1, 2, 3 ) respectively in Teensy. @@ -181,17 +181,17 @@ /// Structure to store calculated Conductivity and Temperature for each sensor. typedef struct { - OVERRIDE_F32_T Conductivity; - OVERRIDE_F32_T Resistance; - OVERRIDE_F32_T Temperature; + OVERRIDE_F32_T Conductivity; ///< Calculated Conductivity + OVERRIDE_F32_T Resistance; ///< Calculated Resistance + OVERRIDE_F32_T Temperature; ///< Calculated Temperature } COND_CALCULATED_MEASUREMENTS_T; /// Structure to enqueue and dequeue commands in the command queue typedef struct { - TEENSY_CMD_INDEX_T cmdIdx; - U08* teensyCMD; - U32 rxSize; + TEENSY_CMD_INDEX_T cmdIdx; ///< Command ID + U08* teensyCMD; ///< Pointer to string command + U32 rxSize; ///< Expected rx size in bytes } COND_CMD_DATA_T; // ********** public function prototypes **********