Airway pressure control system and method for a sleep apnea device
By constructing a unified airway pressure control system, the problem of high complexity in the control system of sleep apnea machines in multiple modes is solved, realizing rapid and smooth switching and stable output in multiple modes, and improving the maintainability of the system and user experience.
Patent Information
- Application Number
- CN202611358016.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2046-09-03
AI Technical Summary
Existing airway pressure control systems for sleep apnea machines suffer from problems such as high software complexity, difficulty in synchronously promoting algorithm upgrades, and insufficient smoothness and speed during multi-mode switching, which affect system maintainability and user experience.
An airway pressure control system for a sleep apnea machine is adopted, including a parameter configuration module, a mode scheduling module, a physiological signal sensing module, a unified pressure regulation module, a switching coordination module, and a safety constraint module. Through a unified control and regulation structure and smooth transition processing, it can achieve rapid and smooth switching between multiple ventilation modes, thereby improving the versatility and stability of the control system.
It achieves stable airway pressure output under multiple ventilation modes, improves the maintainability and user comfort of the control system, reduces system maintenance costs, and achieves consistent control accuracy and stability across different modes.
Smart Images

Figure CN122849589B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fluid pressure control technology, and more particularly to an airway pressure control system and method for a sleep apnea machine. Background Technology
[0002] Sleep apnea machines establish and maintain positive airway pressure to prevent upper airway collapse during sleep, making them an effective treatment for obstructive sleep apnea, severe snoring, and respiratory insufficiency. The airway pressure control system, as the core of the ventilator, directly determines the effectiveness of treatment and patient compliance through its control precision, response speed, and stability. With increasing clinical demand and technological advancements, ventilators have evolved from the initial single-level continuous positive airway pressure (CPAP) mode to a stage where multiple ventilation modes coexist, including spontaneous breathing mode (S mode), time-controlled mode (T mode), spontaneous / time-controlled mode (S / T mode), and average volumetric pressure support mode (AVAPS).
[0003] Existing ventilator airway pressure control technologies, such as the Chinese invention patent with announcement number CN115887841B, disclose a ventilator flow control method and a sleep ventilator based on sleep state. It uses a frog-leapfrog-neural network-PID algorithm for flow control. The frog-leapfrog algorithm optimizes the initial parameters of the PID offline, and the neural network is combined to adjust the PID parameters online, which improves the control performance to a certain extent. However, this solution focuses on tuning and optimizing PID parameters within a single control loop, without addressing the overall control architecture for multiple ventilation modes. Chinese invention patent CN107050600B discloses a pressure control method for a ventilator in CPAP mode. In CPAP mode, the rate of change of flow and pressure is obtained based on flow and pressure curves, respectively. When the rate of change of flow is consistently greater than 0 and the rate of change of pressure is less than 0, the output power of the fan is intermittently increased to quickly adjust the pressure. Chinese invention patent application CN112190800A discloses a pressure control system for a respiratory support device, which integrates a proportional valve at the breathing mask end. Airway pressure is quickly adjusted by regulating the orifice opening of the proportional valve. This solution utilizes the instantaneous opening and closing characteristics of the proportional valve to effectively avoid the delay problem of fan speed regulation and significantly improves pressure following speed. However, it introduces additional electromechanical actuators, increasing system cost and complexity.
[0004] However, the pressure control methods proposed in the aforementioned existing technologies are all tied to specific ventilation modes, while existing sleep apnea machines typically support multiple ventilation modes simultaneously, each with differences in pressure adjustment targets, triggering mechanisms, and safety constraints. The multi-mode, multi-logic architecture leads to high complexity in the control system software, and algorithm upgrades are difficult to implement synchronously across all modes, affecting system maintainability and control performance consistency. Furthermore, the smoothness of multi-mode switching still needs improvement while avoiding additional hardware costs and impacting user experience.
[0005] Therefore, there is an urgent need for a system and method that can uniformly support pressure control of multiple ventilation modes in sleep apnea machines, and achieve rapid and smooth pressure switching between multiple modes, so as to achieve stable pressure output and improve user experience in complex usage scenarios. Summary of the Invention
[0006] To address the technical issues of ventilators lacking a unified support for controlling multiple ventilation modes and the need to improve the speed and smoothness of switching between multiple modes, this invention provides an airway pressure control system and method for sleep apnea machines. This system can uniformly support airway pressure control for multiple ventilation modes and achieve rapid and smooth switching between multiple modes, thereby improving the versatility, stability, and patient comfort of the control system.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: An airway pressure control system for a sleep apnea machine includes interconnected parameter configuration module, mode scheduling module, physiological signal sensing module, unified pressure regulation module, switching coordination module, and safety constraint module.
[0008] The parameter configuration module includes a mode parameter mapping unit and a parameter verification unit, used to receive and manage the mode parameter configurations corresponding to different ventilation modes. The mode parameter configurations include one or more combinations of pressure setpoint, pressure support difference, respiratory rate, inspiratory time, target tidal volume, trigger sensitivity, and pressure rise curve.
[0009] The mode parameter mapping unit establishes a correspondence between ventilation mode types and mode parameter sets; The parameter verification unit verifies the logical relationships and boundary conditions between different parameters.
[0010] The mode scheduling module includes a mode recognition unit, a respiratory phase discrimination unit, and a target trajectory selection unit, which are used to determine the target pressure trajectory type within the current control cycle based on the currently selected ventilation mode and the patient's respiratory status, and to perform unified scheduling among multiple ventilation modes. The pattern recognition unit determines the currently active ventilation mode; The respiratory phase discrimination unit distinguishes between the inspiratory and expiratory phases based on the output of the physiological signal sensing module. The target trajectory selection unit retrieves the corresponding target pressure setting value from the parameter configuration module based on the mode type and respiratory phase.
[0011] As a preferred embodiment of this application, the parameter configuration module writes the parameters into the system shared memory structure, and the target trajectory selection unit reads the target pressure setting value from the shared memory structure (the parameters are written into the shared memory after verification, and the target trajectory selection unit reads from the shared memory).
[0012] The physiological signal sensing module is used to collect signals related to airway pressure, gas flow rate, flow velocity changes, and the patient's respiratory effort, forming real-time feedback information.
[0013] The unified pressure regulation module includes a deviation calculation unit, a regulation operator unit, and a drive output unit. It is used to generate a fan drive command based on the deviation between the target pressure and the real-time feedback information, so that the airway pressure follows the target pressure. The target pressure is the pressure value after the target pressure trajectory has been smoothed by the switching coordination module. The deviation calculation unit calculates the deviation between the target pressure and the actual airway pressure; The adjustment operator unit generates a control quantity based on the deviation. The adjustment operator adopts a unified control structure, while the specific control parameters can be configured differently according to the performance requirements of different ventilation modes, so as to achieve the best control effect of each mode under a unified architecture. The drive output unit converts the control quantity into a drive signal for the fan.
[0014] The switching coordination module includes a mode switching detection unit and a trajectory interpolation unit, which are used to smoothly transition the target pressure trajectory when the ventilation mode changes or the breathing phase changes, so as to avoid pressure jumps. The mode switching detection unit monitors ventilation mode change events and respiratory phase transition events; The trajectory interpolation unit performs continuous interpolation processing on the target pressure trajectory before and after the switching event, so that the output pressure remains continuous and differentiable during the transition between modes.
[0015] The safety constraint module is used to monitor and limit the output pressure, pressure change rate, and system operating status to ensure treatment safety.
[0016] Based on the above system, this application also provides an airway pressure control method for a sleep apnea machine, comprising the following steps: First, obtain the mode parameter configuration corresponding to the currently selected ventilation mode, and establish a mapping relationship between mode type and mode parameter set; Collect airway pressure, gas flow rate, and patient breathing effort signals to generate real-time feedback information; Based on the current ventilation mode and respiratory phase, determine the target pressure trajectory for the current control cycle; The deviation between the target pressure and the actual airway pressure is calculated, and a fan drive control quantity is generated through a unified control and adjustment structure to make the airway pressure follow the target pressure trajectory. This control and adjustment structure adapts to multiple ventilation modes in a mode-independent manner. The target pressure is the pressure value after the target pressure trajectory has been smoothed. The unified control and regulation structure employs a unified deviation calculation and regulation operator generation mechanism for different ventilation modes. This ensures that constant pressure output in CPAP mode, event-driven pressure adjustment in Auto-CPAP mode, autonomously triggered bi-level regulation in S mode, adaptive pressure support in Auto-S mode, time-controlled regulation in T mode, backup ventilation regulation in ST mode, and target tidal volume closed-loop regulation in AVAPS mode are all achieved through the same control and regulation framework. In particular, in AVAPS mode, the framework coordinates slow tidal volume regulation with rapid respiratory phase switching by synchronously updating the target pressure setpoint at the respiratory cycle boundary, thereby maintaining consistent control performance across different ventilation modes.
[0017] When a ventilation mode change event or a breathing phase transition event is detected, a smooth transition process is performed on the target pressure trajectory to keep the output pressure continuous during mode switching and phase transition. The smooth transition process is achieved by interpolating the target pressure trajectory before and after the switch, which limits the rate of pressure change and avoids pressure shocks and human-machine interaction during mode switching.
[0018] It sets safety limits on output pressure and pressure change rate, monitors system operation status, and triggers safety response in abnormal situations.
[0019] The beneficial effects of this invention are as follows: This application solves the problems of high software complexity and difficulty in synchronously promoting algorithm upgrades across multiple modes caused by constructing a mode-independent unified pressure regulation module, enabling multiple ventilation modes to share the same control regulation framework. This application achieves this through the collaborative operation of a unified pressure regulation module and a switching coordination module. The unified pressure regulation module provides a mode-independent control reference, allowing the switching coordination module to perform interpolation at the target pressure level without needing to concern itself with the switching of the underlying control logic. This also ensures that the output pressure remains continuously differentiable during ventilation mode changes and breathing phase transitions, effectively improving the multi-mode switching rate. Conversely, the smooth processing of the switching coordination module ensures that the input commands to the unified pressure regulation module are always continuous, avoiding PID integral saturation caused by command jumps and eliminating human-machine interaction and discomfort caused by pressure steps. All ventilation modes in this application adopt a unified deviation calculation and adjustment operator generation mechanism, which can provide consistent control accuracy and stability in different ventilation modes. This overcomes the defect of inconsistent control performance in different modes in the prior art. The unified control architecture enables algorithm optimization and function upgrades to take effect simultaneously in all ventilation modes, reduces system maintenance costs, and provides a standardized access path for the expansion of new ventilation modes. Attached Figure Description
[0020] Figure 1 This is a diagram of the airway pressure control system architecture of a sleep apnea machine according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating the airway pressure control method for a sleep apnea machine according to an embodiment of the present invention. Figure 3 This is a detailed step diagram of S3 provided in an embodiment of the present invention; Figure 4 This is a detailed step diagram of S4 provided in an embodiment of the present invention; Figure 5 This is a detailed step diagram of S5 provided in an embodiment of the present invention. Detailed Implementation
[0021] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0022] In this embodiment, a sleep apnea machine suitable for hospital and home environments is used as an example to illustrate this application. This ventilator uses a turbine fan as a pressure source and is powered by a 24V DC power adapter. It includes a main unit with a configurable display interface, a heated humidifier, breathing tubing, and a mask, among other accessories. The main unit uses an STM32F4 series microcontroller as its core processor and runs a real-time operating system for multi-task scheduling. The pressure sensor is a differential pressure MEMS sensor (range 0~40hPa, accuracy ±0.3%FS), and the flow sensor is based on the thermal mass flow principle (range 0~180L / min). Together, they achieve synchronous acquisition of airway pressure and flow. It should be understood that the above selection is merely illustrative and does not constitute a limitation on the scope of protection of this invention.
[0023] The modules of this invention can be physically integrated into the same microcontroller on the main control board of the ventilator, and logical decoupling can be achieved through software functional module division; alternatively, they can be distributed across multiple processors to complete the task collaboratively, depending on the product hardware architecture design.
[0024] Figure 1 This diagram illustrates the airway pressure control system architecture of a sleep apnea machine according to an embodiment of the present invention. Please refer to [link / reference]. Figure 1 As shown, the present invention provides an airway pressure control system for a sleep apnea machine, comprising a parameter configuration module, a mode scheduling module, a physiological signal sensing module, a unified pressure regulation module, a switching coordination module, and a safety constraint module that are interconnected.
[0025] The parameter configuration module is responsible for receiving and managing the mode parameter configurations corresponding to different ventilation modes. This module includes a mode parameter mapping unit and a parameter verification unit.
[0026] The mode parameter mapping unit establishes the correspondence between ventilation mode types and mode parameter sets. In this embodiment, the predefined ventilation mode types include seven types: single-level continuous positive pressure ventilation (CPAP), automatic pressure regulation mode (Auto-CPAP), spontaneous breathing mode (S), spontaneous automatic mode (Auto-S), time-controlled mode (T), spontaneous / time-controlled mode (ST), and average volumetric pressure support mode (AVAPS). The mode parameter sets corresponding to each mode are shown in Table 1. Table 1
[0027] The mode parameter mapping unit stores the above mapping relationships at the software level in the form of a look-up table or configuration file. When a clinician selects a ventilation mode through the device interface (such as a knob and display screen), the mapping unit loads the default values in the template into the current mode parameter set according to the parameter configuration template corresponding to the mode type index, and enables the editable state of the corresponding parameters. Taking ST mode as an example, when the mode recognition unit outputs the mode type as ST, the parameter configuration module extracts a complete set of parameters from the mapping table, including inspiratory pressure (default 14.0 hPa), expiratory pressure (default 8.0 hPa), respiratory rate (default 10 bpm), inspiratory time (default 1.0 s), and rise time (default 300 ms), for subsequent modules to call.
[0028] The parameter verification unit verifies the logical relationships and boundary conditions between different parameters to ensure the validity and security of the mode parameter combinations. Verification rules include, but are not limited to, the following types: Boundary verification checks whether each parameter value is within the allowable range. For example, the pressure value must be between 4.0 and 25.0 hPa (depending on the model), the inspiratory time must be between 0.3 and 3.0 seconds, the respiratory rate must be between 3 and 30 bpm, and the target tidal volume must be between 150 and 1500 mL. Parameter configurations that exceed the boundaries will be rejected, and the device interface will provide corresponding prompts.
[0029] Logical relationship verification checks the internal consistency of parameter combinations. For example, in Auto-S mode, the minimum inspiratory pressure must not exceed the maximum inspiratory pressure; in AVAPS mode, the minimum inspiratory pressure must not exceed the maximum inspiratory pressure, and the expiratory pressure should be less than the minimum inspiratory pressure; in CPAP mode, the minimum pressure specific to Auto-CPAP must not exceed the maximum pressure; although inspiratory trigger sensitivity and expiratory trigger sensitivity are set independently, they are used in combination by the mode scheduling module in actual respiratory phase discrimination.
[0030] Safety constraint verification involves checking whether parameter settings meet safety limits. For example, under a single fault condition, the pressure limit in CPAP / Auto-CPAP mode should not exceed 30 hPa, and in other modes, it should not exceed 40 hPa; the inhalation time should not exceed 3 seconds to avoid over-ventilation. Verification rules also include whether performance indicators such as static pressure fluctuation, pressure error, and maximum output flow rate in different modes meet design requirements.
[0031] Only parameter configurations that pass verification can take effect and be sent to the mode scheduling module and the driver output module; if verification fails, the system will refuse to perform parameter updates and prompt the operator to make adjustments.
[0032] The mode scheduling module is responsible for determining the target pressure trajectory type within the current control cycle based on the currently selected ventilation mode and the user's respiratory status, and for unified scheduling among multiple ventilation modes. This module includes a pattern recognition unit, a respiratory phase discrimination unit, and a target trajectory selection unit.
[0033] The pattern recognition unit determines the currently active ventilation mode. During system operation, the pattern recognition unit continuously listens for mode switching commands from the user interface (knob selection and press confirmation) or communication interface (such as clinical mode settings by healthcare personnel). Once a mode change event is detected, the pattern recognition unit updates the current mode status and triggers the parameter configuration module to reload the corresponding parameter set. The mode change event also notifies the switching coordination module to initiate transition processing.
[0034] The respiratory phase discrimination unit distinguishes between the inspiratory and expiratory phases based on the output of the physiological signal sensing module. This unit integrates real-time data from the pressure and flow sensors and performs phase discrimination through the following logic: The system monitors the direction and magnitude of flow in the breathing circuit. Inspiratory phase initiation is determined when the flow sensor detects a forward flow (airflow from the ventilator to the patient) and the flow value exceeds the inspiratory trigger threshold; expiratory phase initiation is determined when the flow reverses (airflow from the patient to the ventilator) or the forward flow decreases below the expiratory trigger threshold. The inspiratory and expiratory trigger thresholds are determined by the inspiratory and expiratory trigger sensitivities in the parameter configuration module, respectively. Sensitivity levels 1-8 correspond to thresholds from high to low (i.e., the higher the level, the smaller the required trigger flow and the higher the sensitivity).
[0035] For weak spontaneous breathing, relying solely on flow rate may be inaccurate. In such cases, the respiratory phase discrimination unit also considers the rate of change of airway pressure (dP / dt): pressure rises rapidly at the start of the inspiratory phase (rise time 100-500ms) and decreases at the start of the expiratory phase. This rate of change pressure discrimination serves as auxiliary logic, providing redundancy when the flow rate signal is unreliable (e.g., significant air leakage).
[0036] To ensure safe operation, the respiratory phase discrimination unit is also constrained by the maximum and minimum inspiratory times. When the respiratory phase is detected and its duration reaches the maximum inspiratory time (e.g., 3.0 s), the system forcibly switches to the expiratory phase regardless of the flow signal to avoid overventilation. When the respiratory phase is detected and its duration exceeds the safety threshold, the backup ventilation mechanism (the backup frequency in ST mode) is triggered. The parameter values for the maximum and minimum inspiratory times are obtained from the mode parameter mapping unit.
[0037] The target trajectory selection unit retrieves the corresponding target pressure setpoint from the parameter configuration module based on the mode type and respiratory phase, and generates the original target pressure P.target .
[0038] In this embodiment, the physiological signal sensing module includes a pressure sensor and a flow sensor, used to collect signals related to airway pressure, gas flow rate, flow velocity changes, and the patient's breathing effort, forming real-time feedback information.
[0039] The pressure sensor is installed near the air outlet of the ventilator and is connected to the patient interface through the airway. The sampling frequency is set to 200Hz.
[0040] The flow sensor, based on the differential pressure principle or the thermal mass flow principle, is installed in the main air path between the fan outlet and the main air inlet, and also collects data at a sampling rate of 200Hz. The analog-to-digital converter (ADC) in the main control chip converts the analog voltage signal output by the sensor into a digital signal. After digital filtering (such as moving average filtering with a window length of 10 points), a stable pressure value P is formed. real With flow value Q real .
[0041] The respiratory effort-related signals are indirectly obtained through morphological analysis of the flow rate curve. When the patient has spontaneous respiratory effort, the flow rate curve shows periodic fluctuations synchronized with the respiratory phase. When spontaneous breathing is weak or stops, the flow rate curve tends to flatten, at which point the backup ventilation mechanism of T mode or ST mode is triggered.
[0042] The physiological signal sensing module pushes real-time feedback data to the unified pressure regulation module and the mode scheduling module at a period of 50ms (synchronized with the control cycle).
[0043] The unified pressure regulation module includes a deviation calculation unit, a regulation operator unit, and a drive output unit.
[0044] The deviation calculation unit calculates the deviation between the target pressure and the actual airway pressure. In each control cycle (e.g., 50ms), the deviation calculation unit obtains the target pressure P from the switching coordination module. cmd (Equal to the original target pressure P during no switching transition) target The current actual pressure P is obtained from the physiological signal sensing module. real And calculate the deviation between the two.
[0045] The regulating operator unit generates control quantities based on the deviation. In this embodiment, the regulating operator adopts a unified incremental PID control structure, and the specific control parameters can be configured differently according to the performance requirements of different ventilation modes, thereby achieving the best control effect for each mode under a unified architecture. Its discretized recursive formula is: First, define the pressure deviation for the current control cycle. for: (1) Where k is the current control cycle number, To meet the pressure of achieving the target, This is to provide actual feedback on pressure.
[0046] Then define the increment of the deviation. (That is, the change in deviation between the current beat and the previous beat) is: (2) Then calculate the control increment of the PID control section. for: (3) Among them, T s To control the period (set to 50 ms in this embodiment), K p K i K d Control parameters related to the ventilation mode are stored in the mode parameter mapping table.
[0047] Simultaneously, calculate the feedforward compensation amount based on the rate of change of the target pressure. and its increment : (4) (5) Where C is the feedforward gain coefficient (also configured according to mode differences).
[0048] The increment of the total control quantity for: (6) The final actual output to the wind turbine drive control quantity Cumulative updates are as follows: (7) The reason this embodiment uses an incremental PID control structure instead of a positional PID is that the output of a positional PID directly corresponds to the absolute value of the fan drive quantity. When the output is forcibly clamped due to mode switching, manual intervention, or system constraints, the integral term is prone to saturation, leading to significant overshoot or response hysteresis (integral failure) after the system recovers from the abnormal state. In contrast, the incremental PID only calculates the increment Δu(k) of the control quantity, and the output is derived from the sum of historical values. When the output is constrained, the growth of the integral term is also limited, naturally possessing anti-integral saturation characteristics, ensuring a smooth and shock-free pressure output after mode switching or abnormal recovery.
[0049] The feedforward compensation term u ff(k) The physical significance lies in providing predictive control based on the rate of change of the target trajectory. Due to the air capacity and air resistance characteristics of the ventilator tubing and airway, pressure build-up exhibits inertial lag. Simply relying on PID control based on deviation feedback inevitably results in dynamic lag. ff (k) By monitoring the changing trend of the target pressure, the fan drive is actively increased in the early stage of pressure rise to compensate for the lag effect of pipeline inertia, thereby significantly improving the pressure following speed without changing the system stability.
[0050] The control parameter K p K i K d The feedforward gain coefficient C is configured differently under different ventilation modes, and the underlying control logic is as follows: For CPAP mode, the treatment goal is to maintain constant pressure, emphasizing steady-state precision control. Therefore, the proportionality coefficient K... p A lower value (e.g., 0.2) is used to suppress pressure fluctuations caused by changes in the patient's respiratory flow; the integral coefficient K i A higher value (e.g., 0.2) is chosen to quickly eliminate steady-state errors caused by pipeline resistance; the differential coefficient K d The value is set to a low value (e.g., 0.01) to filter out pressure fluctuations caused by sensor noise; the feedforward coefficient C is set to zero because the target pressure is constant and there is no need to predict changes.
[0051] For S and ST modes, frequent switching between the inspiratory and expiratory phases is required, emphasizing dynamic response performance. Therefore, the proportionality coefficient K... p A higher value (e.g., 0.5) is chosen to enhance the response speed during inhalation triggering; the integral coefficient K i The value should be relatively low (e.g., 0.1) to avoid integral saturation and overshoot during rapid voltage boost; the differential coefficient K d A moderate value (e.g., 0.02) is chosen to dampen the high-frequency oscillations caused by high gain; a high value (e.g., 0.8) is chosen for the feedforward coefficient C to compensate for gas path lag and achieve a steep pressure rise edge.
[0052] For AVAPS mode, the inspiratory pressure needs to be adjusted slowly based on tidal volume feedback, emphasizing smooth adjustment and stability. Therefore, the proportionality coefficient K... p With integral coefficient K i All values are taken as low to medium (e.g., K). p =0.3, K i =0.05), to avoid excessive pressure adjustment step size interfering with tidal volume monitoring; differential coefficient K d A lower value (e.g., 0.01) ensures smooth slope adjustment; a moderate value (e.g., 0.3) for the feedforward coefficient C assists in slow pressure target slope tracking.
[0053] For T mode and Auto mode: a compromise strategy is adopted for parameter configuration. Scale factor K p A mode between S and CPAP (e.g., 0.4) balances steady-state maintenance of mechanical ventilation with dynamic follow-up of triggering; integral coefficient K i With differential coefficient K d Center setting (e.g., K) i =0.15, K d =0.015), to balance accuracy and stability; the feedforward coefficient C is set to a medium-high value (e.g., 0.6) to adapt to mixed scenarios of spontaneous breathing and mechanical ventilation. Each mode parameter group is stored in a mode parameter mapping table, which is automatically loaded when switching modes, thereby achieving the best control effect of each mode under a unified architecture.
[0054] The drive output unit converts the control quantity into a drive signal for the fan. In this embodiment, the fan is driven by a brushless DC motor. The drive output unit maps the control quantity u(k) to a PWM duty cycle (0~100%), and adjusts the fan speed through the motor drive circuit. The PWM drive signal is output at a carrier frequency of 20kHz, and after being amplified by the motor drive chip, it drives the fan to operate.
[0055] The drive output unit also includes motor current monitoring and overheat protection functions. When the motor current exceeds the safety threshold or the drive chip temperature exceeds the set value, the drive output unit automatically limits the current and reports to the safety constraint module.
[0056] The switching coordination module includes a mode switching detection unit and a trajectory interpolation unit, which are used to smoothly transition the target pressure trajectory when the ventilation mode changes or the breathing phase changes, so as to avoid pressure jumps.
[0057] The mode switching detection unit monitors ventilation mode change events and respiratory phase transition events. Mode change events can originate from user manual mode switching via the device interface, automatic pressure regulation triggering changes within the Auto-CPAP / Auto-S mode, and switching from spontaneous breathing to backup ventilation in ST mode. Respiratory phase transition events are triggered by a change in phase state output by the respiratory phase discrimination unit each cycle.
[0058] Before and after a switching event, the trajectory interpolation unit performs continuous interpolation on the target pressure trajectory, so that the output pressure remains continuous and smooth during mode transitions and phase shifts.
[0059] Specifically, when performing smooth transition processing, the trajectory interpolation unit uses different mathematical models and processing logics depending on the event type: When the mode switching detection unit detects a ventilation mode change event, the trajectory interpolation unit generates a transition trajectory using a clamped cubic spline interpolation method. The nodes are selected with the switching start time t0 and the ending time t1, forming a single interpolation interval [t0, t1]. This interpolation method forces the first derivative (pressure change rate) at the boundary to be zero to satisfy the boundary condition for a smooth pressure transition. The pressure before switching is P0, the pressure after switching is P1, and the transition time window is T. trans (i.e., t1-t0), then the generated transition trajectory equation is:
[0060] Where t represents the current time. This equation ensures that the pressure values at the start and end points of the trajectory are continuous and the slope is zero, achieving a smooth and shock-free transition during mode switching.
[0061] Within the transition time window, the unified pressure regulation module executes the target pressure. After the transition is complete, the target pressure seamlessly switches to the original target pressure P of the new mode. cmd =P target .
[0062] When the respiratory phase discrimination unit detects the start of the inspiratory phase or the start of the expiratory phase (e.g., when S mode switches from EPAP to IPAP), the trajectory interpolation unit uses an S-curve interpolation method to smooth the phase transition. The S-curve interpolation employs a four-segment planning model based on a trapezoidal acceleration profile. Let the rate of change of pressure be velocity v(t), the rate of change of pressure be acceleration a(t), and the rate of change of acceleration be jerk J(t). Specifically, the four-segment planning refers to the jerk J(t) profile being divided into four stages: Phase 1 (0~t1): Acceleration phase, J(t) = J max The acceleration a(t) increases linearly; Second stage (t1~t2): deceleration and acceleration phase, J(t) = -J max The acceleration a(t) decreases linearly to zero; The third stage (t2~t3): the reverse acceleration / deceleration phase, J(t) = -J max The acceleration a(t) decreases linearly (i.e. increases in the opposite direction); Fourth stage (t3~t4): Reverse deceleration phase, J(t)=J max The acceleration a(t) linearly recovers to zero.
[0063] The above acceleration profile is integrated to obtain the velocity profile, and then integrated again to obtain the position (pressure) profile, thereby ensuring that the pressure P(t), the rate of change of pressure v(t), and the rate of change of pressure a(t) are all continuously differentiable, thus minimizing the sense of human-machine interaction during phase switching.
[0064] When mode switching and phase transition occur simultaneously, the trajectory interpolation unit is equipped with a priority arbitration mechanism. When a mode switching event and a respiratory phase transition event are detected to overlap in time or trigger simultaneously, the system determines that the respiratory phase transition event has a higher priority. At this time, the trajectory interpolation unit immediately terminates the current mode switching transition process, uses the actual output pressure value at the current moment as the new starting point, recalculates the target pressure based on the new mode type after the switch and the current respiratory phase, and initiates S-curve interpolation for phase transition. This logic ensures that spontaneous breathing events triggered by the patient during mode switching can be responded to with priority, avoiding human-machine asynchrony caused by rigid mode transition logic.
[0065] The above interpolation process is uniformly executed by the trajectory interpolation unit and is independent of the current ventilation mode type (CPAP, Auto-CPAP, S, Auto-S, T, ST, AVAPS). That is, regardless of the mode switching or phase switching, the same interpolation engine is called to complete the smooth transition.
[0066] Simultaneously, the safety constraint module implements pressure change rate limiting protection for the interpolation curve of the trajectory interpolation unit. Let the safety threshold for the pressure change rate be R. max (In this embodiment, the value is set to 5 hPa / s). Before generating the interpolation curve, the trajectory interpolation unit performs an adaptive correction mechanism for the time parameter.
[0067] Specifically, the preset transition time T trans or rise time T rise The expected configuration value for clinicians represents the expected indicator of system response speed; while the pressure change rate safety threshold R... max This constitutes the system's hard safety boundary. When a conflict arises between the two, the system adaptively adjusts according to the principles of safety priority and smooth execution. The system first determines the pressure difference (i.e., |P1-P0|) and the safety threshold R. max Calculate the theoretical minimum safe transition time T safe The calculation formula is:
[0068] Subsequently, the system will use the user-preset time T set Compared with the theoretical minimum safe time T safe Comparison: If T set ≥Tsafe This indicates that the preset time meets the safety limit, and the trajectory interpolation unit directly follows the preset time T. set Generate interpolation curves and calculate the derivatives at each point on the curve in real time, ensuring that their absolute values do not exceed R. max ; If T set <T safe This indicates that a preset time that is too short will cause the pressure change rate to exceed the limit, and the safety constraint module automatically extends the actual execution time to T. safe A balance is struck between smoothness and security.
[0069] The aforementioned automatic extension operation is essentially a parameter optimization and correction based on safety limits, not a device malfunction. Therefore, the system performs this adjustment directly at the execution level without triggering audible and visual alarms or interface pop-up prompts to avoid unnecessary interference during treatment. However, for each automatic time parameter correction event triggered due to safety constraints, the system records it in the operation log for subsequent maintenance or quality control analysis and traceability.
[0070] The safety constraint module monitors and limits the output pressure, pressure change rate, and system operating status to ensure treatment safety.
[0071] Specifically, the safety constraint module monitors the actual output pressure P in real time. real Ensure that it does not exceed the preset safety limit (under normal conditions, CPAP / Auto-CPAP mode ≤20hPa, other modes ≤25hPa; under single fault conditions, CPAP / Auto-CPAP mode ≤30hPa, other modes ≤40hPa). When P real When the safety limit is exceeded, the safety constraint module forcibly reduces the drive output until the pressure drops back to the safe range.
[0072] The safety constraint module continuously monitors the rate of change between the target pressure trajectory and the actual output pressure to ensure that its absolute value does not exceed the preset safety threshold R. max (In this embodiment, the limit is set to 5 hPa / s). This limiting protection is implemented in two ways in a coordinated manner: Firstly, at the target planning level, when the trajectory interpolation unit of the switching coordination module generates transition trajectories for mode switching or phase switching, the safety constraint module provides R to the trajectory interpolation unit. max As a boundary constraint, the trajectory interpolation unit calculates the derivative of the interpolation curve in real time during the interpolation process. If its absolute value exceeds R max If the transition time or rise time is not met, the interpolation trajectory will be automatically extended until the maximum pressure change rate meets the limit requirement, at which point the interpolation trajectory will be submitted to the unified pressure regulation module for execution. This method ensures the smoothness of the target trajectory itself from the source.
[0073] Secondly, at the execution feedback level, when the rate of change of the actual output pressure exceeds R due to external disturbances (such as a sudden change in mask leakage caused by a patient's cough or change in body position), max At that time, the safety constraint module directly limits the fan drive increment output by the unified pressure regulation module, that is, if (where α is the conversion factor from driving increment to pressure change rate), then Δu(k) will be proportionally reduced to within the limit value to prevent sudden pressure changes from causing discomfort or harm to the patient.
[0074] The two limiting mechanisms work together, with the former taking the initiative to prevent (ensuring that instructions do not exceed limits) and the latter providing a passive safety net (suppressing unexpected disturbances), together ensuring that the rate of change of airway pressure is always within a safe range.
[0075] With the above configuration, the system executes according to strict timing logic. That is, the raw control quantity generated by the unified pressure regulation module must be verified by the safety constraint module in real time for safety limiting before it can be converted into the final PWM drive signal output to the fan. This logical sequence enforces the safety priority principle in the software flow, ensuring that the physical output is always controlled within the safety boundary under any control strategy.
[0076] The safety constraint module also includes continuous monitoring of the system's operating status, including abnormal conditions such as pressure sensor failure, flow sensor failure, motor overcurrent, and temperature exceeding limits. Once an abnormality is detected, the safety constraint module triggers a safety response.
[0077] The safety constraint module also includes continuous monitoring of system leakage. When the leakage exceeds the threshold (≥75 L / min at 4 hPa, ≥105 L / min at 20 hPa) and persists for more than 40 seconds, a leakage alarm is triggered. For leakage within the compensable range (set working pressure ≤20 hPa, leakage ≤70 L / min), the safety constraint module notifies the unified pressure regulation module to perform pressure compensation, maintaining output pressure accuracy ≤±1 hPa.
[0078] All modules of this system execute sequentially according to the following strict timing sequence within one control cycle (Ts=50ms). Data is transferred between modules through shared memory variables and event flags. The execution timing sequence of each module within one control cycle is shown in Table 2: Table 2
[0079] The meaning of each time slot in the above timing table is as follows: T0~T1 (0~2ms): Parameter configuration module execution. The parameter configuration module performs parameter verification during system initialization or upon receiving a user parameter modification command. After successful verification, the parameter configuration module writes the updated parameter set to the param_config structure in shared memory and sets the event flag param_update_flag. The mode scheduling module, switching coordination module, and unified pressure regulation module query param_update_flag at the beginning of each control cycle. If the flag is detected as set, they read the latest parameters from param_config and clear the flag.
[0080] T1~T2 (2~5ms): The physiological signal sensing module executes. It initiates ADC conversion, reads the analog voltage values from the pressure and flow sensors, and then digitally filters the resulting pressure value P. real With flow value Q real The data is written to a sensor_data structure in shared memory. The mode scheduling module and the unified pressure regulation module read data directly from sensor_data in each control cycle, without the need for additional message passing overhead.
[0081] T2~T3 (5~15ms): The pattern scheduling module executes. The pattern scheduling module sequentially performs pattern recognition, respiratory phase determination, and target trajectory selection to generate the original target pressure P. target The event is then written to the target_pressure variable in shared memory. If the pattern recognition unit detects a pattern change event, or the breathing phase discrimination unit detects a phase transition event, the event flag transition_event_flag is set, and the switching type and context information are written to the transition_context structure for the switching coordination module to query in the next time slot.
[0082] T3~T4 (15~25ms): Switching coordination module execution. The switching coordination module queries transition_event_flag. If the flag is set, the trajectory interpolation unit reads the switching type in transition_context and the P value in target_pressure. target Using the pre-switching pressure P0 as the interpolation endpoint, interpolation calculations are performed to generate the transition pressure P for the current control cycle. trans (t) and write it to the cmd_pressure variable in shared memory; if the flag is not set (no switching event), the switching coordination module will set the P in target_pressure. target Copy directly to cmd_pressure. The unified pressure regulation module reads the target pressure P from the cmd_pressure variable in each control cycle.cmd It adopts a per-cycle read rather than an event-driven approach to ensure that the latest interpolation results can be obtained in each control cycle within the transition window.
[0083] T4~T5 (25~40ms): The unified pressure regulation module executes. The unified pressure regulation module reads the target pressure P from the cmd_pressure variable. cmd Read the actual pressure P from the sensor_data structure real The deviation calculation, incremental PID adjustment and feedforward compensation are executed sequentially to generate the total drive control increment Δu(k) and the cumulative control quantity u(k), which are then written to the drive_cmd variable in shared memory.
[0084] T5~T6 (40~50ms): Execution of the safety constraint module and drive output. The safety constraint module reads Δu(k) from drive_cmd, calculates the corresponding pressure change rate according to the conversion factor α, and if it exceeds the safety threshold R... max Then, Δu(k) is proportionally reduced and drive_cmd is updated. Simultaneously, the safety constraint module continuously monitors whether the actual pressure in sensor_data exceeds the safety limit. Finally, the drive output unit reads the safety-limited drive_cmd, maps it to a PWM duty cycle, and outputs it to the fan.
[0085] In the above timing sequence, the two-layer limiting mechanism of the safety constraint module is executed serially within the same control cycle, and there is no parallel relationship. The first layer (active prevention) is completed during the trajectory interpolation execution of the coordination module in the T3~T4 phase: the safety constraint module provides R to the trajectory interpolation unit. max As a boundary constraint, the trajectory interpolation unit calculates the derivative of the interpolation curve in real time during the interpolation process. If its absolute value exceeds R... max The transition time or rise time will be automatically extended until the maximum pressure change rate meets the limit requirement before the interpolated trajectory is written to cmd_pressure. This layer completes the constraint during the target trajectory planning stage and is executed before the unified pressure regulation module. The second layer (passive fallback) is executed after the unified pressure regulation module outputs Δu(k) in stages T5~T6: the safety constraint module reads Δu(k) from drive_cmd, calculates the corresponding pressure change rate according to the conversion factor α, and if the actual pressure change rate exceeds R due to external disturbances... max Then, Δu(k) will be proportionally reduced to within the limit value—this layer is executed serially after the control quantity is generated. The two layers of limiting are completed serially in the same control cycle in the order of planning first and then execution. The former ensures that the target trajectory itself does not exceed the limit, while the latter provides a fallback limit for the actual pressure change rate exceeding the limit due to external disturbances.
[0086] Based on the above system configuration, the present invention also provides an airway pressure control method for a sleep apnea machine. Figure 2 The diagram illustrates the steps of an airway pressure control method for a sleep apnea machine according to an embodiment of the present invention. Please refer to [link / reference]. Figure 2 The specific steps are as follows: S1. First, obtain the mode parameter configuration corresponding to the currently selected ventilation mode, and establish a mapping relationship between mode type and mode parameter set.
[0087] During system power-on initialization, the mode type and parameter configuration saved at the time of the last power-off are read from non-volatile memory (EEPROM or Flash) and used as the current operating parameters. If it is the first time using the system or the parameters are restored to default, the factory default configuration is loaded (e.g., mode is CPAP, pressure is 8.0 hPa).
[0088] When a user modifies the ventilation mode or parameters via the display screen, the parameter configuration module specifically performs the following steps: S11, receive mode selection command (such as switching from CPAP to S mode). S12, the mode parameter mapping unit extracts the corresponding parameter template (IPAP=14.0hPa, EPAP=8.0hPa, rise time=300ms, etc.) from the mapping table according to the target mode type (S mode). S13, The parameter verification unit performs boundary verification and logical relationship verification on the template parameters; S14, after the verification passes, the parameter set is written to the current working parameter area (i.e., the param_config structure in shared memory), and the event flag param_update_flag is set; after the mode scheduling module and the switching coordination module detect the flag being set in the next control cycle T2~T3 and T3~T4 time slots, they respectively read the latest parameters and execute the mode switching process and transition processing process; if the verification fails, the switching is rejected and an error message is sent to the display interface.
[0089] S2, real-time acquisition of airway pressure, gas flow rate, and patient respiratory effort signals to generate real-time feedback information. The physiological signal sensing module executes the following sub-steps in each control cycle: S21, start ADC conversion and read the analog voltage values of the pressure sensor and flow sensor; S22 converts the ADC value into physical quantities (units are hPa and L / min respectively), and the conversion coefficients are stored in the device parameter area after factory calibration; S23, perform digital filtering (moving average or first-order low-pass filter, cutoff frequency 20Hz) to remove high-frequency noise; S24, the filtered pressure value P real With flow value Qreal Stored in the real-time data buffer (i.e., the sensor_data structure in shared memory) for the mode scheduling module and the unified pressure regulation module to read; S3, based on the current ventilation mode and respiratory phase, determine the initial target pressure P for the current control cycle. target .
[0090] It should be noted that if there is a mode switching or phase switching transition event, the original target pressure will be transmitted to the switching coordination module for interpolation and smoothing before execution; if there is no switching event, it will be directly output to the unified pressure regulation module. Figure 3 A detailed step diagram of S3 provided in an embodiment of the present invention is shown below. Please refer to [link / reference]. Figure 3 As shown, the specific steps are as follows: S31, the mode recognition unit reads the currently active ventilation mode type. After system startup, the mode and parameter configuration saved at the last shutdown are loaded by default; if a user-initiated mode switching command is detected, the switching event is processed first and the current mode status is updated, while the event flag transition_event_flag is set. After the switching coordination module finds that the flag is set in the T3~T4 time slot, it notifies the switching coordination module to start the mode switching transition process.
[0091] S32, the respiratory phase discrimination unit comprehensively judges the current respiratory phase based on the flow and pressure data provided by the physiological signal sensing module.
[0092] Specifically, flow rate is the primary criterion, and the flow rate of the breathing circuit is monitored in real time. When the flow rate increases from the expiratory phase baseline (close to 0 or negative, indicating that the patient is exhaling) and exceeds the inspiratory trigger threshold, it is determined as the start of the inspiratory phase; when the flow rate decreases from the high value of the inspiratory phase and falls below the expiratory trigger threshold, it is determined as the start of the expiratory phase.
[0093] The inspiratory trigger threshold and expiratory trigger threshold are determined by the inspiratory trigger sensitivity and expiratory trigger sensitivity in the parameter configuration module. In this embodiment, the sensitivity levels are set from 1 to 8. The higher the inspiratory sensitivity level, the smaller the inspiratory trigger threshold, meaning the patient only needs a small inspiratory effort to trigger the switch. The higher the expiratory sensitivity level, the larger the expiratory trigger threshold, meaning a more significant decrease in flow rate is required to trigger the switch. For example, the typical inspiratory trigger threshold corresponding to sensitivity level 5 is approximately 15 L / min, and the expiratory trigger threshold is 8 L / min. The thresholds between adjacent levels exhibit a non-linear distribution to achieve finer sensitivity adjustment.
[0094] For ventilator users who often experience unclear flow signals, the rate of pressure change is used as an auxiliary diagnostic criterion. At the beginning of the inspiratory phase, the airway pressure rises rapidly due to the increased fan speed (the pressure rise rate can reach 20~40 hPa / s during the rise time); at the beginning of the expiratory phase, the pressure decreases.
[0095] Respiratory phase determination is constrained by both the maximum and minimum inspiratory time. Taking S or ST mode as an example, when the respiratory phase is determined and its duration has reached the maximum inspiratory time setting (e.g., 3.0s), the system forcibly switches to the expiratory phase regardless of the flow signal to avoid overventilation. When in ST mode and the expiratory phase duration is detected to exceed the safety window (i.e., the spontaneous breathing rate is lower than the preset value, such as no spontaneous breathing triggered within 6 seconds), the backup ventilation mechanism is triggered, forcibly entering the inspiratory phase.
[0096] S33, the target trajectory selection unit determines the original target pressure P for the current control cycle based on the aforementioned mode type and respiratory phase. target P target This refers to a specific pressure value (unit: hPa), the method for determining which varies depending on the mode. It is calculated based on the current mode, current respiratory phase, and current parameter configuration, through explicit rules or algorithms. The P values for each mode... target The determination logic is as follows: In CPAP mode, if the delayed boost function is disabled, then P target Set value P set (For example, P in this embodiment) target =P set =8.0 hPa), does not change with respiratory phase. If the delayed boost function is enabled and the current period is in the boost phase, then the P value of the current control cycle is... target The pressure increase curve (from the initial pressure to the set value, either linearly or S-shaped) increases over time. In this embodiment, linear pressure increase is used, and the calculation formula is as follows:
[0097] in, This is the starting pressure (default 4.0 hPa). The set boost time (e.g., 10 min). This represents the time elapsed from the start of the boost cycle to the current control cycle. Afterwards, P target =P set The boost time can be set (adjustable from 5 to 60 minutes in 5-minute increments, or set to Auto mode where the system automatically controls the boost time based on the user's sleep state).
[0098] In Auto-CPAP mode, P target At minimum therapeutic pressure Pmin With maximum therapeutic pressure P max A constant value that is dynamically adjusted within a certain range. Its dynamic adjustment logic is as follows: The system analyzes the flow signal based on respiratory cycles (every 5 respiratory cycles) to determine if there are events such as airflow restriction, snoring, hypopnea, or apnea.
[0099] If the above event is detected, then P target Increase the value by one step ΔP from the current value. up (Typically 0.5~1.0 hPa), but not exceeding P max ; If no event is detected for several consecutive respiratory cycles, then P target Gradually decrease by one step size ΔP down (Usually 0.5 hPa), but not lower than P min ; P in the current control cycle target Take the latest adjusted value. This value remains unchanged after each adjustment until a new adjustment is triggered in the next evaluation cycle. The voltage regulation sensitivity level (1~5) affects ΔP. up and ΔP down The size and adjustment frequency of the gear are adjusted; the higher the gear, the larger the single adjustment step and the faster the response.
[0100] In this embodiment, P min Default 8.0 hPa, P max The default pressure is 12.0 hPa, and the adjustable range is 4.0~20.0 hPa (depending on the equipment model).
[0101] In the following S, Auto-S, T, ST, and AVAPS modes, the target pressure in the inhalation phase is denoted as P. IPAP The target pressure during the expiratory phase is denoted as P. EPAP P target The specific value depends on the current breathing phase.
[0102] In S mode, if the current phase is the inhalation phase, then P target =P IPAP If the current phase is the expiratory phase, then P target =P EPAP In this embodiment, P IPAP =14.0 hPa, P EPAP =8.0 hPa.
[0103] In Auto-S mode, if the current phase is the intake phase, then P target =P IPAP But P IPAPIt dynamically adjusts within the range of minimum and maximum inspiratory pressure. The adjustment logic is similar to Auto-CPAP, except that the pressure adjustment target is IPAP, and EPAP is adjusted synchronously to maintain the pressure support difference PS=P. IPAP -P EPAP Relatively constant (usually PS preset to 4~6 hPa).
[0104] If the current phase is the expiratory phase, then P target =P EPAP At this time P EPAP =P IPAP -PS.
[0105] P IPAP Adjustments are made in units of respiratory cycles, based on recent increases or decreases in respiratory event frequency, with the same step size as Auto-CPAP. The pressure sensitivity setting controls the adjustment step size and frequency. The P value of the current control cycle... target Take the latest adjusted value.
[0106] In this embodiment, P IPAP The highest value can reach 25.0 hPa, P IPAP The minimum value is 10.0 hPa by default, P EPAP Default is 5.0 hPa.
[0107] In T mode, it is controlled by a timer. Let the respiratory rate be RR (breaths / minute) and the inspiratory time be T. I (Second), The system uses a timer to determine whether the current phase is in the inspiratory or expiratory phase.
[0108] If you are currently in the inspiratory phase (i.e., time has elapsed since the last switch), <T I ), then P target =P IPAP ; If the current phase is expiratory (i.e., time ≥ T since the last switch), I and <T I +T E T E =60 / RR-T I ), then P target =P EPAP ; The phase automatically switches after the timer reaches zero, P target Then switch.
[0109] In ST mode, a backup ventilation function is added on top of S mode.
[0110] If the patient's spontaneous breathing rate is greater than or equal to the preset respiratory rate RR set (e.g., 10 bpm), and not in backup ventilation mode, then Ptarget The value is the same as in mode S; If a spontaneous breathing rate lower than RR is detected set If there is no spontaneous breathing for more than a safe time (e.g., 6 seconds), the system will automatically enter backup ventilation mode. At this time, P target Value switching logic to T mode (forced switching), inspiratory phase duration T I Get P in seconds IPAP Expiratory phase T E =60 / RR set -T I Get P in seconds EPAP It is unaffected by breathing.
[0111] When spontaneous breathing resumes and the frequency reaches RR set The system exits backup ventilation mode and reverts to S mode logic. target The switching is also subject to smooth transition constraints.
[0112] In AVAPS mode, based on ST mode, a P based on tidal volume is added. IPAP Closed-loop regulation function. The tidal volume regulation loop is independent of the respiratory phase switching, and updates P once at the end of each respiratory cycle. IPAP The target value.
[0113] If the actual tidal volume is less than the target tidal volume, then P IPAP Increase ΔP in the next respiratory cycle AVAPS (The step size is usually 0.5 hPa, but does not exceed the maximum inspiratory pressure). If the actual tidal volume is greater than the target tidal volume, then P IPAP Decrease ΔP in the next respiratory cycle AVAPS (But not lower than the minimum inhalation pressure); If the actual tidal volume deviates from the target value within the allowable range (e.g., ±10 mL), then P IPAP It remains unchanged.
[0114] P in each control cycle target The value still depends on the current phase: Inspiratory phase P target =P IPAP (Latest adjusted value), expiratory phase P target =P EPAP (P) EPAP (This is a fixed value).
[0115] In this mode, to address the coordination issue between respiratory phase switching (fast timescale) and tidal volume closed-loop regulation (slow timescale), a mechanism of cycle boundary updates and unified command layer execution is adopted. Specifically, the slow timescale tidal volume closed-loop regulation algorithm only updates the P parameter in the parameter configuration module at the respiratory cycle boundary (such as the end of the expiratory phase).IPAP The set value is used to avoid modifying the target pressure midway through the inspiratory phase, which could disrupt ventilation stability. Fast-timescale respiratory phase switching, on the other hand, reads the latest P value at the beginning of the inspiratory phase. IPAP Setting values, through switching coordination modules, generates a smooth transition from EPAP to the new P. IPAP The trajectory. When the unified pressure regulation module executes this trajectory, its feedforward and PID control loops naturally respond by including the phase switching amplitude (the difference between IPAP and EPAP) and P. IPAP The target change is superimposed on the baseline increment, thereby achieving coordinated control of dual-timescale pressure targets through a unified framework without splitting the control loop.
[0116] P IPAP The adjustments are delayed to ensure stability: after each adjustment, the patient should remain stable for at least 3 respiratory cycles before the next assessment.
[0117] In any mode, P target Each value represents a specific pressure value (in hPa), which is uniquely determined within the current control cycle by the aforementioned rules. If multiple conditions exist (such as backup ventilation being triggered in ST mode), the corresponding value is selected according to priority (backup ventilation takes precedence over spontaneous breathing).
[0118] S34, outputting the original target pressure P target The following condition will be performed beforehand: If the switching coordination module is currently in a mode switching transition state (i.e., the mode switching detection unit has marked an incomplete mode change event), then P target Instead of being output directly, it is transmitted as the interpolation endpoint to the trajectory interpolation unit, which generates a smooth transition trajectory and incorporates the transition pressure P. trans (t) Write the cmd_pressure variable to the shared memory; the unified pressure regulation module reads the current cycle's pressure from the cmd_pressure variable during each control cycle T4~T5 time slot. trans The value of (t) is used as the execution target pressure P. cmd It adopts a per-cycle read rather than an event-driven approach to ensure that the latest interpolation results can be obtained in each control cycle within the transition window.
[0119] As the pressure of the execution target P cmd And output to the unified pressure regulation module; If a respiratory phase transition is currently occurring (e.g., the breath has just transitioned from expiration to inspiration), then P target Similarly, the data is transmitted to the trajectory interpolation unit at rise time T. rise Internal generation from current pressure to P target The S-shaped interpolation trajectory, and with P trans(t) represents the execution target pressure P cmd And output to the unified pressure regulation module; If there is neither mode switching nor phase conversion, the switching coordination module will change the Pt value in target_pressure. arget Copy directly to the cmd_pressure variable; the unified pressure regulation module reads P from cmd_pressure. target As the pressure of the execution target P cmd All data transfer is accomplished through shared memory variables (target_pressure→cmd_pressure) and event flags (transition_event_flag), eliminating the need for direct function calls or message passing between modules.
[0120] The above judgment logic ensures that the original target pressure and the final execution pressure are smoothly processed by the switching coordination module, and no pressure jump occurs under any operating condition.
[0121] S4 calculates the deviation between the target pressure and the actual airway pressure, and generates a fan drive control quantity through a unified control and adjustment structure to make the airway pressure follow the target pressure.
[0122] In this embodiment, when the system is in S mode, it is in the rising phase of the transition from exhalation to inhalation. Control period T s 50ms = 0.05s; The control parameters are read from the mode parameter mapping table, where K p =0.5, K i =0.1, K d =0.02, feedforward gain coefficient C=0.8.
[0123] Previous cycle state (k-1): Target pressure P cmd (k-1)=10.5hPa; Actual airway pressure P real (k-1)=9.8hPa; Pressure deviation e(k-1) = 0.7 hPa; The deviation change Δe(k-1) = 0.2hPa; The cumulative control quantity u(k-1) = 50.0 (normalized control quantity).
[0124] Current period state k: Execution target pressure P after switching coordination module smoothing cmd (k) = 11.0 hPa; The actual airway pressure P collected by the physiological signal sensing modulereal (k) = 10.2 hPa.
[0125] The unified pressure regulation module performs calculations (reading P from shared memory cmd_pressure) within each control cycle. cmd Read P from sensor_data real ), Figure 4 A detailed step diagram of step S4 provided in an embodiment of the present invention is shown below. Please refer to [link / reference]. Figure 4 As shown, the specific steps include: S41, the deviation calculation unit reads the target pressure P from the cmd_pressure variable in shared memory. cmd (If the switching coordination module is performing an interpolation transition, then cmd_pressure=P) trans (t); otherwise cmd_pressure=P target The actual pressure P is obtained from the physiological signal sensing module. real According to equation (1), the pressure deviation e(k) of the current control cycle is calculated to be 0.8 hPa; S42, the regulating operator unit generates the control quantity based on the pressure deviation using an incremental PID control structure with feedforward compensation; the calculation process includes the following steps: S421, the increment Δe(k) of the pressure deviation calculated according to equation (2) is 0.1 hPa; S422, according to equation (3) and the pressure deviation e(k-2) of the (k-2) period, the control increment of the PID regulation part is calculated to be 0.074; S423, according to equations (4) and (5), the feedforward compensation increment based on the target pressure change rate is calculated to be 0.4; S424, according to formula (6), the increment of the total control quantity is 0.434; S425, according to formula (7), the total drive control quantity of the actual output to the fan is calculated to be 50.474.
[0126] S43, the safety constraint module performs passive fallback limiting (i.e., second-level limiting) on the drive increment Δu(k) output by the unified pressure regulation module in time slots T5~T6. After the limiting is passed, the drive output unit converts the total control quantity into a PWM drive control signal and outputs it to the fan. Specifically, it includes the following steps: S431, map u(k) to PWM duty cycle (0~100%). Based on the total drive control value of the fan output from step S426, the drive output unit will generate a PWM signal with a duty cycle of 50.474%. S432, based on the pressure change rate limiting threshold R of the safety constraint module maxLimit the PWM increment Δu(k): If Then Δu(k) will be reduced proportionally; In this embodiment, the safety threshold Rmax is set to 5hPa / s, and the conversion factor α between the driving increment and the pressure change rate is 5.0 (hPa / s) / control unit.
[0127] Calculate the pressure change rate corresponding to the current driving increment. The pressure change rate is 2.17 hPa / s; since the calculated rate of change of pressure does not exceed the safety threshold R... max Therefore, there is no need to reduce Δu(k), and we can keep Δu(k) = 0.474 unchanged.
[0128] If the rate of pressure change corresponding to the current driving increment exceeds the safety threshold R max In cases where Δu(k) is 2.0, the corresponding pressure change rate is 10 hPa / s, which exceeds 5 hPa / s. In this case, Δu(k) needs to be reduced to 5.0 / 5.0, i.e., 1.0.
[0129] S433 outputs a PWM signal to drive the fan.
[0130] The control structure described above remains consistent across all ventilation modes (the deviation calculation unit reads data from shared memory `cmd_pressure` and `sensor_data`, the regulating operator generates control values and writes them to `drive_cmd`, and the drive output unit reads from `drive_cmd` and outputs the values). Pressure tracking is performed using a unified process of deviation calculation, incremental PID control with feedforward adjustment, safety limiting, and PWM output. Differences between modes are accommodated within this unified framework in the following ways: Target pressure P cmd It varies depending on the model, but P cmd Once determined, the subsequent deviation calculation, PID adjustment, and drive output processes are the same; The PID control parameters take different calibration values depending on the mode (stored in the mode parameter mapping table), but the function of the parameter group and the structure of the adjustment operator are exactly the same; The feedforward gain coefficient C can also be configured according to different modes to adapt to the dynamic response requirements of different modes.
[0131] Therefore, the aforementioned control architecture, with its mode-independent unified structure, is adapted to constant pressure in CPAP mode, event-driven dynamic pressure adjustment in Auto-CPAP mode, autonomously triggered bi-level switching in S mode, adaptive pressure support in Auto-S mode, time-controlled forced switching in T mode, backup ventilation triggering in ST mode, and target tidal volume closed-loop driven IPAP regulation in AVAPS mode. This unified framework enables algorithm optimizations and functional upgrades to take effect simultaneously across all ventilation modes.
[0132] S5, when any ventilation mode change event or respiratory phase transition event is detected, performs a smooth transition process on the target pressure trajectory to ensure continuous output pressure during mode switching and phase transition. This is executed by the switching coordination module. Figure 5 A detailed step diagram of S5 provided in an embodiment of the present invention is shown below. Please refer to [link / reference]. Figure 5 As shown, the specific steps include: S51, when the mode switching detection unit captures any mode switching event (this embodiment uses CPAP switching to S mode for numerical description), the following steps are executed: S511, record the switching trigger time t0, i.e. the original target pressure P0 of the mode before switching (constant pressure in CPAP mode, such as 8.0 hPa) and the original target pressure P1 of the new mode in the current phase after switching (IPAP in the inspiratory phase of S mode, such as 14.0 hPa or EPAP in the expiratory phase, such as 8.0 hPa). S512, the trajectory interpolation unit uses a clamped cubic spline interpolation method to generate the transition trajectory. Specifically, the starting time t0 and the ending time t1 are selected as nodes, the first derivative (pressure change rate) at the forced constraint boundary is zero, and the transition time window is T. trans (i.e., t1-t0), the generated transition trajectory equation is:
[0133] Where t represents the current time.
[0134] S513, During the transition period, the target pressure is P. cmd =P trans (t), after the transition is complete (t>t0+T) trans The target pressure is seamlessly switched to the original target pressure of the new mode, i.e., P. cmd =P target .
[0135] S52, when the respiratory phase discrimination unit detects a respiratory phase transition (such as switching from the expiratory phase to the inspiratory phase), the following steps are included: S521, the trajectory interpolation unit obtains the rise time (inspiratory EPAP to expiratory IPAP, 100~500ms, default 300ms) or fall time (IPAP to EPAP, take the same value) in the parameter configuration. S522, during the rise time, the target pressure smoothly rises from EPAP to IPAP (or falls in the opposite direction) according to an S-shaped curve. The S-shaped curve employs a four-segment programming model based on a trapezoidal acceleration profile, ensuring third-order continuity of pressure, pressure change rate, and the rate of change of pressure change by controlling the profile of jerk J(t) (four stages: acceleration, uniform acceleration, and deceleration). Interpolation result P trans (t) is written to the cmd_pressure variable in shared memory, and the unified pressure regulation module reads from cmd_pressure every cycle.
[0136] During this process, the safety constraint module executes a time parameter adaptive correction mechanism, first based on the pressure difference (i.e., |P1-P0|) and the pressure change rate safety threshold R. max (In this embodiment, the pressure is set to 5 hPa / s) Calculate the theoretical minimum safe transition time T safe The calculation formula is:
[0137] Then the user-preset time T set Compared with the theoretical minimum safe time T safe Comparison: If T set ≥T safe The trajectory interpolation unit directly follows the preset time T. set Generate interpolation curves and calculate the derivatives at each point on the curve in real time, ensuring that their absolute values do not exceed R. max ; If T set <T safe Then the actual execution time will be automatically extended to T. safe The above corrections will not trigger alarms, but will only be recorded in the operation log.
[0138] When the mode switching detection unit detects that a mode switching event and a respiratory phase transition event occur simultaneously or overlap in timing, the system determines that the respiratory phase transition event has a higher priority. At this time, the trajectory interpolation unit immediately terminates the current mode switching transition process, uses the actual output pressure at the current moment as the new starting point, and re-plans the phase switching transition trajectory based on the new mode type and the current respiratory phase.
[0139] The interpolation method described above is not limited to switching from CPAP to S mode; it also applies to switching between any two ventilation modes, such as CPAP to ST mode, S mode to T mode, Auto-CPAP to AVAPS mode, and ST mode to Auto-S mode. All mode switching scenarios utilize the same interpolation engine, with only P0, P1, and T interpolation being used. trans The value of varies depending on the specific pattern combination and the current breathing phase, and the interpolation algorithm itself does not require any modification.
[0140] The above embodiments are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. An airway pressure control system for a sleep apnea machine, characterized in that, It includes interconnected parameter configuration modules, mode scheduling modules, physiological signal sensing modules, unified pressure regulation modules, switching coordination modules, and safety constraint modules; The unified pressure regulation module includes a deviation calculation unit, a regulation operator unit, and a drive output unit. It is used to generate fan drive commands based on the deviation between the target pressure and real-time feedback information, using a unified control structure to adapt to multiple ventilation modes, so that the airway pressure follows the changes of the target pressure. The unified control structure maintains the same deviation calculation and regulation operator generation mechanism in different ventilation modes, with only the control parameters differing from mode to mode. The regulating operator unit adopts a unified incremental PID control structure and combines it with feedforward compensation to generate control quantities. Its discretized recursive formula is: Where k is the current control cycle number, e(k) is the pressure deviation of the current control cycle, Δe(k) is the increment of the deviation, and T s To control the cycle, K p K i K d For the control parameters related to the ventilation mode, C is the feedforward gain coefficient, and P is the control parameter related to the ventilation mode. cmd (k) represents the target pressure, Δu PID (k) represents the control increment of the PID control section, u ff (k) and Δu ff (k) represents the feedforward compensation amount based on the rate of change of the target pressure and its increment, Δu(k) represents the increment of the total control amount, and u(k) represents the actual output drive control amount to the fan. The switching coordination module includes a mode switching detection unit and a trajectory interpolation unit, which are used to perform smooth transition processing on the target pressure trajectory when the ventilation mode changes or the breathing phase changes, so that the output pressure remains continuous and differentiable. The pressure value after the smooth transition processing is used as the execution target pressure. The trajectory interpolation unit uses a cubic spline interpolation method to generate a transition trajectory when the ventilation mode changes. The smoothing process for the target pressure trajectory includes: When a ventilation mode change event is detected, a transition trajectory is generated within a preset transition time window using a cubic spline interpolation method. The transition trajectory satisfies that the pressure values at the start and end points are continuous and the first derivative is zero. When a respiratory phase transition event is detected, an S-curve interpolation method is used to smoothly transition the target pressure from the current phase pressure to the target phase pressure during the rise or fall time. The S-curve ensures that the pressure, the rate of change of pressure, and the rate of change of the rate of change of pressure are all continuous. The safety constraint module limits the output pressure and pressure change rate based on a safety threshold for the pressure change rate.
2. The airway pressure control system of the sleep apnea machine according to claim 1, characterized in that, The parameter configuration module includes a mode parameter mapping unit and a parameter verification unit. The mode parameter mapping unit establishes a correspondence between ventilation mode types and mode parameter sets. The mode parameter set includes one or more combinations of pressure setpoint, pressure support difference, respiratory rate, inspiratory time, target tidal volume, trigger sensitivity, and pressure rise curve. The parameter verification unit verifies the logical relationships and boundary conditions between different parameters.
3. A method for controlling airway pressure in a sleep apnea machine, characterized in that, The system implementation based on claim 1 includes the following steps: S1, obtain the mode parameter configuration corresponding to the currently selected ventilation mode; S2 collects airway pressure, gas flow rate and patient breathing effort signals to generate real-time feedback information; S3, based on the current ventilation mode and respiratory phase, determine the target pressure trajectory for the current control cycle; S4, calculate the deviation between the target pressure and the real-time feedback information, and generate fan drive commands through a unified control structure to adapt to multiple ventilation modes, so that the airway pressure follows the target pressure. The unified control structure maintains the same deviation calculation and adjustment operator generation mechanism in different ventilation modes, only the control parameters differ from mode to mode. The target pressure is the pressure value after the target pressure trajectory has been smoothed. S5, when a ventilation mode change event or a breathing phase transition event is detected, a smooth transition process is performed on the target pressure trajectory to keep the output pressure continuous during mode switching and phase transition.
4. The airway pressure control method for a sleep apnea machine according to claim 3, characterized in that, The unified control structure employs a unified deviation calculation and adjustment operator generation mechanism for different ventilation modes, including: Calculate the pressure deviation and deviation increment for the current control cycle; The control increment is generated based on the incremental PID control structure and combined with feedforward compensation. Accumulate and update the drive control quantity and output it.
5. The airway pressure control method for a sleep apnea machine according to claim 3, characterized in that, This also includes safety limits on output pressure and pressure change rate: Set a safe threshold for the rate of pressure change; The rate of change of the actual output pressure is monitored in real time. If the rate of change exceeds the safety threshold of the pressure change rate due to external disturbances, the increment of the fan drive control quantity is reduced proportionally.
6. The airway pressure control method for a sleep apnea machine according to claim 3, characterized in that, Determining the target pressure trajectory for the current control cycle includes: The current respiratory phase is determined based on the flow and pressure data provided by the physiological signal sensing module. When the flow exceeds the inspiratory trigger threshold in the positive direction, it is determined to be the start of the inspiratory phase. When the flow is reversed or lower than the expiratory trigger threshold, it is determined to be the start of the expiratory phase. The pressure change rate is used as an auxiliary basis for determination. Based on the currently determined ventilation mode type and respiratory phase, the corresponding target pressure setting value is retrieved from the mode parameter configuration to determine the original target pressure.
Citation Information
Patent Citations
Pressure control methods for ventilators and CPAP mode
CN107050600B
Pressure control system and method for respiratory support device
CN112190800A
A ventilator flow control method based on sleep state and sleep apnea machine
CN115887841B
Sleep breathing control method, device, system, equipment and medium
CN120053829A
Deep sleep maintenance algorithm for self-adaptive pressure regulation of breathing machine
CN120617726A
