Index: firmware/App/Controllers/Fans.c =================================================================== diff -u -rf9b3862d01ce6c64bd05b8649e69b44fa155b8e0 -r1510aec1871295f04541f1b932211d4ac621cc48 --- firmware/App/Controllers/Fans.c (.../Fans.c) (revision f9b3862d01ce6c64bd05b8649e69b44fa155b8e0) +++ firmware/App/Controllers/Fans.c (.../Fans.c) (revision 1510aec1871295f04541f1b932211d4ac621cc48) @@ -20,9 +20,8 @@ #define FANS_MAX_ALLOWED_RAMP_UP_DELTA_DUTY_CYCLE 0.3 ///< Fans max allowed ramp up PWM change. #define FANS_MAX_ALLOWED_RAMP_DOWN_DELTA_DUTY_CYCLE 0.005 ///< Fans min allowed ramp down PWM change. -//#define ONE_MINUTE_TO_MICRO_SECONDS ( SEC_PER_MIN * US_PER_SECOND ) ///< One minute to micro seconds conversion. -#define TOGGLE_PERIOD_RESOLUTION_SECONDS 0.0000025 ///< FPGA fans toggle period resolution in micro seconds. -#define ROTATIONAL_TO_TOGGLE_PERIOD_CONVERSION 4 ///< FPGA rotational to toggle period conversion coefficient. +#define TOGGLE_PERIOD_RESOLUTION_SECONDS 0.0000025 ///< FPGA fans toggle period resolution in micro seconds. +#define ROTATIONAL_TO_TOGGLE_PERIOD_CONVERSION 4 ///< FPGA rotational to toggle period conversion coefficient. #define FANS_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Fans publish data time interval in counts. #define FANS_CONTROL_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Fans control time interval in counts. @@ -303,7 +302,7 @@ // Check if it is time to check for the control if( ++fansControlCounter > FANS_CONTROL_INTERVAL ) { - // Get the maximum temperature among all the thermistors and sensors to run fan from the hottest + // Get the maximum temperature among all the thermistors and temperature sensors to run fan from the hottest temperature F32 temperature = getMaximumTemperature(); //TODO REMOVE FOR TESTING Index: firmware/App/Controllers/TemperatureSensors.c =================================================================== diff -u -rf9b3862d01ce6c64bd05b8649e69b44fa155b8e0 -r1510aec1871295f04541f1b932211d4ac621cc48 --- firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision f9b3862d01ce6c64bd05b8649e69b44fa155b8e0) +++ firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 1510aec1871295f04541f1b932211d4ac621cc48) @@ -45,11 +45,8 @@ #define TRIMMER_HEATER_EXT_TEMP_SENSORS_0_DEGREE_RESISTANCE 100U ///< Trimmer heater external temperature sensors zero degree resistance. #define TEMP_SENSORS_ADC_BITS 24U ///< External temperature sensors ADC bits. -#define TEMP_SENSORS_ADC_MAX_COUNT ( pow(2,TEMP_SENSORS_ADC_BITS) - 1 ) ///< Temperature sensors max ADC count. +#define TEMP_SENSORS_ADC_MAX_COUNT 16777215U ///< Temperature sensors max ADC count (from 2^24 -1) -#define TEMP_EQUATION_COEFF_A (3.9083 * pow(10,-3)) ///< ADC to temperature conversion coefficient A. -#define TEMP_EQUATION_COEFF_B (-5.775 * pow(10,-7)) ///< ADC to temperature conversion coefficient B. - #define ADC_FPGA_READ_DELAY 30U ///< Delay in ms before reading the ADC values from FPGA. #define MAX_NUM_OF_RAW_ADC_SAMPLES 32U ///< Number of ADC reads for moving average calculations. #define MAX_ALLOWED_TEMP_DELTA_BETWEEN_SENSORS 2U ///< Maximum allowed temperature delta between sensors. @@ -68,6 +65,11 @@ #define K_THERMOCOUPLE_TEMP_2_MILLI_VOLT_CONVERSION_COEFF 0.041276 ///< K thermocouple temperature to millivolt conversion coefficient. #define SIZE_OF_THERMOCOUPLE_COEFFICIENTS 10U ///< Size of the thermocouple coefficients. +#define CELSIUS_TO_KELVIN_CONVERSION 273.15 ///< Celsius to Kelvin temperature conversion. +#define ADC_BOARD_TEMP_SENSORS_CONVERSION_CONST 272.5 ///< ADC board temperature sensors conversion constant. +#define TWELVE_BIT_RESOLUTION 4096.0 ///< 12 bit resolution conversion. +#define ADC_BOARD_TEMP_SENSORS_CONST 0x800000 + #define EXTERNAL_TEMP_SENSORS_ERROR_VALUE 0x80 ///< External temperature sensors error value. #define HEATERS_INTERNAL_TEMP_SENSOR_FAULT 0x01 ///< Heaters internal temperature sensor fault. @@ -150,6 +152,10 @@ -1.228034E-2, 9.804036E-4, -4.413030E-5, 1.057734E-6, -1.052755E-8 }; +static F32 tempSensorsADCMaxCount = 0.0; +static const F32 tempEquationCoeffA = 3.9083E-3; ///< ADC to temperature conversion coefficient A. +static const F32 tempEquationCoeffB = -5.775E-7; ///< ADC to temperature conversion coefficient B. + // ********** private function prototypes ********** static TEMPSENSORS_SELF_TEST_STATES_T handleSelfTestStart( void ); @@ -171,10 +177,13 @@ /*********************************************************************//** * @brief - * The initTemperatureSensors function initializes the module - * @details - * Inputs : none - * Outputs : TemperatureSensors module initialized + * The initTemperatureSensors function initializes the module.* + * @details Inputs: tempSensorsSelfTestState, tempSensorsExecState, + * elapsedTime, internalHeatersConversionTimer, dataPublicationTimerCounter, + * tempSensors + * @details Outputs: tempSensorsSelfTestState, tempSensorsExecState, + * elapsedTime, internalHeatersConversionTimer, dataPublicationTimerCounter, + * tempSensors * @return none *************************************************************************/ void initTemperatureSensors( void ) @@ -194,6 +203,7 @@ * The conversion coefficient will be set to 0 for the temperature sensors */ + // Set all the variables to zero for ( i = 0; i < NUM_OF_TEMPERATURE_SENSORS; ++i ) { memset( &tempSensors[ i ], 0x0, sizeof( TEMP_SENSOR_T ) ); @@ -234,10 +244,19 @@ tempSensors[ TEMPSENSORS_PRIMARY_HEATER_COLD_JUNCTION ].conversionCoef = HEATERS_COLD_JUNCTION_ADC_TO_TEMP_CONVERSION_COEFF; tempSensors[ TEMPSENSORS_TRIMMER_HEATER_COLD_JUNCTION ].conversionCoef = HEATERS_COLD_JUNCTION_ADC_TO_TEMP_CONVERSION_COEFF; - // Initialize the heaters calculated internal temperature sensors. The constants are zero since they will not be used for conversion + // FPGA board temperature conversion coefficient + tempSensors[ TEMPSENSORS_FPGA_BOARD_SENSOR ].conversionCoef = 503.975 / TWELVE_BIT_RESOLUTION; + // Board temperature sensors conversion coefficient + tempSensors[ TEMPSENSORS_LOAD_CELL_A1_B1 ].conversionCoef = 1.0 / 13584.0; + tempSensors[ TEMPSENSORS_LOAD_CELL_A2_B2 ].conversionCoef = 1.0 / 13584.0; + tempSensors[ TEMPSENSORS_INTERNAL_THDO_RTD ].conversionCoef = 1.0 / 13584.0; + tempSensors[ TEMPSENSORS_INTERNAL_TDI_RTD ].conversionCoef = 1.0 / 13584.0; + tempSensors[ TEMPSENSORS_INTERNAL_CONDUCTIVITY ].conversionCoef = 1.0 / 13584.0; + // Windowed time count for FPGA temperature sensor error - initTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_TEMPERATURE_SENSOR_ERROR, MAX_TEMPERATURE_SENSOR_FAILURES, MAX_TEMPERATURE_SENSOR_FAILURE_WINDOW_MS ); + initTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_TEMPERATURE_SENSOR_ERROR, MAX_TEMPERATURE_SENSOR_FAILURES, + MAX_TEMPERATURE_SENSOR_FAILURE_WINDOW_MS ); // Persistent alarms for inlet water high/low temperature initPersistentAlarm( PERSISTENT_ALARM_INLET_WATER_HIGH_TEMPERATURE, ALARM_ID_INLET_WATER_HIGH_TEMPERATURE, @@ -250,10 +269,9 @@ * @brief * The execTemperatureSensorsSelfTest function runs the TemperatureSensors * POST during the self-test. - * @details - * Inputs : tempSensorsSelfTestState - * Outputs : tempSensorsSelfTestState - * @return tempSensorsSelfTestState + * @details Inputs: tempSensorsSelfTestState + * @details Outputs: tempSensorsSelfTestState + * @return tempSensorsSelfTestState which is the status of the self test *************************************************************************/ SELF_TEST_STATUS_T execTemperatureSensorsSelfTest( void ) { @@ -286,10 +304,10 @@ /*********************************************************************//** * @brief - * The execTemperatureSensors function executes the temperature sensors' state machine. - * @details - * Inputs : tempSensorsExecState - * Outputs : tempSensorsExecState + * The execTemperatureSensors function executes the temperature sensors' + * state machine. + * @details Inputs: tempSensorsExecState + * @details Outputs: tempSensorsExecState * @return none *************************************************************************/ void execTemperatureSensors( void ) @@ -316,9 +334,8 @@ * @brief * The checkInletWaterTemperature checks inlet water temperature value * and triggers an alarm when temperature value is out of allowed range. - * @details - * Inputs : Inlet water temperature value - * Outputs : Trigger alarms when temperature is out of allowed range + * @details Inputs: none + * @details Outputs: nones * @return none *************************************************************************/ void checkInletWaterTemperature( void ) @@ -333,12 +350,12 @@ /*********************************************************************//** * @brief - * The getTemperatureValue function gets the temperature of the requested sensor. - * @details - * Inputs : none - * Outputs : none - * @param sensor temperature sensor index - * @return temperature + * The getTemperatureValue function gets the temperature of the requested + * sensor. + * @details Inputs: tempSensors + * @details Outputs: none + * @param sensorIndex which is the temperature sensor index + * @return temperature of the requested sensor *************************************************************************/ F32 getTemperatureValue( U32 sensorIndex ) { @@ -355,22 +372,27 @@ temperature = tempSensors[ sensorIndex ].temperatureValues.data; } } + else + { + // Wrong sensor was called, raise an alarm + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_TEMPERATURE_SENSOR_SELECTED, sensorIndex ); + } return temperature; } /*********************************************************************//** * @brief - * The getADC2TempConversion function calculates the temperature from ADC read from FPGA. - * @details - * Inputs : none - * Outputs : none - * @param avgADC Running average ADC + * The getADC2TempConversion function calculates the temperature from the + * moving average ADC samples. + * @details Inputs: tempEquationCoeffA, tempEquationCoeffB + * @details Outputs: none + * @param avgADC moving average ADC * @param gain ADC gain * @param refResistance ADC reference resistance * @param zeroDegResistance ADC zero degree resistance * @param adcConversionCoeff ADC conversion coefficient - * @return temperature + * @return calculated temperature *************************************************************************/ static F32 getADC2TempConversion( F32 avgADC, U32 gain, U32 refResistance, U32 zeroDegResistance, F32 adcConversionCoeff ) { @@ -381,8 +403,8 @@ // R(RTD) = R(ref) * ( adc – 2^N - 1 ) / ( G * 2^N - 1 ); F32 resistance = ( refResistance * ( avgADC - pow( 2,(TEMP_SENSORS_ADC_BITS - 1 ) ) ) ) / ( gain * pow( 2, ( TEMP_SENSORS_ADC_BITS - 1 ) ) ); // T = (-A + √( A^2 - 4B * ( 1 - R_T / R_0 ) ) ) / 2B - F32 secondSqrtPart = 4 * TEMP_EQUATION_COEFF_B * (1 - ( resistance / zeroDegResistance ) ); - temperature = ( -TEMP_EQUATION_COEFF_A + sqrt( pow( TEMP_EQUATION_COEFF_A, 2 ) - secondSqrtPart ) ) / ( 2 * TEMP_EQUATION_COEFF_B ); + F32 secondSqrtPart = 4 * tempEquationCoeffB * (1 - ( resistance / zeroDegResistance ) ); + temperature = ( -tempEquationCoeffA + sqrt( pow( tempEquationCoeffA, 2 ) - secondSqrtPart ) ) / ( 2 * tempEquationCoeffB ); } else { @@ -394,10 +416,10 @@ /*********************************************************************//** * @brief - * The getHeaterInternalTemp function calculates the heaters' internal temperature. - * @details - * Inputs : temperatureValues - * Outputs : temperatureValues + * The getHeaterInternalTemp function calculates the heaters' internal + * temperature. + * @details Inputs: tempSensors + * @details Outputs: tempSensors * @param TCIndex thermocouple index * @param CJIndex cold junction index * @return none @@ -433,10 +455,11 @@ } else { - // TODO Alarm temperature = -1.0; + SET_ALARM_WITH_1_F32_DATA( ALARM_ID_DG_HEATERS_NEGATIVE_COLD_JUNCTION_TEMPERATURE, CJTemp ) } + // Check which heater's internal temperature is being calculated if ( TCIndex == TEMPSENSORS_PRIMARY_HEATER_THERMO_COUPLE ) { tempSensors[ TEMPSENSORS_PRIMARY_HEATER_INTERNAL ].temperatureValues.data = temperature; @@ -453,9 +476,8 @@ * read from FPGA and converts it to an S32. Then it calls another function * to check if the read ADC is valid or not and if it is, it calls another * function to process the ADC value and covert it to temperature. - * @details - * Inputs : none - * Outputs : Processed valid ADC reading + * @details Inputs: none + * @details Outputs: none * @param sensorIndex ID of temperature sensor to process * @param adc ADC value for the temperature sensor * @param fpgaError reported FPGA error status @@ -479,9 +501,8 @@ * different bit shifts on them accordingly. Then it call another function to * check if the read ADC is valid and if it is, the function calls another function * process the ADC and convert it to temperature. - * @details - * Inputs : none - * Outputs : Processed heater ADC reading + * @details Inputs: none + * @detailsOutputs: none * @param sensorIndex ID of temperature sensor to process * @param adc reported ADC value for temperature sensor * @param fpgaError reported error status by FPGA @@ -501,7 +522,7 @@ // so if the sign bit is 1, the sign bit is extended convertedADC = ( (S16)adcConv ) >> SHIFT_BITS_BY_2; } - else if ( ( sensorIndex == TEMPSENSORS_PRIMARY_HEATER_COLD_JUNCTION ) || (sensorIndex == TEMPSENSORS_TRIMMER_HEATER_COLD_JUNCTION ) ) + else if ( ( sensorIndex == TEMPSENSORS_PRIMARY_HEATER_COLD_JUNCTION ) || ( sensorIndex == TEMPSENSORS_TRIMMER_HEATER_COLD_JUNCTION ) ) { // Cast the adc from U32 to U16 and shift it by 4 adcConv = ( (U16)adc ) << SHIFT_BITS_BY_4; @@ -522,13 +543,12 @@ * count. If there is any FPGA, it raises an alarm. If the count has changed * and the ADC value is not the same as the previous ADC read, it returns a * TRUE, signaling that the ADC is valid to be processed. - * @details - * Inputs : readCount - * Outputs : readCount, internalErrorCount + * @details Inputs: tempSensors + * @details Outputs: tempSensors * @param sensorIndex Temperature sensor index * @param fpgaError FPGA error count * @param fpgaCount FPGA read count - * @return isADCValid (BOOL) + * @return returns TRUE if ADC was valid otherwise FALSE *************************************************************************/ static BOOL isADCReadValid( U32 sensorIndex, U32 fpgaError, U32 fpgaCount ) { @@ -569,15 +589,16 @@ * The processADCRead function receives the ADC value and the sensor * index and calculates the running sum and the moving average of the ADCs * The temperatureSensorsADCRead and tempSensorsAvgADCValues are updated. - * @details - * Inputs : adcNextIndex, rawADCReads, adcRunningSum - * Outputs : adcNextIndex, rawADCReads, adcRunningSum, temperatureValues + * @details Inputs: tempSensors + * @details Outputs: tempSensors * @param sensorIndex Temperature sensor index - * @param adc adc reading from fpga + * @param adc adc reading from FPGA * @return none *************************************************************************/ static void processADCRead( U32 sensorIndex, S32 adc ) { + F32 temperature; + U32 const index = tempSensors[ sensorIndex ].adcNextIndex; S32 const indexValue = tempSensors[ sensorIndex ].rawADCReads [ index ]; @@ -588,22 +609,57 @@ // Calculate the average F32 const avgADCReads = tempSensors[ sensorIndex ].adcRunningSum >> SHIFT_BITS_BY_5_FOR_AVERAGING; - F32 const temperature = getADC2TempConversion( avgADCReads, - (U32)tempSensors [ sensorIndex ].gain, - (U32)tempSensors [ sensorIndex ].refResistance, - (U32)tempSensors [ sensorIndex ].zeroDegreeResistance, - tempSensors [ sensorIndex ].conversionCoef ); + // Different sensors have different ADC to temperature conversion methods + switch( sensorIndex ) + { + case TEMPSENSORS_INLET_PRIMARY_HEATER: + case TEMPSENSORS_OUTLET_PRIMARY_HEATER: + case TEMPSENSORS_CONDUCTIVITY_SENSOR_1: + case TEMPSENSORS_CONDUCTIVITY_SENSOR_2: + case TEMPSENSORS_OUTLET_REDUNDANCY: + case TEMPSENSORS_INLET_DIALYSATE: + case TEMPSENSORS_PRIMARY_HEATER_THERMO_COUPLE: + case TEMPSENSORS_TRIMMER_HEATER_THERMO_COUPLE: + case TEMPSENSORS_PRIMARY_HEATER_COLD_JUNCTION: + case TEMPSENSORS_TRIMMER_HEATER_COLD_JUNCTION: + temperature = getADC2TempConversion( avgADCReads, (U32)tempSensors [ sensorIndex ].gain,(U32)tempSensors [ sensorIndex ].refResistance, + (U32)tempSensors [ sensorIndex ].zeroDegreeResistance, tempSensors [ sensorIndex ].conversionCoef ); + break; + case TEMPSENSORS_FPGA_BOARD_SENSOR: + // Temperature(C) = ((ADC x 503.975) / 4096) - 273.15 + // The value of 503.975/4096 has been calculated and stored in the conversion coefficient variable of the structure + temperature = ( avgADCReads * tempSensors[ sensorIndex ].conversionCoef ) - CELSIUS_TO_KELVIN_CONVERSION; + break; + + case TEMPSENSORS_LOAD_CELL_A1_B1: + case TEMPSENSORS_LOAD_CELL_A2_B2: + case TEMPSENSORS_INTERNAL_THDO_RTD: + case TEMPSENSORS_INTERNAL_TDI_RTD: + case TEMPSENSORS_INTERNAL_CONDUCTIVITY: + // Temperature(C) = ((ADC - 0x800000)/13584) - 272.5 + // The value 1/13584 has been calculated and stored in the conversion coefficient variable of the structure + temperature = ( ( avgADCReads - ADC_BOARD_TEMP_SENSORS_CONST ) * tempSensors[ sensorIndex ].conversionCoef ) - + ADC_BOARD_TEMP_SENSORS_CONVERSION_CONST; + break; + + default: + // Wrong sensor was called, raise an alarm + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_TEMPERATURE_SENSOR_SELECTED, sensorIndex ); + break; + } + + // Update the temperature tempSensors[ sensorIndex ].temperatureValues.data = temperature; } /*********************************************************************//** * @brief - * The handleSelfTestStart function transitions the self-test state to check ADC. - * @details - * Inputs : tempSensorsSelfTestResult - * Outputs : none - * @return state (TEMPSENSORS_SELF_TEST_STATES_T) + * The handleSelfTestStart function transitions the self-test state to + * check ADC. + * @details Inputs: tempSensorsSelfTestResult + * @details Outputs: none + * @return the next state of state machine *************************************************************************/ static TEMPSENSORS_SELF_TEST_STATES_T handleSelfTestStart( void ) { @@ -616,17 +672,17 @@ * The handleSelfTestADCCheck function checks whether the ADC reads. If the * reads are above the maximum 24bit ADC count, it will throw an alarm and * switches to the next state. - * @details - * Inputs : TPi ADC reading from FPGA - * Outputs : none - * @return TEMPSENSORS_SELF_TEST_CONSISTENCY_CHECK (TEMPSENSORS_SELF_TEST_STATES_T) + * @details Inputs: tempSensorsSelfTestResult + * @details Outputs: tempSensorsSelfTestResult + * @return the next state of the state machine *************************************************************************/ static TEMPSENSORS_SELF_TEST_STATES_T handleSelfTestADCCheck( void ) { S32 const tpiADC = (S32)getFPGATPiTemp(); BOOL const isLessThanZero = tpiADC <= 0; BOOL const isGreaterThanFullScale = tpiADC >= TEMP_SENSORS_ADC_MAX_COUNT; + if ( isLessThanZero || isGreaterThanFullScale ) { tempSensorsSelfTestResult = SELF_TEST_STATUS_FAILED; @@ -640,10 +696,9 @@ * @brief * The handleSelfTestConsistencyCheck function checks the values of the * sensors to make sure they are within the allowed range from each other. - * @details - * Inputs : TPi and TPo ADC reading from FPGA - * Outputs : none - * @return TEMPSENSORS_SELF_TEST_COMPLETE (TEMPSENSORS_SELF_TEST_STATES_T) + * @details Inputs: tempSensors, tempSensorsSelfTestResult + * @details Outputs: tempSensorsSelfTestResult + * @return the next state of the state machine *************************************************************************/ static TEMPSENSORS_SELF_TEST_STATES_T handleSelfTestConsistencyCheck( void ) { @@ -662,6 +717,7 @@ tempSensors[ TEMPSENSORS_OUTLET_PRIMARY_HEATER ].conversionCoef ); F32 const tempDiff = fabs( tpiTemperature - tpoTemperature ); + if ( tempDiff > MAX_ALLOWED_TEMP_DELTA_BETWEEN_SENSORS ) { tempSensorsSelfTestResult = SELF_TEST_STATUS_FAILED; @@ -679,10 +735,9 @@ * @brief * The handleExecStart function waits for a period of time and switches to * the state that reads the ADC values from FPGA. - * @details - * Inputs : none - * Outputs : elapsedTime - * @return state (TEMPSENSORS_EXEC_STATES_T) + * @details Inputs: elapsedTime + * @details Outputs: elapsedTime + * @return the next state of the state machine *************************************************************************/ static TEMPSENSORS_EXEC_STATES_T handleExecStart( void ) { @@ -692,6 +747,7 @@ { elapsedTime = getMSTimerCount(); } + // A delay to let FPGA to boot up else if ( didTimeout( elapsedTime, ADC_FPGA_READ_DELAY ) ) { elapsedTime = 0; @@ -706,14 +762,13 @@ * The handleExecGetADCValues function reads the ADC values from FPGA and * at the specified time intervals and calls other functions to calculate * the internal temperature of the heaters. - * @details - * Inputs : none - * Outputs : internalHeatersConversionTimer, elapsedTime, temperatureValues - * @return state (TEMPSENSORS_EXEC_STATES_T) + * @details Inputs: internalHeatersConversionTimer + * @details Outputs: internalHeatersConversionTimer + * @return the next state of the state machine *************************************************************************/ static TEMPSENSORS_EXEC_STATES_T handleExecGetADCValues( void ) { - // Look at the error counter and the specific error flag to make sure the error is a temp sensor + // Look at the error counter and the specific error flag to make sure the error is a temperature sensor // Add a byte array to have bits for each sensor to find out exactly what sensor failed processTempSnsrsADCRead( TEMPSENSORS_INLET_PRIMARY_HEATER, getFPGATPiTemp(), getFPGARTDErrorCount(), getFPGARTDReadCount() ); processTempSnsrsADCRead( TEMPSENSORS_OUTLET_PRIMARY_HEATER, getFPGATPoTemp(), getFPGARTDErrorCount(), getFPGARTDReadCount() ); @@ -727,6 +782,14 @@ processHtrsTempSnsrsADCRead( TEMPSENSORS_PRIMARY_HEATER_COLD_JUNCTION, getFPGAPrimaryColdJunctionTemp(), getFPGATrimmerHeaterFlags(), getFPGAPrimaryHeaterReadCount() ); processHtrsTempSnsrsADCRead( TEMPSENSORS_TRIMMER_HEATER_COLD_JUNCTION, getFPGATrimmerColdJunctionTemp(), getFPGATrimmerHeaterFlags(), getFPGATrimmerHeaterReadCount() ); + // TODO check the error and count functions for each FPGA read + processTempSnsrsADCRead( TEMPSENSORS_FPGA_BOARD_SENSOR, getFPGABoardTemp(), 0, 0 ); + processTempSnsrsADCRead( TEMPSENSORS_LOAD_CELL_A1_B1, getFPGALoadCellsA1B1Temp(), 0, 0 ); + processTempSnsrsADCRead( TEMPSENSORS_LOAD_CELL_A2_B2, getFPGALoadCellsA2B2Temp(), 0, 0 ); + processTempSnsrsADCRead( TEMPSENSORS_INTERNAL_THDO_RTD, getFPGATHDoInternalTemp(), getFPGATHDoErrorCount(), getFPGATHDoReadCount() ); + processTempSnsrsADCRead( TEMPSENSORS_INTERNAL_TDI_RTD, getFPGATDiInternalTemp(), getFPGATDiErrorCount(), getFPGATDiReadCount() ); + processTempSnsrsADCRead( TEMPSENSORS_INTERNAL_CONDUCTIVITY, getFPGACondSnsrInternalTemp(), getFPGARTDErrorCount(), getFPGARTDReadCount() ); + // Check if time has elapsed to calculate the internal temperature of the heaters if ( ++internalHeatersConversionTimer >= HEATERS_INTERNAL_TEMPERTURE_CALCULATION_INTERVAL ) { @@ -744,10 +807,9 @@ * @brief * The getPublishTemperatureSensorsDataInterval function returns the data * publication interval either from the data or from the override. - * @details - * Inputs : tempSensorsPublishInterval - * Outputs : none - * @return result + * @details Inputs: tempSensorsPublishInterval + * @details Outputs: none + * @return data publish interval *************************************************************************/ static U32 getPublishTemperatureSensorsDataInterval( void ) { @@ -764,10 +826,9 @@ /*********************************************************************//** * @brief * The publishTemperatureSensorsData function broadcasts the temperature - * sensors data at the publication interval - * @details - * Inputs : dataPublicationTimerCounter, tempValuesForPublication - * Outputs : dataPublicationTimerCounter, tempValuesForPublication + * sensors data at the publication interval. + * @detailsInputs: dataPublicationTimerCounter, tempValuesForPublication + * @details Outputs: dataPublicationTimerCounter, tempValuesForPublication * @return none *************************************************************************/ static void publishTemperatureSensorsData( void ) @@ -776,10 +837,12 @@ { U32 i; + // Populate all the temperature values for ( i = 0; i < NUM_OF_TEMPERATURE_SENSORS; i++ ) { tempValuesForPublication[ i ] = getTemperatureValue ( i ); } + broadcastTemperatureSensorsData( (U08*)(&tempValuesForPublication), NUM_OF_TEMPERATURE_SENSORS * sizeof(F32) ); dataPublicationTimerCounter = 0; } @@ -795,12 +858,11 @@ * @brief * The testSetMeasuredTemperatureOverride function sets the override value * for a specific temperature sensor. - * @details - * Inputs : temperatureValues - * Outputs : temperatureValues + * @details Inputs: tempSensors + * @details Outputs: tempSensors * @param sensorIndex temperature sensor index - * @param temperature temperature value to override if testing activated - * @return result + * @param temperature temperature value to override if testing is activated + * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetMeasuredTemperatureOverride( U32 sensorIndex, F32 temperature ) { @@ -823,11 +885,10 @@ * @brief * The testSetMeasuredTemperatureOverride function resets the override value * of a specified temperature sensor. - * @details - * Inputs : temperatureValues - * Outputs : temperatureValues + * @details Inputs: tempSensors + * @details Outputs: tempSensors * @param sensorIndex temperature sensor index - * @return result + * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testResetMeasuredTemperatureOverride( U32 sensorIndex ) { @@ -850,11 +911,10 @@ * @brief * The testSetTemperatureSensorsPublishIntervalOverride function overrides * the temperature sensors publish data interval. - * @details - * Inputs : tempSensorsPublishInterval - * Outputs : tempSensorsPublishInterval - * @param value temperature sensor data broadcast interval (in ms) to override to - * @return result + * @details Inputs: tempSensorsPublishInterval + * @details Outputs: tempSensorsPublishInterval + * @param value sensors data broadcast interval (in ms) to override + * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testSetTemperatureSensorsPublishIntervalOverride( U32 value ) { @@ -876,10 +936,9 @@ * @brief * The testResetTemperatureSensorsPublishIntervalOverride function resets * the override value of temperature sensors publish data interval. - * @details - * Inputs : tempSensorsPublishInterval - * Outputs : tempSensorsPublishInterval - * @return result + * @details Inputs: tempSensorsPublishInterval + * @details Outputs: tempSensorsPublishInterval + * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testResetTemperatureSensorsPublishIntervalOverride( void ) { Index: firmware/App/Controllers/TemperatureSensors.h =================================================================== diff -u -r54f45c387430e440ab4607451fc84dea61f273f1 -r1510aec1871295f04541f1b932211d4ac621cc48 --- firmware/App/Controllers/TemperatureSensors.h (.../TemperatureSensors.h) (revision 54f45c387430e440ab4607451fc84dea61f273f1) +++ firmware/App/Controllers/TemperatureSensors.h (.../TemperatureSensors.h) (revision 1510aec1871295f04541f1b932211d4ac621cc48) @@ -45,6 +45,12 @@ TEMPSENSORS_TRIMMER_HEATER_COLD_JUNCTION, ///< Trimmer heater cold junction temperature sensor TEMPSENSORS_PRIMARY_HEATER_INTERNAL, ///< Primary heaters internal temperature TEMPSENSORS_TRIMMER_HEATER_INTERNAL, ///< Trimmer heater internal temperature + TEMPSENSORS_FPGA_BOARD_SENSOR, ///< FPGA board temperature sensor + TEMPSENSORS_LOAD_CELL_A1_B1, ///< Load cell A1/B1 temperature sensor + TEMPSENSORS_LOAD_CELL_A2_B2, ///< Load cell A2/B2 temperature sensor + TEMPSENSORS_INTERNAL_THDO_RTD, ///< THDo RTD internal temperature sensor + TEMPSENSORS_INTERNAL_TDI_RTD, ///< TDi RTD internal temperature sensor + TEMPSENSORS_INTERNAL_CONDUCTIVITY, ///< Conductivity sensor temperature sensor NUM_OF_TEMPERATURE_SENSORS ///< Number of temperature sensors } TEMPERATURE_SENSORS_T; Index: firmware/App/Controllers/Thermistors.c =================================================================== diff -u -rf9b3862d01ce6c64bd05b8649e69b44fa155b8e0 -r1510aec1871295f04541f1b932211d4ac621cc48 --- firmware/App/Controllers/Thermistors.c (.../Thermistors.c) (revision f9b3862d01ce6c64bd05b8649e69b44fa155b8e0) +++ firmware/App/Controllers/Thermistors.c (.../Thermistors.c) (revision 1510aec1871295f04541f1b932211d4ac621cc48) @@ -16,16 +16,16 @@ #define THERMISTORS_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Thermistors publish data time interval. #define THERMISTORS_ADC_READ_INTERVAL ( MS_PER_SECOND / ( 2 * TASK_GENERAL_INTERVAL ) ) ///< Thermistors ADC read time interval. -#define ADC_FPGA_READ_DELAY_COUNT 1.0 ///< FGPA read delay upon startup. -#define ONBOARD_THERMISTOR_SOURCE_VOLTAGE 3.0 ///< Onboard thermistor source voltage. -#define ONBOARD_THERMISTOR_REFERENCE_RESISTOR 10000.0 ///< Onboard thermistor reference resistor. -#define ONBOARD_THERMISTOR_BETA_VALUE 3380.0 ///< Onboard thermistor beta value. -#define ONBOARD_THERMISTOR_REFERENCE_TEMPERATURE 298.0 ///< Onboard thermistor reference temperature. +#define ADC_FPGA_READ_DELAY_COUNT 1.0 ///< FGPA read delay upon startup. #define TWELVE_BIT_RESOLUTION 4096.0 ///< 12 bit resolution conversion. +#define THERMISTOR_REFERENCE_VOLTAGE 3.0 ///< Thermistors source voltage. +#define THERMISTOR_REFERENCE_RESISTOR_AT_25 10000.0 ///< Thermistors reference resistor in ohms. +#define THERMISTOR_REFERENCE_TEMPERATURE 298.0 ///< Thermistors reference temperature in kelvin. +#define ONBOARD_THERMISTOR_BETA_VALUE 3380.0 ///< Onboard thermistor beta value. +#define POWER_SUPPLY_THERMISTOR_BETA_VALUE 3345.0 ///< Power supply beta value. #define CELSIUS_TO_KELVIN_CONVERSION 273.15 ///< Celsius to Kelvin temperature conversion. -#define ADC_TEMP_SENSORS_CONVERSION_CONST 272.5 ///< ADC temperature sensors conversion constant. -#define MIN_ALLOWED_TEMPERATURE 0 ///< Thermistors/sensors minimum allowed temperature reading. -#define MAX_ALLOWED_TEMPERATURE 70 ///< Thermistors/sensors maximum allowed temperature reading. +#define MIN_ALLOWED_TEMPERATURE 5.0 ///< Thermistors/sensors minimum allowed temperature reading. +#define MAX_ALLOWED_TEMPERATURE 70.0 ///< Thermistors/sensors maximum allowed temperature reading. #define MAX_ALLOWED_TEMP_OUT_OF_RANGE_COUNT ( MS_PER_SECOND / ( 4 * TASK_GENERAL_INTERVAL ) ) ///< Thermistors/sensors maximum allowed temperature out of range count. /// Thermistors self test states @@ -61,12 +61,9 @@ static U32 dataPublishCounter; ///< Thermistors data publish timer counter static U32 adcReadCounter; ///< Thermistors ADC read counter -static const F32 fpgaBoardTempSensorConvCoeff = 503.975 / TWELVE_BIT_RESOLUTION; ///< FPGA board temperature sensor conversion coefficient -static const F32 adcTempSensorsConversionCoeff1 = 1.0 / 13584.0; ///< ADC temperature sensors conversion coefficient 1 -static const F32 adcTempSensorsConversionCoeff2 = 0x800000 / 13584; ///< ADC temperature sensors conversion coefficient 2 -static const F32 onBoardThermistorVoltageConvCoeff = ONBOARD_THERMISTOR_SOURCE_VOLTAGE / TWELVE_BIT_RESOLUTION; ///< On board thermistor ADC to voltage conversion coefficient -static const F32 onBoardThermistorBetaValueInv = 1 / ONBOARD_THERMISTOR_BETA_VALUE; ///< On board thermistor beta value inverse -static const F32 onBoardThermistorRefTempInv = 1 / ONBOARD_THERMISTOR_REFERENCE_TEMPERATURE; ///< On board thermistor reference inverse +static const F32 thermistorVoltageConvCoeff = THERMISTOR_REFERENCE_VOLTAGE + / TWELVE_BIT_RESOLUTION; ///< On board thermistor ADC to voltage conversion coefficient +static const F32 onBoardThermistorRefTempInv = 1 / THERMISTOR_REFERENCE_TEMPERATURE; ///< On board thermistor reference inverse // ********** private function prototypes ********** @@ -77,7 +74,7 @@ static void monitorThermistors( void ); static void convertADCtoTemperature( void ); -static F32 calculateOnBoardThemristorTemperature( U32 adcValue ); +static F32 calculateTemperature( U32 adcValue, F32 betaValue ); static void publishThermistorsData( void ); static U32 getPublishThermistorsDataInterval( void ); @@ -221,12 +218,6 @@ // Get all the raw readings in ADC thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].rawADCRead = getIntADCReading( INT_ADC_BOARD_THERMISTOR ); - thermistorsStatus[ TEMPSENSOR_FPGA_SENSOR ].rawADCRead = getFPGABoardTemp(); - thermistorsStatus[ TEMPSENSOR_LOAD_CELL_A1_B1 ].rawADCRead = getFPGALoadCellsA1B1Temp(); - thermistorsStatus[ TEMPSENSOR_LOAD_CELL_A2_B2 ].rawADCRead = getFPGALoadCellsA2B2Temp(); - thermistorsStatus[ TEMPSENSOR_INTERNAL_THDO_RTD ].rawADCRead = getFPGATHDoInternalTemp(); - thermistorsStatus[ TEMPSENSOR_INTERNAL_TDI_RTD ].rawADCRead = getFPGATDiInternalTemp(); - thermistorsStatus[ TEMPSENSOR_INTERNAL_CONDUCTIVITY ].rawADCRead = getFPGAConductivitySnsrInternalTemp(); thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].rawADCRead = getIntADCReading( INT_ADC_POWER_SUPPLY_1_THERMISTOR ); thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].rawADCRead = getIntADCReading( INT_ADC_POWER_SUPPLY_2_THERMISTOR ); @@ -291,15 +282,9 @@ if ( ++adcReadCounter >= THERMISTORS_ADC_READ_INTERVAL ) { // Get all the raw readings in ADC - thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].rawADCRead = getIntADCReading( INT_ADC_BOARD_THERMISTOR ); - thermistorsStatus[ TEMPSENSOR_FPGA_SENSOR ].rawADCRead = getFPGABoardTemp(); - thermistorsStatus[ TEMPSENSOR_LOAD_CELL_A1_B1 ].rawADCRead = getFPGALoadCellsA1B1Temp(); - thermistorsStatus[ TEMPSENSOR_LOAD_CELL_A2_B2 ].rawADCRead = getFPGALoadCellsA2B2Temp(); - thermistorsStatus[ TEMPSENSOR_INTERNAL_THDO_RTD ].rawADCRead = getFPGATHDoInternalTemp(); - thermistorsStatus[ TEMPSENSOR_INTERNAL_TDI_RTD ].rawADCRead = getFPGATDiInternalTemp(); - thermistorsStatus[ TEMPSENSOR_INTERNAL_CONDUCTIVITY ].rawADCRead = getFPGAConductivitySnsrInternalTemp(); - thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].rawADCRead = getIntADCReading( INT_ADC_POWER_SUPPLY_1_THERMISTOR ); - thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].rawADCRead = getIntADCReading( INT_ADC_POWER_SUPPLY_2_THERMISTOR ); + thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].rawADCRead = getIntADCReading( INT_ADC_BOARD_THERMISTOR ); + thermistorsStatus[ THERMISTOR_POWER_SUPPLY_1 ].rawADCRead = getIntADCReading( INT_ADC_POWER_SUPPLY_1_THERMISTOR ); + thermistorsStatus[ THERMISTOR_POWER_SUPPLY_2 ].rawADCRead = getIntADCReading( INT_ADC_POWER_SUPPLY_2_THERMISTOR ); // Zero the counter for the next round of reading adcReadCounter = 0; @@ -374,26 +359,13 @@ switch ( thermistor ) { case THERMISTOR_ONBOARD_NTC: - temperature = calculateOnBoardThemristorTemperature( rawADC ); + temperature = calculateTemperature( rawADC, ONBOARD_THERMISTOR_BETA_VALUE ); thermistorsStatus[ THERMISTOR_ONBOARD_NTC ].temperatureValue.data = temperature; break; - case TEMPSENSOR_FPGA_SENSOR: - // Temperature(C) = ((ADC x 503.975) / 4096) - 273.15 - // The value of 503.975/4096 was done in a const variable to prevent the division all the time - temperature = ( rawADC * fpgaBoardTempSensorConvCoeff ) - CELSIUS_TO_KELVIN_CONVERSION; - thermistorsStatus[ TEMPSENSOR_FPGA_SENSOR ].temperatureValue.data = temperature; - break; - - // All these sensors have the same conversion procedure - case TEMPSENSOR_LOAD_CELL_A1_B1: - case TEMPSENSOR_LOAD_CELL_A2_B2: - case TEMPSENSOR_INTERNAL_THDO_RTD: - case TEMPSENSOR_INTERNAL_TDI_RTD: - case TEMPSENSOR_INTERNAL_CONDUCTIVITY: - // Temperature(C) = ((ADC - 0x800000)/13584) - 272.5 - // The values for 1/0x800000 and 0x800000/13584 were done in a const variable to prevent the division all the time - temperature = ( ( rawADC * adcTempSensorsConversionCoeff1 ) - adcTempSensorsConversionCoeff2 ) - ADC_TEMP_SENSORS_CONVERSION_CONST; + case THERMISTOR_POWER_SUPPLY_1: + case THERMISTOR_POWER_SUPPLY_2: + temperature = calculateTemperature( rawADC, POWER_SUPPLY_THERMISTOR_BETA_VALUE ); thermistorsStatus[ thermistor ].temperatureValue.data = temperature; break; @@ -413,27 +385,28 @@ * onBoardThermistorBetaValueInv * @details Outputs: none * @param ADC value to be converted into temperature in C + * @param beta value which is used to calculate temperature from ADC * @return calculated temperature in C *************************************************************************/ -static F32 calculateOnBoardThemristorTemperature( U32 adcValue ) +static F32 calculateTemperature( U32 adcValue, F32 betaValue ) { /* * voltage = ADC x 3 / 2^12 * voltage = 3 x 10 / ( 10 + R(T) ) - * R(T) = 10000 x e^(3380 x (1/T - 1/298)) + * R(T) = 10000 x e^(beta x (1/T - 1/298)) * Solve for T which is temperature in Kelvin */ // Voltage = ADC x 3 / 2^12 for 12 bits resolution and a 3V ADC // The value of 3 / 2^12 has been calculated in a const to prevent the division again - F32 const thermistorVoltage = adcValue * onBoardThermistorVoltageConvCoeff; + F32 const thermistorVoltage = adcValue * thermistorVoltageConvCoeff; // Calculate the thermistor resistor by solving: thermistorVoltage = (3 x 10) / (10 + R(T)) - F32 const thermistorResistor = ( ( ONBOARD_THERMISTOR_REFERENCE_RESISTOR * ONBOARD_THERMISTOR_SOURCE_VOLTAGE ) - - ( ONBOARD_THERMISTOR_REFERENCE_RESISTOR * thermistorVoltage ) ) / thermistorVoltage; + F32 const thermistorResistor = ( ( THERMISTOR_REFERENCE_RESISTOR_AT_25 * THERMISTOR_REFERENCE_VOLTAGE ) - + ( THERMISTOR_REFERENCE_RESISTOR_AT_25 * thermistorVoltage ) ) / thermistorVoltage; // 1/T = Ln(thermistorResistor/10000)/3380 + 1/298 - F32 const invTemperature = ( logf( thermistorResistor / ONBOARD_THERMISTOR_REFERENCE_RESISTOR ) / ONBOARD_THERMISTOR_BETA_VALUE ) + + F32 const invTemperature = ( logf( thermistorResistor / THERMISTOR_REFERENCE_RESISTOR_AT_25 ) / betaValue ) + onBoardThermistorRefTempInv; // Inverse the value to get the temperature in Kelvin and then convert it to Celsius @@ -478,12 +451,6 @@ // Get all the sensors/thermistors temperature values for publication sensorsData.onboardThermistor = getThermistorTemperatureValue( THERMISTOR_ONBOARD_NTC ); - sensorsData.fpgaBoardTempSensor = getThermistorTemperatureValue( TEMPSENSOR_FPGA_SENSOR ); - sensorsData.loadCellA1TempSensor = getThermistorTemperatureValue( TEMPSENSOR_LOAD_CELL_A1_B1 ); - sensorsData.loadCellA2TempSensor = getThermistorTemperatureValue( TEMPSENSOR_LOAD_CELL_A2_B2 ); - sensorsData.rtdInternalTempSensor = getThermistorTemperatureValue( TEMPSENSOR_INTERNAL_THDO_RTD ); - sensorsData.rtdTDiInternalTempSensor = getThermistorTemperatureValue( TEMPSENSOR_INTERNAL_TDI_RTD ); - sensorsData.conductivityTempSensor = getThermistorTemperatureValue( TEMPSENSOR_INTERNAL_CONDUCTIVITY ); sensorsData.powerSupply1Thermistor = getThermistorTemperatureValue( THERMISTOR_POWER_SUPPLY_1 ); sensorsData.powerSupply2Thermistor = getThermistorTemperatureValue( THERMISTOR_POWER_SUPPLY_2 ); Index: firmware/App/Controllers/Thermistors.h =================================================================== diff -u -r62a4d7b976107f7ac4d5013ce06f38f4a0bf65bd -r1510aec1871295f04541f1b932211d4ac621cc48 --- firmware/App/Controllers/Thermistors.h (.../Thermistors.h) (revision 62a4d7b976107f7ac4d5013ce06f38f4a0bf65bd) +++ firmware/App/Controllers/Thermistors.h (.../Thermistors.h) (revision 1510aec1871295f04541f1b932211d4ac621cc48) @@ -8,6 +8,9 @@ /** * @defgroup Thermistors Thermistors * @brief Thermistors driver module. Reads and processes the thermistors. + * Onboard thermistor manufacturer: Murata Manufacturing, PN: NCP14XH103J03RC + * Power supply thermistors manufacturer: Murata Manufacturing, PN: NCP18XH103F03RB or + * Epcos Manufacturing, PN: B57330V2103F260 * * @addtogroup Thermistors * @{ @@ -20,12 +23,6 @@ typedef enum thermistors_Name { THERMISTOR_ONBOARD_NTC = 0, ///< Onboard thermistor - TEMPSENSOR_FPGA_SENSOR, ///< FPGA board temperature sensor - TEMPSENSOR_LOAD_CELL_A1_B1, ///< Load cell A1/B1 temperature sensor - TEMPSENSOR_LOAD_CELL_A2_B2, ///< Load cell A2/B2 temperature sensor - TEMPSENSOR_INTERNAL_THDO_RTD, ///< THDo RTD internal temperature sensor - TEMPSENSOR_INTERNAL_TDI_RTD, ///< TDi RTD internal temperature sensor - TEMPSENSOR_INTERNAL_CONDUCTIVITY, ///< Conductivity sensor temperature sensor THERMISTOR_POWER_SUPPLY_1, ///< DG power supply 1 thermistor THERMISTOR_POWER_SUPPLY_2, ///< DG power supply 2 thermistor NUM_OF_THERMISTORS, ///< Number of thermistors @@ -35,12 +32,6 @@ typedef struct { F32 onboardThermistor; ///< Onboard thermistor data - F32 fpgaBoardTempSensor; ///< FPGA board temperature sensor data - F32 loadCellA1TempSensor; ///< Load cell A1 temperature sensor - F32 loadCellA2TempSensor; ///< Load cell A2 temperature sensor - F32 rtdInternalTempSensor; ///< RTD internal temperature sensor - F32 rtdTDiInternalTempSensor; ///< RTD TDi internal temperature sensor - F32 conductivityTempSensor; ///< Conductivity temperature sensor F32 powerSupply1Thermistor; ///< Power supply 1 thermistor F32 powerSupply2Thermistor; ///< Power supply 2 thermistor } THERMISTORS_DATA_T; Index: firmware/App/Services/AlarmMgmt.h =================================================================== diff -u -rf9b3862d01ce6c64bd05b8649e69b44fa155b8e0 -r1510aec1871295f04541f1b932211d4ac621cc48 --- firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision f9b3862d01ce6c64bd05b8649e69b44fa155b8e0) +++ firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 1510aec1871295f04541f1b932211d4ac621cc48) @@ -158,6 +158,7 @@ SW_FAULT_ID_UV_REACTORS_INVALID_REACTOR_SELECTD, SW_FAULT_ID_RO_PUMP_INVALID_PRESSURE_SELECTED, SW_FAULT_ID_DRAIN_PUMP_INVALID_DELTA_PRESSURE_SELECTED, + SW_FAULT_ID_INVALID_TEMPERATURE_SENSOR_SELECTED, NUM_OF_SW_FAULT_IDS } SW_FAULT_ID_T; Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r62a4d7b976107f7ac4d5013ce06f38f4a0bf65bd -r1510aec1871295f04541f1b932211d4ac621cc48 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 62a4d7b976107f7ac4d5013ce06f38f4a0bf65bd) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 1510aec1871295f04541f1b932211d4ac621cc48) @@ -1649,7 +1649,7 @@ * @details Outputs: none * @return conductivity sensor temperature reading in ADC counts *************************************************************************/ -U32 getFPGAConductivitySnsrInternalTemp( void ) +U32 getFPGACondSnsrInternalTemp( void ) { return fpgaSensorReadings.fpgaRTDTemp; } Index: firmware/App/Services/FPGA.h =================================================================== diff -u -r62a4d7b976107f7ac4d5013ce06f38f4a0bf65bd -r1510aec1871295f04541f1b932211d4ac621cc48 --- firmware/App/Services/FPGA.h (.../FPGA.h) (revision 62a4d7b976107f7ac4d5013ce06f38f4a0bf65bd) +++ firmware/App/Services/FPGA.h (.../FPGA.h) (revision 1510aec1871295f04541f1b932211d4ac621cc48) @@ -112,7 +112,7 @@ U32 getFPGALoadCellsA2B2Temp( void ); U32 getFPGATHDoInternalTemp( void ); U32 getFPGATDiInternalTemp( void ); -U32 getFPGAConductivitySnsrInternalTemp( void ); +U32 getFPGACondSnsrInternalTemp( void ); /**@}*/