/************************************************************************** * * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPBoostDUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file BoostPump.h * * @author (last) Sean Nash * @date (last) 12-Nov-2024 * * @author (original) Sean Nash * @date (original) 12-Nov-2024 * ***************************************************************************/ #ifndef __BOOSTPUMP_H__ #define __BOOSTPUMP_H__ #include "FluidPump.h" #include "DDCommon.h" /** * @defgroup BoostPump BoostPump * @brief Boost Pump controller unit. Controls and monitors the Boost pump. * The diaphragm (Boost) pump is manufactured by Aquatec, PN: 5889-2MM1-V724DY. * * @addtogroup BoostPump * @{ */ // ********** public definitions ********** #define MAX_BOOST_FLOWRATE_MLPM 1500 ///< Maximum target Boost flow rate in mL/min. #define MIN_BOOST_FLOWRATE_MLPM 0 ///< Minimum target Boost flow rate in mL/min. #define MAX_BOOST_PRESSURE_PSI 40.0F ///< Maximum allowed pressure that the Boost pump can go to. #define MIN_BOOST_PRESSURE_PSI 10.0F ///< Minimum allowed pressure that the Boost pump can go to. #define BOOST_FLOW_TO_PWM(flow) ( BOOST_FLOW_TO_PWM_SLOPE * flow + BOOST_FLOW_TO_PWM_INTERCEPT ) ///< PWM line equation for flow. #define BOOST_PRESSURE_TO_PWM(pres) ( BOOST_PRESSURE_TO_PWM_SLOPE * pres + BOOST_PRESSURE_TO_PWM_INTERCEPT ) ///< PWM line equation for pressure. /// Boost pump data record. typedef struct { U32 p40PumpState; ///< Boost pump current state. U32 p40PumpDutyCycle; ///< Boost pump duty cycle at driver level. U32 p40PumpFBDutyCycle; ///< Boost pump feedback duty cycle. F32 p40PumpSpeed; ///< Boost pump speed (RPM). F32 p40TargetPressure; ///< Boost pump target pressure for control. F32 p40TargetFlow; ///< Boost pump target flow ( in mL/min ) for control. F32 p40TargetDutyCycle; ///< Boost pump target duty cycle for open loop control. F32 p40PumpDutyCyclePct; ///< Boost pump duty cycle as a percentage. F32 p40PumpFBDutyCyclePct; ///< Boost pump feedback duty cycle as a percentage. } BOOST_PUMP_DATA_T; // ********** public function prototypes ********** void initBoostPump( void ); void execBoostPumpController( void ); void execBoostPumpMonitor( void ); void signalBoostPumpHardStop( void ); BOOL isBoostPumpRunning( void ); BOOL setBoostPumpTargetFlowRateLPM( U32 roFlowRate ); BOOL setBoostPumpTargetPressure( F32 roPressure ); BOOL setBoostPumpTargetDutyCycle( F32 duty ); F32 getCurrentBoostPumpDutyCyclePCT( void ); F32 getTargetBoostPumpDutyCyclePCT( void ); U32 getTargetBoostPumpFlowRateMLPM( void ); F32 getTargetBoostPumpPressure( void ); BOOL testBoostPumpDataPublishIntervalOverride( MESSAGE_T *message ); BOOL testBoostPumpTargetPressureOverride( MESSAGE_T *message ); BOOL testBoostPumpTargetFlowOverride( MESSAGE_T *message ); BOOL testBoostPumpTargetDutyCycleOverride( MESSAGE_T *message ); BOOL testBoostPumpHardStop( MESSAGE_T *message ); /**@}*/ #endif