Index: firmware/App/Controllers/BoostPump.c =================================================================== diff -u -r9c9d42f9e72b773aa4c9c359399572da2081bd57 -r60693bf21a8a0277eae54cbfcb6cfd68176b079a --- firmware/App/Controllers/BoostPump.c (.../BoostPump.c) (revision 9c9d42f9e72b773aa4c9c359399572da2081bd57) +++ firmware/App/Controllers/BoostPump.c (.../BoostPump.c) (revision 60693bf21a8a0277eae54cbfcb6cfd68176b079a) @@ -52,7 +52,7 @@ #define DATA_PUBLISH_COUNTER_START_COUNT 10 ///< Data publish counter start count. /// PWM line equation for pressure. converted to percentage. -#define ROP_PRESSURE_TO_PWM_PCT(pres) ( ( BOOST_PRESSURE_TO_PWM_SLOPE * pres + BOOST_PRESSURE_TO_PWM_INTERCEPT ) / MAX_FLUID_PUMP_PWM_DUTY_CYCLE ) +#define ROP_PRESSURE_TO_PWM_PCT(pres) ( ( BOOST_PRESSURE_TO_PWM_SLOPE * pres + BOOST_PRESSURE_TO_PWM_INTERCEPT ) / MAX_P40_FLUID_PUMP_PWM_DUTY_CYCLE ) // ********** private data ********** @@ -94,11 +94,11 @@ // Initialize Boost pump PI controller to flow initializePIController( PI_CONTROLLER_ID_BOOST_PUMP_FLOW, MIN_FLUID_PUMP_DUTY_CYCLE_PCT, BOOST_FLOW_CONTROL_P_COEFFICIENT, BOOST_FLOW_CONTROL_I_COEFFICIENT, - MIN_FLUID_PUMP_DUTY_CYCLE_PCT, MAX_FLUID_PUMP_DUTY_CYCLE_PCT, FALSE, 0 ); + MIN_FLUID_PUMP_DUTY_CYCLE_PCT, MAX_P40_FLUID_PUMP_DUTY_CYCLE_PCT, FALSE, 0 ); // Initialize Boost pump PI controller to target pressure initializePIController( PI_CONTROLLER_ID_BOOST_PUMP_PRES, MIN_FLUID_PUMP_DUTY_CYCLE_PCT, BOOST_PRESSURE_CONTROL_P_COEFFICIENT, BOOST_PRESSURE_CONTROL_I_COEFFICIENT, - MIN_FLUID_PUMP_DUTY_CYCLE_PCT, MAX_FLUID_PUMP_DUTY_CYCLE_PCT, FALSE, 0 ); + MIN_FLUID_PUMP_DUTY_CYCLE_PCT, MAX_P40_FLUID_PUMP_DUTY_CYCLE_PCT, FALSE, 0 ); boostPumpState = BOOST_PUMP_OFF_STATE; isBoostPumpOn = FALSE; @@ -292,7 +292,7 @@ else if ( ++boostControlTimerCounter >= BOOST_CONTROL_INTERVAL ) { boostPumpDutyCyclePctSet = runPIController( PI_CONTROLLER_ID_BOOST_PUMP_FLOW, (F32)getTargetBoostPumpFlowRateMLPM(), getFilteredFlow( P7_FLOW ) ); - boostPumpDutyCyclePctSet = MIN( boostPumpDutyCyclePctSet, ( MAX_FLUID_PUMP_PWM_DUTY_CYCLE * MAX_FLUID_PUMP_DUTY_CYCLE_PCT ) ); + boostPumpDutyCyclePctSet = MIN( boostPumpDutyCyclePctSet, ( MAX_P40_FLUID_PUMP_PWM_DUTY_CYCLE * MAX_P40_FLUID_PUMP_DUTY_CYCLE_PCT ) ); setFluidPumpPctToPWMDutyCycle( P40_PUMP, boostPumpDutyCyclePctSet ); boostControlTimerCounter = 0; } @@ -467,7 +467,7 @@ BOOL result = FALSE; BOOL skipSet = FALSE; - if ( ( dutyCycle >= MIN_FLUID_PUMP_DUTY_CYCLE_PCT ) && ( dutyCycle <= MAX_FLUID_PUMP_DUTY_CYCLE_PCT ) ) + if ( ( dutyCycle >= MIN_FLUID_PUMP_DUTY_CYCLE_PCT ) && ( dutyCycle <= MAX_P40_FLUID_PUMP_DUTY_CYCLE_PCT ) ) { if ( firmwareCall == TRUE ) // firmware call { @@ -536,7 +536,7 @@ *************************************************************************/ F32 getCurrentBoostPumpDutyCyclePCT( void ) { - F32 dutyCyclePct = convertDutyCycleCntToPct( getFluidPumpReadPWMDutyCycle( P40_PUMP ) ); + F32 dutyCyclePct = convertDutyCycleCntToPct( P40_PUMP, getFluidPumpReadPWMDutyCycle( P40_PUMP ) ); return dutyCyclePct; } @@ -683,8 +683,8 @@ pumpData.p40TargetPressure = getTargetBoostPumpPressure(); pumpData.p40TargetFlow = getTargetBoostPumpFlowRateMLPM(); pumpData.p40TargetDutyCycle = getTargetBoostPumpDutyCyclePCT(); - pumpData.p40PumpDutyCyclePct = convertDutyCycleCntToPct( (U32)getFluidPumpPWMDutyCycle( P40_PUMP ) ); - pumpData.p40PumpFBDutyCyclePct = convertDutyCycleCntToPct( (U32)getFluidPumpReadPWMDutyCycle( P40_PUMP ) ); + pumpData.p40PumpDutyCyclePct = convertDutyCycleCntToPct( P40_PUMP, (U32)getFluidPumpPWMDutyCycle( P40_PUMP ) ); + pumpData.p40PumpFBDutyCyclePct = convertDutyCycleCntToPct( P40_PUMP, (U32)getFluidPumpReadPWMDutyCycle( P40_PUMP ) ); broadcastData( MSG_ID_FP_BOOST_PUMP_DATA, COMM_BUFFER_OUT_CAN_FP_BROADCAST, (U08*)&pumpData, sizeof( BOOST_PUMP_DATA_T ) ); boostPumpDataPublicationTimerCounter = 0; Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -rfd21f03d28eec499fb5c01bf595c57893db94406 -r60693bf21a8a0277eae54cbfcb6cfd68176b079a --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision fd21f03d28eec499fb5c01bf595c57893db94406) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision 60693bf21a8a0277eae54cbfcb6cfd68176b079a) @@ -61,11 +61,11 @@ #define DATA_PUBLISH_COUNTER_START_COUNT 10 ///< Data publish counter start count. /// PWM line equation for pressure. converted to percentage. -#define ROP_PRESSURE_TO_PWM_PCT(pres) ( ( ROP_PRESSURE_TO_PWM_SLOPE * pres + ROP_PRESSURE_TO_PWM_INTERCEPT ) / MAX_FLUID_PUMP_PWM_DUTY_CYCLE ) +#define ROP_PRESSURE_TO_PWM_PCT(pres) ( ( ROP_PRESSURE_TO_PWM_SLOPE * pres + ROP_PRESSURE_TO_PWM_INTERCEPT ) / MAX_P12_FLUID_PUMP_PWM_DUTY_CYCLE ) /// PWM log equation for flow converted to percentage. -#define ROP_FLOW_TO_PWM_LOG_PCT(slope, intercept, flow) ( ( slope * log(flow) + intercept ) / MAX_FLUID_PUMP_PWM_DUTY_CYCLE ) +#define ROP_FLOW_TO_PWM_LOG_PCT(slope, intercept, flow) ( ( slope * log(flow) + intercept ) / MAX_P12_FLUID_PUMP_PWM_DUTY_CYCLE ) /// PWM line equation for flow converted to percentage. -#define ROP_FLOW_TO_PWM_LIN_PCT(slope, intercept, flow) ( ( slope * flow + intercept ) / MAX_FLUID_PUMP_PWM_DUTY_CYCLE ) +#define ROP_FLOW_TO_PWM_LIN_PCT(slope, intercept, flow) ( ( slope * flow + intercept ) / MAX_P12_FLUID_PUMP_PWM_DUTY_CYCLE ) #define FP_FLOW_RATE_BELOW_TARGET_TIMEOUT_MS ( 10 * MS_PER_SECOND ) ///< Timeout for flow rate below 75% of target flow rate #define FP_FLOW_RATE_BELOW_TARGET_CLEAR_MS ( 10 * MS_PER_SECOND ) ///< Clear timeout for flow rate below target flow rate @@ -116,7 +116,7 @@ // Initialize RO pump PI controller to target pressure initializePIController( PI_CONTROLLER_ID_RO_PUMP_PRES, MIN_FLUID_PUMP_DUTY_CYCLE_PCT, ROP_PRESSURE_CONTROL_P_COEFFICIENT, ROP_PRESSURE_CONTROL_I_COEFFICIENT, - MIN_FLUID_PUMP_DUTY_CYCLE_PCT, MAX_FLUID_PUMP_DUTY_CYCLE_PCT, FALSE, 0 ); + MIN_FLUID_PUMP_DUTY_CYCLE_PCT, MAX_P12_FLUID_PUMP_DUTY_CYCLE_PCT, FALSE, 0 ); roPumpState = RO_PUMP_OFF_STATE; isROPumpOn = FALSE; @@ -330,7 +330,7 @@ if( ( TRUE == roPumpStartControl ) || ( currentFlowRate >= ( minRequiredFlowRate ) ) ) { roPumpDutyCyclePctSet = runPIDController( PID_CONTROLLER_ID_RO_PUMP_FLOW, (F32)getTargetROPumpFlowRateMLPM(), currentFlowRate ); - roPumpDutyCyclePctSet = MIN( roPumpDutyCyclePctSet, ( MAX_FLUID_PUMP_PWM_DUTY_CYCLE * MAX_FLUID_PUMP_DUTY_CYCLE_PCT ) ); + roPumpDutyCyclePctSet = MIN( roPumpDutyCyclePctSet, ( MAX_P12_FLUID_PUMP_PWM_DUTY_CYCLE * MAX_P12_FLUID_PUMP_DUTY_CYCLE_PCT ) ); setFluidPumpPctToPWMDutyCycle( P12_PUMP, roPumpDutyCyclePctSet ); if ( FALSE == roPumpStartControl ) @@ -509,7 +509,7 @@ BOOL result = FALSE; BOOL skipSet = FALSE; - if ( ( dutyCycle >= MIN_FLUID_PUMP_DUTY_CYCLE_PCT ) && ( dutyCycle <= MAX_FLUID_PUMP_DUTY_CYCLE_PCT ) ) + if ( ( dutyCycle >= MIN_FLUID_PUMP_DUTY_CYCLE_PCT ) && ( dutyCycle <= MAX_P12_FLUID_PUMP_DUTY_CYCLE_PCT ) ) { if ( firmwareCall == TRUE ) // firmware call { @@ -578,7 +578,7 @@ *************************************************************************/ F32 getCurrentROPumpDutyCyclePCT( void ) { - F32 dutyCyclePct = convertDutyCycleCntToPct( getFluidPumpReadPWMDutyCycle( P12_PUMP ) ); + F32 dutyCyclePct = convertDutyCycleCntToPct( P12_PUMP, getFluidPumpReadPWMDutyCycle( P12_PUMP ) ); return dutyCyclePct; } @@ -782,8 +782,8 @@ pumpData.p12TargetPressure = getTargetROPumpPressure(); pumpData.p12TargetFlow = getTargetROPumpFlowRateMLPM(); pumpData.p12TargetDutyCycle = getTargetROPumpDutyCyclePCT(); - pumpData.p12PumpDutyCyclePct = convertDutyCycleCntToPct( (U32)getFluidPumpPWMDutyCycle( P12_PUMP ) ); - pumpData.p12PumpFBDutyCyclePct = convertDutyCycleCntToPct( (U32)getFluidPumpReadPWMDutyCycle( P12_PUMP ) ); + pumpData.p12PumpDutyCyclePct = convertDutyCycleCntToPct( P12_PUMP, (U32)getFluidPumpPWMDutyCycle( P12_PUMP ) ); + pumpData.p12PumpFBDutyCyclePct = convertDutyCycleCntToPct( P12_PUMP, (U32)getFluidPumpReadPWMDutyCycle( P12_PUMP ) ); broadcastData( MSG_ID_FP_RO_PUMP_DATA, COMM_BUFFER_OUT_CAN_FP_BROADCAST, (U08*)&pumpData, sizeof( RO_PUMP_DATA_T ) ); roPumpDataPublicationTimerCounter = 0; Index: firmware/App/Drivers/FluidPump.c =================================================================== diff -u -r046bc2b62cf942b7e846fa5bff698b94238edf24 -r60693bf21a8a0277eae54cbfcb6cfd68176b079a --- firmware/App/Drivers/FluidPump.c (.../FluidPump.c) (revision 046bc2b62cf942b7e846fa5bff698b94238edf24) +++ firmware/App/Drivers/FluidPump.c (.../FluidPump.c) (revision 60693bf21a8a0277eae54cbfcb6cfd68176b079a) @@ -30,14 +30,17 @@ // ********** private definitions ********** -#define FLUID_PUMP_COUNTS_2_RPM_NUMERATOR 1500000.0F ///< Numerator in counts to RPM conversion. -#define FLUID_PUMP_COUNTS_FOR_STOPPED_PUMP 0xFFFF ///< FPGA will report FFFF counts when pump is stopped. +#define FLUID_PUMP_P12_COUNTS_2_RPM_NUMERATOR 1500000.0F ///< Numerator in counts to RPM conversion. +#define FLUID_PUMP_COUNTS_FOR_STOPPED_PUMP 0xFFFF ///< FPGA will report FFFF counts when pump is stopped. +#define US_IN_SECONDS ( 1 / US_PER_SECOND ) ///< One micro second in relation to 1 second +#define TEN_US_IN_SECONDS ( 10 * US_IN_SECONDS ) ///< 10 micro seconds in relation to 1 second. +#define FLUID_PUMP_P40_COUNTS_2_RPM_NUMERATOR 30 ///< Fixed known value for RPM conversion with P40. /// Payload record structure for fluid pump set PWM request typedef struct { U32 pumpID; ///< Pump ID - U32 pwm; ///< Pump PWM magnitude (0..500). + U32 pwm; ///< Pump PWM magnitude. } FLUID_PUMP_CMD_PAYLOAD_T; // ********** private data ********** @@ -90,7 +93,8 @@ *************************************************************************/ void readFluidPumps( void ) { - U32 tach; + U32 p12Tach; + U16 p40RPMCnts; U32 pump; for ( pump = 0; pump < NUM_OF_PUMPS; pump++ ) @@ -100,22 +104,31 @@ if ( P12_PUMP == pump ) { fluidPumpReadDutyCycle[ pump ].data = getFPGAP12PumpPWM(); - tach = (U32)getFPGAP12PumpTachCount(); + p12Tach = (U32)getFPGAP12PumpTachCount(); + + if ( ( p12Tach != 0 ) && ( p12Tach < FLUID_PUMP_COUNTS_FOR_STOPPED_PUMP ) ) + { + fluidPumpMeasRPM[ pump ].data = FLUID_PUMP_P12_COUNTS_2_RPM_NUMERATOR / (F32)p12Tach; + } + else + { + fluidPumpMeasRPM[ pump ].data = 0.0F; + } } else { fluidPumpReadDutyCycle[ pump ].data = getFPGAP40PumpPWM(); - tach = (U32)getFPGAP40PumpTachCount(); + p40RPMCnts = (U32)getFPGAP40PumpRPMCount(); + if ( ( p40RPMCnts != 0 ) ) + { + fluidPumpMeasRPM[ pump ].data = FLUID_PUMP_P40_COUNTS_2_RPM_NUMERATOR / ((F32)( p40RPMCnts * TEN_US_IN_SECONDS )); + } + else + { + fluidPumpMeasRPM[ pump ].data = 0.0F; + } } - if ( ( tach != 0 ) && ( tach < FLUID_PUMP_COUNTS_FOR_STOPPED_PUMP ) ) - { - fluidPumpMeasRPM[ pump ].data = FLUID_PUMP_COUNTS_2_RPM_NUMERATOR / (F32)tach; - } - else - { - fluidPumpMeasRPM[ pump ].data = 0.0F; - } } } @@ -137,7 +150,7 @@ if ( pumpID < NUM_OF_PUMPS ) { - pwmCnt = convertDutyCyclePctToCnt( dutyCyclePct ); + pwmCnt = convertDutyCyclePctToCnt( pumpID, dutyCyclePct ); result = setFluidPumpPWMDutyCycle(pumpID, pwmCnt); } else @@ -150,13 +163,13 @@ /*********************************************************************//** * @brief - * The setFluidPumpPWMDutyCycle function sets the commanded PWM magnitude (0..500) + * The setFluidPumpPWMDutyCycle function sets the commanded PWM magnitude * for the given fluid pump. * @details \b Alarm: ALARM_ID_RO_SOFTWARE_FAULT if invalid fluid pump ID given. * @details \b Inputs: none * @details \b Outputs: fluidPumpCmdDutyCycle[] * @param pumpID ID of fluid pump to set commanded PWM magnitude for. - * @param pwm Value (0..500) indicating magnitude of PWM duty cycle to set + * @param pwm Value indicating magnitude of PWM duty cycle to set. (0..500) for P12_PUMP (0..5000) for P40. * @return TRUE if duty cycle set successfully, FALSE if not *************************************************************************/ BOOL setFluidPumpPWMDutyCycle( FP_FLUID_PUMP_T pumpID, U16 pwm ) @@ -189,16 +202,17 @@ } } - // constrain given pwm magnitude to valid range - pwm = MIN( pwm, MAX_FLUID_PUMP_PWM_DUTY_CYCLE ); - // set commanded duty cycle for given fluid pump to given pwm magnitude - fluidPumpCmdDutyCycle[ pumpID ] = pwm; + // set commanded duty cycle for given fluid pump to given pwm magnitude. if ( P12_PUMP == pumpID ) { + // constrain given pwm magnitude to valid range + pwm = MIN( pwm, MAX_P12_FLUID_PUMP_PWM_DUTY_CYCLE ); setFPGAP12PumpPWM( pwm ); } else { + // constrain given pwm magnitude to valid range + pwm = MIN( pwm, MAX_P40_FLUID_PUMP_PWM_DUTY_CYCLE ); setFPGAP40PumpPWM( pwm ); } result = TRUE; @@ -213,13 +227,13 @@ /*********************************************************************//** * @brief - * The getFluidPumpPWMDutyCycle function gets the commanded PWM magnitude (0..500) + * The getFluidPumpPWMDutyCycle function gets the commanded PWM magnitude * for the given fluid pump. * @details \b Alarm: ALARM_ID_RO_SOFTWARE_FAULT if invalid fluid pump ID given. * @details \b Inputs: fluidPumpCmdDutyCycle[] * @details \b Outputs: none * @param pumpID ID of fluid pump to get commanded PWM magnitude for. - * @return Value (0..500) indicating magnitude of PWM duty cycle + * @return Value indicating magnitude of PWM duty cycle. (0..500) for P12_PUMP (0..5000) for P40. *************************************************************************/ U16 getFluidPumpPWMDutyCycle( FP_FLUID_PUMP_T pumpID ) { @@ -239,13 +253,13 @@ /*********************************************************************//** * @brief - * The getFluidPumpReadPWMDutyCycle function gets the PWM magnitude (0..500) + * The getFluidPumpReadPWMDutyCycle function gets the PWM magnitude * read back from FPGA for the given fluid pump. * @details \b Alarm: ALARM_ID_RO_SOFTWARE_FAULT if invalid fluid pump ID given. * @details \b Inputs: fluidPumpReadDutyCycle[] * @details \b Outputs: none * @param pumpID ID of fluid pump to get read back PWM magnitude for. - * @return Value (0..500) indicating magnitude of PWM duty cycle + * @return Value indicating magnitude of PWM duty cycle. (0..500) for P12_PUMP (0..5000) for P40. *************************************************************************/ U16 getFluidPumpReadPWMDutyCycle( FP_FLUID_PUMP_T pumpID ) { @@ -296,12 +310,28 @@ * @details Inputs: none * @details Outputs: none * @param dutyCyclePct duty cycle percentage to be converted. - * @return Value (0..500) indicating magnitude of PWM duty cycle. + * @return Value indicating magnitude of PWM duty cycle. (0..500) for P12_PUMP (0..5000) for P40. *************************************************************************/ -U16 convertDutyCyclePctToCnt( F32 dutyCyclePct ) +U16 convertDutyCyclePctToCnt( FP_FLUID_PUMP_T pumpID, F32 dutyCyclePct ) { - U16 pwmCnt = (U16)MAX( (MAX_FLUID_PUMP_PWM_DUTY_CYCLE * dutyCyclePct) , MIN_FLUID_PUMP_PWM_DUTY_CYCLE ); + U16 pwmCnt = 0; + if ( pumpID < NUM_OF_PUMPS ) + { + if ( P12_PUMP == pumpID ) + { + pwmCnt = (U16)MAX( (MAX_P12_FLUID_PUMP_PWM_DUTY_CYCLE * dutyCyclePct) , MIN_FLUID_PUMP_PWM_DUTY_CYCLE ); + } + else + { + pwmCnt = (U16)MAX( (MAX_P40_FLUID_PUMP_PWM_DUTY_CYCLE * dutyCyclePct) , MIN_FLUID_PUMP_PWM_DUTY_CYCLE ); + } + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, FP_FAULT_ID_INVALID_FLUID_PUMP_ID5, (U32)pumpID ) + } + return pwmCnt; } /*********************************************************************//** @@ -313,10 +343,25 @@ * @param dutyCyclePct duty cycle count to be converted. * @return Value (0..0.99) indicating magnitude of PWM duty cycle as a percentage. *************************************************************************/ -F32 convertDutyCycleCntToPct( U32 dutyCycleCnt ) +F32 convertDutyCycleCntToPct( FP_FLUID_PUMP_T pumpID, U32 dutyCycleCnt ) { - F32 pwmCnt = MAX( ( (F32)dutyCycleCnt / (F32)MAX_FLUID_PUMP_PWM_DUTY_CYCLE ) , (F32)MIN_FLUID_PUMP_PWM_DUTY_CYCLE ); + F32 pwmCnt = 0.0; + if ( pumpID < NUM_OF_PUMPS ) + { + if ( P12_PUMP == pumpID ) + { + pwmCnt = MAX( ( (F32)dutyCycleCnt / (F32)MAX_P12_FLUID_PUMP_PWM_DUTY_CYCLE ) , (F32)MIN_FLUID_PUMP_PWM_DUTY_CYCLE ); + } + else + { + pwmCnt = MAX( ( (F32)dutyCycleCnt / (F32)MAX_P40_FLUID_PUMP_PWM_DUTY_CYCLE ) , (F32)MIN_FLUID_PUMP_PWM_DUTY_CYCLE ); + } + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, FP_FAULT_ID_INVALID_FLUID_PUMP_ID6, (U32)pumpID ) + } return pwmCnt; } @@ -420,7 +465,7 @@ *************************************************************************/ BOOL testFluidPumpPWMOverride( MESSAGE_T *message ) { - BOOL result = u32ArrayOverride( message, &fluidPumpReadDutyCycle[0], NUM_OF_PUMPS - 1, 0, MAX_FLUID_PUMP_PWM_DUTY_CYCLE ); + BOOL result = u32ArrayOverride( message, &fluidPumpReadDutyCycle[0], NUM_OF_PUMPS - 1, 0, MAX_P40_FLUID_PUMP_PWM_DUTY_CYCLE ); return result; } Index: firmware/App/Drivers/FluidPump.h =================================================================== diff -u -r830213bc6dcc1a684610caf78c79d55f2cb41e93 -r60693bf21a8a0277eae54cbfcb6cfd68176b079a --- firmware/App/Drivers/FluidPump.h (.../FluidPump.h) (revision 830213bc6dcc1a684610caf78c79d55f2cb41e93) +++ firmware/App/Drivers/FluidPump.h (.../FluidPump.h) (revision 60693bf21a8a0277eae54cbfcb6cfd68176b079a) @@ -32,10 +32,12 @@ // ********** public definitions ********** -#define MAX_FLUID_PUMP_PWM_DUTY_CYCLE 500 ///< Maximum settable boost pump duty cycle magnitude. -#define MIN_FLUID_PUMP_PWM_DUTY_CYCLE 0 ///< minimum settable boost pump duty cycle magnitude. +#define MAX_P40_FLUID_PUMP_PWM_DUTY_CYCLE 5000 ///< Maximum settable pump duty cycle magnitude for P40. +#define MAX_P12_FLUID_PUMP_PWM_DUTY_CYCLE 500 ///< Maximum settable pump duty cycle magnitude for P12. +#define MIN_FLUID_PUMP_PWM_DUTY_CYCLE 0 ///< Minimum settable pump duty cycle magnitude. -#define MAX_FLUID_PUMP_DUTY_CYCLE_PCT 0.90F ///< Max duty cycle in percentage. +#define MAX_P40_FLUID_PUMP_DUTY_CYCLE_PCT 0.98F ///< Max duty cycle for P40 in percentage +#define MAX_P12_FLUID_PUMP_DUTY_CYCLE_PCT 0.90F ///< Max duty cycle for P12 in percentage. #define MIN_FLUID_PUMP_DUTY_CYCLE_PCT 0.0F ///< Min duty cycle in percentage. /// Enumerations of fluid pumps. @@ -57,8 +59,8 @@ U16 getFluidPumpReadPWMDutyCycle( FP_FLUID_PUMP_T pumpID ); F32 getFluidPumpRPM( FP_FLUID_PUMP_T pumpID ); -F32 convertDutyCycleCntToPct( U32 dutyCycleCnt ); -U16 convertDutyCyclePctToCnt( F32 dutyCyclePct ); +F32 convertDutyCycleCntToPct( FP_FLUID_PUMP_T pumpID, U32 dutyCycleCnt ); +U16 convertDutyCyclePctToCnt( FP_FLUID_PUMP_T pumpID, F32 dutyCyclePct ); BOOL setFluidPumpPctToPWMDutyCycle( FP_FLUID_PUMP_T pumpID, F32 dutyCyclePct); void handleFluidPumpU32Data( OVERRIDE_U32_T *ovU32); void handleFluidPumpF32Data( OVERRIDE_F32_T *ovF32); Index: firmware/App/Services/AlarmMgmtSWFaults.h =================================================================== diff -u -r824e9354a800e80aff089a545f91f424c6e4bd52 -r60693bf21a8a0277eae54cbfcb6cfd68176b079a --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 824e9354a800e80aff089a545f91f424c6e4bd52) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 60693bf21a8a0277eae54cbfcb6cfd68176b079a) @@ -163,6 +163,8 @@ SW_FAULT_ID_PID_CTRL_INVALID_CONTROLLER3 = 132, SW_FAULT_ID_PID_CTRL_INVALID_CONTROLLER4 = 133, SW_FAULT_ID_PID_CTRL_INVALID_SIGNAL = 134, + SW_FAULT_ID_SUBSTITUTION_PUMP_INVALID_ID = 135, + SW_FAULT_ID_SUBSTITUTION_PUMP_EXEC_INVALID_STATE = 136, NUM_OF_SW_FAULT_IDS } DD_SW_FAULT_ID_T; @@ -295,6 +297,8 @@ FP_FAULT_ID_FP_INVALID_PERMEATE_TANK_STATE = 123, FP_FAULT_ID_FP_INVALID_INLET_PRESSURE_CHECK_STATE = 124, FP_FAULT_ID_FP_INVALID_RECOVERY_VALVE_STATE = 125, + FP_FAULT_ID_INVALID_FLUID_PUMP_ID5 = 126, + FP_FAULT_ID_INVALID_FLUID_PUMP_ID6 = 127, NUM_OF_FP_FAULT_IDS } FP_SW_FAULT_ID_T; Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -ra6737c3bcc8286c153b778c2c395f465e76aaafb -r60693bf21a8a0277eae54cbfcb6cfd68176b079a --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision a6737c3bcc8286c153b778c2c395f465e76aaafb) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 60693bf21a8a0277eae54cbfcb6cfd68176b079a) @@ -251,7 +251,7 @@ U16 temperatureP13; ///< Reg 674. P13 temperature data. S16 pressureP17; ///< Reg 676. P17 pressure data. U16 temperatureP17; ///< Reg 678. P17 temperature data. - U16 p40PumpTachCount; ///< Reg 680. P40 pump tachometer counter. + U16 p40PumpRPMCounts; ///< Reg 680. P40 pump tachometer counter. U08 p25LevelSwitch; ///< Reg 682. P25 level switch. U08 reserved4; ///< Reg 683. Reserved. U32 conductivityP9Data; ///< Reg 684. P9 conductivity sensor data. @@ -371,7 +371,7 @@ U16 temperatureP13; ///< Reg 634. P13 temperature data. S16 pressureP17; ///< Reg 636. P17 pressure data. U16 temperatureP17; ///< Reg 638. P17 temperature data. - U16 p40PumpTachCount; ///< Reg 640. P40 pump tachometer counter. + U16 p40PumpRPMCounts; ///< Reg 640. P40 pump rpm counter. U08 p25LevelSwitch; ///< Reg 642. P25 level switch. U08 fpgaGPIOStatus; ///< Reg 643. GPIO Status U16 flowRateP7; ///< Reg 644. P7 flow sensor rate. @@ -3730,15 +3730,15 @@ /*********************************************************************//** * @brief - * The getFPGAP12PumpTachCount function gets the running 16-bit tachometer count + * The getFPGAP40PumpRPMCount function gets the running 16-bit rpm count * from the P40 pump hall sensor. - * @details \b Inputs: p40PumpTachCount + * @details \b Inputs: p40PumpRPMCounts * @details \b Outputs: none - * @return P40 pump tachometer count + * @return P40 pump rpm count *************************************************************************/ -U16 getFPGAP40PumpTachCount( void ) +U16 getFPGAP40PumpRPMCount( void ) { - return GET_FPGA_SENSOR_FIELD( p40PumpTachCount ); + return GET_FPGA_SENSOR_FIELD( p40PumpRPMCounts ); } /*********************************************************************//** Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -rb04db69f541f245e543df343257bcbdb73fbbc3d -r60693bf21a8a0277eae54cbfcb6cfd68176b079a --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision b04db69f541f245e543df343257bcbdb73fbbc3d) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 60693bf21a8a0277eae54cbfcb6cfd68176b079a) @@ -316,7 +316,7 @@ void setFPGAP40PumpEnable( BOOL enable ); void setFPGAP40PumpPWM( U16 pwm ); U16 getFPGAP40PumpPWM( void ); -U16 getFPGAP40PumpTachCount( void ); +U16 getFPGAP40PumpRPMCount( void ); /**@}*/