Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -rc7ea3969643ead419cbfcd34c3cb203c45bcad71 -r39799e6911039979ddec56a4eda7876aa4e0f165 --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision c7ea3969643ead419cbfcd34c3cb203c45bcad71) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 39799e6911039979ddec56a4eda7876aa4e0f165) @@ -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