Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -rb36ca0b49c410f690519c0622990825fd5dba500 -r696a272b81bab714038cbc3f25f0b8d633cbcf53 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision b36ca0b49c410f690519c0622990825fd5dba500) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 696a272b81bab714038cbc3f25f0b8d633cbcf53) @@ -37,7 +37,8 @@ #define CONCENTRATE_PUMP_RAMP_SPEED_INCREMENT 10.0F ///< Speed increase (mL/min) when controlling concentrate pump to target step speed. #define CONCENTRATE_PUMP_MIN_SPEED 3.0F ///< Minimum speed for concentrate pump in mL per min. -#define CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_ON_PCT 0.02F ///< Concentrate pump speed out of range tolerance when on in percentage. +#define CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_ON_PCT 0.01F ///< Concentrate pump speed out of range tolerance when on in percentage. +#define CONCENTRATE_PUMP_CLEANING_SPD_OUT_OF_RANGE_TOL_PCT 0.05F ///< Concentrate pump cleaning mode speed out of range tolerance when on in percentage. #define CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_SLOW_MLPM 1.0F ///< Concentrate pump speed out of range tolerance when slow in mL/min. #define CONCENTRATE_PUMP_LOW_SPEED_THRESHOLD_MLPM 10.0F ///< Concentrate pump low speed threshold in mL/min. #define CONCENTRATE_PUMP_ZERO_FLOW_RATE 0xFFFF ///< Pulse width value when zero flow rate or pump is off. @@ -140,6 +141,7 @@ static U32 concentratePumpMonitorTimerCounter; ///< Timer counter to perform monitor on concentrate pump. static BOOL acidConcentratePumpParkPersistenceClear; ///< Boolean acid park persistence clearing. static BOOL bicarbConcentratePumpParkPersistenceClear; ///< Boolean for bicarb park persistence clearing. +static BOOL ufPumpParkPersistenceClear; ///< Boolean for UF pump park persistence clearing. /// Concentrate pump data publish interval. static OVERRIDE_U32_T concentratePumpDataPublishInterval = { CONCENTRATE_PUMP_DATA_PUBLISH_INTERVAL, CONCENTRATE_PUMP_DATA_PUBLISH_INTERVAL, 0, 0 }; @@ -186,6 +188,7 @@ concentratePumpMonitorTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; acidConcentratePumpParkPersistenceClear = FALSE; bicarbConcentratePumpParkPersistenceClear = FALSE; + ufPumpParkPersistenceClear = FALSE; for ( pumpId = CONCENTRATEPUMPS_FIRST; pumpId < NUM_OF_CONCENTRATE_PUMPS; pumpId++ ) { @@ -229,7 +232,7 @@ initPersistentAlarm( ALARM_ID_DD_D11_PUMP_SPEED_CONTROL_ERROR, 0, CONCENTRATE_PUMP_SPEED_OUT_OF_RANGE_TIMEOUT_MS ); initPersistentAlarm( ALARM_ID_DD_D10_PUMP_SPEED_CONTROL_ERROR, 0, CONCENTRATE_PUMP_SPEED_OUT_OF_RANGE_TIMEOUT_MS ); - //TODO: UF pump park bits to be defined in HDD and then will handle UF pump alarm later + initPersistentAlarm( ALARM_ID_DD_D76_PUMP_SPEED_CONTROL_ERROR, 0, CONCENTRATE_PUMP_SPEED_OUT_OF_RANGE_TIMEOUT_MS ); initPersistentAlarm( ALARM_ID_DD_CONC_PUMP_HALL_SENSOR_OUT_OF_RANGE, CONCENTRATE_PUMP_HALL_SENSORS_OUT_OF_RANGE_TIME_MS, CONCENTRATE_PUMP_HALL_SENSORS_OUT_OF_RANGE_TIME_MS ); initPersistentAlarm( ALARM_ID_DD_CONCENTRATE_PUMP_FAULT, CONCENTRATE_PUMP_FAULT_PERSISTENCE_PERIOD, CONCENTRATE_PUMP_FAULT_PERSISTENCE_PERIOD ); } @@ -248,6 +251,9 @@ U08 fpgaConcPumpsFault = getFPGAConcentratePumpsFault(); BOOL isConcPumpFault = ( fpgaConcPumpsFault > 0 ? TRUE : FALSE ); + //Update UF pump speed fault + fpgaConcPumpsFault |= getFPGAUFPumpFault(); + // Check if a new calibration is available // if ( TRUE == isNewCalibrationRecordAvailable() ) // { @@ -272,6 +278,7 @@ //Monitor Pump Speed monitorPumpSpeed( D11_PUMP, ALARM_ID_DD_D11_PUMP_SPEED_CONTROL_ERROR ); monitorPumpSpeed( D10_PUMP, ALARM_ID_DD_D10_PUMP_SPEED_CONTROL_ERROR ); + monitorPumpSpeed( D76_PUMP, ALARM_ID_DD_D76_PUMP_SPEED_CONTROL_ERROR ); checkPersistentAlarm( ALARM_ID_DD_CONCENTRATE_PUMP_FAULT, isConcPumpFault, fpgaConcPumpsFault, CONCENTRATE_PUMP_FAULT_PERSISTENCE_PERIOD ); @@ -285,16 +292,17 @@ * and associated fault handling. * @details \b Inputs: Park status * @details \b Outputs: isConcPumpParkInProgress,acidConcentratePumpParkPersistenceClear - * bicarbConcentratePumpParkPersistenceClear + * bicarbConcentratePumpParkPersistenceClear,ufPumpParkPersistenceClear * @return none *************************************************************************/ static void monitorPumpParkStatus( void ) { parked[ D11_PUMP ].data = (U32)getFPGAD11PumpIsParked(); parked[ D10_PUMP ].data = (U32)getFPGAD10PumpIsParked(); + parked[ D76_PUMP ].data = (U32)getFPGAD76PumpIsParked(); parkFaulted[ D11_PUMP ].data = (U32)getFPGAD11PumpParkFault(); parkFaulted[ D10_PUMP ].data = (U32)getFPGAD10PumpParkFault(); - // TODO : Handle UF Pump Park alarms once HDD updated with the details. + parkFaulted[ D76_PUMP ].data = (U32)getFPGAD76PumpParkFault(); if ( ( TRUE == getConcPumpIsParked( D11_PUMP ) ) || ( TRUE == getConcPumpParkIsFaulted( D11_PUMP ) ) ) { @@ -305,6 +313,10 @@ { concentratePumps[ D10_PUMP ].isConcPumpParkInProgress = FALSE; } + if ( ( TRUE == getConcPumpIsParked( D76_PUMP ) ) || ( TRUE == getConcPumpParkIsFaulted( D76_PUMP ) ) ) + { + concentratePumps[ D76_PUMP ].isConcPumpParkInProgress = FALSE; + } // Don't monitor persistence for cp speed alarms if we are parked. if ( TRUE == acidConcentratePumpParkPersistenceClear ) @@ -332,6 +344,19 @@ resetPersistentAlarmTimer( ALARM_ID_DD_D10_PUMP_SPEED_CONTROL_ERROR ); } } + + if ( TRUE == ufPumpParkPersistenceClear ) + { + // Clear flag and resume persistence checking once park bit is set. + if ( TRUE == getConcPumpIsParked( D76_PUMP ) ) + { + ufPumpParkPersistenceClear = FALSE; + } + else + { + resetPersistentAlarmTimer( ALARM_ID_DD_D76_PUMP_SPEED_CONTROL_ERROR ); + } + } } /*********************************************************************//** @@ -404,7 +429,7 @@ * the concentrate pumps. * @details \b Inputs: none * @details \b Outputs: concentratePumps[],acidConcentratePumpParkPersistenceClear, - * bicarbConcentratePumpParkPersistenceClear + * bicarbConcentratePumpParkPersistenceClear, ufPumpParkPersistenceClear * @details \b Alarms: ALARM_ID_DD_SOFTWARE_FAULT when invalid pump ID is seen. * @param pumpId concentrate pump id * @return none @@ -416,6 +441,7 @@ concentratePumps[ pumpId ].hasTurnOnPumpsBeenRequested = TRUE; acidConcentratePumpParkPersistenceClear = FALSE; bicarbConcentratePumpParkPersistenceClear = FALSE; + ufPumpParkPersistenceClear = FALSE; } else { @@ -875,8 +901,8 @@ } else { - //TODO: Need to evaluate park support in the new pump. setFPGAD76PumpParkCmd(); + ufPumpParkPersistenceClear = TRUE; } concentratePumps[ pumpId ].isConcPumpParkInProgress = TRUE; } @@ -1144,23 +1170,33 @@ * between requested and measured is not in range. * @details \b Alarm: ALARM_ID_DD_D10_PUMP_SPEED_CONTROL_ERROR when the speed difference * between requested and measured is not in range. + * @details \b Alarm: ALARM_ID_DD_D76_PUMP_SPEED_CONTROL_ERROR when the speed difference + * between requested and measured is not in range. * @param pumpId pump id to check the difference between requested and measured speed * @param alarm which the corresponding alarm of the concentrate pump * @return none *************************************************************************/ static void monitorPumpSpeed( CONCENTRATE_PUMPS_T pumpId, ALARM_ID_T alarm ) { - F32 cpTargetSpeed = concentratePumps[ pumpId ].currentPumpSpeed; - F32 cpError = fabs( fabs( getMeasuredPumpSpeedMLPM( pumpId ) ) - cpTargetSpeed ); - BOOL isCpSpeedOut = FALSE; - F32 tolerance = CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_SLOW_MLPM; + F32 cpTargetSpeed = fabs( concentratePumps[ pumpId ].currentPumpSpeed ); + F32 cpMeasSpeed = fabs( getMeasuredPumpSpeedMLPM( pumpId ) ); + F32 cpError = fabs( cpMeasSpeed - cpTargetSpeed ); + BOOL isCpSpeedOut = FALSE; + F32 tolerance = CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_SLOW_MLPM; + DD_OP_MODE_T opMode = getCurrentOperationMode(); if ( cpTargetSpeed > CONCENTRATE_PUMP_LOW_SPEED_THRESHOLD_MLPM ) { // Check if the pump is not in the off state and if it is not and greater than the minimum threshold, divide the error // to target speed. If the pump is off the target speed is 0 so the speed check is done differently + // The speed tolerance is looser in heat disinfect and flush than the rest of the modes that the concentrate pump are running. cpError = cpError / cpTargetSpeed; tolerance = CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_ON_PCT; + + if ( DD_MODE_HEAT == opMode ) + { + tolerance = CONCENTRATE_PUMP_CLEANING_SPD_OUT_OF_RANGE_TOL_PCT; + } } isCpSpeedOut = ( cpError > tolerance ? TRUE : FALSE ); Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -rb36ca0b49c410f690519c0622990825fd5dba500 -r696a272b81bab714038cbc3f25f0b8d633cbcf53 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision b36ca0b49c410f690519c0622990825fd5dba500) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 696a272b81bab714038cbc3f25f0b8d633cbcf53) @@ -52,7 +52,8 @@ #define HEATERS_DUTY_CYCLE_CONVERSION_FACTOR 100.0F ///< Heaters duty cycle 0: OFF, 100: 100% duty cycle. #define HEATERS_ZERO_EFFICIENCY 0.0F ///< Zero heater efficiency #define HEATER_CNTL_TRANSFER_DELTA_TEMP_C 0.50F ///< AC heater delta temperature to transfer control from open to close loop -#define MAX_ADJ_DELTA_TEMP_C 3.0F ///< Maximum adjusted delta temperature to add/remove from calculated target temperature +#define ADJ_DELTA_TEMP_STEP 2.0F ///< Adjust target temperature based on D28 feedback per cycle. +#define MAX_ADJ_DELTA_TEMP_C 5.0F ///< Maximum adjusted delta temperature to add/remove from calculated target temperature #define D5_HEAT_TX_INIT_FEED_FORWARD 0.0F ///< Initial Feed forward term for heater control //#define D5_HEAT_TX_P_COEFFICIENT 0.050F ///< P Term for AC primary heater control during treatment mode. @@ -82,7 +83,7 @@ #define D5_HEAT_CONTROL_INTERVAL_COUNT ( D5_HEAT_CONTROL_INTERVAL_MS / TASK_GENERAL_INTERVAL ) ///< Primary heater control interval count. #define D45_HEAT_CONTROL_INTERVAL_MS ( 1 * MS_PER_SECOND ) ///< Trimmer heater control interval in milli seconds #define D45_HEAT_CONTROL_INTERVAL_COUNT ( D45_HEAT_CONTROL_INTERVAL_MS / TASK_GENERAL_INTERVAL ) ///< Trimmer heater control interval count. -#define D5_TARGET_TEMP_ADJUST_INTERVAL_MS ( 10 * SEC_PER_MIN * MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Adjust primary target temperature +#define D5_TARGET_TEMP_ADJUST_INTERVAL_MS ( 5 * SEC_PER_MIN * MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Adjust primary target temperature #define PRIMARY_HEATER_MAX_PWR_WATTS 1400.0F ///< AC Primary Heater Max Power consumeption in Watts #define TX_PRIMARY_HEATER_MAX_PWR_WATTS 700.0F ///< Estimated power to be supplied to the primary heater during treatement mode #define HEAT_PRIMARY_HEATER_MAX_PWR_WATTS 980.0F ///< Estimated power to be supplied to the primary heater during heat disinfect mode @@ -387,7 +388,7 @@ F32 measuredTempAtDialyzer = getConductivityTemperatureValue( D27_COND ); F32 calcTargetTemp = getHeaterTargetTemperature( D5_HEAT ); F32 deltaTempC = targetTempfromTD - measuredTempAtDialyzer; - F32 capDeltaTempC = MIN( fabs(deltaTempC), MAX_ADJ_DELTA_TEMP_C ); + F32 capDeltaTempC = MIN( fabs(deltaTempC), ADJ_DELTA_TEMP_STEP ); if ( deltaTempC > HEATERS_ZERO_DELTA_TEMP_C ) { Index: firmware/App/DDCommon.h =================================================================== diff -u -r399c6b8efe0bf5ca7f5afb0aa0bc38c557fa36be -r696a272b81bab714038cbc3f25f0b8d633cbcf53 --- firmware/App/DDCommon.h (.../DDCommon.h) (revision 399c6b8efe0bf5ca7f5afb0aa0bc38c557fa36be) +++ firmware/App/DDCommon.h (.../DDCommon.h) (revision 696a272b81bab714038cbc3f25f0b8d633cbcf53) @@ -25,7 +25,7 @@ #define DD_VERSION_MAJOR 0 #define DD_VERSION_MINOR 0 #define DD_VERSION_MICRO 0 -#define DD_VERSION_BUILD 11 +#define DD_VERSION_BUILD 13 // ********** development build switches ********** @@ -40,7 +40,7 @@ //#define __PITEST__ 1 //Uncomment below if diener concentrate pump used -//#define __DIENER_CONC_PUMP__ 1 +#define __DIENER_CONC_PUMP__ 1 //Uncomment below if beta hardware is used //#define __BETA_HW_VER__ 1 @@ -55,7 +55,7 @@ //#define ENABLE_ALARM_2 //Uncomment below if balancing chamber pressure alarm is required -#define __BC_PRESSURE_ALARM__ 1 +//#define __BC_PRESSURE_ALARM__ 1 //Uncomment below to disable heaters debug message #define __HEATERS_DEBUG__ 1