Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -r2475e55c224cbd841d61b76f1618451efe6be1f5 -rb9084c526c8ab28a605f4d2640288e2fc80796ff --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 2475e55c224cbd841d61b76f1618451efe6be1f5) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision b9084c526c8ab28a605f4d2640288e2fc80796ff) @@ -286,7 +286,7 @@ RO_PUMP_STATE_T state = RO_PUMP_CONTROL_TO_TARGET_FLOW_STATE; F32 nexttgtflow = 0.0; F32 currentFlowRate = 0.0; - F32 adjustedFlowRRate = 0.0; + F32 adjustedFlowRate = 0.0; BOOL isFlowRateLow = FALSE; // Check if need to switch control modes @@ -311,10 +311,10 @@ else if ( ++roControlTimerCounter >= ROP_CONTROL_INTERVAL ) { currentFlowRate = getFilteredFlow( P16_FLOW ); - adjustedFlowRRate = (F32)getTargetROPumpFlowRateMLPM() * ROP_MIN_FLOW_TO_CONTROL_PCT; + adjustedFlowRate = (F32)getTargetROPumpFlowRateMLPM() * ROP_MIN_FLOW_TO_CONTROL_PCT; // P16 flow seems to lag in current Leahi HW. We will wait till we hit a % of target flow before we start changing control. - if( ( TRUE == roPumpStartControl ) || ( currentFlowRate >= ( adjustedFlowRRate ) ) ) + if( ( TRUE == roPumpStartControl ) || ( currentFlowRate >= ( adjustedFlowRate ) ) ) { roPumpDutyCyclePctSet = runPIController( PI_CONTROLLER_ID_RO_PUMP_FLOW, (F32)getTargetROPumpFlowRateMLPM(), currentFlowRate ); roPumpDutyCyclePctSet = MIN( roPumpDutyCyclePctSet, ( MAX_FLUID_PUMP_PWM_DUTY_CYCLE * MAX_FLUID_PUMP_DUTY_CYCLE_PCT ) ); @@ -329,8 +329,8 @@ //is flow rate less than 75% of the target flow rate // wait for 10 seconds for timeout - isFlowRateLow = ( ( currentFlowRate < ( adjustedFlowRRate ) ) ? TRUE : FALSE); - checkPersistentAlarm( ALARM_ID_FP_PERMEATE_FLOW_RATE_BELOW_TARGET, isFlowRateLow, currentFlowRate, adjustedFlowRRate); + isFlowRateLow = ( ( currentFlowRate < ( adjustedFlowRate ) ) ? TRUE : FALSE); + checkPersistentAlarm( ALARM_ID_FP_PERMEATE_FLOW_RATE_BELOW_TARGET, isFlowRateLow, currentFlowRate, adjustedFlowRate); } return state;