Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -rd3e3b8113dfb4f7cb77aed5e8e7b08ba3efb4c50 -r90be43508ea3f0f7d7bf9be4f047b3db4dda34b1 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision d3e3b8113dfb4f7cb77aed5e8e7b08ba3efb4c50) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 90be43508ea3f0f7d7bf9be4f047b3db4dda34b1) @@ -49,6 +49,7 @@ #define MAX_DIAL_IN_PUMP_PWM_STEP_DN_CHANGE 0.02F ///< Max duty cycle change when ramping down ~ 300 mL/min/s. #define MAX_DIAL_IN_PUMP_PWM_DUTY_CYCLE 0.89F ///< Controller will error if PWM duty cycle > 90%, so set max to 89%. #define MIN_DIAL_IN_PUMP_PWM_DUTY_CYCLE 0.10F ///< Controller will error if PWM duty cycle < 10%, so set min to 10%. +#define MIN_DG_DIAL_FLOW_RATE 10.0F ///< Minimum DG Dialysate Flow Rate (mL/Min) - DN-9NOV2022 #define DIP_CONTROL_INTERVAL_SEC 4 ///< Dialysate inlet pump control interval (in seconds). /// Interval (ms/task time) at which the dialIn pump is controlled. @@ -1349,8 +1350,6 @@ static void checkDialInPumpFlowRate( void ) { F32 flow = getMeasuredDialInFlowRate(); - F32 estimatedFlow = flow; - F32 deltaFlow; F32 measuredDialInFlow; // Range check on measure DPi flow rate. @@ -1394,14 +1393,13 @@ errorDialInFlowVsMotorSpeedPersistTimerCtr = 0; } - // Check the measured flow against estimated flow + // Check DG Dialysate flow rate measuredDialInFlow = getDGDialysateFlowRateLMin() * ML_PER_LITER; - deltaFlow = FIFTY_PERCENT * estimatedFlow; if ( ( TRUE == isDialInPumpRunning() ) && ( dialInPumpControlMode != PUMP_CONTROL_MODE_OPEN_LOOP ) ) { - if ( ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_DIAL_IN_FLOW_CHECK_FAILURE, deltaFlow < fabs( estimatedFlow - measuredDialInFlow ) ) ) ) + if ( ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_DIAL_IN_FLOW_CHECK_FAILURE, measuredDialInFlow < MIN_DG_DIAL_FLOW_RATE ) ) ) { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_DIAL_IN_FLOW_CHECK_FAILURE, measuredDialInFlow, estimatedFlow ); + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_DIAL_IN_FLOW_CHECK_FAILURE, measuredDialInFlow, (F32)targetDialInFlowRate ); } } else