Index: firmware/App/Drivers/ConductivitySensors.c =================================================================== diff -u -r44d7a987b5c6b91396ddb2cc8163b36c21f59bde -r14277e7c55fbb8407612572aca191ffae0835796 --- firmware/App/Drivers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 44d7a987b5c6b91396ddb2cc8163b36c21f59bde) +++ firmware/App/Drivers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 14277e7c55fbb8407612572aca191ffae0835796) @@ -126,7 +126,6 @@ static U32 getTemperatureSensorErrorCount( CONDUCTIVITY_SENSORS_T sensor ); static BOOL monitorCalDataReads( CONDUCTIVITY_SENSORS_T sensorId ); static BOOL checkConductivityCoefficientRanges( CONDUCTIVITY_SENSORS_T sensorId ); -static void calculateConductivityUpdatedStandard( CONDUCTIVITY_SENSORS_T sensorNum, BOOL isFPSensor ); static void calculateConductivityUpdatedStandardTempCompensated( CONDUCTIVITY_SENSORS_T sensorNum, BOOL isFPSensor ); static void calculateTemperature( CONDUCTIVITY_SENSORS_T sensorNum ); static void calculateResistance( CONDUCTIVITY_SENSORS_T sensorNum, BOOL isFPSensor ); @@ -558,7 +557,6 @@ { isFPSensor = TRUE; } - calculateConductivityUpdatedStandard( sensor, isFPSensor ); calculateConductivityUpdatedStandardTempCompensated( sensor, isFPSensor ); } @@ -1004,40 +1002,6 @@ /*********************************************************************//** * @brief - * The calculateConductivityUpdatedStandard function calculates the conductivity value. - * @details \b Inputs: conductivitySensorCoefficients - Conductivity Coefficients - * @details \b Inputs: conductivitySensorStatus - Raw measurement values - * @details \b Outputs: conductivitySensorStatus - calculated conductivity value - * @param sensorNum - Conductivity sensor index value. - * @param isFPSensor - T/F if sensor is on FP hardware. - * @return - *************************************************************************/ -static void calculateConductivityUpdatedStandard( CONDUCTIVITY_SENSORS_T sensorNum, BOOL isFPSensor ) -{ - F64 calculatedConductivity = 0.0; - F64 alpha = 0.0; - F64 k = 0.0; - - if ( TRUE == isFPSensor ) - { - alpha = conductivitySensorCoefficients[ sensorNum ].alpha_low; - k = conductivitySensorCoefficients[ sensorNum ].K_low; - } - else - { - alpha = conductivitySensorCoefficients[ sensorNum ].alpha_high; - k = conductivitySensorCoefficients[ sensorNum ].K_high; - } - calculateResistance( sensorNum, isFPSensor ); - calculateTemperature( sensorNum ); - - calculatedConductivity = ( ( k / conductivitySensorStatus[ sensorNum ].calculatedResistance ) * - ( 1 + ( alpha * ( COND_TEMP_OFFSET - conductivitySensorStatus[ sensorNum ].calculatedTemperature ) ) ) ); - currentConductivityReadings[ sensorNum ].data = calculatedConductivity * SIEMENS_TO_MICROSIEMENS_CONVERSION; -} - -/*********************************************************************//** - * @brief * The calculateConductivityUpdatedStandardTempCompensated function calculates the conductivity value with temperature compensation. * @details \b Inputs: conductivitySensorCoefficients - Conductivity Coefficients * @details \b Inputs: conductivitySensorStatus - Raw measurement values Index: firmware/App/Monitors/Conductivity.c =================================================================== diff -u -rb9d148dce4c70d0dca63f34fce73c22a7bfd4fbc -r14277e7c55fbb8407612572aca191ffae0835796 --- firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision b9d148dce4c70d0dca63f34fce73c22a7bfd4fbc) +++ firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision 14277e7c55fbb8407612572aca191ffae0835796) @@ -69,8 +69,6 @@ static U08 condPrevReadCount[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Previous read count for conductivity per sensor static U08 condTempPrevReadCount[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Previous read count for temperature per sensor. static FILTER_CONDUCTIVITY_READINGS_T filteredConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Filtered conductivity reading for conductivity sensors. -static FILTER_CONDUCTIVITY_READINGS_T filteredUConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; -static OVERRIDE_F32_T filteredcurrentUConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; static OVERRIDE_F32_T filteredcurrentConductivityReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< filtered current conductivity sensor conductivity readings (overrideable). static FILTER_CONDUCTIVITY_TEMPERATURE_READINGS_T filteredConductivityTemperatureReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< Filtered temperature reading for conductivity sensors. static OVERRIDE_F32_T filteredcurrentTemperatureReadings[ NUM_OF_CONDUCTIVITY_SENSORS ]; ///< filtered current conductivity sensor temperature readings (overrideable). @@ -89,8 +87,6 @@ static U32 roRRCount; ///< RO rejection ratio Number of samples in average buffer. static F32 roRRTankFillAvg; ///< Average RO rejection ratio during permeate tank fill state. static U32 roRRSampleIntervalCounter; ///< RO rejection ratio sample collection timer counter. -static U32 conductivityResistancePublishTimerCounter; ///< DD and FP Conductivity data publication counter. -static OVERRIDE_U32_T conductivityResistanceDataPublishInterval; ///< DD and FP Conductivity sensors publish time interval override. // ********** private function prototypes ********** @@ -100,7 +96,6 @@ static void filterConductivitySensorTemperatureReadings( void ); static void calcRORejectionRatio( void ); static void filterRORejectionRatioReadings( void ); -static void broadcastResistanceData( void ); /*********************************************************************//** * @brief @@ -119,7 +114,6 @@ ddConductivityPublishTimerCounter = DD_CONDUCTIVITY_DATA_PUBLISH_COUNTER_START_COUNT; fpConductivityPublishTimerCounter = FP_CONDUCTIVITY_DATA_PUBLISH_COUNTER_START_COUNT; roRRPublishTimerCounter = RO_DATA_PUBLISH_COUNTER_START_COUNT; - conductivityResistancePublishTimerCounter = RESISTANCE_DATA_PUBLISH_COUNTER_START_COUNT; roRejectionRatio = 0.0F; roRejectionRatioTankFill = 0.0F; roRRRunningSum = 0.0F; @@ -137,15 +131,7 @@ // Initialize override structures for each conductivity sensor for ( sensor = FIRST_DD_COND_SENSOR; sensor < NUM_OF_CONDUCTIVITY_SENSORS; sensor++ ) { - filteredcurrentUConductivityReadings[ sensor ].data = 0.0F; - filteredcurrentUConductivityReadings[ sensor ].ovData = 0.0F; - filteredcurrentUConductivityReadings[ sensor ].ovInitData = 0.0F; - filteredcurrentUConductivityReadings[ sensor ].override = OVERRIDE_RESET; - filteredUConductivityReadings[ sensor ].conductivityReadingsIdx = 0; - filteredUConductivityReadings[ sensor ].conductivityReadingsTotal = 0.0F; - filteredUConductivityReadings[ sensor ].conductivityReadingsCount = 0; - filteredcurrentConductivityReadings[ sensor ].data = 0.0F; filteredcurrentConductivityReadings[ sensor ].ovData = 0.0F; filteredcurrentConductivityReadings[ sensor ].ovInitData = 0.0F; @@ -183,11 +169,6 @@ roRRDataPublishInterval.ovInitData = 0; roRRDataPublishInterval.override = OVERRIDE_RESET; - conductivityResistanceDataPublishInterval.data = COND_SENSOR_REPORT_PERIOD; - conductivityResistanceDataPublishInterval.ovData = COND_SENSOR_REPORT_PERIOD; - conductivityResistanceDataPublishInterval.ovInitData = 0; - conductivityResistanceDataPublishInterval.override = OVERRIDE_RESET; - } /*********************************************************************//** @@ -294,7 +275,6 @@ if ( condPrevReadCount[ sensor ] != getConductivityReadCount( sensor ) ) { calculatedConductivity = getConductivity( sensor ); - uncompenstatedConductivity = getUncompensatedConductivity( sensor ); condPrevReadCount[ sensor ] = getConductivityReadCount( sensor ); freshData = TRUE; } @@ -315,16 +295,6 @@ filteredConductivityReadings[ sensor ].conductivityReadingsCount = INC_CAP( filteredConductivityReadings[ sensor ].conductivityReadingsCount, SIZE_OF_COND_ROLLING_AVG ); filteredcurrentConductivityReadings[ sensor ].data = filteredConductivityReadings[ sensor ].conductivityReadingsTotal / (F32)filteredConductivityReadings[ sensor ].conductivityReadingsCount; - if ( filteredUConductivityReadings[ sensor ].conductivityReadingsCount >= SIZE_OF_COND_ROLLING_AVG ) - { - filteredUConductivityReadings[ sensor ].conductivityReadingsTotal -= filteredUConductivityReadings[ sensor ].conductivityReadings[ filteredUConductivityReadings[ sensor ].conductivityReadingsIdx ]; - } - filteredUConductivityReadings[ sensor ].conductivityReadings[ filteredUConductivityReadings[ sensor ].conductivityReadingsIdx ] = uncompenstatedConductivity; - filteredUConductivityReadings[ sensor ].conductivityReadingsTotal += uncompenstatedConductivity; - filteredUConductivityReadings[ sensor ].conductivityReadingsIdx = INC_WRAP( filteredUConductivityReadings[ sensor ].conductivityReadingsIdx, 0, SIZE_OF_COND_ROLLING_AVG - 1 ); - filteredUConductivityReadings[ sensor ].conductivityReadingsCount = INC_CAP( filteredUConductivityReadings[ sensor ].conductivityReadingsCount, SIZE_OF_COND_ROLLING_AVG ); - filteredcurrentUConductivityReadings[ sensor ].data = filteredUConductivityReadings[ sensor ].conductivityReadingsTotal / (F32)filteredUConductivityReadings[ sensor ].conductivityReadingsCount; - } } }