Index: firmware/App/Drivers/PressureSensor.c =================================================================== diff -u -r6f961c6e113a4076ba9d5f97e078a398a8976d7c -rc9a16bd5cab11fef6078dac1dd1cf62ab59801f3 --- firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision 6f961c6e113a4076ba9d5f97e078a398a8976d7c) +++ firmware/App/Drivers/PressureSensor.c (.../PressureSensor.c) (revision c9a16bd5cab11fef6078dac1dd1cf62ab59801f3) @@ -90,28 +90,28 @@ F32 presMinPSI = PRES_MIN_PSI; // Update and convert raw pressures to mmHg - currentPressureReadings[ D9_PRES ].data = convertPressureReading( getFPGAD9PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); + currentPressureReadings[ D9_PRES ].data = convertPressureReading( getFPGAD9PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); currentPressureReadings[ D66_PRES ].data = convertPressureReading( getFPGAD66PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); currentPressureReadings[ D51_PRES ].data = convertPressureReading( getFPGAD51PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); currentPressureReadings[ D18_PRES ].data = convertPressureReading( getFPGAD18PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); currentPressureReadings[ D41_PRES ].data = convertPressureReading( getFPGAD41PresRawPressure(), presMinPSI, LOW_PRES_MAX_PSI ); - currentPressureReadings[ M1_PRES ].data = convertPressureReading( getFPGAM1RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); - currentPressureReadings[ P8_PRES ].data = convertPressureReading( getFPGAP8RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ M3_PRES ].data = convertPressureReading( getFPGAM3RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ P8_PRES ].data = convertPressureReading( getFPGAP8RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); currentPressureReadings[ P13_PRES ].data = convertPressureReading( getFPGAP13RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); currentPressureReadings[ P17_PRES ].data = convertPressureReading( getFPGAP17RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); + currentPressureReadings[ P46_PRES ].data = convertPressureReading( getFPGAP46RawPressure(), presMinPSI, HIGH_PRES_MAX_PSI ); // Update and convert raw pressure sensor temperatures to deg C - currentPresTempReadings[ D9_PRES ].data = convertPressureTempReading2DegC( getFPGAD9PresRawTemperature() ); + currentPresTempReadings[ D9_PRES ].data = convertPressureTempReading2DegC( getFPGAD9PresRawTemperature() ); currentPresTempReadings[ D66_PRES ].data = convertPressureTempReading2DegC( getFPGAD66PresRawTemperature() ); currentPresTempReadings[ D51_PRES ].data = convertPressureTempReading2DegC( getFPGAD51PresRawTemperature() ); currentPresTempReadings[ D18_PRES ].data = convertPressureTempReading2DegC( getFPGAD18PresRawTemperature() ); currentPresTempReadings[ D41_PRES ].data = convertPressureTempReading2DegC( getFPGAD41PresRawTemperature() ); - currentPresTempReadings[ M1_PRES ].data = convertPressureTempReading2DegC( getFPGAM1RawTemperature() ); - currentPresTempReadings[ M3_PRES ].data = convertPressureTempReading2DegC( getFPGAM3RawTemperature() ); - currentPresTempReadings[ P8_PRES ].data = convertPressureTempReading2DegC( getFPGAP8RawTemperature() ); + currentPresTempReadings[ M3_PRES ].data = convertPressureTempReading2DegC( getFPGAM3RawTemperature() ); + currentPresTempReadings[ P8_PRES ].data = convertPressureTempReading2DegC( getFPGAP8RawTemperature() ); currentPresTempReadings[ P13_PRES ].data = convertPressureTempReading2DegC( getFPGAP13RawTemperature() ); currentPresTempReadings[ P17_PRES ].data = convertPressureTempReading2DegC( getFPGAP17RawTemperature() ); + currentPresTempReadings[ P46_PRES ].data = convertPressureTempReading2DegC( getFPGAP46RawTemperature() ); } /*********************************************************************//** Index: firmware/App/Drivers/PressureSensor.h =================================================================== diff -u -re6504e7e162d00745033a55191d6f810d2753105 -rc9a16bd5cab11fef6078dac1dd1cf62ab59801f3 --- firmware/App/Drivers/PressureSensor.h (.../PressureSensor.h) (revision e6504e7e162d00745033a55191d6f810d2753105) +++ firmware/App/Drivers/PressureSensor.h (.../PressureSensor.h) (revision c9a16bd5cab11fef6078dac1dd1cf62ab59801f3) @@ -42,15 +42,15 @@ D18_PRES, ///< Fresh Dialysate pressure (PDf) D41_PRES, ///< Transmembrane pressure (Ptm) LAST_DD_PRESSURE_SENSOR = D41_PRES, ///< End of DD pressure sensor group - M1_PRES, ///< Water inlet pressure before regulator (PRi) - FIRST_IO_PRESSURE_SENSOR = M1_PRES, ///< Start of IO pressure sensor group - M3_PRES, ///< Water inlet pressure after regulator (PRo) + M3_PRES, ///< Water inlet pressure after regulator (PR0) + FIRST_IO_PRESSURE_SENSOR = M3_PRES, ///< Start of IO pressure sensor group LAST_IO_PRESSURE_SENSOR = M3_PRES, ///< End of IO pressure sensor group P8_PRES, ///< Water inlet pressure before conductivity sensor FIRST_FP_PRESSURE_SENSOR = P8_PRES, ///< Start of FP pressure sensor group P13_PRES, ///< Pressure before RO filter P17_PRES, ///< Pressure after RO filter - LAST_FP_PRESSURE_SENSOR = P17_PRES, ///< End of FP pressure sensor group + P46_PRES, ///< Pressure after sediment filter + LAST_FP_PRESSURE_SENSOR = P46_PRES, ///< End of FP pressure sensor group NUM_OF_PRESSURE_SENSORS ///< Number of pressure sensors } PRESSURE_SENSORS_T; Index: firmware/App/Monitors/Pressure.c =================================================================== diff -u -r6f961c6e113a4076ba9d5f97e078a398a8976d7c -rc9a16bd5cab11fef6078dac1dd1cf62ab59801f3 --- firmware/App/Monitors/Pressure.c (.../Pressure.c) (revision 6f961c6e113a4076ba9d5f97e078a398a8976d7c) +++ firmware/App/Monitors/Pressure.c (.../Pressure.c) (revision c9a16bd5cab11fef6078dac1dd1cf62ab59801f3) @@ -422,11 +422,11 @@ { PRESSURE_FP_DATA_T data; - data.m1Pressure = getFilteredPressure( M1_PRES ); data.m3Pressure = getFilteredPressure( M3_PRES ); data.p8Pressure = getFilteredPressure( P8_PRES ); data.p13Pressure = getFilteredPressure( P13_PRES ); data.p17Pressure = getFilteredPressure( P17_PRES ); + data.p46Pressure = getFilteredPressure( P46_PRES ); broadcastData( MSG_ID_FP_PRESSURES_DATA, COMM_BUFFER_OUT_CAN_FP_BROADCAST, (U08*)&data, sizeof( PRESSURE_FP_DATA_T ) ); fpPressuresDataPublicationTimerCounter = 0; Index: firmware/App/Monitors/Pressure.h =================================================================== diff -u -rfd42b31a0572ab85c862ebf94997766f27dd8e97 -rc9a16bd5cab11fef6078dac1dd1cf62ab59801f3 --- firmware/App/Monitors/Pressure.h (.../Pressure.h) (revision fd42b31a0572ab85c862ebf94997766f27dd8e97) +++ firmware/App/Monitors/Pressure.h (.../Pressure.h) (revision c9a16bd5cab11fef6078dac1dd1cf62ab59801f3) @@ -45,11 +45,11 @@ /// FP Pressure data struct. typedef struct { - F32 m1Pressure; ///< Water Inlet Input pressure F32 m3Pressure; ///< Water Inlet Output pressure F32 p8Pressure; ///< Pressure before inlet conductivity sensor (P8) F32 p13Pressure; ///< Pressure before RO filter (P13) F32 p17Pressure; ///< Pressure after RO filter (P17) + F32 p46Pressure; ///< Pressure after sediment filter (P46) } PRESSURE_FP_DATA_T; // ********** public function prototypes ********** Index: firmware/App/Monitors/Temperature.c =================================================================== diff -u -r325e67dab10f6666702bf0f1256015b31e58de4f -rc9a16bd5cab11fef6078dac1dd1cf62ab59801f3 --- firmware/App/Monitors/Temperature.c (.../Temperature.c) (revision 325e67dab10f6666702bf0f1256015b31e58de4f) +++ firmware/App/Monitors/Temperature.c (.../Temperature.c) (revision c9a16bd5cab11fef6078dac1dd1cf62ab59801f3) @@ -490,7 +490,6 @@ { TEMPERATURE_SENSORS_FP_DATA_T data; - data.m1Temp = getFilteredPressureSensorTemperature( M1_PRES ); data.m3Temp = getFilteredPressureSensorTemperature( M3_PRES ); data.p10Temp = getFilteredConductivitySensorTemperature( P9_COND ); data.p19Temp = getFilteredConductivitySensorTemperature( P18_COND ); @@ -499,6 +498,7 @@ data.p17Temp = getFilteredPressureSensorTemperature( P17_PRES ); data.p7Temp = getFilteredFlowSensorTemperature( P7_FLOW ); data.p16Temp = getFilteredFlowSensorTemperature( P16_FLOW ); + data.p46Temp = getFilteredPressureSensorTemperature( P46_PRES ); broadcastData( MSG_ID_FP_TEMPERATURE_DATA, COMM_BUFFER_OUT_CAN_FP_BROADCAST, (U08*)&data, sizeof( TEMPERATURE_SENSORS_FP_DATA_T ) ); fpTempDataPublicationTimerCounter = 0; Index: firmware/App/Monitors/Temperature.h =================================================================== diff -u -r325e67dab10f6666702bf0f1256015b31e58de4f -rc9a16bd5cab11fef6078dac1dd1cf62ab59801f3 --- firmware/App/Monitors/Temperature.h (.../Temperature.h) (revision 325e67dab10f6666702bf0f1256015b31e58de4f) +++ firmware/App/Monitors/Temperature.h (.../Temperature.h) (revision c9a16bd5cab11fef6078dac1dd1cf62ab59801f3) @@ -59,7 +59,6 @@ /// Temperature sensors data structure. typedef struct { - F32 m1Temp; ///< Temperature before pressure regulator (M1) F32 m3Temp; ///< Temperature after pressure regulator (M3) F32 p10Temp; ///< P10 temperature from inlet conductivity sensor. F32 p19Temp; ///< P19 temperature from outlet conductivity sensor. @@ -68,6 +67,7 @@ F32 p17Temp; ///< Temperature after RO filter (P17) F32 p7Temp; ///< Temperature RO inlet F32 p16Temp; ///< Temperature RO outlet + F32 p46Temp; ///< Temperature after sediment filter (P46) } TEMPERATURE_SENSORS_FP_DATA_T; // ********** public function prototypes ********** Index: firmware/App/Monitors/WaterQualityMonitor.c =================================================================== diff -u -r6f961c6e113a4076ba9d5f97e078a398a8976d7c -rc9a16bd5cab11fef6078dac1dd1cf62ab59801f3 --- firmware/App/Monitors/WaterQualityMonitor.c (.../WaterQualityMonitor.c) (revision 6f961c6e113a4076ba9d5f97e078a398a8976d7c) +++ firmware/App/Monitors/WaterQualityMonitor.c (.../WaterQualityMonitor.c) (revision c9a16bd5cab11fef6078dac1dd1cf62ab59801f3) @@ -21,6 +21,7 @@ #include "FPOperationModes.h" #include "PersistentAlarm.h" #include "Pressure.h" +#include "ROPump.h" #include "SystemCommDD.h" #include "TaskPriority.h" #include "Temperature.h" @@ -33,27 +34,30 @@ // ********** private definitions ********** -#define INLET_TEMPERATURE_LOW_THRESHOLD_C 5.0F ///< Minimum allowed Inlet temperature in C. -#define INLET_TEMPERATURE_HIGH_THRESHOLD_C 30.0F ///< Maximum allowed Inlet temperature in C. -#define INLET_TEMPERATURE_PERSISTENCE_TIMER_MS ( 5 * MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Persistence timer to trigger alarm in ms. -#define INLET_TEMPERATURE_PERSISTENCE_CLEAR_MS ( 5 * MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Persistence timer to clear alarm in ms. +#define INLET_TEMPERATURE_LOW_THRESHOLD_C 5.0F ///< Minimum allowed Inlet temperature in C. +#define INLET_TEMPERATURE_HIGH_THRESHOLD_C 30.0F ///< Maximum allowed Inlet temperature in C. +#define INLET_TEMPERATURE_PERSISTENCE_TIMER_MS ( 5 * MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Persistence timer to trigger alarm in ms. +#define INLET_TEMPERATURE_PERSISTENCE_CLEAR_MS ( 5 * MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Persistence timer to clear alarm in ms. -#define MAX_INLET_RO_PUMP_PRESSURE_WARNING_PSIG 120.0F ///< Maximum allowed Input pressure to the RO membrane. -#define MIN_INLET_WATER_PRESSURE_WARNING_LOW_PSIG 30.0F ///< Minimum allowed Input low pressure value in psig without boost pump. -#define MAX_INLET_WATER_PRESSURE_WARNING_HIGH_PSIG 80.0F ///< Maximum allowed Input high pressure value in psig without boost pump. -#define MIN_INLET_WATER_PRESSURE_WARNING_BOOST_LOW_PSIG 10.0F ///< Minimum allowed Input low pressure value in psig with boost pump. -#define MAX_INLET_WATER_PRESSURE_WARNING_BOOST_HIGH_PSIG 80.0F ///< Maximum allowed Input high pressure value in psig with boost pump. -#define MIN_PRESSURE_RELIEF_WARNING_LOW_PSIG 13.0F ///< Minimum pressure relief warning in psi -#define MAX_PRESSURE_RELIEF_WARNING_HIGH_PSIG 17.0F ///< Maximum pressure relief warning in psi -#define INLET_WATER_PRES_OUT_OF_RANGE_TIMEOUT_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for pressure out of range error in milliseconds. -#define INLET_WATER_PRES_OUT_OF_RANGE_CLEAR_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for pressure out of range clear in milliseconds. -#define INLET_WATER_PRES_RELIEF_OUT_OF_RANGE_TIMEOUT_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for pressure out of range error in milliseconds. -#define INLET_WATER_PRES_RELIEF_OUT_OF_RANGE_CLEAR_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for pressure out of range clear in milliseconds. +#define MAX_INLET_RO_PUMP_PRESSURE_WARNING_PSIG 120.0F ///< Maximum allowed Input pressure to the RO membrane. +#define MIN_INLET_WATER_PRESSURE_WARNING_LOW_PSIG 25.0F ///< Minimum allowed Input warning low pressure value in psig for RO featured. +#define MAX_INLET_WATER_PRESSURE_WARNING_HIGH_PSIG 40.0F ///< Maximum allowed Input warning high pressure value in psig for RO featured. +#define MAX_INLET_WATER_PRESSURE_FAULT_HIGH_PSIG 75.0F ///< Maximum allowed Input fault high pressure value in psig for RO featured. +#define MIN_INLET_WATER_PRESSURE_DEFEATURED_WARNING_LOW_PSIG 5.0F ///< Minimum allowed Input warning low pressure value in psig for RO Defeatured. +#define MAX_INLET_WATER_PRESSURE_DEFEATURED_WARNING_HIGH_PSIG 10.0F ///< Maximum allowed Input warning high pressure value in psig for RO Defeatured. +#define MAX_INLET_WATER_PRESSURE_DEFEATURED_FAULT_HIGH_PSIG 40.0F ///< Maximum allowed Input fault high pressure value in psig for RO Defeatured. +#define MIN_PRESSURE_RELIEF_WARNING_LOW_PSIG 13.0F ///< Minimum pressure relief warning in psi +#define MAX_PRESSURE_RELIEF_WARNING_HIGH_PSIG 17.0F ///< Maximum pressure relief warning in psi +#define MAX_PERMEATE_FLOW_FAULT_THRESHOLD 1.25F ///< Maximum permeate flow threshold value in percentage. +#define INLET_WATER_PRES_OUT_OF_RANGE_TIMEOUT_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for pressure out of range error in milliseconds. +#define INLET_WATER_PRES_OUT_OF_RANGE_CLEAR_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for pressure out of range clear in milliseconds. +#define INLET_WATER_PRES_RELIEF_OUT_OF_RANGE_TIMEOUT_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for pressure out of range error in milliseconds. +#define INLET_WATER_PRES_RELIEF_OUT_OF_RANGE_CLEAR_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for pressure out of range clear in milliseconds. -#define OUTLET_CONDUCTIVITY_HIGH_THRESHOLD_US 200.0F ///< Minimum allowed inlet conductivity in uS/cm. -#define INLET_WATER_COND_OUT_OF_RANGE_TIMEOUT_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for conductivity out of range error in milliseconds. -#define INLET_WATER_COND_OUT_OF_RANGE_CLEAR_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for conductivity out of range clear in milliseconds. -#define INLET_CONDUCTIVITY_HIGH_THRESHOLD_US 2000.0F ///< Maximum allowed outlet conductivity in uS/cm. +#define OUTLET_CONDUCTIVITY_HIGH_THRESHOLD_US 200.0F ///< Minimum allowed inlet conductivity in uS/cm. +#define INLET_WATER_COND_OUT_OF_RANGE_TIMEOUT_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for conductivity out of range error in milliseconds. +#define INLET_WATER_COND_OUT_OF_RANGE_CLEAR_MS ( 5 * MS_PER_SECOND ) ///< Persistence period for conductivity out of range clear in milliseconds. +#define INLET_CONDUCTIVITY_HIGH_THRESHOLD_US 2000.0F ///< Maximum allowed outlet conductivity in uS/cm. // ********** private data ********** @@ -88,38 +92,66 @@ * @brief * The checkInletPressures function checks the inlet water pressure * against the pressure threshold and alarm if the pressure is out of range. - * @details \b Inputs: pressureM1 + * @details \b Inputs: pressureM3 * @details \b Outputs: none * @details \b Alarms: ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE when - * M1 pressure goes beyond low pressure limit. + * M3 pressure goes beyond low pressure limit. * @details \b Alarms: ALARM_ID_FP_INLET_PRESSURE_OUT_HIGH_RANGE when - * M1 pressure goes beyond high pressure limit + * M3 pressure goes beyond high pressure limit + * @details \b Alarms: ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE when + * M3 pressure goes beyond fault high pressure limit * @return none *************************************************************************/ void checkInletPressures( void ) { - F32 pressureM1 = getFilteredPressure( M1_PRES ); + F32 pressureM3 = getFilteredPressure( M3_PRES ); BOOL isPresOutOfLowRange = FALSE; BOOL isPresOutOfHighRange = FALSE; + BOOL isPresOutOfHighRangeFault = FALSE; - if ( TRUE == isBoostPumpInstalled() ) + if ( TRUE == isFPDefeatured() ) { - isPresOutOfLowRange = ( ( pressureM1 < MIN_INLET_WATER_PRESSURE_WARNING_BOOST_LOW_PSIG ) ? TRUE : FALSE); - isPresOutOfHighRange = ( ( pressureM1 > MAX_INLET_WATER_PRESSURE_WARNING_BOOST_HIGH_PSIG ) ? TRUE : FALSE); - checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE, isPresOutOfLowRange, pressureM1, MIN_INLET_WATER_PRESSURE_WARNING_BOOST_LOW_PSIG ); - checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_HIGH_RANGE, isPresOutOfHighRange, pressureM1, MAX_INLET_WATER_PRESSURE_WARNING_BOOST_HIGH_PSIG ); + isPresOutOfLowRange = ( ( pressureM3 < MIN_INLET_WATER_PRESSURE_DEFEATURED_WARNING_LOW_PSIG ) ? TRUE : FALSE); + isPresOutOfHighRange = ( ( ( pressureM3 > MAX_INLET_WATER_PRESSURE_DEFEATURED_WARNING_HIGH_PSIG ) && ( pressureM3 < MAX_INLET_WATER_PRESSURE_DEFEATURED_FAULT_HIGH_PSIG ) ) ? TRUE : FALSE); + isPresOutOfHighRangeFault = ( ( pressureM3 > MAX_INLET_WATER_PRESSURE_DEFEATURED_FAULT_HIGH_PSIG ) ? TRUE : FALSE); + checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE, isPresOutOfLowRange, pressureM3, MIN_INLET_WATER_PRESSURE_DEFEATURED_WARNING_LOW_PSIG ); + checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_HIGH_RANGE, isPresOutOfHighRange, pressureM3, MAX_INLET_WATER_PRESSURE_DEFEATURED_WARNING_HIGH_PSIG ); + checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE, isPresOutOfHighRangeFault, pressureM3, MAX_INLET_WATER_PRESSURE_DEFEATURED_FAULT_HIGH_PSIG ); } else { - isPresOutOfLowRange = ( ( pressureM1 < MIN_INLET_WATER_PRESSURE_WARNING_LOW_PSIG ) ? TRUE : FALSE); - isPresOutOfHighRange = ( ( pressureM1 > MAX_INLET_WATER_PRESSURE_WARNING_HIGH_PSIG ) ? TRUE : FALSE); - checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE, isPresOutOfLowRange, pressureM1, MIN_INLET_WATER_PRESSURE_WARNING_LOW_PSIG ); - checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_HIGH_RANGE, isPresOutOfHighRange, pressureM1, MAX_INLET_WATER_PRESSURE_WARNING_HIGH_PSIG ); + isPresOutOfLowRange = ( ( pressureM3 < MIN_INLET_WATER_PRESSURE_WARNING_LOW_PSIG ) ? TRUE : FALSE); + isPresOutOfHighRange = ( ( ( pressureM3 > MAX_INLET_WATER_PRESSURE_WARNING_HIGH_PSIG ) && ( pressureM3 < MAX_INLET_WATER_PRESSURE_FAULT_HIGH_PSIG ) ) ? TRUE : FALSE); + isPresOutOfHighRangeFault = ( ( pressureM3 > MAX_INLET_WATER_PRESSURE_FAULT_HIGH_PSIG ) ? TRUE : FALSE); + checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_LOW_RANGE, isPresOutOfLowRange, pressureM3, MIN_INLET_WATER_PRESSURE_WARNING_LOW_PSIG ); + checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_OUT_HIGH_RANGE, isPresOutOfHighRange, pressureM3, MAX_INLET_WATER_PRESSURE_WARNING_HIGH_PSIG ); + checkPersistentAlarm( ALARM_ID_FP_INLET_PRESSURE_CRITICAL_OUT_RANGE, isPresOutOfHighRangeFault, pressureM3, MAX_INLET_WATER_PRESSURE_FAULT_HIGH_PSIG ); } } /*********************************************************************//** * @brief + * The checkPermeateFlow function checks the permeate flow rate from P16 + * against the set target flow rate and alarm if the flow is out of range. + * @details \b Inputs: permeateFlow + * @details \b Outputs: none + * @details \b Alarms: ALARM_ID_FP_PERMEATE_FLOW_OUT_HIGH_RANGE when + * P16 flow goes beyond threshold limit from set target flow. + * @return none + *************************************************************************/ +void checkPermeateFlow( void ) +{ + F32 permeateFlow = getFilteredFlow( P16_FLOW ); + BOOL isFlowOutOfRange = FALSE; + F32 maxAllowedPermeateFlow = (F32)getTargetROPumpFlowRateMLPM() * MAX_PERMEATE_FLOW_FAULT_THRESHOLD; + + isFlowOutOfRange = ( ( permeateFlow > maxAllowedPermeateFlow ) ? TRUE : FALSE); + checkPersistentAlarm( ALARM_ID_FP_PERMEATE_FLOW_OUT_HIGH_RANGE, isFlowOutOfRange, permeateFlow, maxAllowedPermeateFlow ); + +} + +/*********************************************************************//** + * @brief * The checkROPressures function checks the RO membrane pressure * against the pressure threshold and alarm if the pressure is out of range. * @details \b Inputs: pressureP13 @@ -167,18 +199,18 @@ * @brief * The checkInletTemperatures function checks the inlet water temperature * against the temperature threshold and alarm if the temperature is out of range. - * @details \b Inputs: temperatureP10, temperatureM1 + * @details \b Inputs: temperatureP10, temperatureM3 * @details \b Outputs: none * @details \b Alarms: ALARM_ID_FP_INLET_TEMPERATURE_OUT_LOW_RANGE when - * P10 or M1 temperature goes beyond low temperature limit. + * P10 or M3 temperature goes beyond low temperature limit. * @details \b Alarms: ALARM_ID_FP_INLET_TEMPERATURE_OUT_HIGH_RANGE when - * P10 or M1 temperature goes beyond high temperature limit + * P10 or M3 temperature goes beyond high temperature limit * @return none *************************************************************************/ void checkInletTemperatures( void ) { F32 temperatureP10 = getFilteredConductivitySensorTemperature( P9_COND ); - F32 temperatureM1 = getFilteredPressureSensorTemperature( M1_PRES ); + F32 temperatureM3 = getFilteredPressureSensorTemperature( M3_PRES ); BOOL isTempOutOfLowRange = FALSE; BOOL isTempOutOfHighRange = FALSE; @@ -187,10 +219,10 @@ checkPersistentAlarm( ALARM_ID_FP_INLET_TEMPERATURE_OUT_LOW_RANGE, isTempOutOfLowRange, temperatureP10, INLET_TEMPERATURE_LOW_THRESHOLD_C ); checkPersistentAlarm( ALARM_ID_FP_INLET_TEMPERATURE_OUT_HIGH_RANGE, isTempOutOfHighRange, temperatureP10, INLET_TEMPERATURE_HIGH_THRESHOLD_C ); - isTempOutOfLowRange = ( ( temperatureM1 < INLET_TEMPERATURE_LOW_THRESHOLD_C ) ? TRUE : FALSE); - isTempOutOfHighRange = ( ( temperatureM1 > INLET_TEMPERATURE_HIGH_THRESHOLD_C ) ? TRUE : FALSE); - checkPersistentAlarm( ALARM_ID_FP_INLET_TEMPERATURE_OUT_LOW_RANGE, isTempOutOfLowRange, temperatureM1, INLET_TEMPERATURE_LOW_THRESHOLD_C ); - checkPersistentAlarm( ALARM_ID_FP_INLET_TEMPERATURE_OUT_HIGH_RANGE, isTempOutOfHighRange, temperatureM1, INLET_TEMPERATURE_HIGH_THRESHOLD_C ); + isTempOutOfLowRange = ( ( temperatureM3 < INLET_TEMPERATURE_LOW_THRESHOLD_C ) ? TRUE : FALSE); + isTempOutOfHighRange = ( ( temperatureM3 > INLET_TEMPERATURE_HIGH_THRESHOLD_C ) ? TRUE : FALSE); + checkPersistentAlarm( ALARM_ID_FP_INLET_TEMPERATURE_OUT_LOW_RANGE, isTempOutOfLowRange, temperatureM3, INLET_TEMPERATURE_LOW_THRESHOLD_C ); + checkPersistentAlarm( ALARM_ID_FP_INLET_TEMPERATURE_OUT_HIGH_RANGE, isTempOutOfHighRange, temperatureM3, INLET_TEMPERATURE_HIGH_THRESHOLD_C ); } /*********************************************************************//** Index: firmware/App/Monitors/WaterQualityMonitor.h =================================================================== diff -u -r6f961c6e113a4076ba9d5f97e078a398a8976d7c -rc9a16bd5cab11fef6078dac1dd1cf62ab59801f3 --- firmware/App/Monitors/WaterQualityMonitor.h (.../WaterQualityMonitor.h) (revision 6f961c6e113a4076ba9d5f97e078a398a8976d7c) +++ firmware/App/Monitors/WaterQualityMonitor.h (.../WaterQualityMonitor.h) (revision c9a16bd5cab11fef6078dac1dd1cf62ab59801f3) @@ -42,5 +42,6 @@ void checkInletTemperatures( void ); void checkInletConductivity( void ); void checkOutletConductivity( void ); +void checkPermeateFlow( void ); #endif Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r8ffa9372b0000d0714fa88eb9a1714eb172b9399 -rc9a16bd5cab11fef6078dac1dd1cf62ab59801f3 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 8ffa9372b0000d0714fa88eb9a1714eb172b9399) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision c9a16bd5cab11fef6078dac1dd1cf62ab59801f3) @@ -205,8 +205,8 @@ U08 fpgaD76PumpFault; ///< Reg 658: UF pump fault U08 fpga_UnUsed_3; ///< reg 659: Not used - S16 pressureM1; ///< Reg 660. M1 pressure data. - U16 temperatureM1; ///< Reg 662. M1 temperature data. + S16 pressureP46; ///< Reg 660. P46 pressure data. + U16 temperatureP46; ///< Reg 662. P46 temperature data. S16 pressureM3; ///< Reg 664. M3 pressure data. U16 temperatureM3; ///< Reg 666. M3 temperature data. S16 pressureP8; ///< Reg 668. P8 pressure data. @@ -2976,26 +2976,26 @@ /*********************************************************************//** * @brief - * The getFPGAM1RawPressure function gets the M1 pressure reading. - * @details \b Inputs: fpgaSensorReadings.pressureM1 + * The getFPGAP46RawPressure function gets the P46 pressure reading. + * @details \b Inputs: fpgaSensorReadings.pressureP46 * @details \b Outputs: none - * @return M1 pressure + * @return P46 pressure *************************************************************************/ -S16 getFPGAM1RawPressure( void ) +S16 getFPGAP46RawPressure( void ) { - return fpgaSensorReadings.pressureM1; + return fpgaSensorReadings.pressureP46; } /*********************************************************************//** * @brief - * The getFPGAM1RawTemperature function gets the M1 sensor temperature reading. - * @details \b Inputs: fpgaSensorReadings.temperatureM1 + * The getFPGAP46RawTemperature function gets the P46 sensor temperature reading. + * @details \b Inputs: fpgaSensorReadings.temperatureP46 * @details \b Outputs: none - * @return M1 sensor temperature + * @return P46 sensor temperature *************************************************************************/ -S16 getFPGAM1RawTemperature( void ) +S16 getFPGAP46RawTemperature( void ) { - return fpgaSensorReadings.temperatureM1; + return fpgaSensorReadings.temperatureP46; } /*********************************************************************//** Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -r8ffa9372b0000d0714fa88eb9a1714eb172b9399 -rc9a16bd5cab11fef6078dac1dd1cf62ab59801f3 --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 8ffa9372b0000d0714fa88eb9a1714eb172b9399) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision c9a16bd5cab11fef6078dac1dd1cf62ab59801f3) @@ -247,8 +247,8 @@ void setFPGAP24Enabled( BOOL enable ); void setFPGAP24PWM( U16 pwm ); -S16 getFPGAM1RawPressure( void ); -S16 getFPGAM1RawTemperature( void ); +S16 getFPGAP46RawPressure( void ); +S16 getFPGAP46RawTemperature( void ); S16 getFPGAM3RawPressure( void ); S16 getFPGAM3RawTemperature( void ); S16 getFPGAP8RawPressure( void );