Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -rc7ea3969643ead419cbfcd34c3cb203c45bcad71 -r46a9148605c584c65aa759d2044d91428fcdd175 --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision c7ea3969643ead419cbfcd34c3cb203c45bcad71) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 46a9148605c584c65aa759d2044d91428fcdd175) @@ -416,6 +416,7 @@ switch ( getCurrentOperationMode() ) { case DG_MODE_GENE: + case DG_MODE_CHFL: // The flow cannot be out of target by more than +/- 100 mL/min isFlowOutOfRange = ( ( fabs( currentFlowLPM - targetFlowLPM ) * ML_PER_LITER ) > MAX_ALLOWED_FLOW_DEVIATION_MLPM ); isFlowOutOfUpperRange = ( isFlowOutOfRange && ( currentFlowLPM > targetFlowLPM ) ? TRUE : FALSE ); @@ -433,7 +434,6 @@ case DG_MODE_FLUS: case DG_MODE_HEAT: case DG_MODE_CHEM: - case DG_MODE_CHFL: // 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 ); @@ -735,11 +735,13 @@ F32 actualPressure = getMeasuredDGPressure( PRESSURE_SENSOR_RO_PUMP_OUTLET ); // Control at set interval - if ( ++roControlTimerCounter >= ROP_CONTROL_INTERVAL && roPumpControlMode == PUMP_CONTROL_MODE_CLOSED_LOOP ) + if ( ( ++roControlTimerCounter >= ROP_CONTROL_INTERVAL ) && ( roPumpControlMode == PUMP_CONTROL_MODE_CLOSED_LOOP ) ) { if ( actualPressure > targetROPumpMaxPressure ) { + // Reduce the duty cycle and make sure it does not go below 0% roPumpDutyCyclePctSet -= ROP_RAMP_DOWN_DUTY_CYCLE_RATIO; + roPumpDutyCyclePctSet = MAX( roPumpDutyCyclePctSet, MIN_RO_PUMP_DUTY_CYCLE ); resetPIController( PI_CONTROLLER_ID_RO_PUMP_MAX_PRES, roPumpDutyCyclePctSet ); } else