Index: firmware/App/Modes/FPModes/InletPressureCheck.c =================================================================== diff -u -rfb0f180eb25dbcfd15d58ef584d535efd1c24e30 -r95a7e12ec9b9d70b13baf9aafd94e183beccd89c --- firmware/App/Modes/FPModes/InletPressureCheck.c (.../InletPressureCheck.c) (revision fb0f180eb25dbcfd15d58ef584d535efd1c24e30) +++ firmware/App/Modes/FPModes/InletPressureCheck.c (.../InletPressureCheck.c) (revision 95a7e12ec9b9d70b13baf9aafd94e183beccd89c) @@ -50,7 +50,6 @@ static FP_INLET_PRES_CHECK_STATE_T inletPressureCheckState; ///< Currently active Inlet Pressure check state. static U32 inletPressureCheckDataPublicationTimerCounter; ///< Used to schedule Inlet Pressure Check data publication to CAN bus. static U32 inletPressureCheckTimer; ///< Inlet Pressure check timeout timer -static U32 inletPressureCheckPersistanceStartTimeMS; ///< Current time for inlet pressure check persistence time started in milliseconds. static BOOL isPressureCheckComplete; ///< Inlet Pressure Check complete BOOL static OVERRIDE_U32_T inletPressureCheckDataPublishInterval; ///< Inlet Pressure Check mode data publish interval. static OVERRIDE_U32_T inletPressureCheckTimeout; ///< Inlet Pressure check timeout value @@ -84,7 +83,6 @@ inletPressureCheckTimeout.override = OVERRIDE_RESET; inletPressureCheckDataPublicationTimerCounter = 0; inletPressureCheckTimer = 0; - inletPressureCheckPersistanceStartTimeMS = 0; isPressureCheckComplete = FALSE; // Pressure alarms @@ -168,23 +166,19 @@ { 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 ) ) + // check for inlet pressure (M3) within range + if( ( m3Pressure >= minThreshold ) && ( m3Pressure <= maxThreshold ) ) { - // check for inlet pressure (M3) within range - if( ( m3Pressure >= minThreshold ) && ( m3Pressure <= maxThreshold ) ) - { - inletPressureCheckPersistanceStartTimeMS = 0; - isPressureCheckComplete = TRUE; - state = INLET_PRES_CHECK_PAUSED; - } + isPressureCheckComplete = TRUE; + state = INLET_PRES_CHECK_PAUSED; } + else + { + // 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 ); + } + } } else @@ -255,7 +249,6 @@ } signalROPumpHardStop(); inletPressureCheckTimer = getMSTimerCount(); - inletPressureCheckPersistanceStartTimeMS = getMSTimerCount(); break; case INLET_PRES_CHECK_PAUSED: Index: firmware/App/Modes/FPModes/ModeGenPermeate.c =================================================================== diff -u -rfb0f180eb25dbcfd15d58ef584d535efd1c24e30 -r95a7e12ec9b9d70b13baf9aafd94e183beccd89c --- firmware/App/Modes/FPModes/ModeGenPermeate.c (.../ModeGenPermeate.c) (revision fb0f180eb25dbcfd15d58ef584d535efd1c24e30) +++ firmware/App/Modes/FPModes/ModeGenPermeate.c (.../ModeGenPermeate.c) (revision 95a7e12ec9b9d70b13baf9aafd94e183beccd89c) @@ -251,9 +251,7 @@ 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; @@ -271,9 +269,7 @@ 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 ) ); Index: firmware/App/Monitors/WaterQualityMonitor.c =================================================================== diff -u -rfb0f180eb25dbcfd15d58ef584d535efd1c24e30 -r95a7e12ec9b9d70b13baf9aafd94e183beccd89c --- firmware/App/Monitors/WaterQualityMonitor.c (.../WaterQualityMonitor.c) (revision fb0f180eb25dbcfd15d58ef584d535efd1c24e30) +++ firmware/App/Monitors/WaterQualityMonitor.c (.../WaterQualityMonitor.c) (revision 95a7e12ec9b9d70b13baf9aafd94e183beccd89c) @@ -375,5 +375,17 @@ * TEST SUPPORT FUNCTIONS *************************************************************************/ +/*********************************************************************//** + * @brief + * The testROGetCurrentCalcuclatedDutyCycle function + * return RO calculated duty cycle at instantaneous pressure + * @details \b Inputs: none + * @details \b Outputs: none + * @return dutycycle + *************************************************************************/ +F32 testROGetCurrentCalcuclatedDutyCycle() +{ + return getCalculatedRODutyCycle(); +} /**@}*/ Index: firmware/App/Monitors/WaterQualityMonitor.h =================================================================== diff -u -r846073b88a25474464d43b4c0e8f300b52021f96 -r95a7e12ec9b9d70b13baf9aafd94e183beccd89c --- firmware/App/Monitors/WaterQualityMonitor.h (.../WaterQualityMonitor.h) (revision 846073b88a25474464d43b4c0e8f300b52021f96) +++ firmware/App/Monitors/WaterQualityMonitor.h (.../WaterQualityMonitor.h) (revision 95a7e12ec9b9d70b13baf9aafd94e183beccd89c) @@ -48,4 +48,6 @@ void checkPermeateLowFlow( void ); void checkRODutyCycle( void ); +F32 testROGetCurrentCalcuclatedDutyCycle(); + #endif Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r2475e55c224cbd841d61b76f1618451efe6be1f5 -r95a7e12ec9b9d70b13baf9aafd94e183beccd89c --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 2475e55c224cbd841d61b76f1618451efe6be1f5) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 95a7e12ec9b9d70b13baf9aafd94e183beccd89c) @@ -63,6 +63,7 @@ #include "Ultrafiltration.h" #include "Valves.h" #include "Voltages.h" +#include "WaterQualityMonitor.h" /** * @addtogroup Messaging @@ -240,8 +241,9 @@ { MSG_ID_FP_RO_PUMP_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testROPumpDataPublishIntervalOverride }, { MSG_ID_DD_RINSE_PUMP_DATA_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testRinsePumpDataPublishIntervalOverride }, { MSG_ID_FP_SET_START_STOP_OVERRIDE_REQUEST, &testSetGeneratePermeateSignal }, - { MSG_ID_FP_RO_REJECTION_RATIO_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testRORejectionRatioDataPublishIntervalOverride }, - { MSG_ID_FP_RO_FILTERED_REJECTION_RATIO_OVERRIDE_REQUEST, &testRORejectionRatioFilteredOverride }, + { MSG_ID_FP_RO_REJECTION_RATIO_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testRORejectionRatioDataPublishIntervalOverride }, + { MSG_ID_FP_RO_FILTERED_REJECTION_RATIO_OVERRIDE_REQUEST, &testRORejectionRatioFilteredOverride }, + { MSG_ID_FP_RO_GET_CALCULATED_DUTY_CYCLE_REQUEST, &testROGetCurrentCalcuclatedDutyCycle }, }; /// Calculation for number of entries in the incoming message function handler look-up table.