Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -rded084860cbbde7fc763859c7c0991f13d77c8f9 -rb3712df3e9e729dc9d4e4b35a0c4567f07882d2f --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision ded084860cbbde7fc763859c7c0991f13d77c8f9) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision b3712df3e9e729dc9d4e4b35a0c4567f07882d2f) @@ -53,7 +53,7 @@ #define MAX_DIAL_OUT_PUMP_PWM_STEP_UP_CHANGE 0.0133F ///< Maximum duty cycle change when ramping up ~ 200 mL/min/s. #define MAX_DIAL_OUT_PUMP_PWM_STEP_DN_CHANGE 0.02F ///< Maximum duty cycle change when ramping down ~ 300 mL/min/s. -#define MAX_DIAL_OUT_PUMP_PWM_DUTY_CYCLE 0.89F ///< Controller will error if PWM duty cycle > 90%, so set max to 89%. +#define MAX_DIAL_OUT_PUMP_PWM_DUTY_CYCLE 0.90F ///< Controller will error if PWM duty cycle > 90%, so set max to 89%. #define MIN_DIAL_OUT_PUMP_PWM_DUTY_CYCLE 0.10F ///< Controller will error if PWM duty cycle < 10%, so set min to 10%. #define MAX_DIAL_OUT_PUMP_PWM_OFFSET_CONTROL 0.4F ///< Maximum PWM offset (added to DPi PWM duty cycle). #define MIN_DIAL_OUT_PUMP_PWM_OFFSET_CONTROL -0.4F ///< Minimum PWM offset (added to DPi PWM duty cycle). @@ -1687,16 +1687,16 @@ BOOL testSetDialOutPumpTargetDutyCycle( F32 value ) { BOOL result = FALSE; - F32 targetRate = DOP_ML_PER_MIN_FROM_PWM( value ); MOTOR_DIR_T dir = ( value < 0.0F ? MOTOR_DIR_REVERSE : MOTOR_DIR_FORWARD ); + F32 absolutePWM = fabs( value ); + F32 targetRate = DOP_ML_PER_MIN_FROM_PWM( absolutePWM ); - // currently conversion can create negative values with values <= 10%. *** Function used in dialyzer re-prime, so no Dialin login required *** - if ( targetRate < 0 ) + // check for max of pump pwm for acceptance. *** Function used in dialyzer re-prime, so no Dialin login required *** + if ( absolutePWM < MAX_DIAL_OUT_PUMP_PWM_DUTY_CYCLE ) { - targetRate = 0; + setDialOutPumpTargetRate( (U32)targetRate, dir, PUMP_CONTROL_MODE_OPEN_LOOP ); + result = TRUE; } - setDialOutPumpTargetRate( (U32)targetRate, dir, PUMP_CONTROL_MODE_OPEN_LOOP ); - result = TRUE; return result; } Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -rded084860cbbde7fc763859c7c0991f13d77c8f9 -rb3712df3e9e729dc9d4e4b35a0c4567f07882d2f --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision ded084860cbbde7fc763859c7c0991f13d77c8f9) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision b3712df3e9e729dc9d4e4b35a0c4567f07882d2f) @@ -54,7 +54,7 @@ #ifdef DIALYZER_REPRIME_ENABLED // Dialyzer reprime constants -static const U32 DIALYZER_REPRIME_INTERVAL = ((30 * SEC_PER_MIN * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); +static const U32 DIALYZER_REPRIME_INTERVAL = ((5 * SEC_PER_MIN * MS_PER_SECOND) / TASK_GENERAL_INTERVAL); // TODO - temporary set to 5 min for testing - restore to 30 min /// Dialyzer reprime interval count. Time between reprime attempts. #define DIALYZER_REPRIME_REPRIME_DURATION_MS ( 40 * MS_PER_SECOND ) ///< Duration of dialyzer reprime reprime state. #define DIALYZER_REPRIME_PURGE_PRIOR_1_DURATION_MS ( 10 * MS_PER_SECOND ) ///< Duration of dialyzer reprime purge prior 1 state. @@ -1278,6 +1278,7 @@ setValvePosition( VDI, VALVE_POSITION_B_OPEN ); setValvePosition( VDO, VALVE_POSITION_B_OPEN ); signalDialInPumpHardStop(); + signalDialOutPumpHardStop(); // Reset the timer for reprime interval and the reprime in progress flag. dialyzerReprimeIntervalTimerCtr = 0; dialyzerReprimeInProgress = FALSE;