Index: firmware/App/Controllers/RinsePump.c =================================================================== diff -u -rfc63fb0998e49133a69660c3eccf63fd0aba9413 -r84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd --- firmware/App/Controllers/RinsePump.c (.../RinsePump.c) (revision fc63fb0998e49133a69660c3eccf63fd0aba9413) +++ firmware/App/Controllers/RinsePump.c (.../RinsePump.c) (revision 84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd) @@ -288,7 +288,7 @@ else { // Set PWM count zero to stop the logical rinse pump - setRinsePumpPwmCount( D79_RINSE_PUMP, RINSE_PUMP_OFF_COUNT ); + setRinsePumpPwm( D79_RINSE_PUMP, RINSE_PUMP_OFF_COUNT ); } return state; Index: firmware/App/Controllers/SubstitutionPump.h =================================================================== diff -u --- firmware/App/Controllers/SubstitutionPump.h (revision 0) +++ firmware/App/Controllers/SubstitutionPump.h (revision 84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd) @@ -0,0 +1,73 @@ +/************************************************************************** +* +* Copyright (c) 2024-2026 Diality Inc. - All Rights Reserved. +* +* THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +* WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +* +* @file SubstitutionPump.h +* +* @author (last) Sameer Kalliadan Poyil +* @date (last) 15-Apr-2026 +* +* @author (original) Vinayakam Mani +* @date (original) 19-Sep-2024 +* +***************************************************************************/ + +#ifndef __SUBSTITUTION_PUMPS_H__ +#define __SUBSTITUTION_PUMPS_H__ + +#include "DDCommon.h" +//#include "NVDataMgmt.h" + +/** + * @defgroup SubstitutionPumps SubstitutionPumps + * @brief Substitution pumps monitor and control unit. Monitors and control Substitution pump with an closed loop approach. + * + * @addtogroup SubstitutionPumps + * @{ + */ + +// ********** public definitions ********** + +#define SUB_PUMP_CONT_VOLUME 0xFFFFFFFF ///< Volume set to 0xFFFFFFFF enables continuous delivery based on the speed set. + +#define PARK_CONC_PUMPS TRUE ///< For park parameter to requestConcentratePumpOff(). +#define NO_PARK_CONC_PUMPS FALSE ///< For park parameter to requestConcentratePumpOff(). + +/// Enumeration of substitution pumps. +typedef enum SubstitutionPumps +{ + D92_PUMP = 0, ///< HDF pump + SUBPUMPS_FIRST = D92_PUMP, ///< First substitution pump in list + NUM_OF_SUB_PUMPS ///< Number of substitution pumps +} SUBSTITUTION_PUMPS_T; + +/// Substitution pump data struct. +typedef struct +{ + F32 d92_PumpTargetSpeed; ///< substitution pump D92_Pump target speed + F32 d92_PumpCurrentSetSpeed; ///< substitution pump D92_Pump current set speed + U32 d92_PumpTargetRevCount; ///< substitution pump D92_Pump target revolution count + U32 d92_PumpState; ///< substitution pump D92_Pump current state +} SUBSTITUTION_PUMP_DATA_T; + +// ********** public function prototypes ********** + +void initSubstitutionPump( void ); +void execSubstitutionPumpMonitor( void ); +void execSubstitutionPumpController( void ); + +void requestSubstitutionPumpOn( SUBSTITUTION_PUMPS_T pumpId ); +void requestSubstitutionPumpOff( SUBSTITUTION_PUMPS_T pumpId ); +F32 getSubstitutionPumpTargetSpeed( SUBSTITUTION_PUMPS_T pumpId ); + +BOOL testSubstitutionPumpDataPublishIntervalOverride( MESSAGE_T *message ); +BOOL testSubstitutionPumpTargetSpeedOverride( MESSAGE_T *message ); + +BOOL testSubstitutionPumpStartStopOverride( MESSAGE_T *message ); // Concentrate pump start/stop request + +/**@}*/ + +#endif Index: firmware/App/Monitors/Conductivity.c =================================================================== diff -u -rfc63fb0998e49133a69660c3eccf63fd0aba9413 -r84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd --- firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision fc63fb0998e49133a69660c3eccf63fd0aba9413) +++ firmware/App/Monitors/Conductivity.c (.../Conductivity.c) (revision 84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd) @@ -84,10 +84,6 @@ static U32 roRRCount; ///< RO rejection ratio Number of samples in average buffer. static F32 roRRTankFillAvg; ///< Average RO rejection ratio during permeate tank fill state. static U32 roRRSampleIntervalCounter; ///< RO rejection ratio sample collection timer counter. -static U32 condtempDataCollectionTimeInterval; ///< Conductivity Temperature data collection time interval in task counts. -static U32 condtempSampleIntervalCounter; ///< Conductivity Temperature sensor sample collection timer counter. -static U32 condDataCollectionTimeInterval; ///< Conductivity data collection time interval in task counts. -static U32 condSampleIntervalCounter; ///< Conductivity sensor sample collection timer counter. // ********** private function prototypes ********** @@ -126,8 +122,6 @@ roRRAvg.ovInitData = 0.0F; roRRAvg.override = OVERRIDE_RESET; roRRSampleIntervalCounter = 0; - condtempDataCollectionTimeInterval= COND_SENSOR_UPDATE_INTERVAL; - condtempSampleIntervalCounter = 0; memset( &roRRSamples, 0, sizeof( roRRSamples ) ); Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -rfc63fb0998e49133a69660c3eccf63fd0aba9413 -r84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision fc63fb0998e49133a69660c3eccf63fd0aba9413) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd) @@ -615,10 +615,12 @@ U08 fpgaConSensD43Control; ///< Reg 118. Conductivity/Temperature Sensors D43 Control registers U16 fpgaConSensD43_Addrs; ///< Reg 119. D43 Initialization Address register U32 fpgaConSensD43_Data_In; ///< Reg 121. D43 Initialization data register - U08 unusedRegister3; ///< Reg 125. Unused register 3 + U08 fpgaD92PumpControl; ///< Reg 125. D92 HDF Pump Control U32 fpgaD11PumpSpeed; ///< Reg 126. Acid Concentrate Pump Speed/RPM Control U32 fpgaD10PumpSpeed; ///< Reg 130. BiCarb Concentrate Pump Speed/RPM Control U32 fpgaD76PumpSpeed; ///< Reg 134. UF Pump Speed/RPM Control + U32 fpgaD92PumpSpeed; ///< Reg 138. HDF Pump Speed/RPM Control + U32 fpgaD92PumpRevCount; ///< Reg 142. HDF pump revolution count } FPGA_ACTUATORS_T; #pragma pack(pop) Index: firmware/App/Services/FpgaDD.h =================================================================== diff -u -rb04db69f541f245e543df343257bcbdb73fbbc3d -r84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd --- firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision b04db69f541f245e543df343257bcbdb73fbbc3d) +++ firmware/App/Services/FpgaDD.h (.../FpgaDD.h) (revision 84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd) @@ -131,19 +131,23 @@ void setFPGAD11PumpSetStepSpeed( U32 stepSpeed ); void setFPGAD10PumpSetStepSpeed( U32 stepSpeed ); void setFPGAD76PumpSetStepSpeed( U32 stepSpeed ); +void setFPGAD92PumpSetStepSpeed( U32 stepSpeed ); void setFPGAD11PumpControl( U08 control ); void setFPGAD10PumpControl( U08 control ); void setFPGAD76PumpControl( U08 control ); +void setFPGAD92PumpControl( U08 control ); void setFPGAD11PumpParkCmd( void ); void setFPGAD10PumpParkCmd( void ); void setFPGAD76PumpParkCmd( void ); void setFPGAD11PumpRevolutionCount( U32 count ); void setFPGAD10PumpRevolutionCount( U32 count ); void setFPGAD76PumpRevolutionCount( U32 count ); +void setFPGAD92PumpRevolutionCount( U32 count ); U08 getFPGAD11PumpControlStatus( void ); U08 getFPGAD10PumpControlStatus( void ); U08 getFPGAD76PumpControlStatus( void ); +U08 getFPGAD92PumpControlStatus( void ); U08 getFPGAUFPumpFault( void ); BOOL getFPGAD76PumpParkFault( void ); BOOL getFPGAD76PumpIsParked( void ); Index: firmware/App/Services/TDInterface.c =================================================================== diff -u -r8f861eb50b8c751db8c9c76a9ae63bb4ab3d1cdc -r84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd --- firmware/App/Services/TDInterface.c (.../TDInterface.c) (revision 8f861eb50b8c751db8c9c76a9ae63bb4ab3d1cdc) +++ firmware/App/Services/TDInterface.c (.../TDInterface.c) (revision 84b30e2da7c4374d06ef068d3cb2b5c0c4fabccd) @@ -27,6 +27,7 @@ #include "OperationModes.h" #include "PersistentAlarm.h" #include "SystemCommDD.h" +#include "SubstitutionPump.h" #include "TaskGeneral.h" #include "TDInterface.h" #include "Timers.h" @@ -542,6 +543,7 @@ setTDAcidAndBicarbType( startTxRequest.acidConvFactor, startTxRequest.bicarbConvFactor, startTxRequest.sodium, startTxRequest.bicarbonate ); setTDDialyzerBypass( startTxRequest.bypassDialyzer ); + setSubstitutionPumpTargetSpeed(startTxRequest.hdfRate); // start dialysate generation result = requestDDGenDialStart();