Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -rb156b12139fea40401c94b512503a2ceced69e22 -rded084860cbbde7fc763859c7c0991f13d77c8f9 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision b156b12139fea40401c94b512503a2ceced69e22) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision ded084860cbbde7fc763859c7c0991f13d77c8f9) @@ -1527,15 +1527,10 @@ **************************************************************************/ static BOOL setDialInPumpToFixedPWM( F32 pwm ) { - MOTOR_DIR_T dir = MOTOR_DIR_FORWARD; + MOTOR_DIR_T dir = ( pwm < 0.0F ? MOTOR_DIR_REVERSE : MOTOR_DIR_FORWARD ); BOOL result = FALSE; F32 pwmFabs = fabs(pwm); - if ( pwm < 0 ) - { - dir = MOTOR_DIR_REVERSE; - } - // Direction change while pump is running is not allowed unless we are turning off if ( ( FALSE == isDialInPumpOn ) && ( dir != dialInPumpDirectionSet ) ) { @@ -1919,14 +1914,12 @@ BOOL result = FALSE; F32 absolutePWM = fabs( pwmPct ); - if ( TRUE == isTestingActivated() ) + // check for max of pump pwm for acceptance. *** Function used in dialyzer re-prime, so no Dialin login required *** + if ( absolutePWM < MAX_DIAL_IN_PUMP_PWM_DUTY_CYCLE ) { - // check for max of pump pwm for acceptance. - if ( absolutePWM < MAX_DIAL_IN_PUMP_PWM_DUTY_CYCLE ) - { - result = setDialInPumpToFixedPWM( pwmPct ); - } + result = setDialInPumpToFixedPWM( pwmPct ); } + return result; } Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -rf760ffc4b10556e5186e9ceb90294262063440ca -rded084860cbbde7fc763859c7c0991f13d77c8f9 --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision f760ffc4b10556e5186e9ceb90294262063440ca) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision ded084860cbbde7fc763859c7c0991f13d77c8f9) @@ -1688,17 +1688,15 @@ { 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 ); - if ( TRUE == isTestingActivated() ) + // currently conversion can create negative values with values <= 10%. *** Function used in dialyzer re-prime, so no Dialin login required *** + if ( targetRate < 0 ) { - // currently conversion can create negative values with values <= 10%. - if ( targetRate < 0 ) - { - targetRate = 0; - } - setDialOutPumpTargetRate( (U32)targetRate, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); - result = TRUE; + targetRate = 0; } + setDialOutPumpTargetRate( (U32)targetRate, dir, PUMP_CONTROL_MODE_OPEN_LOOP ); + result = TRUE; return result; } Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -r63c005754a45cfcf122581596458b744a1c5a155 -rded084860cbbde7fc763859c7c0991f13d77c8f9 --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 63c005754a45cfcf122581596458b744a1c5a155) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision ded084860cbbde7fc763859c7c0991f13d77c8f9) @@ -62,8 +62,8 @@ #define DIALYZER_REPRIME_PURGE_LINES_DURATION_MS ( 10 * MS_PER_SECOND ) ///< Duration of dialyzer reprime purge prior 2 state. #define DIALYZER_REPRIME_BEFORE_TREATEMENT_END_INTERVAL_SEC 300 ///< Time before end of treatment to perform final dialyzer reprime, sec. #define DP_FAST_PURGE_FLOW_RATE_ML_MIN 500.0F ///< Dialysate pump speed for purging air in dialyzer reprime states, ml/min. -#define DPI_REPRIME_FLOW_RATE_ML_MIN 64.0F ///< Inlet dialysate pump speed for repriming in dialyzer reprime states, ml/min. -#define DPO_REPRIME_FLOW_RATE_ML_MIN 60.0F ///< Outlet dialysate pump speed for repriming in dialyzer reprime states, ml/min. +#define DPI_REPRIME_PWM_DC -0.18F ///< Inlet dialysate pump PWM duty cycle. +#define DPO_REPRIME_PWM_DC -0.175F ///< Outlet dialysate pump PWM duty cycle. #endif /// Defined states for the Load Cell cycles. @@ -1170,8 +1170,8 @@ // Set valves to flow through dialyzer setValvePosition( VDI, VALVE_POSITION_B_OPEN ); setValvePosition( VDO, VALVE_POSITION_B_OPEN ); - setDialInPumpTargetFlowRate ( DPI_REPRIME_FLOW_RATE_ML_MIN, MOTOR_DIR_REVERSE, PUMP_CONTROL_MODE_OPEN_LOOP ); - setDialOutPumpTargetRate( DPO_REPRIME_FLOW_RATE_ML_MIN, MOTOR_DIR_REVERSE, PUMP_CONTROL_MODE_OPEN_LOOP ); + testSetDialInPumpTargetDutyCycle( DPI_REPRIME_PWM_DC ); + testSetDialOutPumpTargetDutyCycle( DPO_REPRIME_PWM_DC ); dialyzerReprimeInProgress = TRUE; result = DIALYZER_REPRIME_STATE_REPRIME; }