Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r99e330b5b872f68fdf2d842bd0597e54044d9ba9 -rd9abd635c7ca0e2f3d393f9568125df23b4d43bc --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 99e330b5b872f68fdf2d842bd0597e54044d9ba9) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision d9abd635c7ca0e2f3d393f9568125df23b4d43bc) @@ -241,6 +241,34 @@ /*********************************************************************//** * @brief + * The getBicarbDoseVol function gets the bicarb dose volume + * @details \b Inputs: bicarbDoseVolume + * @details \b Outputs: none + * @return TRUE if successful, FALSE if not. + *************************************************************************/ +F32 getBicarbDoseVol( void ) +{ + F32 result = getF32OverrideValue( &bicarbDoseVolume ); + + return result; +} + +/*********************************************************************//** + * @brief + * The getAcidDoseVol function gets acid mix volume + * @details \b Inputs: acidDoseVolume + * @details \b Outputs: none + * @return TRUE if successful, FALSE if not. + *************************************************************************/ +F32 getAcidDoseVol( void ) +{ + F32 result = getF32OverrideValue( &acidDoseVolume ); + + return result; +} + +/*********************************************************************//** + * @brief * The applyBalChamberSwitchingPeriod function applies the active balancing * chamber switching time based on the provided dialysis flow rate. * @details \b Inputs: Dialysis flow rate. Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -rf580ae73bbd06a249e4464b410a85755403a2f15 -rd9abd635c7ca0e2f3d393f9568125df23b4d43bc --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision f580ae73bbd06a249e4464b410a85755403a2f15) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision d9abd635c7ca0e2f3d393f9568125df23b4d43bc) @@ -51,8 +51,8 @@ #define DRY_BICART_FILL_COMPLETE_TIME_MS ( 1 * MS_PER_SECOND ) ///< Wait time to reset the request flag after fill complete #define DRY_BICART_WCID2_FILL_COMPLETE_PRESSURE_PSI ( 10.0F + WCDI2_PRESSURE_OFFSET_PSI ) ///< Maximum pressure reached to indicate the dry bicart fill being completed for WCID2 #define DRY_BICART_WCID1_FILL_COMPLETE_PRESSURE_PSI ( 10.0F + WCID1_PRESSURE_OFFSET_PSI ) ///< Maximum pressure reached to indicate the dry bicart fill being completed for WCID1 -#define GET_DRY_BICART_FILL_COMPLETE_PRESSURE_PSI (getTestConfigStatus( TEST_CONFIG_DD_ENABLE_WCID_1 ) \ - != TRUE ? DRY_BICART_WCID2_FILL_COMPLETE_PRESSURE_PSI : DRY_BICART_WCID1_FILL_COMPLETE_PRESSURE_PSI ) +#define GET_FILL_COMPLETE_PRESSURE_PSI (getTestConfigStatus( TEST_CONFIG_DD_ENABLE_WCID_1 ) != TRUE ? \ + DRY_BICART_WCID2_FILL_COMPLETE_PRESSURE_PSI : DRY_BICART_WCID1_FILL_COMPLETE_PRESSURE_PSI ) ///< Get fill complete pressure based on the WCID configuration #define DRY_BICART_FILL_INITIATE_PRESSURE_PSI 1.5F ///< Minimum pressure required to initiate the dry bicart fill process. #define DRY_BICART_FILL_COMPLETE_SUPPLY_PRESSURE_PSI 10.0F ///< Maximum pressure allowed at bicart fill during supply process/state #define DRY_BICART_FILL_INITIATE_SUPPLY_PRESSURE_PSI 3.0F ///< Minimum pressure required to initiate the dry bicart fill during supply process/state @@ -99,6 +99,7 @@ DRY_BICART_INITIAL_FILL, ///< Dry bicart initial fill DRY_BICART_SUPPLY, ///< Dry bicart chamber fill DRY_BICART_DRAIN, ///< Dry bicart drain + DRY_BICART_DEPRESSURIZE, ///< Dry bicart depressurize NUM_OF_DRY_BICART_OPERATION ///< Number of dry bicart operation } DRY_BICART_OPERATION_T; @@ -107,6 +108,7 @@ static DRY_BICART_FILL_EXEC_STATE_T dryBiCartFillExecState; ///< Current state of dry bicart fill executive state machine. static BICARB_CHAMBER_FILL_EXEC_STATE_T bicarbChamberFillExecState; ///< Current state of bicarb chamber fill executive state machine. static DRY_BICART_DRAIN_EXEC_STATE_T dryBiCartDrainExecState; ///< Current state of dry bicart drain executive state machine +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T dryBiCartDepressurizeExecState; ///< Current state of dry bicart depressurize executive state machine // fill static U32 dryBiCartFillStartTime; ///< Dry bicart fill start time. static U32 biCartFillCycleCounter; ///< Number of drybicart fill cycle @@ -121,6 +123,7 @@ static OVERRIDE_U32_T dryBiCartFillRequested; ///< Start/stop dry bicart fill. static OVERRIDE_U32_T bicarbChamberFillRequested; ///< Start/stop bicarb chamber fill. static OVERRIDE_U32_T dryBiCartDrainRequested; ///< Start/stop dry bicart drain. +static OVERRIDE_U32_T dryBiCartDepressurizeRequested; ///< Start/stop dry bicart depressurize // publish static OVERRIDE_U32_T dryBiCartDataPublishInterval; ///< Dry bicart data publish interval. static U32 dryBiCartDataPublicationTimerCounter; ///< Used to schedule drybicart data publication to CAN bus. @@ -166,6 +169,10 @@ static DRY_BICART_DRAIN_EXEC_STATE_T handleDryBicartFluidDrainDurationCheckState( void ); static DRY_BICART_DRAIN_EXEC_STATE_T handleDryBicartFluidDrainEndState( void ); +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeStartState( void ); +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeVentStartState( void ); +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeVentEndState( void ); + static F32 getDryBicartLowerCartPressure( void ); static F32 getDryBicartUpperCartPressure( void ); @@ -270,9 +277,6 @@ *************************************************************************/ void execDryBicart( void ) { - - execMixingControl(); - // top level state machine selection DRY_BICART_OPERATION_T dryBicartState = dryBicartStartRequest; @@ -298,6 +302,11 @@ execDryBicartDrainMode(); break; + case DRY_BICART_DEPRESSURIZE: + // Dry bicart depressurize + execDryBicartDepressurize(); + break; + default: // software fault, dryBicartStartRequest = DRY_BICART_IDLE; @@ -454,16 +463,53 @@ /*********************************************************************//** * @brief + * The execDryBicartDepressurize function executes the dry bicart depressurize state machine. + * @details \b Inputs: dryBiCartDepressurizeExecState + * @details \b Outputs: dryBiCartDepressurizeExecState + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when wrong dry bicart depressurize state + * invoked. + * @return current state. + *************************************************************************/ +U32 execDryBicartDepressurize( void ) +{ + // execute drybicart depressurize state machines + switch ( dryBiCartDepressurizeExecState ) + { + case DRY_BICART_DEPRESSURIZE_START_STATE: + dryBiCartDepressurizeExecState = handleDryBicartDepressurizeStartState(); + break; + + case DRY_BICART_DEPRESSURIZE_VENT_START_STATE: + dryBiCartDepressurizeExecState = handleDryBicartDepressurizeVentStartState(); + break; + + case DRY_BICART_DEPRESSURIZE_VENT_END_STATE: + dryBiCartDepressurizeExecState = handleDryBicartDepressurizeVentEndState(); + break; + + default: + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_DRY_BICART_DEPRESURIZE_INVALID_EXEC_STATE, dryBiCartDepressurizeExecState ); + break; + } + + return dryBiCartDepressurizeExecState; +} + +/*********************************************************************//** + * @brief * The setBicarbChamberFillRequested function sets the chmaberFillRequest * flag value to be True. - * @details \b Inputs: dryBiCartFillRequested, dryBiCartDrainRequested + * @details \b Inputs: dryBiCartFillRequested, dryBiCartDrainRequested, + * dryBiCartDepressurizeRequested * @details \b Outputs: bicarbChamberFillRequested * @return TRUE if successful, FALSE if not. *************************************************************************/ BOOL setBicarbChamberFillRequested( void ) { BOOL result = FALSE; - BOOL requestStatus = getU32OverrideValue( &dryBiCartFillRequested ) || getU32OverrideValue( &dryBiCartDrainRequested ); + BOOL requestStatus = getU32OverrideValue( &dryBiCartFillRequested ) ||\ + getU32OverrideValue( &dryBiCartDrainRequested ) || \ + getU32OverrideValue( &dryBiCartDepressurizeRequested ); // ensure that there is no other operation in progress before new request set to true if ( FALSE == requestStatus ) @@ -499,14 +545,17 @@ * @brief * The setBicartFillRequested function sets the bicart fill request * flag value to be True. - * @details \b Inputs: bicarbChamberFillRequested, dryBiCartDrainRequested + * @details \b Inputs: bicarbChamberFillRequested, dryBiCartDrainRequested, + * dryBiCartDepressurizeRequested * @details \b Outputs: dryBiCartFillRequested * @return TRUE if successful, FALSE if not. *************************************************************************/ BOOL setBicartFillRequested( void ) { BOOL result = FALSE; - BOOL requestStatus = getU32OverrideValue( &bicarbChamberFillRequested ) || getU32OverrideValue( &dryBiCartDrainRequested ); + BOOL requestStatus = getU32OverrideValue( &bicarbChamberFillRequested ) \ + || getU32OverrideValue( &dryBiCartDrainRequested ) || \ + getU32OverrideValue( &dryBiCartDepressurizeRequested ) ; //ensure that there is no other operation in progress before new request set to true if ( FALSE == requestStatus ) @@ -542,14 +591,17 @@ * @brief * The setBicartDrainRequested function sets the bicart drain request * flag value to be True. - * @details \b Inputs: bicarbChamberFillRequested,dryBiCartFillRequested + * @details \b Inputs: bicarbChamberFillRequested,dryBiCartFillRequested, + * dryBiCartDepressurizeRequested * @details \b Outputs: dryBiCartDrainRequested * @return TRUE if successful, FALSE if not. *************************************************************************/ BOOL setBicartDrainRequested( void ) { BOOL result = FALSE; - BOOL requestStatus = getU32OverrideValue( &bicarbChamberFillRequested ) || getU32OverrideValue( &dryBiCartFillRequested ); + BOOL requestStatus = getU32OverrideValue( &bicarbChamberFillRequested ) || \ + getU32OverrideValue( &dryBiCartFillRequested ) || \ + getU32OverrideValue( &dryBiCartDepressurizeRequested ); //ensure that there is no other operation in progress before new request set to true if ( FALSE == requestStatus ) @@ -583,6 +635,51 @@ /*********************************************************************//** * @brief + * The setBicartDepressurizeRequested function sets the bicart depressurize request + * flag value to be True. + * @details \b Inputs: bicarbChamberFillRequested,dryBiCartFillRequested,dryBiCartDrainRequested + * @details \b Outputs: dryBiCartDepressurizeRequested + * @return TRUE if successful, FALSE if not. + *************************************************************************/ +BOOL setBicartDepressurizeRequested( void ) +{ + BOOL result = FALSE; + BOOL requestStatus = getU32OverrideValue( &bicarbChamberFillRequested ) || \ + getU32OverrideValue( &dryBiCartFillRequested ) || \ + getU32OverrideValue( &dryBiCartDrainRequested ); + + //ensure that there is no other operation in progress before new request set to true + if ( FALSE == requestStatus ) + { + dryBiCartDepressurizeRequested.data = TRUE; + result = TRUE; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The getBicartDepressurizeRequested function gets the bicart depressurize request + * flag value + * @details \b Inputs: dryBiCartDepressurizeRequested + * @details \b Outputs: none + * @return TRUE if successful, FALSE if not. + *************************************************************************/ +BOOL getBicartDepressurizeRequested( void ) +{ + BOOL result = FALSE; + + if ( ( TRUE == getU32OverrideValue( &dryBiCartDepressurizeRequested ) ) ) + { + result = TRUE; + } + + return result; +} + +/*********************************************************************//** + * @brief * The getCurrentDryBiCartFillExecState function returns the current state * of the dry bicart fill state. * @details \b Inputs: dryBiCartFillExecState @@ -624,7 +721,8 @@ /*********************************************************************//** * @brief - * The updateDrybicartOperation function initiates the water fill, bicarbonate supply or bicarbonate drain + * The updateDrybicartOperation function initiates bicart fill water, bicarbonate supply, + * bicart drain or bicart depressurize * operation * @details \b Inputs: none * @details \b Outputs: dryBicartStartRequest @@ -647,6 +745,10 @@ //drain dryBicartStartRequest = DRY_BICART_DRAIN; } + else if ( TRUE == getBicartDepressurizeRequested() ) + { + dryBicartStartRequest = DRY_BICART_DEPRESSURIZE; + } else { // idle @@ -726,7 +828,7 @@ { DRY_BICART_FILL_EXEC_STATE_T state = DRY_BICART_FILL_WATER_END_STATE; F32 d66Pressure = getFilteredPressure( D66_PRES ); - F32 fillCompletePressure = GET_DRY_BICART_FILL_COMPLETE_PRESSURE_PSI; + F32 fillCompletePressure = GET_FILL_COMPLETE_PRESSURE_PSI; // Close dry bicart inlet water if D66 pressure is 17 PSI if ( d66Pressure >= fillCompletePressure ) @@ -989,7 +1091,7 @@ { BICARB_CHAMBER_FILL_EXEC_STATE_T state = BICARB_CARTRIDGE_FILL_WATER_END_STATE; F32 d66Pressure = getFilteredPressure( D66_PRES ); - F32 fillCompletePressure = GET_DRY_BICART_FILL_COMPLETE_PRESSURE_PSI; + F32 fillCompletePressure = GET_FILL_COMPLETE_PRESSURE_PSI; // check D66 pressure greater than or equal to 17 PSI if ( d66Pressure >= fillCompletePressure ) @@ -1225,29 +1327,6 @@ dryBiCartDrainTimePeriod = SMALL_DRY_BICART_MAX_DRAIN_TIME_MS; } - //Close D14 valve - setValveState( D14_VALV, VALVE_STATE_CLOSED ); - setValveState( D34_VALV, VALVE_STATE_CLOSED ); - setValveState( D35_VALV, VALVE_STATE_CLOSED ); - setValveState( D40_VALV, VALVE_STATE_CLOSED ); - setValveState( D91_VALV, VALVE_STATE_CLOSED ); - - // open bypass valve - setValveState( D34_VALV, VALVE_STATE_OPEN ); - - // open iofp drain valve - setValveState( M12_VALV, VALVE_STATE_OPEN ); - - // Open balancing chamber valves - valveControlForBCOpenState(); - - // Run D10 In Open loop mode(max speed 200ml/min) - setConcentratePumpTargetSpeed( D10_PUMP, DRAIN_BICART_PUMP_SPEED, DOSING_CONT_VOLUME ); - requestConcentratePumpOn( D10_PUMP ); - - // Run D48 at 1000 rpm,There is no improvement over above 1000 rpm for drain duration. - setDialysatePumpTargetRPM( D48_PUMP, DIAL_PUMP_DRAIN_RPM, TRUE ); - dryBiCartDrainStartTime = getMSTimerCount(); dryBiCartDrainLastCondSampleTime = dryBiCartDrainStartTime; dryBiCartDrainCondStableCount = 0; @@ -1270,14 +1349,33 @@ { DRY_BICART_DRAIN_EXEC_STATE_T state = DRY_BICART_FLUID_DRAIN_STATE; - // Open vent valves and close de-scaling valve - setValveState( D80_VALV, VALVE_STATE_OPEN ); + //Close D14 valve + setValveState( D14_VALV, VALVE_STATE_CLOSED ); + setValveState( D65_VALV, VALVE_STATE_CLOSED ); + setValveState( D35_VALV, VALVE_STATE_CLOSED ); + setValveState( D40_VALV, VALVE_STATE_CLOSED ); + setValveState( D91_VALV, VALVE_STATE_CLOSED ); setValveState( D81_VALV, VALVE_STATE_CLOSED ); - setValveState( D85_VALV, VALVE_STATE_OPEN ); + // Open vent valves and close descaling valve + setValveState( D80_VALV, VALVE_STATE_OPEN ); + setValveState( D85_VALV, VALVE_STATE_OPEN ); // Open D64 valve (vent for equilibrium) setValveState( D64_VALV, VALVE_STATE_OPEN ); + // open bypass valve + setValveState( D34_VALV, VALVE_STATE_OPEN ); + // TODO: open iofp drain valve, remove, this should be handled in IO/FP module. + setValveState( M12_VALV, VALVE_STATE_OPEN ); + // Open balancing chamber valves + valveControlForBCOpenState(); + // Run D10 In Open loop mode(max speed 200ml/min) + setConcentratePumpTargetSpeed( D10_PUMP, DRAIN_BICART_PUMP_SPEED, DOSING_CONT_VOLUME ); + requestConcentratePumpOn( D10_PUMP ); + + // Run D48 at 1000 rpm,There is no improvement over above 1000 rpm for drain duration. + setDialysatePumpTargetRPM( D48_PUMP, DIAL_PUMP_DRAIN_RPM, TRUE ); + state = DRY_BICART_FLUID_DRAIN_DURATION_CHECK_STATE; return state; @@ -1312,14 +1410,10 @@ setValveState( D64_VALV, VALVE_STATE_CLOSED ); setValveState( D80_VALV, VALVE_STATE_CLOSED ); setValveState( D85_VALV, VALVE_STATE_CLOSED ); - // close bypass valve setValveState( D34_VALV, VALVE_STATE_CLOSED ); - // TODO: close DD drain - setValveState( D53_VALV, VALVE_STATE_CLOSED ); - - // TODO : close iofp drain valve + // TODO : close iofp drain valve, remove this should be handled in IO/FP module. setValveState( M12_VALV, VALVE_STATE_CLOSED ); //close all balancing chamber valves @@ -1379,6 +1473,97 @@ /*********************************************************************//** * @brief + * The handleDryBicartDepressurizeStartState function set the one time actuation + * for drybicart de-pressurise request. + * @details \b Inputs: dryBiCartDepressurizeRequested + * @details \b Outputs: none + * @return the next drybicart depressurize state. + *************************************************************************/ +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeStartState( void ) +{ + DRY_BICART_DEPRESSURIZE_EXEC_STATE_T state = DRY_BICART_DEPRESSURIZE_START_STATE; + + if ( TRUE == getU32OverrideValue( &dryBiCartDepressurizeRequested ) ) + { + setValveState( D85_VALV, VALVE_STATE_OPEN ); + + state = DRY_BICART_DEPRESSURIZE_VENT_START_STATE; + } + + return state; +} + +/*********************************************************************//** + * @brief + * The handleDryBicartDepressurizeVentStartState function handles the vent start state for + * drybicart de-pressurise + * @details \b Inputs: dryBiCarbSypplyVentStartTime, dryBiCartPersistenceStartTime + * @details \b Outputs: none + * @return the next drybicart depressurize state. + *************************************************************************/ +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeVentStartState( void ) +{ + DRY_BICART_DEPRESSURIZE_EXEC_STATE_T state = DRY_BICART_DEPRESSURIZE_VENT_START_STATE; + + F32 d66Pressure = getFilteredPressure( D66_PRES ); + + if ( TRUE == didTimeout( dryBiCarbSypplyVentStartTime, DRY_BICART_SUPPLY_VENT_TIME_MS ) ) + { + //Vent chamber F to atmosphere + setValveState( D64_VALV, VALVE_STATE_OPEN ); + + // D66 pressure drops to below 1.5 PSI or time out + if ( ( d66Pressure <= DRY_BICART_FILL_VENT_COMPLETE_PRESSURE_PSI ) ) + { + // start the persistence timer once d66 reaches if it drops below 1.5 + if ( 0 == dryBiCartPersistenceStartTime ) + { + dryBiCartPersistenceStartTime = getMSTimerCount(); + } + // 200 ms persistence on D66 pressure since pressure overshoot just after D65 opening + if ( TRUE == didTimeout( dryBiCartPersistenceStartTime, DRY_BICART_PERSISTENCE_DURATION_MS ) ) + { + setValveState( D85_VALV, VALVE_STATE_CLOSED ); + dryBiCartPersistenceStartTime = 0; + + state = DRY_BICART_DEPRESSURIZE_VENT_END_STATE; + } + } + else + { + dryBiCartPersistenceStartTime = 0; + } + } + + return state; +} + +/*********************************************************************//** + * @brief + * The handleDryBicartDepressurizeVentEndState function handles the vent end state for + * drybicart de-pressurise + * @details \b Inputs: none + * @details \b Outputs: dryBiCartDepressurizeRequested + * @return the next drybicart depressurize state. + *************************************************************************/ +static DRY_BICART_DEPRESSURIZE_EXEC_STATE_T handleDryBicartDepressurizeVentEndState( void ) +{ + DRY_BICART_DEPRESSURIZE_EXEC_STATE_T state = DRY_BICART_DEPRESSURIZE_VENT_END_STATE; + + // Go idle + dryBiCartDepressurizeRequested.data = FALSE; + // for this request override also cleared + dryBiCartDepressurizeRequested.ovData = FALSE; + + state = DRY_BICART_DEPRESSURIZE_START_STATE; + + dryBicartStartRequest = DRY_BICART_IDLE; + + return state; +} + +/*********************************************************************//** + * @brief * The publishDryBicartData function broadcasts the dry bicart * data at defined interval. * @details \b Inputs: dryBiCartDataPublicationTimerCounter @@ -1505,6 +1690,23 @@ /*********************************************************************//** * @brief + * The testDryBiCartDepressurizeRequestOverride function starts/stops the bicart + * depressurize request + * @details \b Inputs: dryBiCartDepressurizeRequested + * @details \b Outputs: dryBiCartDepressurizeRequested + * @param message set message from Dialin which includes the bicart + * depressurize request start/stop. + * @return TRUE if set request is successful, FALSE if not + *************************************************************************/ +BOOL testDryBiCartDepressurizeRequestOverride( MESSAGE_T *message ) +{ + BOOL result = u32Override( message, &dryBiCartDepressurizeRequested, FALSE, TRUE ); + + return result; +} + +/*********************************************************************//** + * @brief * The testDryBiCartTypeOverride function selects small/large cartridge type * @details \b Inputs: dryBiCartType * @details \b Outputs: dryBiCartType Index: firmware/App/Controllers/MixingControl.c =================================================================== diff -u -r201fd50c9a5d2e5840bf6acfa77bfedf1d031338 -rd9abd635c7ca0e2f3d393f9568125df23b4d43bc --- firmware/App/Controllers/MixingControl.c (.../MixingControl.c) (revision 201fd50c9a5d2e5840bf6acfa77bfedf1d031338) +++ firmware/App/Controllers/MixingControl.c (.../MixingControl.c) (revision d9abd635c7ca0e2f3d393f9568125df23b4d43bc) @@ -329,6 +329,8 @@ mixingControlAcidControlInterval.override = OVERRIDE_RESET; mixingControlDataPublicationTimerCounter = 0; + lastBicarbMixVolume = 0; + lastAcidMixVolume = 0; initializePIController( PI_CONTROLLER_ID_BICARB_VOL, 0.0F,\ getBicarbKpGainCoefficient(), getBicarbKiGainCoefficient(),\ @@ -363,7 +365,7 @@ *************************************************************************/ void execMixingControl( void ) { - if( getCurrentBalancingChamberExecState() > BAL_CHAMBER_STATE_IDLE ) + if ( getCurrentBalancingChamberExecState() > BAL_CHAMBER_STATE_IDLE ) { updatedConcentrateControlInterval(); Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -r98f2b3df325b323494f2e110f71a4163d4df7fbd -rd9abd635c7ca0e2f3d393f9568125df23b4d43bc --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 98f2b3df325b323494f2e110f71a4163d4df7fbd) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision d9abd635c7ca0e2f3d393f9568125df23b4d43bc) @@ -30,6 +30,7 @@ #include "PermeateTank.h" #include "RinsePump.h" #include "ROPump.h" +#include "SubstitutionPump.h" #include "SystemCommDD.h" #include "TaskGeneral.h" #include "WatchdogMgmt.h" @@ -81,7 +82,7 @@ execConcentratePumpMonitor(); // Monitor DD voltages - ///execVoltagesMonitor(); + execVoltagesMonitor(); // run DD operation mode state machine execDDOperationModes(); @@ -104,6 +105,9 @@ execDryBicart(); } + // Control Substitution pump + execSubstitutionPumpController(); + // Control closed loop mixing of bicarb and acid execMixingControl();