/************************************************************************** * * Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file ROPump.h * * @author (last) Bill Bracken * @date (last) 22-Aug-2022 * * @author (original) Sean * @date (original) 04-Apr-2020 * ***************************************************************************/ #ifndef __RO_PUMP_H__ #define __RO_PUMP_H__ #include "DGCommon.h" /** * @defgroup ROPump ROPump * @brief RO Pump monitor and controller module. Controls and monitors the RO pump. * The flow meter is manufactured by SwissFlow, PN: 82015311. * The diaphragm (RO) pump is manufactured by Aquatec, PN: 5889-2MM1-V724DY. * * @addtogroup ROPump * @{ */ // ********** public definitions ********** #define MAX_RO_FLOWRATE_LPM 1.8F ///< Maximum target RO flow rate in L/min. #define MIN_RO_FLOWRATE_LPM 0.0F ///< Minimum target RO flow rate in L/min. /// RO pump data struct. typedef struct { F32 roPumpTgtPressure; ///< RO pump target pressure. F32 measROFlowRate; ///< RO flow rate measurement. F32 roPumpDutyCycle; ///< RO pump duty cycle. U32 roPumpState; ///< RO pump current state. F32 roPumpTgtFlowRateLM; ///< RO pump target flow rate in L/min F32 roPumpFBDutyCycle; ///< RO pump feedback duty cycle. F32 roPumpMeasFlowWithConcPumps; ///< RO pump measured flow with the concentrate pumps. } RO_PUMP_DATA_T; // ********** public function prototypes ********** void initROPump( void ); void execROPumpMonitor( void ); void execROPumpController( void ); SELF_TEST_STATUS_T execROPumpSelfTest( void ); BOOL setROPumpTargetFlowRateLPM( F32 roFlowRate, U32 maxPressure ); BOOL setROPumpTargetFlowRateDelayed( F32 roFlowRate, U32 maxPressure, U32 delayMs ); void signalROPumpHardStop( void ); BOOL isROPumpRunning( void ); F32 getTargetROPumpFlowRateLPM( void ); F32 getMeasuredROFlowRateLPM( void ); F32 getMeasuredROFlowRateWithConcPumpsLPM( void ); F32 getTargetROPumpPressure( void ); F32 getROGeneratedVolumeL( void ); void resetROGenerateVolumeL( void ); BOOL testSetROPumpDataPublishIntervalOverride( U32 value ); BOOL testResetROPumpDataPublishIntervalOverride( void ); BOOL testSetMeasuredROFlowRateOverride( F32 value ); BOOL testResetMeasuredROFlowRateOverride( void ); BOOL testSetTargetROPumpFlow( F32 flow ); BOOL testSetTargetROPumpPressure( U32 value ); BOOL testSetTargetDutyCycle( F32 value ); /**@}*/ #endif