Index: firmware/App/Modes/ModeRecirculate.c =================================================================== diff -u -rd7926685f2fe3086bab183166119f0965a192a69 -r2fff37fa585181917705645494549b5fd4a4d522 --- firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision d7926685f2fe3086bab183166119f0965a192a69) +++ firmware/App/Modes/ModeRecirculate.c (.../ModeRecirculate.c) (revision 2fff37fa585181917705645494549b5fd4a4d522) @@ -44,7 +44,7 @@ #define TARGET_RO_FLOW_RATE_L 0.3 ///< Target flow rate for RO pump. #define TARGET_FLUSH_LINES_RO_FLOW_RATE_L 0.6 ///< Target flow rate for RO pump. -#define FLUSH_LINES_VOLUME_L 0.1 ///< Water volume (in Liters) to flush when starting re-circulate mode. +#define FLUSH_LINES_VOLUME_L 0.01 ///< Water volume (in Liters) to flush when starting re-circulate mode. // ********** private data ********** @@ -85,19 +85,27 @@ // set initial actuator states setValveState( VSP, VALVE_STATE_CLOSED ); setValveState( VPI, VALVE_STATE_OPEN ); +#ifndef V_2_SYSTEM + setValveState( VPD, VALVE_STATE_OPEN_C_TO_NC ); +#endif setValveState( VRC, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VDR, VALVE_STATE_DRAIN_C_TO_NO ); setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); - setROPumpTargetFlowRate( TARGET_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); signalDrainPumpHardStop(); requestConcentratePumpsOff( CONCENTRATEPUMPS_CP1_ACID ); requestConcentratePumpsOff( CONCENTRATEPUMPS_CP2_BICARB ); - // UV on + // UV reactors on turnOnUVReactor( INLET_UV_REACTOR ); turnOnUVReactor( OUTLET_UV_REACTOR ); + // NOTE: The target flow rate should be set prior to setting the start primary heater + // because the initial guess in the heaters driver needs the target flow to calculate + // the new PWMs for the main and small primary heaters + setROPumpTargetFlowRate( TARGET_FLUSH_LINES_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); + startPrimaryHeater(); + #ifndef _VECTORCAST_ { // TODO - test code to start the fan since we're turning the heater on F32 fanPWM = 0.25; @@ -170,7 +178,9 @@ // when enough water volume has flowed to flush the lines, transition to re-circ state if ( flushLinesVolumeL >= FLUSH_LINES_VOLUME_L ) { +#ifndef SKIP_RECIRC setValveState( VDR, VALVE_STATE_RECIRC_C_TO_NC ); +#endif setROPumpTargetFlowRate( TARGET_RO_FLOW_RATE_L, TARGET_RO_PRESSURE_PSI ); result = DG_RECIRCULATE_MODE_STATE_RECIRC_WATER; }