Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -r1bff8e530735be63ba557b77557a0bc2ac4b37b2 -re283a8f2f25dea73d84f87ac346c23e7b3059531 --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 1bff8e530735be63ba557b77557a0bc2ac4b37b2) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision e283a8f2f25dea73d84f87ac346c23e7b3059531) @@ -340,6 +340,7 @@ { setAirPumpState( AIR_PUMP_STATE_ON ); airPumpUpperLevelCtr = 0; + signalUserRateChange(); // so pressure limits re-stabilize } } Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -r97e1c0abbbf667f834d284eb6fc14999f073b020 -re283a8f2f25dea73d84f87ac346c23e7b3059531 --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 97e1c0abbbf667f834d284eb6fc14999f073b020) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision e283a8f2f25dea73d84f87ac346c23e7b3059531) @@ -288,8 +288,10 @@ else { // if rate correction offset not yet set, set it based on target dialysate flow rate if ( fabs( dopRateCorrectionOffset ) < NEARLY_ZERO ) - { + { // set initial estimate for rate correction offset dopRateCorrectionOffset = (F32)getTargetDialInFlowRate() * DOP_RATE_CORRECTION_SCALAR + DOP_RATE_CORRECTION_OFFSET; + // adjust initial pwm duty cycle % per rate correction offset + pwmDC -= ( ( dopRateCorrectionOffset / RPM_2_ML_MIN_CONVERSION ) / DOP_100_PCT_PWM_RPM_RANGE ); } } // Don't interrupt pump control unless rate or mode is changing Index: firmware/App/Modes/ModePostTreat.c =================================================================== diff -u -r1a300e3a8f0eb834010f72777aa30e61e329125b -re283a8f2f25dea73d84f87ac346c23e7b3059531 --- firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision 1a300e3a8f0eb834010f72777aa30e61e329125b) +++ firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision e283a8f2f25dea73d84f87ac346c23e7b3059531) @@ -573,9 +573,10 @@ *************************************************************************/ static DRAIN_STATE_T handleDrainReservoirSwitchState( void ) { - DRAIN_STATE_T state = DRAIN_RESERVOIR_SWITCH_STATE; + DRAIN_STATE_T state = DRAIN_RESERVOIR_SWITCH_STATE; + DG_OP_MODE_T dgMode = getDGOpMode(); - if ( ( DG_MODE_GENE == getDGOpMode() ) && ( DG_GEN_IDLE_MODE_STATE_FLUSH_WATER == getDGSubMode() ) ) + if ( ( DG_MODE_GENE == dgMode ) && ( DG_GEN_IDLE_MODE_STATE_FLUSH_WATER == getDGSubMode() ) ) { DG_CMD_RESPONSE_T dgCmdResp; @@ -609,8 +610,12 @@ } } } - else if ( DG_MODE_FAUL == getDGOpMode() ) - { + else if ( DG_MODE_STAN == dgMode ) + { // In case DG was reset/power cycled, re-start DG so we can drain the reservoirs + cmdStartDG(); + } + else if ( DG_MODE_FAUL == dgMode ) + { // In case DG faulted, skip DG drain states and move on state = DRAIN_RESERVOIR_COMPLETE_STATE; }