Index: firmware/App/Controllers/BoostPump.c =================================================================== diff -u -r319d8e8f56e60bec2c38c79e1de0acc4841551a9 -re6c6e39765c3f993b6a2b965188e7c13e93ffa92 --- firmware/App/Controllers/BoostPump.c (.../BoostPump.c) (revision 319d8e8f56e60bec2c38c79e1de0acc4841551a9) +++ firmware/App/Controllers/BoostPump.c (.../BoostPump.c) (revision e6c6e39765c3f993b6a2b965188e7c13e93ffa92) @@ -122,20 +122,20 @@ isBoostPumpOn = FALSE; stopPumpRequest = FALSE; boostControlTimerCounter = 0; - boostPumpDutyCyclePctSet = 0.0; - boostPumpOpenLoopTargetDutyCycle = 0.0; + boostPumpDutyCyclePctSet = 0.0F; + boostPumpOpenLoopTargetDutyCycle = 0.0F; boostPumpDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; boostPumpDataPublishInterval.data = BOOST_DATA_PUB_INTERVAL; boostPumpDataPublishInterval.ovData = BOOST_CONTROL_INTERVAL; boostPumpDataPublishInterval.ovInitData = 0; boostPumpDataPublishInterval.override = OVERRIDE_RESET; - targetBoostPumpFlowRate.data = 0.0; - targetBoostPumpFlowRate.ovData = 0.0; - targetBoostPumpFlowRate.ovInitData = 0.0; + targetBoostPumpFlowRate.data = 0.0F; + targetBoostPumpFlowRate.ovData = 0.0F; + targetBoostPumpFlowRate.ovInitData = 0.0F; targetBoostPumpFlowRate.override = OVERRIDE_RESET; - targetBoostPumpPressure.data = 0.0; - targetBoostPumpPressure.ovData = 0.0; - targetBoostPumpPressure.ovInitData = 0.0; + targetBoostPumpPressure.data = 0.0F; + targetBoostPumpPressure.ovData = 0.0F; + targetBoostPumpPressure.ovInitData = 0.0F; targetBoostPumpPressure.override = OVERRIDE_RESET; stopBoostPump(); @@ -248,15 +248,15 @@ if ( ( getTargetBoostPumpPressure() > 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) { //transition to closed loop - resetPIController( PI_CONTROLLER_ID_BOOST_PUMP_PRES, boostPumpDutyCyclePctSet, 0 ); + resetPIController( PI_CONTROLLER_ID_BOOST_PUMP_PRES, boostPumpDutyCyclePctSet, 0.0F ); 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 ( ( getTargetBoostPumpFlowRateLPM() > 0.0F ) && ( PUMP_CONTROL_MODE_CLOSED_LOOP == boostPumpControlMode ) ) { ///transition to closed loop - resetPIController( PI_CONTROLLER_ID_BOOST_PUMP_FLOW, boostPumpDutyCyclePctSet, 0 ); + resetPIController( PI_CONTROLLER_ID_BOOST_PUMP_FLOW, boostPumpDutyCyclePctSet, 0.0F ); state = BOOST_PUMP_CONTROL_TO_TARGET_FLOW_STATE; } @@ -336,11 +336,11 @@ // Clear previous target data if ( getTargetBoostPumpPressure() > 0.0F ) { - targetBoostPumpPressure.data = 0.0; + targetBoostPumpPressure.data = 0.0F; } if ( boostPumpOpenLoopTargetDutyCycle > 0.0F ) { - boostPumpOpenLoopTargetDutyCycle = 0.0; + boostPumpOpenLoopTargetDutyCycle = 0.0F; } result = TRUE; } @@ -379,11 +379,11 @@ // Clear previous target data if ( getTargetBoostPumpFlowRateLPM() > 0.0F ) { - targetBoostPumpFlowRate.data = 0.0; + targetBoostPumpFlowRate.data = 0.0F; } if ( boostPumpOpenLoopTargetDutyCycle > 0.0F ) { - boostPumpOpenLoopTargetDutyCycle = 0.0; + boostPumpOpenLoopTargetDutyCycle = 0.0F; } result = TRUE; } @@ -422,11 +422,11 @@ // Clear previous target data if ( getTargetBoostPumpFlowRateLPM() > 0.0F ) { - targetBoostPumpFlowRate.data = 0.0; + targetBoostPumpFlowRate.data = 0.0F; } if ( getTargetBoostPumpPressure() > 0.0F ) { - targetBoostPumpPressure.data = 0.0; + targetBoostPumpPressure.data = 0.0F; } } else @@ -473,8 +473,10 @@ * pressure. * @details Inputs: none * @details Outputs: dutyCyclePct + * @param targetPressure target pressure value to control in PSI * @return the current target Boost pump PWM in a percentage. *************************************************************************/ + static F32 boostPumpPresToPWM( F32 targetPressure ) { F32 dutyCyclePct = BOOST_PRESSURE_TO_PWM( targetPressure ); @@ -488,6 +490,7 @@ * flow rate. * @details Inputs: none * @details Outputs: dutyCyclePct + * @param targetFlow target flow value to control in in L/min * @return the current target Boost pump PWM in a percentage. *************************************************************************/ static F32 boostPumpFlowToPWM( F32 targetFlow ) @@ -503,42 +506,41 @@ * resets all the variables associated with the P12 pump run. * @details \b Inputs: boostPumpState[] * @details \b Outputs: stopPumpRequest[] - * @param pumpID ID of boost pump to stop * @return none *************************************************************************/ void signalBoostPumpHardStop( void ) { if( targetBoostPumpFlowRate.data > 0.0F ) { - targetBoostPumpFlowRate.data = 0.0; + targetBoostPumpFlowRate.data = 0.0F; resetPIController( PI_CONTROLLER_ID_BOOST_PUMP_FLOW, MIN_FLUID_PUMP_DUTY_CYCLE_PCT, 0 ); } if( targetBoostPumpPressure.data > 0.0F ) { - targetBoostPumpPressure.data = 0.0; + targetBoostPumpPressure.data = 0.0F; resetPIController( PI_CONTROLLER_ID_BOOST_PUMP_PRES, MIN_FLUID_PUMP_DUTY_CYCLE_PCT, 0 ); } boostPumpState = BOOST_PUMP_OFF_STATE; - boostPumpDutyCyclePctSet = 0; + boostPumpDutyCyclePctSet = 0.0F; boostControlTimerCounter = 0; - boostPumpOpenLoopTargetDutyCycle = 0; + boostPumpOpenLoopTargetDutyCycle = 0.0F; stopBoostPump(); } /*********************************************************************//** * @brief * The stopBoostPump function sets the P40 pump duty cycle to zero. - * @details Inputs: isBoostPumpOn, boostPumpPWMDutyCyclePctSet + * @details Inputs: none * @details Outputs: isBoostPumpOn, boostPumpPWMDutyCyclePctSet * @return none *************************************************************************/ static void stopBoostPump( void ) { isBoostPumpOn = FALSE; - boostPumpDutyCyclePctSet = 0.0; + boostPumpDutyCyclePctSet = 0.0F; // Set the new duty cycle of the pump setFluidPumpPWMDutyCycle( P40_PUMP, 0 ); } @@ -555,6 +557,7 @@ { return isBoostPumpOn; } + /*********************************************************************//** * @brief * The publishBoostPumpData function publishes p12 pump data at the set interval. @@ -608,10 +611,10 @@ /*********************************************************************//** * @brief - * The testBoostPumpDataPublishIntervalOverride function overrides the Boost pump + * The testBoostPumpTargetPressureOverride function overrides the Boost pump * data publish interval. - * @details Inputs: boostPumpDataPublishInterval - * @details Outputs: boostPumpDataPublishInterval + * @details Inputs: targetBoostPumpPressure + * @details Outputs: targetBoostPumpPressure * @param message Override message from Dialin which includes the value * that override boost pump data publish interval with (in ms) * @return TRUE if override successful, FALSE if not @@ -625,10 +628,10 @@ /*********************************************************************//** * @brief - * The testBoostPumpDataPublishIntervalOverride function overrides the Boost pump + * The testBoostPumpTargetFlowOverride function overrides the Boost pump * data publish interval. - * @details Inputs: boostPumpDataPublishInterval - * @details Outputs: boostPumpDataPublishInterval + * @details Inputs: targetBoostPumpFlowRate + * @details Outputs: targetBoostPumpFlowRate * @param message Override message from Dialin which includes the value * that override boost pump data publish interval with (in ms) * @return TRUE if override successful, FALSE if not Index: firmware/App/Controllers/ROPump.c =================================================================== diff -u -rc71fc505053e922b9865f1e241d01e144d8d68cd -re6c6e39765c3f993b6a2b965188e7c13e93ffa92 --- firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision c71fc505053e922b9865f1e241d01e144d8d68cd) +++ firmware/App/Controllers/ROPump.c (.../ROPump.c) (revision e6c6e39765c3f993b6a2b965188e7c13e93ffa92) @@ -124,20 +124,20 @@ isROPumpOn = FALSE; stopPumpRequest = FALSE; roControlTimerCounter = 0; - roPumpDutyCyclePctSet = 0.0; - roPumpOpenLoopTargetDutyCycle = 0.0; + roPumpDutyCyclePctSet = 0.0F; + roPumpOpenLoopTargetDutyCycle = 0.0F; roPumpDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; roPumpDataPublishInterval.data = RO_PUMP_DATA_PUB_INTERVAL; roPumpDataPublishInterval.ovData = RO_PUMP_DATA_PUB_INTERVAL; roPumpDataPublishInterval.ovInitData = 0; roPumpDataPublishInterval.override = OVERRIDE_RESET; - targetROPumpFlowRate.data = 0.0; - targetROPumpFlowRate.ovData = 0.0; - targetROPumpFlowRate.ovInitData = 0.0; + targetROPumpFlowRate.data = 0.0F; + targetROPumpFlowRate.ovData = 0.0F; + targetROPumpFlowRate.ovInitData = 0.0F; targetROPumpFlowRate.override = OVERRIDE_RESET; - targetROPumpPressure.data = 0.0; - targetROPumpPressure.ovData = 0.0; - targetROPumpPressure.ovInitData = 0.0; + targetROPumpPressure.data = 0.0F; + targetROPumpPressure.ovData = 0.0F; + targetROPumpPressure.ovInitData = 0.0F; targetROPumpPressure.override = OVERRIDE_RESET; stopROPump(); @@ -339,11 +339,11 @@ // Clear previous target data if ( getTargetROPumpPressure() > 0.0F ) { - targetROPumpPressure.data = 0; + targetROPumpPressure.data = 0.0F;; } if ( roPumpOpenLoopTargetDutyCycle > 0.0F ) { - roPumpOpenLoopTargetDutyCycle = 0; + roPumpOpenLoopTargetDutyCycle = 0.0F;; } result = TRUE; } @@ -382,11 +382,11 @@ // Clear previous target data if ( getTargetROPumpFlowRateLPM() > 0.0F ) { - targetROPumpFlowRate.data = 0; + targetROPumpFlowRate.data = 0.0F;; } if ( roPumpOpenLoopTargetDutyCycle > 0.0F ) { - roPumpOpenLoopTargetDutyCycle = 0; + roPumpOpenLoopTargetDutyCycle = 0.0F;; } result = TRUE; } @@ -425,11 +425,11 @@ // Clear previous target data if ( getTargetROPumpFlowRateLPM() > 0.0F ) { - targetROPumpFlowRate.data = 0; + targetROPumpFlowRate.data = 0.0F;; } if ( getTargetROPumpPressure() > 0.0F ) { - targetROPumpPressure.data = 0; + targetROPumpPressure.data = 0.0F;; } } else @@ -476,6 +476,7 @@ * pressure. * @details Inputs: none * @details Outputs: dutyCyclePct + * @param targetPressure target pressure value to control in PSI * @return the current target RO pump PWM in a percentage. *************************************************************************/ static F32 roPumpPresToPWM( F32 targetPressure ) @@ -491,6 +492,7 @@ * flow rate. * @details Inputs: none * @details Outputs: dutyCyclePct + * @param targetFlow target flow value to control in in mL/min * @return the current target RO pump PWM in a percentage. *************************************************************************/ static F32 roPumpFlowToPWM( F32 targetFlow ) @@ -506,26 +508,25 @@ * resets all the variables associated with the P12 pump run. * @details \b Inputs: roPumpState[] * @details \b Outputs: stopPumpRequest[] - * @param pumpID ID of boost pump to stop * @return none *************************************************************************/ void signalROPumpHardStop( void ) { if( targetROPumpFlowRate.data > 0.0F ) { - targetROPumpFlowRate.data = 0.0; - resetPIController( PI_CONTROLLER_ID_RO_PUMP_FLOW, MIN_FLUID_PUMP_DUTY_CYCLE_PCT, 0 ); + targetROPumpFlowRate.data = 0.0F;; + resetPIController( PI_CONTROLLER_ID_RO_PUMP_FLOW, MIN_FLUID_PUMP_DUTY_CYCLE_PCT, 0.0F ); } if( targetROPumpPressure.data > 0.0F ) { - targetROPumpPressure.data = 0.0; - resetPIController( PI_CONTROLLER_ID_RO_PUMP_PRES, MIN_FLUID_PUMP_DUTY_CYCLE_PCT, 0 ); + targetROPumpPressure.data = 0.0F;; + resetPIController( PI_CONTROLLER_ID_RO_PUMP_PRES, MIN_FLUID_PUMP_DUTY_CYCLE_PCT, 0.0F ); } roPumpState = RO_PUMP_OFF_STATE; - roPumpDutyCyclePctSet = 0; + roPumpDutyCyclePctSet = 0.0F; roControlTimerCounter = 0; roPumpOpenLoopTargetDutyCycle = 0; stopROPump(); @@ -534,14 +535,14 @@ /*********************************************************************//** * @brief * The stopROPump function sets the P12 pump duty cycle to zero. - * @details Inputs: isROPumpOn, roPumpPWMDutyCyclePctSet + * @details Inputs: none * @details Outputs: isROPumpOn, roPumpPWMDutyCyclePctSet * @return none *************************************************************************/ static void stopROPump( void ) { isROPumpOn = FALSE; - roPumpDutyCyclePctSet = 0.0; + roPumpDutyCyclePctSet = 0.0F; // Set the new duty cycle of the pump setFluidPumpPWMDutyCycle( P12_PUMP, 0 ); } @@ -558,6 +559,7 @@ { return isROPumpOn; } + /*********************************************************************//** * @brief * The publishROPumpData function publishes p12 pump data at the set interval. @@ -611,10 +613,10 @@ /*********************************************************************//** * @brief - * The testROPumpDataPublishIntervalOverride function overrides the RO pump + * The testROPumpTargetPressureOverride function overrides the RO pump * data publish interval. - * @details Inputs: roPumpDataPublishInterval - * @details Outputs: roPumpDataPublishInterval + * @details Inputs: targetROPumpPressure + * @details Outputs: targetROPumpPressure * @param message Override message from Dialin which includes the value * that override ro pump data publish interval with (in ms) * @return TRUE if override successful, FALSE if not @@ -628,10 +630,10 @@ /*********************************************************************//** * @brief - * The testROPumpDataPublishIntervalOverride function overrides the RO pump + * The testROPumpTargetFlowOverride function overrides the RO pump * data publish interval. - * @details Inputs: roPumpDataPublishInterval - * @details Outputs: roPumpDataPublishInterval + * @details Inputs: targetROPumpFlowRate + * @details Outputs: targetROPumpFlowRate * @param message Override message from Dialin which includes the value * that override ro pump data publish interval with (in ms) * @return TRUE if override successful, FALSE if not