Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -ra631e128cd6be44aa232e23b58a229bfb8fe9043 -r43ebe58702128e865210533f9e6deaf13f99d262 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision a631e128cd6be44aa232e23b58a229bfb8fe9043) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 43ebe58702128e865210533f9e6deaf13f99d262) @@ -96,6 +96,7 @@ static U32 balChamberFillTimeoutCount; ///< Timeout count (in task interval) to detect BC fill timeout. static S32 diffSpentFillCompleteCount; ///< Difference between spent target fill to actual fill count static BOOL isSpentFillComplete; ///< Flag indicating spent side fill complete. +static BOOL isFreshSideValvesClosed; ///< Flag indicating fresh-side BC valves are closed while spent side may still be filling. static F32 lastPrevSpentDialPressure; ///< Low-Qd slope: spent pressure last sample of dosing (tick before VALVES_CLOSE); then n-2 in VC. static F32 prevSpentDialPressure; ///< Spent pressure previous sample (n-1) during VALVES_CLOSE for low-Qd slope detection. static U32 spentFillRiseHitCount; ///< Low-Qd slope: counted rise hits (only incremented when in timing window). @@ -127,6 +128,9 @@ static void applyBalChamberSwitchingPeriod( F32 tdDialysateFlowrate ); static BOOL isBalChamberTimeBasedSwitching( void ); static void scheduleFirstCycleRelaxAfterQdApply( void ); +static void valveControlForBCState1FreshSideClose( void ); +static void valveControlForBCState2FreshSideClose( void ); +static void closeFreshSideValvesWhenFillComplete( void ); /*********************************************************************//** * @brief @@ -179,6 +183,7 @@ spentFillRiseHitCount = 0; spentFillRiseMissCounter = 0; isSpentFillComplete = FALSE; + isFreshSideValvesClosed = FALSE; isBalChamberSwitchingActive = FALSE; isBalChamberSwitchingOnRequested = FALSE; isBalChamberSwitchingOffRequested = FALSE; @@ -311,6 +316,7 @@ spentFillRiseHitCount = 0; spentFillRiseMissCounter = 0; isSpentFillComplete = FALSE; + isFreshSideValvesClosed = FALSE; spentDialPressure = getFilteredPressure( D51_PRES ); lastPrevSpentDialPressure = spentDialPressure; prevSpentDialPressure = spentDialPressure; @@ -620,6 +626,59 @@ /*********************************************************************//** * @brief + * The valveControlForBCState1FreshSideClose function closes only the fresh-side + * balancing chamber valves opened during state 1 fill. + * @details \b Inputs: none + * @details \b Outputs: valve states + * @return none. + *************************************************************************/ +static void valveControlForBCState1FreshSideClose( void ) +{ + setValveState( D19_VALV, VALVE_STATE_CLOSED ); + setValveState( D22_VALV, VALVE_STATE_CLOSED ); +} + +/*********************************************************************//** + * @brief + * The valveControlForBCState2FreshSideClose function closes only the fresh-side + * balancing chamber valves opened during state 2 fill. + * @details \b Inputs: none + * @details \b Outputs: valve states + * @return none. + *************************************************************************/ +static void valveControlForBCState2FreshSideClose( void ) +{ + setValveState( D20_VALV, VALVE_STATE_CLOSED ); + setValveState( D21_VALV, VALVE_STATE_CLOSED ); +} + +/*********************************************************************//** + * @brief + * The closeFreshSideValvesWhenFillComplete function closes the fresh-side BC + * valves once fresh fill is detected, without waiting for spent fill. + * @details \b Inputs: balChamberSWState, isPressureStabilizedDuringFill, isFreshSideValvesClosed + * @details \b Outputs: isFreshSideValvesClosed, valve states + * @return none. + *************************************************************************/ +static void closeFreshSideValvesWhenFillComplete( void ) +{ + if ( ( TRUE == isPressureStabilizedDuringFill ) && ( FALSE == isFreshSideValvesClosed ) ) + { + if ( BAL_CHAMBER_SW_STATE1 == balChamberSWState ) + { + valveControlForBCState1FreshSideClose(); + } + else + { + valveControlForBCState2FreshSideClose(); + } + + isFreshSideValvesClosed = TRUE; + } +} + +/*********************************************************************//** + * @brief * The handleBalChamberState1FillStart function handles the balancing chamber * state 1 fill and time to fill chamber counter being updated. * @details \b Inputs: Pressure @@ -645,6 +704,7 @@ spentFillRiseHitCount = 0; spentFillRiseMissCounter = 0; isSpentFillComplete = FALSE; + isFreshSideValvesClosed = FALSE; if ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) { @@ -775,7 +835,6 @@ static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState1FillDetectComplete( void ) { BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE1_FILL_DETECT_COMPLETE; - BOOL isBothFillsComplete = FALSE; BOOL isFirstCycleNotDone = FALSE; BOOL isFillCompleteOrFirstCycle = FALSE; @@ -806,16 +865,17 @@ } } + closeFreshSideValvesWhenFillComplete(); + checkSpentFillComplete( spentDialPressure ); - // Check both spent and fresh side fill is complete - isBothFillsComplete = ( ( TRUE == isSpentFillComplete ) && ( TRUE == isPressureStabilizedDuringFill ) ) ? TRUE : FALSE; isFirstCycleNotDone = ( ( FALSE == isFirstCycleBCSwitchingCompleted ) && ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) ) ? TRUE : FALSE; if ( FALSE == getBalChamberSwitchingOnlyStatus() ) { - isFillCompleteOrFirstCycle = ( ( TRUE == isBothFillsComplete ) || ( TRUE == isFirstCycleNotDone ) ) ? TRUE : FALSE; + isFillCompleteOrFirstCycle = ( ( ( TRUE == isSpentFillComplete ) && ( TRUE == isFreshSideValvesClosed ) ) || + ( TRUE == isFirstCycleNotDone ) ) ? TRUE : FALSE; } if ( ( TRUE == isFillCompleteOrFirstCycle ) || @@ -963,6 +1023,7 @@ spentFillRiseHitCount = 0; spentFillRiseMissCounter = 0; isSpentFillComplete = FALSE; + isFreshSideValvesClosed = FALSE; if ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) { @@ -1036,7 +1097,6 @@ static BAL_CHAMBER_EXEC_STATE_T handleBalChamberState2FillDetectComplete( void ) { BAL_CHAMBER_EXEC_STATE_T state = BAL_CHAMBER_STATE2_FILL_DETECT_COMPLETE; - BOOL isBothFillsComplete = FALSE; BOOL isFirstCycleNotDone = FALSE; BOOL isFillCompleteOrFirstCycle = FALSE; @@ -1067,26 +1127,17 @@ state = BAL_CHAMBER_STATE_IDLE; } - // Check fresh dialysate pressure back in range to indicate fill complete. - if ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) - { - if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) - { - // stabilized pressure indicating fresh side fill is complete - isPressureStabilizedDuringFill = TRUE; - } - } + closeFreshSideValvesWhenFillComplete(); checkSpentFillComplete( spentDialPressure ); - // Check switching cycle time or pressure check for valve closure - isBothFillsComplete = ( ( TRUE == isSpentFillComplete ) && ( TRUE == isPressureStabilizedDuringFill ) ) ? TRUE : FALSE; isFirstCycleNotDone = ( ( FALSE == isFirstCycleBCSwitchingCompleted ) && ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) ) ? TRUE : FALSE; if ( FALSE == getBalChamberSwitchingOnlyStatus() ) { - isFillCompleteOrFirstCycle = ( ( TRUE == isBothFillsComplete ) || ( TRUE == isFirstCycleNotDone ) ) ? TRUE : FALSE; + isFillCompleteOrFirstCycle = ( ( ( TRUE == isSpentFillComplete ) && ( TRUE == isFreshSideValvesClosed ) ) || + ( TRUE == isFirstCycleNotDone ) ) ? TRUE : FALSE; } if ( ( TRUE == isFillCompleteOrFirstCycle ) || @@ -1459,6 +1510,66 @@ /*********************************************************************//** * @brief + * The getBalChamberFreshSideValvesClosedStatus function returns whether the + * fresh-side balancing chamber valves are closed for the current switch state. + * @details \b Inputs: isFreshSideValvesClosed + * @details \b Outputs: none + * @return TRUE when fresh-side BC valves are closed. + *************************************************************************/ +BOOL getBalChamberFreshSideValvesClosedStatus( void ) +{ + return isFreshSideValvesClosed; +} + +/*********************************************************************//** + * @brief + * The getBalChamberFreshFillCompleteStatus function returns whether fresh-side + * fill completed during the current BC switch cycle. + * @details \b Inputs: isPressureStabilizedDuringFill + * @details \b Outputs: none + * @return TRUE when fresh-side fill is complete. + *************************************************************************/ +BOOL getBalChamberFreshFillCompleteStatus( void ) +{ + return isPressureStabilizedDuringFill; +} + +/*********************************************************************//** + * @brief + * The getBalChamberSpentFillCompleteStatus function returns whether spent-side + * fill completed during the current BC switch cycle. + * @details \b Inputs: isSpentFillComplete + * @details \b Outputs: none + * @return TRUE when spent-side fill is complete. + *************************************************************************/ +BOOL getBalChamberSpentFillCompleteStatus( void ) +{ + return isSpentFillComplete; +} + +/*********************************************************************//** + * @brief + * The isBalChamberSwitchImminent function returns whether the balancing chamber + * is within the valve-close window (50 ms) before switching. + * @details \b Inputs: currentBalChamberSwitchingCounter, balChamberValveClosePeriod + * @details \b Outputs: none + * @return TRUE when BC switch is imminent. + *************************************************************************/ +BOOL isBalChamberSwitchImminent( void ) +{ + BOOL result = FALSE; + + if ( ( balChamberValveClosePeriod > 0 ) && + ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) ) + { + result = TRUE; + } + + return result; +} + +/*********************************************************************//** + * @brief * The getBalChamberSwitchingFreq function gets the balancing chamber switching * frequency value. * @details \b Inputs: balChamberSwitchingFreq Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -ra631e128cd6be44aa232e23b58a229bfb8fe9043 -r43ebe58702128e865210533f9e6deaf13f99d262 --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision a631e128cd6be44aa232e23b58a229bfb8fe9043) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision 43ebe58702128e865210533f9e6deaf13f99d262) @@ -160,6 +160,8 @@ static BICARB_CHAMBER_FILL_EXEC_STATE_T handleBicarbChamberPressureCheckState( void ); static BICARB_CHAMBER_FILL_EXEC_STATE_T handleBicarbChamberSupplyVentStartState(void); static BICARB_CHAMBER_FILL_EXEC_STATE_T handleBicarbChamberSupplyVentEndState(void); +static BOOL isDryBicartBalChamberFillWindowOpen( void ); +static void closeD65IfBalChamberSwitchImminent( void ); // Drain static DRY_BICART_DRAIN_EXEC_STATE_T handleDryBicartDrainStartState( void ); static DRY_BICART_DRAIN_EXEC_STATE_T handleDryBicartFluidDrainState( void ); @@ -540,6 +542,44 @@ /*********************************************************************//** * @brief + * The isDryBicartBalChamberFillWindowOpen function checks whether D65 may be + * opened for dry bicarb refill: fresh-side BC valves closed and BC switch not + * within the 50 ms valve-close window. + * @details \b Inputs: getBalChamberFreshSideValvesClosedStatus, isBalChamberSwitchImminent + * @details \b Outputs: none + * @return TRUE when the BC fresh-side fill window is open for D65. + *************************************************************************/ +static BOOL isDryBicartBalChamberFillWindowOpen( void ) +{ + BOOL result = FALSE; + + if ( ( TRUE == getBalChamberFreshSideValvesClosedStatus() ) && + ( FALSE == isBalChamberSwitchImminent() ) ) + { + result = TRUE; + } + + return result; +} + +/*********************************************************************//** + * @brief + * The closeD65IfBalChamberSwitchImminent function closes D65 when the balancing + * chamber is within 50 ms of switching. + * @details \b Inputs: isBalChamberSwitchImminent + * @details \b Outputs: valve states + * @return none + *************************************************************************/ +static void closeD65IfBalChamberSwitchImminent( void ) +{ + if ( TRUE == isBalChamberSwitchImminent() ) + { + setValveState( D65_VALV, VALVE_STATE_CLOSED ); + } +} + +/*********************************************************************//** + * @brief * The setBicartFillRequested function sets the bicart fill request * flag value to be True. * @details \b Inputs: bicarbChamberFillRequested, dryBiCartDrainRequested, @@ -1060,20 +1100,25 @@ *************************************************************************/ static BICARB_CHAMBER_FILL_EXEC_STATE_T handleBicarbChamberCartridgeFillWaterStartState( void ) { - BICARB_CHAMBER_FILL_EXEC_STATE_T state = BICARB_CARTRIDGE_FILL_WATER_END_STATE; + BICARB_CHAMBER_FILL_EXEC_STATE_T state = BICARB_CARTRIDGE_FILL_WATER_START_STATE; - // Close vent valves and descaling valve - setValveState( D80_VALV, VALVE_STATE_CLOSED ); - setValveState( D81_VALV, VALVE_STATE_CLOSED ); - setValveState( D85_VALV, VALVE_STATE_CLOSED ); + if ( TRUE == isDryBicartBalChamberFillWindowOpen() ) + { + // Close vent valves and descaling valve + setValveState( D80_VALV, VALVE_STATE_CLOSED ); + setValveState( D81_VALV, VALVE_STATE_CLOSED ); + setValveState( D85_VALV, VALVE_STATE_CLOSED ); - // open inlet water to bicart - setValveState( D65_VALV, VALVE_STATE_OPEN ); - setValveState( D64_VALV, VALVE_STATE_OPEN ); + // open inlet water to bicart only when fresh-side BC valves are closed + setValveState( D65_VALV, VALVE_STATE_OPEN ); + setValveState( D64_VALV, VALVE_STATE_OPEN ); - dryBiCarbSupplyStartTime = getMSTimerCount(); - dryBiCartPersistenceStartTime = 0; + dryBiCarbSupplyStartTime = getMSTimerCount(); + dryBiCartPersistenceStartTime = 0; + state = BICARB_CARTRIDGE_FILL_WATER_END_STATE; + } + return state; } @@ -1090,6 +1135,20 @@ F32 d66Pressure = getFilteredPressure( D66_PRES ); F32 fillCompletePressure = GET_FILL_COMPLETE_PRESSURE_PSI; + closeD65IfBalChamberSwitchImminent(); + + if ( ( FALSE == isDryBicartBalChamberFillWindowOpen() ) && + ( d66Pressure < fillCompletePressure ) ) + { + setValveState( D65_VALV, VALVE_STATE_CLOSED ); + } + else if ( ( TRUE == isDryBicartBalChamberFillWindowOpen() ) && + ( d66Pressure < fillCompletePressure ) ) + { + setValveState( D65_VALV, VALVE_STATE_OPEN ); + setValveState( D64_VALV, VALVE_STATE_OPEN ); + } + // check D66 pressure greater than or equal to 17 PSI if ( d66Pressure >= fillCompletePressure ) { @@ -1157,6 +1216,8 @@ F32 d66Pressure = getFilteredPressure( D66_PRES ); LVL_STATE_T bicarbChamberLevel = getBicarbChamberLevelStatus(); + closeD65IfBalChamberSwitchImminent(); + // Once upper level reached high , close the valve, timeout is for safety in case level sensor didn't work(10 sec), or else its a time based filling (3 sec) if ( ( LVL_STATE_HIGH == bicarbChamberLevel ) || ( TRUE == didTimeout( dryBiCarbSupplyStartTime, DRY_BICART_SUPPLY_VALVE_D80_OPEN_TIME_MS ) ) ) @@ -1192,7 +1253,8 @@ drybicartPersistenceOnLowercartPressureStartTime = getMSTimerCount(); } // 200 ms persistence on D66 pressure - if ( TRUE == didTimeout( drybicartPersistenceOnLowercartPressureStartTime, DRY_BICART_PERSISTENCE_DURATION_MS ) ) + if ( ( TRUE == didTimeout( drybicartPersistenceOnLowercartPressureStartTime, DRY_BICART_PERSISTENCE_DURATION_MS ) ) && + ( TRUE == isDryBicartBalChamberFillWindowOpen() ) ) { setValveState( D65_VALV, VALVE_STATE_OPEN ); drybicartPersistenceOnLowercartPressureStartTime = 0; @@ -1608,7 +1670,7 @@ * @details \b Outputs: dryBiCartDataPublishInterval * @param Override message from Dialin which includes the interval * (in ms) to override the DD dry bicart data publish interval to. - * @return TRUE if override successful, FALSE if not + * @return TRUE if override successful, FALSE if not. *************************************************************************/ BOOL testDryBiCartDataPublishIntervalOverride( MESSAGE_T *message ) { Index: firmware/App/Controllers/MixingControl.c =================================================================== diff -u -ra631e128cd6be44aa232e23b58a229bfb8fe9043 -r43ebe58702128e865210533f9e6deaf13f99d262 --- firmware/App/Controllers/MixingControl.c (.../MixingControl.c) (revision a631e128cd6be44aa232e23b58a229bfb8fe9043) +++ firmware/App/Controllers/MixingControl.c (.../MixingControl.c) (revision 43ebe58702128e865210533f9e6deaf13f99d262) @@ -69,8 +69,8 @@ #define MIX_NO_FEED_FORWARD 0.0F ///< Feed forward term for dialysate closed loop control -#define BICARB_MIX_CONTROL_INTERVAL ( 9 * MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the bicarb mix is controlled. -#define ACID_MIX_CONTROL_INTERVAL ( 15 * MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the dialysate mix is controlled. +#define BICARB_MIX_CONTROL_INTERVAL_MULTIPLIER ( 3 * MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the bicarb mix is controlled. +#define ACID_MIX_CONTROL_INTERVAL_MULTIPLIER ( 5 * MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the dialysate mix is controlled. #define BICARB_DEADBAND_CONTROL 15.0F ///< Bicarb dead band control #define ACID_DEADBAND_CONTROL 50.0F ///< Acid dead band control @@ -201,6 +201,7 @@ static void setBicarbMixVol( F32 targetValue ); static void setAcidMixVol( F32 targetValue ); +static void updatedConcentrateControlInterval( void ); static F32 getBicarbDeltaConductivity( void ); static F32 getBicarbTargetConductivity( void ); @@ -257,6 +258,9 @@ mixingControlBicarbVolume.ovInitData = 0.0F; mixingControlBicarbVolume.override = OVERRIDE_RESET; + lastAcidMixVolume = DEFAULT_ACID_VOLUME_ML; + lastBicarbMixVolume = DEFAULT_BICARB_VOLUME_ML; + mixingControlAcidVolumeKpGain.data = ACID_VOL_CONTROL_P_COEFFICIENT; mixingControlAcidVolumeKpGain.ovData = ACID_VOL_CONTROL_P_COEFFICIENT; mixingControlAcidVolumeKpGain.ovInitData = 0.0F; @@ -312,13 +316,13 @@ mixingControlTargetAdjBicarbSettings.ovInitData = 0.0F; mixingControlTargetAdjBicarbSettings.override = OVERRIDE_RESET; - mixingControlBicarbControlInterval.data = BICARB_MIX_CONTROL_INTERVAL; - mixingControlBicarbControlInterval.ovData = BICARB_MIX_CONTROL_INTERVAL; + mixingControlBicarbControlInterval.data = BICARB_MIX_CONTROL_INTERVAL_MULTIPLIER; + mixingControlBicarbControlInterval.ovData = BICARB_MIX_CONTROL_INTERVAL_MULTIPLIER; mixingControlBicarbControlInterval.ovInitData = 0; mixingControlBicarbControlInterval.override = OVERRIDE_RESET; - mixingControlAcidControlInterval.data = ACID_MIX_CONTROL_INTERVAL; - mixingControlAcidControlInterval.ovData = ACID_MIX_CONTROL_INTERVAL; + mixingControlAcidControlInterval.data = ACID_MIX_CONTROL_INTERVAL_MULTIPLIER; + mixingControlAcidControlInterval.ovData = ACID_MIX_CONTROL_INTERVAL_MULTIPLIER; mixingControlAcidControlInterval.ovInitData = 0; mixingControlAcidControlInterval.override = OVERRIDE_RESET; @@ -361,6 +365,8 @@ { if ( getCurrentBalancingChamberExecState() > BAL_CHAMBER_STATE_IDLE ) { + updatedConcentrateControlInterval(); + // closed loop bicarb and acid mixing controller handleDialysateCompositionMixing(); } @@ -427,6 +433,36 @@ /*********************************************************************//** * @brief + * The updatedConcentrateControlInterval function sets both acid and bicarb + * Mix volume provided by the controller + * @details \b Inputs: none + * @details \b Outputs: mixingControlBicarbMixVolume + * @param targetValue bicarb Mix volume + * @return TRUE if successful, FALSE if not. + *************************************************************************/ +static void updatedConcentrateControlInterval( void ) +{ + F32 tdDialysateFlowRate = 0.0F; + F32 balChamberSwitchingFreq = 0.0F; + U32 balChamberSwitchingPeriod = 0; + + tdDialysateFlowRate = getTDDialysateFlowrate(); + + balChamberSwitchingFreq = tdDialysateFlowRate / 30.0; + balChamberSwitchingPeriod = ( SEC_PER_MIN ) / (U32)balChamberSwitchingFreq; + + // For acid control period, we are using 3 cycles of balancing chamber switching period (for ex: At Qd = 600, switching period = 3sec, so acid control interval = 3*3 = 9sec + // For bicarb control period, we are using 5 cycles of balancing chamber switching period (for ex: At Qd = 600, switching period = 3sec, so bicarb control interval = 3*5 = 15sec + + if ( balChamberSwitchingPeriod > 0) + { + mixingControlAcidControlInterval.data = ACID_MIX_CONTROL_INTERVAL_MULTIPLIER * balChamberSwitchingPeriod; + mixingControlBicarbControlInterval.data = BICARB_MIX_CONTROL_INTERVAL_MULTIPLIER * balChamberSwitchingPeriod; + } +} + +/*********************************************************************//** + * @brief * The getBicarbDeltaConductivity function gets the delta target conductivity * @details \b Inputs: mixingControlBicarbDeltaConductivity * @details \b Outputs: none @@ -1101,7 +1137,7 @@ *************************************************************************/ BOOL testMixingControlBicarbControlIntervalOverride( MESSAGE_T *message ) { - BOOL result = u32Override( message, &mixingControlBicarbControlInterval, 0, BICARB_MIX_CONTROL_INTERVAL ); + BOOL result = u32Override( message, &mixingControlBicarbControlInterval, 0, BICARB_MIX_CONTROL_INTERVAL_MULTIPLIER ); return result; } @@ -1118,7 +1154,7 @@ *************************************************************************/ BOOL testMixingControlAcidControlIntervalOverride( MESSAGE_T *message ) { - BOOL result = u32Override( message, &mixingControlAcidControlInterval, 0, BICARB_MIX_CONTROL_INTERVAL ); + BOOL result = u32Override( message, &mixingControlAcidControlInterval, 0, ACID_MIX_CONTROL_INTERVAL_MULTIPLIER ); return result; }