Index: firmware/App/Modes/ModeFlush.c =================================================================== diff -u -re86af65442a36724461317980814f0868bd8c995 -r654c5598765bb862c00a0175bdac95604c6c9b24 --- firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision e86af65442a36724461317980814f0868bd8c995) +++ firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision 654c5598765bb862c00a0175bdac95604c6c9b24) @@ -41,7 +41,7 @@ #define FLUSH_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Mode flush data publish interval in counts. #define RO_PUMP_TARGET_FLOW_RATE_LPM 0.8 ///< RO pump target flow rate during flush/fill in L/min. TODO original flow was 0.8 #define RO_PUMP_MAX_PRESSURE_PSI 130 ///< Maximum RO pump pressure during flush/fill states in psi. -#define DRAIN_PUMP_TARGET_RPM 1800 ///< Drain pump target RPM during drain. +#define DRAIN_PUMP_TARGET_RPM 2200 ///< Drain pump target RPM during drain. // Drain R1 & R2 states defines #define DRAIN_WEIGHT_UNCHANGE_TIMEOUT ( 6 * MS_PER_SECOND ) ///< Time period of unchanged weight during draining before timeout. @@ -298,8 +298,14 @@ // Request a tare for reservoir 1 tareReservoir(); +#ifndef V_2_SYSTEM // Set the actuators to drain R1 + setValveState( VRD1, VALVE_STATE_OPEN ); +#else + // Set the actuators to drain R1 setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif + setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); stateTimerStart = getMSTimerCount(); @@ -334,9 +340,17 @@ tareReservoir(); } +#ifndef V_2_SYSTEM + // Close reservoir 1 drain + setValveState( VRD1, VALVE_STATE_CLOSED ); // Set the actuators to drain R2 // NOTE: Drain pump is already on and VDr is already on drain state + setValveState( VRD2, VALVE_STATE_OPEN ); +#else + // Set the actuators to drain R2 + // NOTE: Drain pump is already on and VDr is already on drain state setValveState( VRD, VALVE_STATE_R2_C_TO_NO ); +#endif stateTimerStart = getMSTimerCount(); rsrvr2Status = DG_RESERVOIR_ABOVE_TARGET; @@ -376,15 +390,25 @@ { // Set the actuators to flush drain setValveState( VPI, VALVE_STATE_OPEN ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); + setValveState( VRD2, VALVE_STATE_CLOSED ); +#else setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); +#endif state = DG_FLUSH_STATE_FLUSH_DRAIN; } else { // Set the actuators to pull fresh water in to drain the circulation line setValveState( VPI, VALVE_STATE_OPEN ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); + setValveState( VRD2, VALVE_STATE_CLOSED ); +#else setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setROPumpTargetFlowRate( FINAL_DRAIN_RO_PUMP_FLOW_LPM, RO_PUMP_MAX_PRESSURE_PSI ); @@ -416,7 +440,11 @@ if ( TRUE == didTimeout( stateTimerStart, FLUSH_DRAIN_WAIT_TIME_MS ) ) { +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); +#else setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif setROPumpTargetFlowRate( RO_PUMP_TARGET_FLOW_RATE_LPM, RO_PUMP_MAX_PRESSURE_PSI ); // Turn on the UV reactors @@ -529,7 +557,11 @@ setValveState( VRF, VALVE_STATE_R2_C_TO_NO ); setValveState( VRI, VALVE_STATE_R1_C_TO_NO ); setValveState( VRO, VALVE_STATE_R2_C_TO_NC ); +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_OPEN ); +#else setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); stateTimerStart = getMSTimerCount(); @@ -579,6 +611,9 @@ { // Done with draining R1 signalDrainPumpHardStop(); +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_CLOSED ); +#endif } // Reservoir 1 drain time out else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr1Status ) @@ -615,7 +650,11 @@ if ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) { signalROPumpHardStop(); +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_OPEN ); +#else setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif setDrainPumpTargetRPM( DRAIN_PUMP_TARGET_RPM ); stateTimerStart = getMSTimerCount(); @@ -664,7 +703,11 @@ { // Set the actuators to transition to flush circulation // The valves are set to do flush drain and flush circulation +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); +#else setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); +#endif setValveState( VRC, VALVE_STATE_RECIRC_C_TO_NC ); setValveState( VDR, VALVE_STATE_RECIRC_C_TO_NC ); setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); @@ -699,7 +742,11 @@ if ( TRUE == didTimeout( stateTimerStart, FLUSH_CIRCULATION_WAIT_TIME_MS ) ) { +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); +#else setValveState( VPD, VALVE_STATE_OPEN_C_TO_NO ); +#endif setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); @@ -776,7 +823,12 @@ // Set the actuators setValveState( VPI, VALVE_STATE_CLOSED ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NO ); + setValveState( VRD2, VALVE_STATE_OPEN ); +#else setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); +#endif // Set both reservoirs to be considered as full rsrvr1Status = DG_RESERVOIR_ABOVE_TARGET; @@ -801,8 +853,13 @@ if ( DG_RESERVOIR_REACHED_TARGET == rsrvr2Status ) { +#ifndef V_2_SYSTEM + setValveState( VRD1, VALVE_STATE_OPEN ); + setValveState( VRD2, VALVE_STATE_CLOSED ); +#else // Set the drain valve to reservoir 1 setValveState( VRD, VALVE_STATE_R1_C_TO_NC ); +#endif } } else if ( DG_RESERVOIR_NOT_REACHED_TARGET == rsrvr2Status ) @@ -818,6 +875,9 @@ if ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) { +#ifndef V_2_SYSTEM + setValveState( VRD2, VALVE_STATE_CLOSED ); +#endif // Done with draining signalDrainPumpHardStop();