Index: firmware/App/Controllers/BoostPump.c =================================================================== diff -u -r051cd0430ef8342bd606115c98871e26dc24acf1 -r410afd26b3ae5e372310c696c82f58c59235e10d --- firmware/App/Controllers/BoostPump.c (.../BoostPump.c) (revision 051cd0430ef8342bd606115c98871e26dc24acf1) +++ firmware/App/Controllers/BoostPump.c (.../BoostPump.c) (revision 410afd26b3ae5e372310c696c82f58c59235e10d) @@ -171,7 +171,7 @@ break; default: - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, SW_FAULT_ID_RO_INVALID_PUMP_DUTY_CYCLE_SELECTED, boostPumpState ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, SW_FAULT_ID_FP_INVALID_PUMP_DUTY_CYCLE_SELECTED, boostPumpState ) boostPumpState = BOOST_PUMP_OFF_STATE; break; } @@ -193,34 +193,38 @@ BOOST_PUMP_STATE_T state = BOOST_PUMP_OFF_STATE; isBoostPumpOn = FALSE; - // If there is a target pressure set, transition to the PI controller and control to pressure. - if ( ( getTargetBoostPumpPressure() > 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) + // Do not control unless boost is installed + if ( TRUE == isBoostPumpInstalled ) { - // Set pump to on - isBoostPumpOn = TRUE; - boostPumpDutyCyclePctSet = boostPumpPresToPWM( getTargetBoostPumpPressure() ); - setFluidPumpPctToPWMDutyCycle( P40_PUMP, boostPumpDutyCyclePctSet ); - state = BOOST_PUMP_CONTROL_TO_TARGET_PRESSURE_STATE; - } + // If there is a target pressure set, transition to the PI controller and control to pressure. + if ( ( getTargetBoostPumpPressure() > 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) + { + // Set pump to on + isBoostPumpOn = TRUE; + boostPumpDutyCyclePctSet = boostPumpPresToPWM( getTargetBoostPumpPressure() ); + setFluidPumpPctToPWMDutyCycle( P40_PUMP, boostPumpDutyCyclePctSet ); + state = BOOST_PUMP_CONTROL_TO_TARGET_PRESSURE_STATE; + } - // If there is a target flow set, transition to the PI controller and control to flow - else if ( ( getTargetBoostPumpFlowRateMLPM() > 0 ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) - { - // Set pump to on - isBoostPumpOn = TRUE; - boostPumpDutyCyclePctSet = boostPumpFlowToPWM( getTargetBoostPumpFlowRateMLPM() ); - setFluidPumpPctToPWMDutyCycle( P40_PUMP, boostPumpDutyCyclePctSet ); - state = BOOST_PUMP_CONTROL_TO_TARGET_FLOW_STATE; + // If there is a target flow set, transition to the PI controller and control to flow + else if ( ( getTargetBoostPumpFlowRateMLPM() > 0 ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) + { + // Set pump to on + isBoostPumpOn = TRUE; + boostPumpDutyCyclePctSet = boostPumpFlowToPWM( getTargetBoostPumpFlowRateMLPM() ); + setFluidPumpPctToPWMDutyCycle( P40_PUMP, boostPumpDutyCyclePctSet ); + state = BOOST_PUMP_CONTROL_TO_TARGET_FLOW_STATE; + } + // If the target duty cycle is greater than zero (minimum is 10%) and the mode has been set to open + // loop, set the duty cycle + else if ( ( boostPumpOpenLoopTargetDutyCycle > 0.0F ) && ( PUMP_CONTROL_MODE_OPEN_LOOP == boostPumpControlMode ) ) + { + setFluidPumpPctToPWMDutyCycle( P40_PUMP, boostPumpOpenLoopTargetDutyCycle ); + boostPumpDutyCyclePctSet = boostPumpOpenLoopTargetDutyCycle; + isBoostPumpOn = TRUE; + state = BOOST_PUMP_OPEN_LOOP_STATE; + } } - // If the target duty cycle is greater than zero (minimum is 10%) and the mode has been set to open - // loop, set the duty cycle - else if ( ( boostPumpOpenLoopTargetDutyCycle > 0.0F ) && ( PUMP_CONTROL_MODE_OPEN_LOOP == boostPumpControlMode ) ) - { - setFluidPumpPctToPWMDutyCycle( P40_PUMP, boostPumpOpenLoopTargetDutyCycle ); - boostPumpDutyCyclePctSet = boostPumpOpenLoopTargetDutyCycle; - isBoostPumpOn = TRUE; - state = BOOST_PUMP_OPEN_LOOP_STATE; - } return state; } @@ -370,7 +374,7 @@ // Requested flow rate is out of range else { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, SW_FAULT_ID_RO_PUMP_INVALID_FLOW_RATE_SET, boostFlowRate ) + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, SW_FAULT_ID_FP_PUMP_INVALID_FLOW_RATE_SET, boostFlowRate ) } return result; @@ -413,7 +417,7 @@ // Requested flow rate is out of range else { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, SW_FAULT_ID_RO_PUMP_INVALID_PRESSURE_SELECTED, boostPressure ) + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, SW_FAULT_ID_FP_PUMP_INVALID_PRESSURE_SELECTED, boostPressure ) } return result; @@ -454,7 +458,7 @@ } else { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, SW_FAULT_ID_RO_INVALID_PUMP_DUTY_CYCLE_SELECTED, dutyCycle ) + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, SW_FAULT_ID_FP_INVALID_PUMP_DUTY_CYCLE_SELECTED, dutyCycle ) } return status; @@ -603,7 +607,7 @@ pumpData.p40TargetFlow = getTargetBoostPumpFlowRateMLPM(); pumpData.p40TargetDutyCycle = boostPumpOpenLoopTargetDutyCycle; - broadcastData( MSG_ID_FP_BOOST_PUMP_DATA, COMM_BUFFER_OUT_CAN_RO_BROADCAST, (U08*)&pumpData, sizeof( BOOST_PUMP_DATA_T ) ); + broadcastData( MSG_ID_FP_BOOST_PUMP_DATA, COMM_BUFFER_OUT_CAN_FP_BROADCAST, (U08*)&pumpData, sizeof( BOOST_PUMP_DATA_T ) ); boostPumpDataPublicationTimerCounter = 0; } }