Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -rbd9f7ebe27d5fbdc893d04c9925f1990e873edfa -r752defbb739ea0756a8bf060f00bc6b9429c2764 --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision bd9f7ebe27d5fbdc893d04c9925f1990e873edfa) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 752defbb739ea0756a8bf060f00bc6b9429c2764) @@ -66,8 +66,6 @@ #define RO_FLOW_ADC_TO_LPM_FACTOR 300 ///< Conversion factor from ADC counts to LPM (liters/min) for RO flow rate (multiply this by inverse of FPGA reading). -#define RO_FLOW_ADC_TO_LPM_FACTOR_TEMP_REMOVE 5555 //TODo remove - #define ROP_FLOW_TO_PWM_SLOPE 0.1 ///< Slope of flow to PWM line equation. #define ROP_FLOW_TO_PWM_INTERCEPT 0.0 ///< Intercept of flow to PWM line equation. @@ -136,12 +134,6 @@ static U32 flowFilterCounter = 0; ///< Flow filtering counter. static DG_FLOW_SENSORS_CAL_RECORD_T flowSensorsCalRecord; ///< Flow sensors calibration record. -// TODO remove -static S32 temporaryFlowVariableRemove; -static F32 temporaryFlowValueRemove; - -// TODO remove - // ********** private function prototypes ********** static RO_PUMP_STATE_T handleROPumpOffState( void ); @@ -198,10 +190,6 @@ roPumpState = RO_PUMP_OFF_STATE; roPumpControlMode = NUM_OF_PUMP_CONTROL_MODES; isROPumpOn = FALSE; - - - temporaryFlowVariableRemove = 0; - temporaryFlowValueRemove = 0.0; } /*********************************************************************//** @@ -339,11 +327,6 @@ // Update sum for flow average calculation measuredFlowReadingsSum += (S32)roFlowReading; - // TODO remove this code - U16 tempROFlowRemove = getFPGAFMPTemporaryFlow(); - temporaryFlowVariableRemove += (S32)tempROFlowRemove; - // TODO remove this code - // Read the pressure at the sensor. The pump cannot be more that the maximum allowed pressure // to make sure the hardware (especially the ROF) is not damaged. If it is the case, we need to stop immediately F32 actualPressure = getMeasuredDGPressure( PRESSURE_SENSOR_RO_PUMP_OUTLET ); @@ -377,25 +360,6 @@ measuredFlowReadingsSum = 0; flowFilterCounter = 0; - - // TODO remove this code after testing - F32 flowTemp = RO_FLOW_ADC_TO_LPM_FACTOR_TEMP_REMOVE / ( (F32)temporaryFlowVariableRemove * FLOW_AVERAGE_MULTIPLIER ); - - temporaryFlowValueRemove = pow(flowTemp, 4) * flowSensorsCalRecord.flowSensors[ CAL_DATA_RO_PUMP_FLOW_SENSOR ].fourthOrderCoeff + - pow(flowTemp, 3) * flowSensorsCalRecord.flowSensors[ CAL_DATA_RO_PUMP_FLOW_SENSOR ].thirdOrderCoeff + - pow(flowTemp, 2) * flowSensorsCalRecord.flowSensors[ CAL_DATA_RO_PUMP_FLOW_SENSOR ].secondOrderCoeff + - flowTemp * flowSensorsCalRecord.flowSensors[ CAL_DATA_RO_PUMP_FLOW_SENSOR ].gain + - flowSensorsCalRecord.flowSensors[ CAL_DATA_RO_PUMP_FLOW_SENSOR ].offset; - - // If the flow is less than a certain value, FPGA will return 0xFFFF meaning that - // the flow is 0. - if ( FLOW_SENSOR_ZERO_READING == tempROFlowRemove ) - { - temporaryFlowValueRemove = 0.0; - } - - temporaryFlowVariableRemove = 0; - // TODO remove this code after testing } #ifndef IGNORE_RO_PUMP_MONITOR @@ -870,8 +834,6 @@ pumpData.roPumpDutyCycle = roPumpDutyCyclePctSet * FRACTION_TO_PERCENT_FACTOR; pumpData.roPumpState = (U32)roPumpState; - pumpData.roPumpTemporaryFlowRateRemove = temporaryFlowValueRemove; - broadcastROPumpData( &pumpData ); roPumpDataPublicationTimerCounter = 0; }