Index: firmware/App/Modes/ModeGenDialysate.c =================================================================== diff -u -rb96f1964c061605200af748e1b4a5c2785c7985d -rac5e52d907ff6adad795d8f81ca8206c5cd33c77 --- firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision b96f1964c061605200af748e1b4a5c2785c7985d) +++ firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision ac5e52d907ff6adad795d8f81ca8206c5cd33c77) @@ -33,6 +33,7 @@ #include "TaskGeneral.h" #include "TDInterface.h" #include "Temperature.h" +#include "TestSupport.h" #include "Timers.h" #include "Ultrafiltration.h" #include "Valves.h" @@ -63,8 +64,10 @@ #define ZERO_DIAL_FLOW_RATE 0.0F ///< Zero dialysate flow rate #define SPENT_CHAMBER_FILL_MAX_COUNT 10 ///< Total number of spent chamber fill allowed. #define BICARB_CHAMBER_FILL_TIMEOUT ( 1 * MS_PER_SECOND ) ///< Bicarb chamber fill timeout. -#define PUMP_SPEED_SLOPE_FACTOR 1.24F ///< D48 pump speed (calculation based on Qd) slope factor. -#define PUMP_SPEED_INTERCEPT_FACTOR 30.0F ///< D48 pump speed (calculation based on Qd) intercept factor. +#define PUMP_SPEED_SLOPE_FACTOR_DIENER_2000 1.24F ///< D48 Diener 2000 pump speed slope (y = 1.24x + 30). +#define PUMP_SPEED_INTERCEPT_FACTOR_DIENER_2000 30.0F ///< D48 Diener 2000 pump speed intercept. +#define PUMP_SPEED_SLOPE_FACTOR_DIENER_1000 2.869F ///< D48 Diener 1000 pump speed slope (y = 2.869x + 25.956). +#define PUMP_SPEED_INTERCEPT_FACTOR_DIENER_1000 25.956F ///< D48 Diener 1000 pump speed intercept. //Testing #define DELAY_BC_SWITCHING_AT_START_UP ( 10 * MS_PER_SECOND ) ///< Provide a balancing chamber switching start up delay to stabilize pump speed etc., /// Payload record structure for Gen dialysate execution state set request @@ -140,7 +143,7 @@ bicarbFillStartTimeMS = 0; pendingSpentChamberFill = FALSE; pendingBicarbChamberFill = FALSE; - d48PumpSpeed = MIN_DIALYSATE_PUMP_RPM; + d48PumpSpeed = getD48MinPumpRPM(); //Testing bypassStateDelayStartTimeMS = 0; delayBypassStateFlag = TRUE; @@ -585,16 +588,30 @@ /*********************************************************************//** * @brief - * The calculateD48PumpSpeedForBCFill function calculates the pump speed based on the - * dialysate flow rate for continuous delivery of dialysate. - * @details \b Inputs: Qd. + * The getCalculatedD48PumpSpeedForBCFill function returns the D48 pump speed + * calculated from dialysate flow rate (Qd) for continuous delivery. + * @details \b Inputs: Qd from TD, test config TEST_CONFIG_DD_ENABLE_DIENER_1000_PUMP. * @details \b Outputs: none - * @return calculated D48 pump speed. + * @return Calculated D48 pump speed in RPM (Diener 1000 or 2000 formula per test config). *************************************************************************/ U32 getCalculatedD48PumpSpeedForBCFill( void ) { F32 dialFlowrate = getTDDialysateFlowrate(); - return (U32)( ( PUMP_SPEED_SLOPE_FACTOR * dialFlowrate ) + PUMP_SPEED_INTERCEPT_FACTOR ); + F32 slope; + F32 intercept; + + if ( TRUE == getTestConfigStatus( TEST_CONFIG_DD_ENABLE_DIENER_1000_PUMP ) ) + { + slope = PUMP_SPEED_SLOPE_FACTOR_DIENER_1000; + intercept = PUMP_SPEED_INTERCEPT_FACTOR_DIENER_1000; + } + else + { + slope = PUMP_SPEED_SLOPE_FACTOR_DIENER_2000; + intercept = PUMP_SPEED_INTERCEPT_FACTOR_DIENER_2000; + } + + return (U32)( ( slope * dialFlowrate ) + intercept ); } /*********************************************************************//**