Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -rd325999b7b3ea03b7e294cb8a0b97df93812fbe9 -re2406180bf569fb495b709542c12da099c8e23ea --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision d325999b7b3ea03b7e294cb8a0b97df93812fbe9) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision e2406180bf569fb495b709542c12da099c8e23ea) @@ -51,7 +51,7 @@ #define DRAIN_PUMP_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Interval (ms/task time) at which the Drain Pump data is published on the CAN bus. #define DRP_CONTROL_INTERVAL ( 1000 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the Drain pump is controlled. -#define DRP_CONTROL_MAX_ALLOWED_PPO_PSI 30.0F ///< Drain pump maximum allowed PPo pressure in psi. +#define DRP_CONTROL_MAX_ALLOWED_PPO_PSI CLEANING_MODE_HIGH_TEMP_MAX_RO_PRESSURE_PSI ///< Drain pump maximum allowed PPo pressure in psi. #define DRP_CONTROL_MAX_ALLOWED_PDR_PSI 40.0F ///< Drain pump maximum allowed PDr pressure in psi. #define DRP_CONTROL_PSI_TO_DAC_P_ONLY_TERM 0.2F ///< Drain pump psi to DAC conversion. #define DRP_CONTROL_FLOW_TO_DAC_P_ONLY_TERM 100.0F ///< Drain pump flow (L/min) to DAC conversion. @@ -715,10 +715,11 @@ if ( TRUE == isDrainPumpControlInFlowMode ) { - F32 dac = runPIController( PI_CONTROLLER_ID_DRAIN_PUMP, targetROFlowLPM, msrdROFlowLPM ); + F32 dac = runPIController( PI_CONTROLLER_ID_DRAIN_PUMP, targetROFlowLPM, msrdROFlowLPM ); + drainPumpDACSet = (U32)( dac + FLOAT_TO_INT_ROUNDUP_OFFSET ); - if ( ( drainPumpOutletPressurePSI > DRP_CONTROL_MAX_ALLOWED_PDR_PSI ) || ( roPumpOutletPressurePSI > DRP_CONTROL_MAX_ALLOWED_PPO_PSI ) ) + if ( ( drainPumpOutletPressurePSI > DRP_CONTROL_MAX_ALLOWED_PDR_PSI ) || ( roPumpOutletPressurePSI > (F32)DRP_CONTROL_MAX_ALLOWED_PPO_PSI ) ) { // If either of the pressure sensors are above range, transition to control to pressure isDrainPumpControlInFlowMode = FALSE; @@ -736,7 +737,7 @@ // Get the status of the current pressure readings with respect to their maximum pressures // Get the maximum of the pressure difference of PPo and PDr F32 pdrSubPSI = drainPumpOutletPressurePSI - DRP_CONTROL_MAX_ALLOWED_PDR_PSI; - F32 ppoSubPSI = roPumpOutletPressurePSI - DRP_CONTROL_MAX_ALLOWED_PPO_PSI; + F32 ppoSubPSI = roPumpOutletPressurePSI - (F32)DRP_CONTROL_MAX_ALLOWED_PPO_PSI; F32 maxPresPSI = MAX( pdrSubPSI, ppoSubPSI ); if ( ( pdrSubPSI > 0.0F ) || ( ppoSubPSI > 0.0F ) ) Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -rff9e67dd840fc373a4aedc8b3af21e08b28efe99 -re2406180bf569fb495b709542c12da099c8e23ea --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision ff9e67dd840fc373a4aedc8b3af21e08b28efe99) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision e2406180bf569fb495b709542c12da099c8e23ea) @@ -436,17 +436,26 @@ case DG_MODE_FILL: case DG_MODE_FLUS: - case DG_MODE_HEAT: case DG_MODE_CHEM: - case DG_MODE_HCOL: case DG_MODE_CHFL: case DG_MODE_ROPS: - // The flow cannot be out of range for than 10% of the target flow + // The flow cannot be out of range for than 10% of the target flow isFlowOutOfRange = ( fabs( 1.0F - ( currentFlowLPM / targetFlowLPM ) ) > MAX_ALLOWED_FLOW_DEVIATION_PCT ? TRUE : FALSE ); isFlowOutOfUpperRange = ( isFlowOutOfRange && ( currentFlowLPM > targetFlowLPM ) ? TRUE : FALSE ); isFlowOutOfLowerRange = ( isFlowOutOfRange && ( currentFlowLPM < targetFlowLPM ) ? TRUE : FALSE ); break; + case DG_MODE_HEAT: + case DG_MODE_HCOL: + if ( getTargetROPumpPressurePSI() > CLEANING_MODE_HIGH_TEMP_MAX_RO_PRESSURE_PSI ) + { + // The flow cannot be out of range for than 10% of the target flow + isFlowOutOfRange = ( fabs( 1.0F - ( currentFlowLPM / targetFlowLPM ) ) > MAX_ALLOWED_FLOW_DEVIATION_PCT ? TRUE : FALSE ); + isFlowOutOfUpperRange = ( isFlowOutOfRange && ( currentFlowLPM > targetFlowLPM ) ? TRUE : FALSE ); + isFlowOutOfLowerRange = ( isFlowOutOfRange && ( currentFlowLPM < targetFlowLPM ) ? TRUE : FALSE ); + } + break; + default: // Do nothing in the rest of the modes. // Do not check the flow target in heat disinfect active cool since the flow during cooling might be very different from the target flow Index: firmware/App/Controllers/ROPump.h =================================================================== diff -u -rb8f298547eb578000b3ff3cf55732fda7a689ce0 -re2406180bf569fb495b709542c12da099c8e23ea --- firmware/App/Controllers/ROPump.h (.../ROPump.h) (revision b8f298547eb578000b3ff3cf55732fda7a689ce0) +++ firmware/App/Controllers/ROPump.h (.../ROPump.h) (revision e2406180bf569fb495b709542c12da099c8e23ea) @@ -31,9 +31,11 @@ */ // ********** public definitions ********** -#define MAX_RO_FLOWRATE_LPM 1.8F ///< Maximum target RO flow rate in L/min. -#define MIN_RO_FLOWRATE_LPM 0.0F ///< Minimum target RO flow rate in L/min. +#define MAX_RO_FLOWRATE_LPM 1.8F ///< Maximum target RO flow rate in L/min. +#define MIN_RO_FLOWRATE_LPM 0.0F ///< Minimum target RO flow rate in L/min. +#define CLEANING_MODE_HIGH_TEMP_MAX_RO_PRESSURE_PSI 30 ///< Cleaning mode high temperature maximum RO pressure in psi. + /// Enumerations of RO pump PI controller profiles. typedef enum { Index: firmware/App/Modes/ModeHeatDisinfectActiveCool.c =================================================================== diff -u -rf62ad14b34df363aaf82e3d0272471a402fadc9f -re2406180bf569fb495b709542c12da099c8e23ea --- firmware/App/Modes/ModeHeatDisinfectActiveCool.c (.../ModeHeatDisinfectActiveCool.c) (revision f62ad14b34df363aaf82e3d0272471a402fadc9f) +++ firmware/App/Modes/ModeHeatDisinfectActiveCool.c (.../ModeHeatDisinfectActiveCool.c) (revision e2406180bf569fb495b709542c12da099c8e23ea) @@ -56,7 +56,6 @@ // RO filter cool down defines #define ROF_ACTIVE_COOL_TARGET_FLOW_LPM 0.3F ///< RO active cool down target flow in L/min. -#define ROF_ACTIVE_COOL_MAX_ALLOWED_PRESSURE_PSI 30 ///< RO active cool down maximum pressure in psi. #define ROF_ACTIVE_COOL_TARGET_RSRVR_FILL_ML 600.0F ///< RO active cool target reservoir fill in mL. #define ROF_ACTIVE_COOL_TARGET_TEMP_C 40.0F ///< RO active cool target temperature in C. #define ROF_ACTIVE_COOL_BELOW_TEMP_TIMEOUT_MS ( 30 * MS_PER_SECOND ) ///< RO active cool temperature below target for cooling timeout in milliseconds. @@ -887,7 +886,7 @@ requestConcentratePumpOn( CONCENTRATEPUMPS_CP1_ACID ); requestConcentratePumpOn( CONCENTRATEPUMPS_CP2_BICARB ); // RO pump - setROPumpTargetFlowRateLPM( ROF_ACTIVE_COOL_TARGET_FLOW_LPM, ROF_ACTIVE_COOL_MAX_ALLOWED_PRESSURE_PSI ); + setROPumpTargetFlowRateLPM( ROF_ACTIVE_COOL_TARGET_FLOW_LPM, CLEANING_MODE_HIGH_TEMP_MAX_RO_PRESSURE_PSI ); // Drain pump signalDrainPumpHardStop(); break; @@ -915,7 +914,7 @@ requestConcentratePumpOn( CONCENTRATEPUMPS_CP1_ACID ); requestConcentratePumpOn( CONCENTRATEPUMPS_CP2_BICARB ); // RO pump - setROPumpTargetFlowRateLPM( ROF_ACTIVE_COOL_TARGET_FLOW_LPM, ROF_ACTIVE_COOL_MAX_ALLOWED_PRESSURE_PSI ); + setROPumpTargetFlowRateLPM( ROF_ACTIVE_COOL_TARGET_FLOW_LPM, CLEANING_MODE_HIGH_TEMP_MAX_RO_PRESSURE_PSI ); // Drain pump signalDrainPumpHardStop(); break; Index: firmware/App/Modes/ModeROPermeateSample.c =================================================================== diff -u -rd325999b7b3ea03b7e294cb8a0b97df93812fbe9 -re2406180bf569fb495b709542c12da099c8e23ea --- firmware/App/Modes/ModeROPermeateSample.c (.../ModeROPermeateSample.c) (revision d325999b7b3ea03b7e294cb8a0b97df93812fbe9) +++ firmware/App/Modes/ModeROPermeateSample.c (.../ModeROPermeateSample.c) (revision e2406180bf569fb495b709542c12da099c8e23ea) @@ -48,9 +48,9 @@ // ********** private data ********** #define RO_PERMEATE_SAMPLE_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Mode RO permeate sample data publish interval in counts. -#define ACID_PUMP_SPEED_ML_PER_MIN 30.6F ///< Acid concentrate pump speed in mL/min. +#define ACID_PUMP_SPEED_ML_PER_MIN -30.0F ///< Acid concentrate pump speed in mL/min. // The acid pump is 2% faster than the acid pump to create a flow from acid to bicarb line during sampling -#define BICARB_PUMP_SPEED_ML_PER_MIN -30.0F ///< Bicarb concentrate pump speed in mL/min. +#define BICARB_PUMP_SPEED_ML_PER_MIN 30.6F ///< Bicarb concentrate pump speed in mL/min. #define RO_PUMP_TARGET_FLOW_RATE_LPM 0.8F ///< RO pump target flow rate during flush/fill in L/min. #define RO_PUMP_MAX_PRESSURE_PSI 130 ///< Maximum RO pump pressure during flush/fill states in psi. #define FLUSH_DRAIN_WAIT_TIME_MS ( 2 * SEC_PER_MIN * MS_PER_SECOND ) ///< Flush Drain path wait time in milliseconds.