Index: firmware/App/Modes/FPModes/FlushFilterDefeatured.c =================================================================== diff -u -r0cee1110f21bca6bd223f8c94d2171a9f162edb5 -rfb0f180eb25dbcfd15d58ef584d535efd1c24e30 --- firmware/App/Modes/FPModes/FlushFilterDefeatured.c (.../FlushFilterDefeatured.c) (revision 0cee1110f21bca6bd223f8c94d2171a9f162edb5) +++ firmware/App/Modes/FPModes/FlushFilterDefeatured.c (.../FlushFilterDefeatured.c) (revision fb0f180eb25dbcfd15d58ef584d535efd1c24e30) @@ -20,42 +20,38 @@ #include "FPOperationModes.h" #include "MessageSupport.h" #include "Messaging.h" +#include "PersistentAlarm.h" #include "Pressure.h" #include "TaskGeneral.h" #include "Timers.h" #include "Valves.h" #include "WaterQualityMonitor.h" /** - * @addtogroup FPFilterFlush + * @addtogroup FPFilterFlushDefeatured * @{ */ // ********** private definitions ********** -#define FILTER_FLUSH_MAX_TIMEOUT ( 10 * SEC_PER_MIN * MS_PER_SECOND ) ///< Max override timeout for 10 minutes +#define FILTER_FLUSH_DYNAMIC_PRESSURE_MAX_TIMEOUT ( 10 * SEC_PER_MIN * MS_PER_SECOND ) ///< Max override timeout for 10 minutes #define FILTER_FLUSH_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the gen water mode data published. #define FILTER_FLUSH_TIMEOUT ( 5 * MS_PER_SECOND ) ///< Filter flush timeout for 5 seconds (in ms) -#define FILTER_FLUSH_PRESSURE_CHECK_TIMEOUT ( 1 * MS_PER_SECOND ) ///< Filter flush timeout for 5 second (in ms) +#define FILTER_FLUSH_STATIC_PRESSURE_CHECK_TIMEOUT ( 1 * MS_PER_SECOND ) ///< Filter flush timeout for 5 second (in ms) #define MAX_INLET_WATER_PRESSURE_DEFEATURED_FAULT_HIGH_PSIG 40 ///< maximum dynamic M3 pressure is within range < 40 #define MIN_FILTER_FLUSH_PRESSURE_DEFEATURED_LOW_PSIG 5.0F ///< Minimum allowed Input warning low pressure value in psig for RO Defeatured. #define MAX_FILTER_FLUSH_PRESSURE_DEFEATURED_HIGH_PSIG 10.0F ///< Maximum allowed Input warning high pressure value in psig for RO Defeatured. -#define FILTER_FLUSH_PRES_OUT_OF_RANGE_TIMEOUT_MS ( 1 * MS_PER_SECOND ) ///< Persistence period for pressure out of range error in milliseconds. -#define FILTER_FLUSH_PRES_OUT_OF_RANGE_CLEAR_MS ( 1 * MS_PER_SECOND ) ///< Persistence period for pressure out of range clear in milliseconds. - // ********** private data ********** -static FP_FILTER_FLUSH_DEF_STATE_T filterFlushDefState; ///< Currently active filter flush de-featured state. -static U32 filterFlushDefDataPublicationTimerCounter; ///< Used to schedule filter flush de-featured data publication to CAN bus. -static OVERRIDE_U32_T filterFlushDefDataPublishInterval; ///< Filter Flush de-featured data publish interval. -static OVERRIDE_U32_T filterFlushDefTimeout; ///< Filter Flush timeout value -static U32 filterFlushDefTimer; ///< Filter Flush timeout timer -static U32 filterFlushDefPressureLowCheckTimer; ///< Filter Flush timeout timer for pressure low check -static U32 filterFlushDefPressureHighCheckTimer; ///< Filter Flush timeout timer for pressure high check -static U32 filterFlushPressureCheckStartTimeMS; ///< Filter Flush pressure check timer -static BOOL pendingStartFilterFlushDefRequest; ///< signal to start flushing. -static BOOL isFlushDefComplete; ///< Filter Flush complete +static FP_FILTER_FLUSH_DEF_STATE_T filterFlushDefState; ///< Currently active defeatured filter flush state. +static U32 filterFlushDefDataPublicationTimerCounter; ///< Used to schedule defeatured filter flush data publication to CAN bus. +static OVERRIDE_U32_T filterFlushDefDataPublishInterval; ///< Defeatured filter flush data publish interval. +static OVERRIDE_U32_T filterFlushDefDynamicPressureTimeout; ///< Defeatured filter flush timeout value for dynamic pressure check +static U32 filterFlushDefDynamicPressureTimer; ///< Defeatured filter flush timeout timer for dynamic pressure check +static U32 filterFlushDefStaticPressureTimer; ///< Defeatured filter flush timeout timer for static pressure check +static BOOL pendingStartFilterFlushDefRequest; ///< Signal to start defeatured filter flush +static BOOL isFlushDefComplete; ///< Defeatured filter flush complete // ********** private function prototypes ********** @@ -77,27 +73,41 @@ void initFilterFlushDefeatured( void ) { filterFlushDefState = FILTER_FLUSH_DEF_PAUSED; + filterFlushDefDataPublishInterval.data = FILTER_FLUSH_DATA_PUBLISH_INTERVAL; filterFlushDefDataPublishInterval.ovData = FILTER_FLUSH_DATA_PUBLISH_INTERVAL; filterFlushDefDataPublishInterval.ovInitData = 0; filterFlushDefDataPublishInterval.override = OVERRIDE_RESET; - filterFlushDefTimeout.data = FILTER_FLUSH_TIMEOUT; - filterFlushDefTimeout.ovData = FILTER_FLUSH_TIMEOUT; - filterFlushDefTimeout.ovInitData = 0; - filterFlushDefTimeout.override = OVERRIDE_RESET; + + filterFlushDefDynamicPressureTimeout.data = FILTER_FLUSH_TIMEOUT; + filterFlushDefDynamicPressureTimeout.ovData = FILTER_FLUSH_TIMEOUT; + filterFlushDefDynamicPressureTimeout.ovInitData = 0; + filterFlushDefDynamicPressureTimeout.override = OVERRIDE_RESET; + filterFlushDefDataPublicationTimerCounter = 0; - filterFlushDefTimer = 0; - filterFlushDefPressureLowCheckTimer = 0; - filterFlushDefPressureHighCheckTimer = 0; - filterFlushPressureCheckStartTimeMS = 0; - isFlushDefComplete = 0; - pendingStartFilterFlushDefRequest = 0; + filterFlushDefDynamicPressureTimer = 0; + filterFlushDefStaticPressureTimer = 0; - initPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE, FILTER_FLUSH_PRES_OUT_OF_RANGE_CLEAR_MS, FILTER_FLUSH_PRES_OUT_OF_RANGE_TIMEOUT_MS ); + isFlushDefComplete = 0; + pendingStartFilterFlushDefRequest = FALSE; } /*********************************************************************//** * @brief + * The transitionToFilterFlushDefeatured function prepares for transition to de-featured + * FilterFlush + * permeate mode. + * @details \b Inputs: genPermeateState + * @details \b Outputs: none + * @return initial state + *************************************************************************/ +U32 transitionToFilterFlushDefeatured( void ) +{ + initFilterFlushDefeatured(); + return 0; +} +/*********************************************************************//** + * @brief * The execFilterFlushDefeatured function executes the de-featured filter flush state machine * and publishes filter flush data. * @details \b Inputs: filterFlushDefState @@ -121,65 +131,106 @@ break; case FILTER_FLUSH_DEF_PAUSED: - filterFlushDefState = handleFilterFlushPausedState(); + filterFlushDefState = handleFilterFlushDefPausedState(); break; default: SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_SOFTWARE_FAULT, FP_FAULT_ID_FP_INVALID_FILTER_FLUSH_STATE, (U32)filterFlushDefState ) - filterFlushDefState = FILTER_FLUSH_PAUSED; + filterFlushDefState = FILTER_FLUSH_DEF_PAUSED; break; } if ( prevState != filterFlushDefState ) { - setFilterFlushTransition( filterFlushDefState ); + setFilterFlushDefTransition( filterFlushDefState ); } // publish filter flush data on interval - publishFilterFlushData(); + publishFilterFlushDefData(); } /*********************************************************************//** * @brief - * The handleFilterFlushDefDynamicPressureCheckState handles the Dynamic pressure check state of de-featured filter flush - * @details \b Inputs: filterFlushDefTimer + * The getCurrentFilterFlushDefState function returns the current state of + * de-featured filter flush. + * @details \b Inputs: none + * @details \b Outputs: none + * @return the current state of filter flush + *************************************************************************/ +FP_FILTER_FLUSH_DEF_STATE_T getCurrentFilterFlushDefState( void ) +{ + return filterFlushDefState; +} + +/*********************************************************************//** + * @brief + * The isFilterFlushDefComplete function returns de-featured filter flush complete status. + * @details \b Inputs: isFlushComplete + * @details \b Outputs: none + * @return TRUE if filter flush is complete, FALSE if not. + *************************************************************************/ +BOOL isFilterFlushDefComplete( void ) +{ + return isFlushDefComplete; +} + +/*********************************************************************//** + * @brief + * The signalStartDefFilterFlush function signals the FP to start de-featured filter flush. + * @details \b Inputs: filterFlushDefState + * @details \b Outputs: pendingStartFilterFlushDefRequest + * @return none + *************************************************************************/ +void signalStartDefFilterFlush( void ) +{ + if ( FILTER_FLUSH_DEF_PAUSED == getCurrentFilterFlushDefState() ) + { + pendingStartFilterFlushDefRequest = TRUE; + } +} + +/*********************************************************************//** + * @brief + * The resetFilterFlushDefSignals function resets the signal values for + * FP de-featured filter flush. + * @details \b Inputs: none + * @details \b Outputs: pendingStartFilterFlushDefRequest, isFlushDefComplete + * @return none + *************************************************************************/ +void resetFilterFlushDefSignals( void ) +{ + pendingStartFilterFlushDefRequest = FALSE; + isFlushDefComplete = FALSE; +} + +/*********************************************************************//** + * @brief + * The handleFilterFlushDefDynamicPressureCheckState handles the Dynamic pressure check state + * of de-featured filter flush + * @details \b Inputs: filterFlushDefDynamicPressureTimer, m3Pressure * @details \b Outputs: None + * @details \b Alarm: ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE + * when pressure is not in range during dynamic pressure check state * @return the next state of de-featured filter flush state *************************************************************************/ static FP_FILTER_FLUSH_DEF_STATE_T handleFilterFlushDefDynamicPressureCheckState( void ) { FP_FILTER_FLUSH_DEF_STATE_T state = FILTER_FLUSH_DEF_DYNAMIC_PRESSURE_CHECK; - F32 pressureM3 = getFilteredPressure( M3_PRES ); - BOOL isPresOutOfHighRange = FALSE; + F32 m3Pressure = getFilteredPressure( M3_PRES ); -// if ( TRUE == 1 )// TODO Alarm and Stop State Rework -// { -// state = FILTER_FLUSH_PAUSED; -// } - - // check the dynamic pressure - if( TRUE == didTimeout( filterFlushDefTimer, getFilterFlushTimeout() ) ) + // check the dynamic pressure after 5 second + if( TRUE == didTimeout( filterFlushDefDynamicPressureTimer, getFilterFlushDefTimeout() ) ) { // check for inlet pressure (M3) within range < 40 - if( pressureM3 < MAX_INLET_WATER_PRESSURE_DEFEATURED_FAULT_HIGH_PSIG ) + if( m3Pressure < MAX_INLET_WATER_PRESSURE_DEFEATURED_FAULT_HIGH_PSIG ) { - if ( 0 == filterFlushPressureCheckStartTimeMS ) - { - filterFlushPressureCheckStartTimeMS = getMSTimerCount(); - } - else if ( TRUE == didTimeout( filterFlushPressureCheckStartTimeMS, FILTER_FLUSH_PRESSURE_CHECK_TIMEOUT ) ) - { - filterFlushPressureCheckStartTimeMS = 0; - //isFlushDefComplete = TRUE; - // move to dynamic pressure check state - state = FILTER_FLUSH_DEF_STATIC_PRESSURE_CHECK; - } + // move to dynamic pressure check state + state = FILTER_FLUSH_DEF_STATIC_PRESSURE_CHECK; } else { - // second persistent alarm + // change the state to paused state = FILTER_FLUSH_DEF_PAUSED; - isPresOutOfHighRange = ( ( pressureM3 > MAX_INLET_WATER_PRESSURE_DEFEATURED_FAULT_HIGH_PSIG ) ? TRUE : FALSE ); - checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE, isPresOutOfHighRange, pressureM3, MAX_INLET_WATER_PRESSURE_DEFEATURED_FAULT_HIGH_PSIG ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE, m3Pressure, MAX_INLET_WATER_PRESSURE_DEFEATURED_FAULT_HIGH_PSIG ) } } @@ -189,78 +240,48 @@ /*********************************************************************//** * @brief * The handleFilterFlushDefStaticPressureCheckState handles the static pressure check of the de-featured filter flush - * @details \b Inputs: filterFlushTimer + * @details \b Inputs: filterFlushDefStaticPressureTimer, m3Pressure * @details \b Outputs: isFlushDefComplete * @return the next state of de-featured filter flush state *************************************************************************/ static FP_FILTER_FLUSH_DEF_STATE_T handleFilterFlushDefStaticPressureCheckState( void ) { FP_FILTER_FLUSH_DEF_STATE_T state = FILTER_FLUSH_DEF_STATIC_PRESSURE_CHECK; - U32 thresholdMin = MIN_FILTER_FLUSH_PRESSURE_DEFEATURED_LOW_PSIG; - U32 thresholdMax = MAX_FILTER_FLUSH_PRESSURE_DEFEATURED_HIGH_PSIG; - F32 pressureM3 = getFilteredPressure( M3_PRES ); + U32 minThreshold = MIN_FILTER_FLUSH_PRESSURE_DEFEATURED_LOW_PSIG; + U32 maxThreshold = MAX_FILTER_FLUSH_PRESSURE_DEFEATURED_HIGH_PSIG; + F32 m3Pressure = getFilteredPressure( M3_PRES ); -// if ( TRUE == 1 )// TODO Alarm and Stop State Rework -// { -// state = FILTER_FLUSH_PAUSED; -// } - // check for inlet pressure (M3) within range 5 -10 - if ( ( pressureM3 >= thresholdMin ) && ( pressureM3 <= thresholdMax ) ) + if ( TRUE == didTimeout( filterFlushDefStaticPressureTimer, FILTER_FLUSH_STATIC_PRESSURE_CHECK_TIMEOUT ) ) { - filterFlushDefPressureHighCheckTimer = 0; - filterFlushDefPressureLowCheckTimer = 0; - if ( 0 == filterFlushPressureCheckStartTimeMS ) + if ( ( m3Pressure >= minThreshold ) && ( m3Pressure <= maxThreshold ) ) { - filterFlushPressureCheckStartTimeMS = getMSTimerCount(); - } - else if ( TRUE == didTimeout( filterFlushPressureCheckStartTimeMS, FILTER_FLUSH_PRESSURE_CHECK_TIMEOUT ) ) - { - filterFlushPressureCheckStartTimeMS = 0; isFlushDefComplete = TRUE; state = FILTER_FLUSH_DEF_PAUSED; } - } - // reset the persistence timer when inlet pressure is < 5 - else if ( pressureM3 <= thresholdMin ) - { - filterFlushPressureCheckStartTimeMS = 0; - filterFlushDefPressureHighCheckTimer = 0; - if ( 0 == filterFlushDefPressureLowCheckTimer ) + // when inlet pressure is < 5 + else if ( m3Pressure <= minThreshold ) { - filterFlushDefPressureLowCheckTimer = getMSTimerCount(); + // Trigger alarm if M3 pressure is not within range + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE, m3Pressure, FILTER_FLUSH_STATIC_PRESSURE_CHECK_TIMEOUT ); + state = FILTER_FLUSH_DEF_PAUSED; } - - // Trigger alarm if M3 pressure is not within range - else if ( TRUE == didTimeout( filterFlushDefPressureLowCheckTimer, getFilterFlushTimeout() ) ) + // when inlet pressure is > 10 + else if ( m3Pressure >= maxThreshold ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_RO_INLET_PRESSURE_OUT_HIGH_RANGE, getFilterFlushTimeout(), pressureM3 ) - state = INLET_PRES_CHECK_PAUSED; + // Trigger alarm if M3 pressure is not within range + //ALARM_ID_FP_INLET_PRESSURE_OUT_HIGH_RANGE or ALARM_ID_FP_RO_INLET_PRESSURE_OUT_HIGH_RANGE //TODO + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_RO_INLET_PRESSURE_OUT_HIGH_RANGE, m3Pressure, FILTER_FLUSH_STATIC_PRESSURE_CHECK_TIMEOUT ); + state = FILTER_FLUSH_DEF_PAUSED; } } - // reset the persistence timer when inlet pressure is > 10 - else if ( pressureM3 >= thresholdMax ) - { - filterFlushPressureCheckStartTimeMS = 0; - filterFlushDefPressureLowCheckTimer = 0; - if ( 0 == filterFlushDefPressureHighCheckTimer ) - { - filterFlushDefPressureHighCheckTimer = getMSTimerCount(); - } - // Trigger alarm if M3 pressure is not within range - else if ( TRUE == didTimeout( filterFlushDefPressureHighCheckTimer, getFilterFlushTimeout() ) ) - { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_RO_INLET_PRESSURE_OUT_HIGH_RANGE, getFilterFlushTimeout(), pressureM3 ) - state = INLET_PRES_CHECK_PAUSED; - } - } return state; } /*********************************************************************//** * @brief - * The handleFilterFlushDefPausedState handles the pause state of filter flush + * The handleFilterFlushDefPausedState handles the pause state of de-featured filter flush * @details \b Inputs: pendingStartFilterFlushDefRequest * @details \b Outputs: pendingStartFilterFlushDefRequest, isFlushDefComplete * @return the next state of de-featured filter flush state @@ -282,10 +303,10 @@ /*********************************************************************//** * @brief * The setFilterFlushDefTransition function sets the actuators and variables - * for the state transition in filter flush de-featured mode. + * for the state transition in de-featured filter flush mode. * @details Inputs: Valve states, Pump speed * @details Outputs: Actuate valves, pumps as desired. - * @param state de-featured filter flush state enum + * @param state de-featured de-featured filter flush state enum * @return none *************************************************************************/ static void setFilterFlushDefTransition( FP_FILTER_FLUSH_DEF_STATE_T state ) @@ -297,19 +318,19 @@ setValveState( M4_VALV, VALVE_STATE_OPEN ); setValveState( M12_VALV, VALVE_STATE_OPEN ); setValveState( D52_VALV, VALVE_STATE_OPEN ); - filterFlushDefTimer = getMSTimerCount(); + filterFlushDefDynamicPressureTimer = getMSTimerCount(); break; case FILTER_FLUSH_DEF_STATIC_PRESSURE_CHECK: setValveState( M4_VALV, VALVE_STATE_CLOSED ); setValveState( M12_VALV, VALVE_STATE_CLOSED ); setValveState( D52_VALV, VALVE_STATE_CLOSED ); - filterFlushDefTimer = getMSTimerCount(); + filterFlushDefStaticPressureTimer = getMSTimerCount(); break; case FILTER_FLUSH_DEF_PAUSED: // close only if we actually pause during flush - if ( FALSE == isFilterFlushComplete() ) + if ( FALSE == isFilterFlushDefComplete() ) { setValveState( M4_VALV, VALVE_STATE_CLOSED ); setValveState( M12_VALV, VALVE_STATE_CLOSED ); @@ -325,69 +346,15 @@ /*********************************************************************//** * @brief - * The signalStartDefFilterFlush function signals the FP to start defeatured filter flush. - * @details \b Inputs: filterFlushState - * @details \b Outputs: pendingStartFilterFlushDefRequest - * @return none - *************************************************************************/ -void signalStartDefFilterFlush( void ) -{ - if ( FILTER_FLUSH_DEF_PAUSED == getCurrentFilterFlushDefSState() ) - { - pendingStartFilterFlushDefRequest = TRUE; - } -} - -/*********************************************************************//** - * @brief - * The resetFilterFlushDefSignals function resets the signal values for - * FP filter flush. - * @details \b Inputs: none - * @details \b Outputs: pendingStartFilterFlushDefRequest, isFlushDefComplete - * @return none - *************************************************************************/ -void resetFilterFlushDefSignals( void ) -{ - pendingStartFilterFlushDefRequest = FALSE; - isFlushDefComplete = FALSE; -} - -/*********************************************************************//** - * @brief - * The getCurrentFilterFlushDefState function returns the current state of - * filter flush. - * @details \b Inputs: none - * @details \b Outputs: none - * @return the current state of filter flush - *************************************************************************/ -FP_FILTER_FLUSH_DEF_STATE_T getCurrentFilterFlushDefState( void ) -{ - return filterFlushDefState; -} - -/*********************************************************************//** - * @brief - * The isFilterFlushDefComplete function returns isFilterFlushDefComplete. - * @details \b Inputs: isFlushComplete - * @details \b Outputs: none - * @return TRUE if filter flush is complete, FALSE if not. - *************************************************************************/ -BOOL isFilterFlushDefComplete( void ) -{ - return isFlushDefComplete; -} - -/*********************************************************************//** - * @brief * The getFilterFlushDefTimeout function gets the generate water * mode data publish interval. - * @details \b Inputs: filterFlushDefTimeout + * @details \b Inputs: filterFlushDefDynamicPressureTimeout * @details \b Outputs: none * @return the timeout timer for filter flush. *************************************************************************/ static U32 getFilterFlushDefTimeout( void ) { - U32 result = getU32OverrideValue( &filterFlushDefTimeout ); + U32 result = getU32OverrideValue( &filterFlushDefDynamicPressureTimeout ); return result; } @@ -398,7 +365,7 @@ * mode data publish interval. * @details \b Inputs: filterFlushDefDataPublishInterval * @details \b Outputs: none - * @return the interval at defeatured filter flush mode data being published. + * @return the interval at de-featured filter flush mode data being published. *************************************************************************/ static U32 getFilterFlushDefPublishInterval( void ) { @@ -409,10 +376,10 @@ /*********************************************************************//** * @brief - * The publishFilterFlushDefData function broadcasts the filter flush + * The publishFilterFlushDefData function broadcasts the de-featured filter flush * mode data at defined interval. - * @details \b Inputs: filterFlushDataPublicationTimerCounter - * @details \b Outputs: fp filter flush defeatured data broadcast message sent + * @details \b Inputs: filterFlushDefDataPublicationTimerCounter + * @details \b Outputs: fp filter flush de-featured data broadcast message sent * @details \b Message \b Sent: MSG_ID_FP_FILTER_FLUSH_DATA to publish the * filter flush mode data. * @return none @@ -439,11 +406,11 @@ /*********************************************************************//** * @brief * The testFilterFlushDefDataPublishIntervalOverride function overrides the - * FP filter flush defeatured mode data publish interval. + * FP filter flush de-featured mode data publish interval. * @details \b Inputs: filterFlushDefDataPublishInterval * @details \b Outputs: filterFlushDefDataPublishInterval * @param Override message from Dialin which includes the interval - * (in ms) to override the FP filter flush defeatured data publish interval to. + * (in ms) to override the FP filter flush de-featured data publish interval to. * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testFilterFlushDefDataPublishIntervalOverride( MESSAGE_T *message ) @@ -457,15 +424,15 @@ * @brief * The testFilterFlushDefTimerOverride function overrides the * FP filter flush timeout value. - * @details \b Inputs: filterFlushDefTimeout - * @details \b Outputs: filterFlushDefTimeout + * @details \b Inputs: filterFlushDefDynamicPressureTimeout + * @details \b Outputs: filterFlushDefDynamicPressureTimeout * @param Override message from Dialin which includes the interval * (in ms) to override the FP filter flush timeout to. * @return TRUE if override successful, FALSE if not *************************************************************************/ BOOL testFilterFlushDefTimerOverride( MESSAGE_T *message ) { - BOOL result = u32Override( message, &filterFlushDefTimeout, 0, FILTER_FLUSH_MAX_TIMEOUT ); + BOOL result = u32Override( message, &filterFlushDefDynamicPressureTimeout, 0, FILTER_FLUSH_DYNAMIC_PRESSURE_MAX_TIMEOUT ); return result; } Index: firmware/App/Modes/FPModes/FlushFilterDefeatured.h =================================================================== diff -u -r0cee1110f21bca6bd223f8c94d2171a9f162edb5 -rfb0f180eb25dbcfd15d58ef584d535efd1c24e30 --- firmware/App/Modes/FPModes/FlushFilterDefeatured.h (.../FlushFilterDefeatured.h) (revision 0cee1110f21bca6bd223f8c94d2171a9f162edb5) +++ firmware/App/Modes/FPModes/FlushFilterDefeatured.h (.../FlushFilterDefeatured.h) (revision fb0f180eb25dbcfd15d58ef584d535efd1c24e30) @@ -41,12 +41,11 @@ // ********** public function prototypes ********** void initFilterFlushDefeatured( void ); // Initialize this de-featured Filter Flush unit -//U32 transitionToFilterFlushDefeatured( void ); // Transition to Filter Flush +U32 transitionToFilterFlushDefeatured( void ); // Transition to Filter Flush void execFilterFlushDefeatured( void ); // Execute the de-featured Filter Flush state machine BOOL isFilterFlushDefComplete( void ); // returns if de-featured flush is complete void signalStartDefFilterFlush( void ); // signal to start de-featured flush void resetFilterFlushDefSignals( void ); // reset signals for de-featured flush - FP_FILTER_FLUSH_STATE_T getCurrentFilterFlushState( void ); // Get the current state of the de-featured Filter Flush BOOL testFilterFlushDataPublishIntervalOverride( MESSAGE_T *message ); Index: firmware/App/Modes/FPModes/InletPressureCheck.c =================================================================== diff -u -rdd0e9acd5f0fb570403be8908ac45e79840d4b70 -rfb0f180eb25dbcfd15d58ef584d535efd1c24e30 --- firmware/App/Modes/FPModes/InletPressureCheck.c (.../InletPressureCheck.c) (revision dd0e9acd5f0fb570403be8908ac45e79840d4b70) +++ firmware/App/Modes/FPModes/InletPressureCheck.c (.../InletPressureCheck.c) (revision fb0f180eb25dbcfd15d58ef584d535efd1c24e30) @@ -17,10 +17,11 @@ #include "BoostPump.h" #include "FlowSensor.h" -#include "InletPressureCheck.h" #include "FPOperationModes.h" +#include "InletPressureCheck.h" #include "MessageSupport.h" #include "Messaging.h" +#include "PersistentAlarm.h" #include "Pressure.h" #include "ROPump.h" #include "TaskGeneral.h" @@ -34,16 +35,16 @@ // ********** private definitions ********** -#define INLET_PRES_CHECK_MAX_TIMEOUT ( 600 * MS_PER_SECOND ) ///< Max override timeout for 10 minutes +#define INLET_PRES_CHECK_MAX_TIMEOUT ( 10 * SEC_PER_MIN * MS_PER_SECOND ) ///< Max override timeout for 10 minutes #define INLET_PRES_CHECK_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the gen water mode data published. -#define INLET_PRES_CHECK_TIMEOUT ( 60 * MS_PER_SECOND ) ///< Inlet Pressure Check timer (in ms) +#define INLET_PRES_CHECK_TIMEOUT ( 10 * MS_PER_SECOND ) ///< Inlet Pressure Check timer (in ms) #define INLET_PRES_CHECK_BOOST_PUMP_TGT_PWM 0.2F ///< target in PWM % for the BOOST pump during inlet pressure check. #define INLET_PRES_CHECK_WITH_BP_TGT_PSI 30 ///< Pressure target in PSI for the M3 during inlet pressure check with booster pump. #define INLET_PRES_CHECK_TGT_PSI 75 ///< Pressure target in PSI for the M3 during inlet pressure check without booster pump. #define INLET_PRES_CHECK_TOLERANCE_PSI 2 ///< Pressure tolerance in PSI for the M3 during inlet pressure check. -#define INLET_PRES_PERSISTENCE_TIME_WITH_BP_MS ( 10 * MS_PER_SECOND ) ///< Persistence time for M3 during inlet pressure check with booster pump. -#define INLET_PRES_PERSISTENCE_TIME_MS ( 1 * MS_PER_SECOND ) ///< Persistence time for M3 during inlet pressure check without booster pump. - +#define INLET_PRES_PERSISTENCE_TIME_WITH_BP_MS ( 1 * MS_PER_SECOND ) ///< Persistence time for M3 during inlet pressure check with booster pump. +#define INLET_PRES_OUT_OF_RANGE_CLEAR_MS ( 1 * MS_PER_SECOND ) ///< Persistence time for M3 during inlet pressure check without booster pump. +#define INLET_PRES_OUT_OF_RANGE_TIMEOUT_MS ( 1 * MS_PER_SECOND ) ///< Persistence time for M3 during inlet pressure check without booster pump. // ********** private data ********** static FP_INLET_PRES_CHECK_STATE_T inletPressureCheckState; ///< Currently active Inlet Pressure check state. @@ -85,10 +86,29 @@ inletPressureCheckTimer = 0; inletPressureCheckPersistanceStartTimeMS = 0; isPressureCheckComplete = FALSE; + + // Pressure alarms + initPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE, INLET_PRES_OUT_OF_RANGE_CLEAR_MS, INLET_PRES_OUT_OF_RANGE_TIMEOUT_MS ); + initPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_HIGH_RANGE, INLET_PRES_OUT_OF_RANGE_CLEAR_MS, INLET_PRES_OUT_OF_RANGE_TIMEOUT_MS ); } /*********************************************************************//** * @brief + * The transitionToInletPressureCheck function prepares for transition to + * inlet pressure check + * permeate mode. + * @details \b Inputs: inletPressureCheckState + * @details \b Outputs: none + * @return initial 0 + *************************************************************************/ +U32 transitionToInletPressureCheck( void ) +{ + initInletPressureCheck(); + return 0; +} + +/*********************************************************************//** + * @brief * The execInletPressureCheck function executes the inlet pressure check * state machine and publishes inlet pressure check data. * @details \b Inputs: inletPressureCheckState @@ -135,59 +155,51 @@ static FP_INLET_PRES_CHECK_STATE_T handleInletPressureCheckProgressState( void ) { FP_INLET_PRES_CHECK_STATE_T state = INLET_PRES_CHECK_IN_PROGRESS; - F32 inletPressure = 0.0; - F32 thresholdMin = INLET_PRES_CHECK_WITH_BP_TGT_PSI - INLET_PRES_CHECK_TOLERANCE_PSI; - F32 thresholdMax = INLET_PRES_CHECK_WITH_BP_TGT_PSI + INLET_PRES_CHECK_TOLERANCE_PSI; + F32 m3Pressure = getFilteredPressure(M3_PRES); + F32 minThreshold = INLET_PRES_CHECK_WITH_BP_TGT_PSI - INLET_PRES_CHECK_TOLERANCE_PSI; + F32 maxThreshold = INLET_PRES_CHECK_WITH_BP_TGT_PSI + INLET_PRES_CHECK_TOLERANCE_PSI; + BOOL isPresOutOfLowRange = FALSE; + BOOL isPresOutOfHighRange = FALSE; - inletPressure = getFilteredPressure(M3_PRES); - if ( TRUE == isBoostPumpInstalled() ) { - // check for inlet pressure (M3) within range - if( ( inletPressure >= thresholdMin ) && ( inletPressure <= thresholdMax ) ) + // timeout after 10 seconds + if ( TRUE == didTimeout(inletPressureCheckTimer , getInletPressureCheckTimeout() ) ) { - if ( 0 == inletPressureCheckPersistanceStartTimeMS ) + isPresOutOfLowRange = ( ( m3Pressure < minThreshold ) ? TRUE : FALSE ); + isPresOutOfHighRange = ( ( ( m3Pressure > maxThreshold ) ) ? TRUE : FALSE ); + + // SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_RO_INLET_PRESSURE_OUT_HIGH_RANGE, INLET_PRES_CHECK_TIMEOUT, m3Pressure ); // re-check the alarm ID + // check persistent alarm for 1 second + checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE, isPresOutOfLowRange, m3Pressure, minThreshold ); + checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_HIGH_RANGE, isPresOutOfHighRange, m3Pressure, maxThreshold ); + + // Trigger alarm if M3 pressure is not within range after 10 + 1 seconds + if ( TRUE == didTimeout( inletPressureCheckPersistanceStartTimeMS, getInletPressureCheckTimeout() + INLET_PRES_PERSISTENCE_TIME_WITH_BP_MS ) ) { - inletPressureCheckPersistanceStartTimeMS = getMSTimerCount(); + // check for inlet pressure (M3) within range + if( ( m3Pressure >= minThreshold ) && ( m3Pressure <= maxThreshold ) ) + { + inletPressureCheckPersistanceStartTimeMS = 0; + isPressureCheckComplete = TRUE; + state = INLET_PRES_CHECK_PAUSED; + } } - else if ( TRUE == didTimeout( inletPressureCheckPersistanceStartTimeMS, INLET_PRES_PERSISTENCE_TIME_WITH_BP_MS ) ) - { - inletPressureCheckPersistanceStartTimeMS = 0; - isPressureCheckComplete = TRUE; - state = INLET_PRES_CHECK_PAUSED; - } } - // reset the persistence timer when inlet pressure out of range - else if ( ( inletPressure <= thresholdMin ) || ( inletPressure >= thresholdMax ) ) - { - inletPressureCheckPersistanceStartTimeMS = 0; - // Trigger alarm if M3 pressure is not within range - if ( TRUE == didTimeout( inletPressureCheckTimer, getInletPressureCheckTimeout() ) ) - { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_RO_INLET_PRESSURE_OUT_HIGH_RANGE, INLET_PRES_CHECK_TIMEOUT, inletPressure ) - state = INLET_PRES_CHECK_PAUSED; - } - } } else - { - if ( inletPressure >= INLET_PRES_CHECK_TGT_PSI ) + { // Change inlet pressure check for M3 criteria from 30 PSI to <75 PSI for both featured and de-featured + // ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE is defined for featured when > 75 and > 40 for de-featured so re using + // INLET_PRES_CHECK_TGT_PSI = 75 + if ( m3Pressure >= INLET_PRES_CHECK_TGT_PSI ) { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_RO_INLET_PRESSURE_OUT_HIGH_RANGE, INLET_PRES_CHECK_TGT_PSI, inletPressure ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE, m3Pressure, INLET_PRES_CHECK_TGT_PSI ) state = INLET_PRES_CHECK_PAUSED; } else { - if ( 0 == inletPressureCheckPersistanceStartTimeMS ) - { - inletPressureCheckPersistanceStartTimeMS = getMSTimerCount(); - } - else if ( TRUE == didTimeout( inletPressureCheckPersistanceStartTimeMS, INLET_PRES_PERSISTENCE_TIME_MS ) ) - { - inletPressureCheckPersistanceStartTimeMS = 0; - isPressureCheckComplete = TRUE; - state = INLET_PRES_CHECK_PAUSED; - } + isPressureCheckComplete = TRUE; + state = INLET_PRES_CHECK_PAUSED; } } @@ -243,6 +255,7 @@ } signalROPumpHardStop(); inletPressureCheckTimer = getMSTimerCount(); + inletPressureCheckPersistanceStartTimeMS = getMSTimerCount(); break; case INLET_PRES_CHECK_PAUSED: Index: firmware/App/Modes/FPModes/InletPressureCheck.h =================================================================== diff -u -r3417933e6edf61a914c428e2fa944b3b349272a4 -rfb0f180eb25dbcfd15d58ef584d535efd1c24e30 --- firmware/App/Modes/FPModes/InletPressureCheck.h (.../InletPressureCheck.h) (revision 3417933e6edf61a914c428e2fa944b3b349272a4) +++ firmware/App/Modes/FPModes/InletPressureCheck.h (.../InletPressureCheck.h) (revision fb0f180eb25dbcfd15d58ef584d535efd1c24e30) @@ -40,12 +40,12 @@ // ********** public function prototypes ********** -void initInletPressureCheck( void ); // Initialize this Concentrate Flush unit -void execInletPressureCheck( void ); // Execute the Concentrate Flush state machine -BOOL isInletPressureCheckCompleted( void ); // returns if flush is complete +void initInletPressureCheck( void ); // Initialize Inlet Pressure Check +U32 transitionToInletPressureCheck( void ); // Transition to Inlet Pressure Check +void execInletPressureCheck( void ); // Execute the Inlet Pressure Checks state machine +BOOL isInletPressureCheckCompleted( void ); // returns if Inlet Pressure Check is complete +FP_INLET_PRES_CHECK_STATE_T getCurrentInletPressureCheckState( void ); // Get the current state of the Inlet Pressure Check -FP_INLET_PRES_CHECK_STATE_T getCurrentInletPressureCheckState( void ); // Get the current state of the Concentrate Flush - BOOL testInletPressureCheckDataPublishIntervalOverride( MESSAGE_T *message ); BOOL testInletPressureCheckTimerOverride( MESSAGE_T *message ); Index: firmware/App/Modes/FPModes/ModeGenPermeate.c =================================================================== diff -u -r846073b88a25474464d43b4c0e8f300b52021f96 -rfb0f180eb25dbcfd15d58ef584d535efd1c24e30 --- firmware/App/Modes/FPModes/ModeGenPermeate.c (.../ModeGenPermeate.c) (revision 846073b88a25474464d43b4c0e8f300b52021f96) +++ firmware/App/Modes/FPModes/ModeGenPermeate.c (.../ModeGenPermeate.c) (revision fb0f180eb25dbcfd15d58ef584d535efd1c24e30) @@ -251,8 +251,11 @@ static F32 getTankFullAlarmTimeout( void ) { F32 ddConsumptionRate = getTDDialysateFlowrate() + RINSE_PUMP_TARGET_FLOW; + F32 expectedTankFullTime = ( ( PERMEATE_TANK_HIGH_LEVEL_VOL_ML - PERMEATE_TANK_LOW_LEVEL_VOL_ML ) / ddConsumptionRate ) * SEC_PER_MIN; + F32 expectedDeprimeTime = ( ( PERMEATE_TANK_LOW_LEVEL_VOL_ML - PERMEATE_TANK_EMPTY_LEVEL_VOL_ML ) / ddConsumptionRate ) * SEC_PER_MIN; + tankFullAlarmTimeout = expectedTankFullTime + expectedDeprimeTime; return tankFullAlarmTimeout; @@ -268,8 +271,11 @@ static F32 getTankFillAlarmTimeout( void ) { F32 ddConsumptionRate = getTDDialysateFlowrate() + RINSE_PUMP_TARGET_FLOW; + F32 expectedTankFillTime = ( ( PERMEATE_TANK_HIGH_LEVEL_VOL_ML - PERMEATE_TANK_LOW_LEVEL_VOL_ML ) / ddConsumptionRate ) * SEC_PER_MIN; + F32 expectedOverfillTime = ( ( PERMEATE_TANK_FULL_LEVEL_VOL_ML - PERMEATE_TANK_HIGH_LEVEL_VOL_ML ) / ddConsumptionRate ) * SEC_PER_MIN; + tankFillAlarmTimeout = ( expectedTankFillTime + ( expectedOverfillTime / 2 ) ); return tankFillAlarmTimeout; Index: firmware/App/Modes/FPModes/ModePreGenPermeateDefeatured.c =================================================================== diff -u -rdd0e9acd5f0fb570403be8908ac45e79840d4b70 -rfb0f180eb25dbcfd15d58ef584d535efd1c24e30 --- firmware/App/Modes/FPModes/ModePreGenPermeateDefeatured.c (.../ModePreGenPermeateDefeatured.c) (revision dd0e9acd5f0fb570403be8908ac45e79840d4b70) +++ firmware/App/Modes/FPModes/ModePreGenPermeateDefeatured.c (.../ModePreGenPermeateDefeatured.c) (revision fb0f180eb25dbcfd15d58ef584d535efd1c24e30) @@ -15,8 +15,10 @@ * ***************************************************************************/ +#include "FlushFilterDefeatured.h" #include "FPModeStandby.h" #include "FPOperationModes.h" +#include "InletPressureCheck.h" #include "Messaging.h" #include "MessageSupport.h" #include "ModeGenPermeateDefeatured.h" @@ -42,8 +44,6 @@ static U32 preGenPermeateDefDataPublicationTimerCounter; ///< Used to schedule generate Permeate data publication to CAN bus. static OVERRIDE_U32_T preGenPermeateDefDataPublishInterval; ///< Generate permeate mode data publish interval. static BOOL pendingStartPreGenDefRequest; ///< Flag indicating DD has requested FP start the generate permeate. -static U32 preGenPermeateDefFlushTimer; -static U32 preGenPermeateDefWaterCheckTimer; // ********** private function prototypes ********** @@ -64,16 +64,14 @@ *************************************************************************/ void initPreGenPermeateDefeaturedMode( void ) { - preGenPermeateDefState = FP_PRE_GENP_INLET_PRESSURE_CHECK; + preGenPermeateDefState = FP_PRE_GENP_DEF_INLET_PRESSURE_CHECK; preGenPermeateDefDataPublishInterval.data = PRE_GEN_DEF_PERMEATE_DATA_PUBLISH_INTERVAL; preGenPermeateDefDataPublishInterval.ovData = PRE_GEN_DEF_PERMEATE_DATA_PUBLISH_INTERVAL; preGenPermeateDefDataPublishInterval.ovInitData = 0; preGenPermeateDefDataPublishInterval.override = OVERRIDE_RESET; preGenPermeateDefDataPublicationTimerCounter = 0; pendingStartPreGenDefRequest = FALSE; - preGenPermeateDefFlushTimer = 0; - preGenPermeateDefWaterCheckTimer = 0; -} + } /*********************************************************************//** * @brief @@ -169,7 +167,6 @@ setValveState( P34_VALV, VALVE_STATE_CLOSED ); setValveState( P37_VALV, VALVE_STATE_CLOSED ); setValveState( P39_VALV, VALVE_STATE_CLOSED ); - preGenPermeateDefFlushTimer = getMSTimerCount(); break; case FP_PRE_GENP_DEF_PAUSED: @@ -200,16 +197,11 @@ { FP_PRE_GENP_DEF_MODE_STATE_T state = FP_PRE_GENP_DEF_INLET_PRESSURE_CHECK; -// if ( TRUE == 1 ))// TODO Alarm and Stop State Rework -// { -// state = FP_PRE_GENP_PAUSED; -// } - execInletPressureCheck(); if ( TRUE == isInletPressureCheckCompleted() ) { - signalStartFilterFlush(); + signalStartDefFilterFlush(); state = FP_PRE_GENP_DEF_FLUSH; } @@ -220,21 +212,17 @@ * @brief * The handlePreGenPDefFlushState handles the supply water of gen permeate * defeatured mode. - * @details \b Inputs: preGenPermeateDefFlushTimer + * @details \b Inputs: none * @details \b Outputs: none * @return the next state of gen water defeatured mode *************************************************************************/ static FP_PRE_GENP_DEF_MODE_STATE_T handlePreGenPDefFlushState( void ) { FP_PRE_GENP_DEF_MODE_STATE_T state = FP_PRE_GENP_DEF_FLUSH; -// if ( TRUE == 1 )// TODO Alarm and Stop State Rework -// { -// state = FP_PRE_GENP_DEF_PAUSED; -// } - //checkInletPressures(); TODO + execFilterFlushDefeatured(); - if( TRUE == didTimeout( preGenPermeateDefFlushTimer, PRE_GEN_DEF_FLUSH_TIMEOUT_MS ) ) + if ( TRUE == isFilterFlushDefComplete() ) { transitionToGenPermeateDefeaturedMode(); requestGenWaterDefStart(); Index: firmware/App/Monitors/WaterQualityMonitor.c =================================================================== diff -u -r0a837501d88e61cf21aa90b9853deda9bf24f98c -rfb0f180eb25dbcfd15d58ef584d535efd1c24e30 --- firmware/App/Monitors/WaterQualityMonitor.c (.../WaterQualityMonitor.c) (revision 0a837501d88e61cf21aa90b9853deda9bf24f98c) +++ firmware/App/Monitors/WaterQualityMonitor.c (.../WaterQualityMonitor.c) (revision fb0f180eb25dbcfd15d58ef584d535efd1c24e30) @@ -91,9 +91,10 @@ // Pressure alarms initPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE, INLET_WATER_PRES_OUT_OF_RANGE_CLEAR_MS, INLET_WATER_PRES_OUT_OF_RANGE_TIMEOUT_MS ); initPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_HIGH_RANGE, INLET_WATER_PRES_OUT_OF_RANGE_CLEAR_MS, INLET_WATER_PRES_OUT_OF_RANGE_TIMEOUT_MS ); + initPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE, INLET_WATER_PRES_OUT_OF_RANGE_CLEAR_MS, INLET_WATER_PRES_OUT_OF_RANGE_TIMEOUT_MS ); + initPersistentAlarm( ALARM_ID_FP_PRESSURE_RELIEF_OUT_LOW_RANGE, INLET_WATER_PRES_RELIEF_OUT_OF_RANGE_CLEAR_MS, INLET_WATER_PRES_RELIEF_OUT_OF_RANGE_TIMEOUT_MS ); initPersistentAlarm( ALARM_ID_FP_PRESSURE_RELIEF_OUT_HIGH_RANGE, INLET_WATER_PRES_RELIEF_OUT_OF_RANGE_CLEAR_MS, INLET_WATER_PRES_RELIEF_OUT_OF_RANGE_TIMEOUT_MS ); - initPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE, INLET_WATER_PRES_OUT_OF_RANGE_CLEAR_MS, INLET_WATER_PRES_OUT_OF_RANGE_TIMEOUT_MS ); // Temperature Alarms initPersistentAlarm( ALARM_ID_FP_INLET_TEMPERATURE_OUT_LOW_RANGE, INLET_TEMPERATURE_PERSISTENCE_CLEAR_MS, INLET_TEMPERATURE_PERSISTENCE_TIMER_MS ); @@ -109,20 +110,21 @@ initPersistentAlarm( ALARM_ID_FP_PERMEATE_FLOW_OUT_LOW_RANGE, 0, PERMEATE_FLOW_OUT_OF_RANGE_TIMEOUT_MS ); // duty cycle warning alarm - initPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE, RO_PUMP_DUTY_CYCLE_WARNING_CLEAR_MS, RO_PUMP_DUTY_CYCLE_WARNING_TIMEOUT_MS ); + initPersistentAlarm( ALARM_ID_FP_POWER_BUDGET_OUT_OF_RANGE, RO_PUMP_DUTY_CYCLE_WARNING_CLEAR_MS, RO_PUMP_DUTY_CYCLE_WARNING_TIMEOUT_MS ); } /*********************************************************************//** * @brief * The checkInletPressures function checks the inlet water pressure * against the pressure threshold and alarm if the pressure is out of range. + * RO Featured, Water Production and RO Defeatured, Water Supply * @details \b Inputs: pressureM3 * @details \b Outputs: none * @details \b Alarms: ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE when * M3 pressure goes beyond low pressure limit. * @details \b Alarms: ALARM_ID_FP_INLET_PRESSURE_OUT_HIGH_RANGE when * M3 pressure goes beyond high pressure limit - * @details \b Alarms: ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE when + * @details \b Alarms: when * M3 pressure goes beyond fault high pressure limit * @return none *************************************************************************/ @@ -209,16 +211,16 @@ if ( pressureP13 > MAX_INLET_RO_PUMP_PRESSURE_WARNING_HIGH_PSIG ) { + // TODO , create an alarm SET_ALARM_WITH_2_U32_DATA( ALARM_ID_FP_RO_INLET_PRESSURE_OUT_HIGH_RANGE, pressureP13, MAX_INLET_RO_PUMP_PRESSURE_WARNING_HIGH_PSIG ) } } /*********************************************************************//** * @brief - * The getCalculatedRODutyCycle function get the RO calculated dutycycle based on M3 pressure + * The getCalculatedRODutyCycle function get the RO calculated dutycycle based on P13 pressure * @details \b Inputs: none * @details \b Outputs: none - * @details \b Alarms: none * @return dutyCyclePct *************************************************************************/ F32 getCalculatedRODutyCycle( void )