High frequency respirator airway pressure and solenoid valve driving control method
Patent Information
- Application Number
- CN202611134622.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-09-25
AI Technical Summary
其核心挑战在于,气道压力必须在极短吸气时间内精确跟踪目标波形,而气体管路阻抗、阀体动态延迟和传感器噪声等因素极易造成压力波动和相位滞后
[0044]分析本发明提供的上述一种高频呼吸机气道压力与电磁阀驱动控制方法可知,该控制方法,包括以下步骤:S10:根据预设的通气频率、目标潮气量和呼吸回路阻抗模型,通过前馈计算获得维持目标气道压力所需的脉冲宽度调制PWM基础占空比D_base;S20:以1ms至5ms的调节周期实时采集气道压力,计算与目标压力的偏差ΔP,并采用反馈控制算法生成PWM占空比微调量ΔD;S30:将所述PWM基础占空比D_base与所述PWM占空比微调量ΔD叠加,得到目标驱动占空比D_target;S40:在接收到阀门开启指令时,向高速电磁阀的线圈输出第一占空比的PWM信号,使线圈电流在预设峰值时间段内上升到吸合阈值电流;S50:当检测到线圈电流达到所述吸合阈值电流或所述预设峰值时间段届满时,切换至以所述目标驱动占空比D_target输出PWM信号,并通过电流闭环将线圈电流维持在保持阈值范围内;S60:在接收到阀门关闭指令时,停止输出PWM信号,并启动主动泄放电路使线圈电流在预设关断时间内强制归零。
Smart Images

Figure CN122805938A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ventilators, and more particularly to a method for controlling airway pressure and solenoid valve drive in a high-frequency ventilator. Background Technology
[0002] High-frequency ventilators are required to provide precise ventilation at frequencies of several hertz or even tens of hertz in clinical scenarios such as neonatal respiratory distress and acute respiratory failure. The core challenge lies in the fact that the airway pressure must accurately track the target waveform within an extremely short inspiratory time. Factors such as gas tubing impedance, valve dynamic delay, and sensor noise can easily cause pressure fluctuations and phase lag.
[0003] Existing technologies often employ PID feedback control to regulate the opening of solenoid valves. However, pure feedback methods are limited by control cycles and phase lag, making it difficult to meet the dynamic response requirements under high-frequency operating conditions. Some solutions introduce feedforward compensation, but these often rely on fixed models and cannot cope with actual disturbances such as temperature drift and changes in pipeline parameters, resulting in accumulated pressure deviations.
[0004] In solenoid valve driving, to shorten the pull-in time and reduce power consumption, commonly used high- and low-voltage drive schemes suffer from current overshoot or untimely switching during the switching process, leading to valve action delays or coil overheating. Furthermore, if the microprocessor's main clock source experiences frequency shifts due to external interference, it can cause PWM control timing errors, potentially triggering pressure runaway. Existing watchdog circuits only activate when the signal is completely lost, failing to intervene in advance as the clock gradually deteriorates, thus creating a safety blind spot.
[0005] Therefore, a comprehensive control method is needed that integrates precise feedforward, dynamic feedback correction, fast current drive, and clock prediction protection to achieve smooth pressure tracking and high system safety under high-frequency ventilation. Summary of the Invention
[0006] The purpose of this invention is to provide a method for controlling airway pressure and solenoid valve drive in a high-frequency ventilator, which solves the aforementioned technical problems pointed out in the prior art.
[0007] This invention provides a method for controlling airway pressure and solenoid valve drive in a high-frequency ventilator, comprising the following steps:
[0008] S10: Based on the preset ventilation frequency, target tidal volume, and respiratory circuit impedance model, the pulse width modulation (PWM) base duty cycle required to maintain the target airway pressure is obtained through feedforward calculation. ;
[0009] S20: Real-time acquisition of airway pressure with an adjustment period of 1ms to 5ms, calculation of the deviation ΔP from the target pressure, and generation of PWM duty cycle fine adjustment ΔD using a feedback control algorithm;
[0010] S30: Set the PWM base duty cycle The target drive duty cycle is obtained by superimposing the PWM duty cycle fine-tuning amount ΔD. ;
[0011] S40: When a valve opening command is received, a PWM signal with the first duty cycle is output to the coil of the high-speed solenoid valve, so that the coil current rises to the pull-in threshold current within a preset peak time period.
[0012] S50: When the coil current reaches the pull-in threshold current or the preset peak time period expires, switch to the target drive duty cycle. Output a PWM signal and maintain the coil current within the holding threshold range through a current closed loop;
[0013] S60: Upon receiving a valve closing command, stop outputting the PWM signal and activate the active discharge circuit to force the coil current to zero within a preset turn-off time.
[0014] Preferably, as one possible implementation; in step S10, the breathing circuit impedance model includes the flow resistance R and compliance C of the breathing tubing, and the target airway pressure. The relationship with the required flow rate Q is as follows = R·Q + V / C, combined with the flow-duty cycle characteristic curve of the solenoid valve, the basic duty cycle of the PWM is obtained through a linear fitting algorithm. =a· + b, where a and b are fitting coefficients.
[0015] Preferably, as one possible implementation; in step S20, the feedback control algorithm is an incremental PID algorithm, and the increment of the PWM duty cycle fine-tuning ΔD is... And limit the integral term to prevent integral saturation; where e(k) is the pressure deviation of the current cycle, and Kp, Ki, and Kd are the proportional, integral, and derivative coefficients, respectively.
[0016] Preferably, as one possible implementation: in step S40, the PWM signal of the first duty cycle is output through the high-voltage drive branch, and its voltage is 1.5 to 3 times the rated drive voltage, so as to realize the rapid rise of the coil current; in step S50, the switched PWM signal is output through the low-voltage drive branch, and its voltage is the rated drive voltage; in step S60, the active discharge circuit includes a series freewheeling diode and a transient voltage suppressor diode (TVS), and the clamping voltage of the TVS is higher than the output voltage of the drive branch and lower than the withstand voltage of the switching element, so as to realize that the coil current returns to zero within a preset off time that is less than the mechanical reset time of the solenoid valve.
[0017] Preferably, as one possible implementation; in step S30, the target drive duty cycle Determined through the following vectorization operations:
[0018] Define the error state vector Where e(k) is the current pressure deviation, Δe(k) = e(k) - e(k-1), ;
[0019] coefficient vector , It is a preset nonnegative constant;
[0020] Then the PWM duty cycle fine-tuning amount Where λ is a preset amplitude constant, It is the hyperbolic tangent function. It is an infinite norm. It is a symbolic function;
[0021] The target drive duty cycle .
[0022] Preferably, as one possible implementation, in step S20, a pressure deviation dead zone threshold ε is also set. When |e(k)| < ε, the increment δu(k) is set to zero to avoid frequent adjustments caused by small deviations. Furthermore, when the airway pressure is detected to exceed the safety limit, ΔD is forcibly set to the negative maximum amplitude value to quickly relieve pressure.
[0023] Preferably, as one possible implementation; in step S50, the frequency of the PWM signal output with the target drive duty cycle is set in the range of 20kHz to 40kHz, avoiding the mechanical resonance frequency of the high-frequency ventilator tubing system; and the method further includes: monitoring the PWM signal output by the microprocessor by a hardware watchdog circuit, and forcibly cutting off the drive output when the signal is abnormal or lost for more than a preset time;
[0024] It also includes: dynamically determining the timing of sending the valve opening and closing commands based on the ventilation frequency and the inspiratory-expiratory ratio; and updating the PWM base duty cycle D_base based on the latest acquired ventilation frequency and target tidal volume at a preset time before the start of each inspiratory phase, so as to achieve synchronization between feedforward calculation and respiratory cycle.
[0025] Preferably, as one possible implementation; in step S50, the coil current is monitored in real time by a sampling resistor and a comparator. When the real-time current value is greater than or equal to the pull-in threshold current, a hardware interrupt is generated to trigger the switch to output with the target drive duty cycle; the preset peak time period is used as a redundancy switching condition, and its duration is set to 1.2 to 1.5 times the pull-in time under rated voltage.
[0026] Preferably, as one possible implementation, it also includes a clock monitoring step:
[0027] Real-time comparison of the frequency deviation between the microprocessor's main clock source and the reference clock source;
[0028] If the frequency deviation exceeds the first preset threshold but the hardware watchdog is not triggered, the system switches to an internal low-speed clock source to maintain basic ventilation function in a degraded mode that reduces the sampling and control rates.
[0029] If the frequency deviation exceeds the second preset threshold, or the airway pressure exceeds the safety limit and the duration exceeds the preset tolerance, the hardware watchdog is triggered to forcibly cut off the drive output.
[0030] Preferably, as one possible implementation: in the clock monitoring step, a pre-trained temporal convolutional network is used to process the historical frequency deviation sequence of the master clock source and output the frequency deviation prediction value for the next time period; when the prediction value exceeds a first preset threshold, the system actively switches to an internal low-speed clock source before the predicted over-limit time to prevent clock failure.
[0031] The pre-trained temporal convolutional network's processing of historical frequency deviation sequences includes the following sub-steps:
[0032] S111: Collect the frequency deviation between the master clock source and the reference clock source within a fixed time window, and construct a deviation sequence of length N. ,in Let be the deviation value at the i-th sampling time.
[0033] S112: The bias sequence x is input into a temporal convolutional network. The network contains multiple dilated convolutional layers. The dilation factor d of each layer increases exponentially with the number of layers. Each layer performs a one-dimensional causal convolution operation, so that the output depends only on the input at the current and past times. The shallow features are directly passed to the deep layers through residual connections.
[0034] S113: The output layer of the temporal convolutional network generates a sequence of predicted frequency deviations for the next M time steps. ;
[0035] S114: Take the maximum value from the predicted value sequence. ,like If the prediction exceeds the first preset threshold, a prediction over-limit flag is generated, and the moment of prediction over-limit is recorded as the first time the condition is met. The future time corresponding to j of the first preset threshold;
[0036] The step of actively switching to the internal low-speed clock source before the predicted timeout includes:
[0037] S115: After the predicted over-limit flag is generated, calculate the time interval from the current time to the predicted over-limit time. ;
[0038] S116: If Greater than the minimum preparation time required for internal clock switching Then delay at the current time. The clock will then be switched.
[0039] like Less than or equal to If so, the clock switch will be executed immediately;
[0040] S117: After the clock switch is executed, the actual frequency deviation value is still continuously collected. If the actual deviation exceeds the first preset threshold before the predicted over-limit time is reached, the subsequent prediction sequence is ignored, the current internal low-speed clock source is maintained, and the clock health abnormality flag is set for use by the upper-layer security logic.
[0041] Preferably, as one possible implementation, the degradation mode includes: extending the airway pressure adjustment period from 1ms to 5ms to 10ms to 20ms, fixing the PWM base duty cycle to the feedforward calculation result based on the last normal clock, and pausing the update of the duty cycle fine-tuning amount, maintaining only the current drive state.
[0042] Preferably, as one possible implementation, the frequency deviation between the master clock source and the reference clock source is obtained by a period counting method, and the moving average of the deviation is continuously calculated over multiple counting periods; both the first preset threshold and the second preset threshold are expressed in parts per million, and the second preset threshold is 3 to 5 times the first preset threshold.
[0043] Compared with the prior art, the embodiments of the present invention have at least the following technical advantages:
[0044] Analysis of the high-frequency ventilator airway pressure and solenoid valve drive control method provided by the present invention reveals that the control method includes the following steps: S10: Based on the preset ventilation frequency, target tidal volume, and respiratory circuit impedance model, the pulse width modulation (PWM) base duty cycle D_base required to maintain the target airway pressure is obtained through feedforward calculation; S20: Airway pressure is collected in real time with an adjustment period of 1ms to 5ms, the deviation ΔP from the target pressure is calculated, and a feedback control algorithm is used to generate a PWM duty cycle fine adjustment ΔD; S30: The PWM base duty cycle D_base and the PWM duty cycle fine adjustment ΔD are superimposed to obtain the target airway pressure. S40: Upon receiving a valve opening command, output a PWM signal with the first duty cycle to the coil of the high-speed solenoid valve, causing the coil current to rise to the pull-in threshold current within a preset peak time period; S50: When it is detected that the coil current reaches the pull-in threshold current or the preset peak time period expires, switch to outputting a PWM signal with the target drive duty cycle D_target, and maintain the coil current within the holding threshold range through a current closed loop; S60: Upon receiving a valve closing command, stop outputting the PWM signal and start the active discharge circuit to force the coil current to return to zero within a preset turn-off time.
[0045] This invention provides a high-frequency ventilator airway pressure and solenoid valve drive control method. It calculates the PWM base duty cycle based on the ventilation frequency, target tidal volume, and respiratory circuit impedance model using feedforward; it collects airway pressure in real time and generates duty cycle fine-tuning parameters using incremental PID; these parameters are then superimposed to obtain the target drive duty cycle. When the valve opens, it first uses high-pressure drive for rapid adsorption, then switches to the target duty cycle and maintains the holding current through a current closed loop; when shutting off, it activates an active discharge circuit to force the current to zero. Based on this, vectorized error state calculation is introduced to suppress dynamic interference, and a time-domain convolutional network is used to predict the master clock source frequency deviation, achieving predictive clock switching and graded safety protection. This invention combines feedforward compensation, feedback correction, and rapid current drive, significantly improving pressure tracking accuracy and dynamic response under high-frequency ventilation, while ensuring safe system operation during clock anomalies through a clock prediction mechanism. Attached Figure Description
[0046] Figure 1 This is a flowchart of a high-frequency ventilator airway pressure and solenoid valve drive control method according to Embodiment 1.
[0047] Figure 2 This is a detailed operation flowchart of a high-frequency ventilator airway pressure and solenoid valve drive control method according to Embodiment 1. Detailed Implementation
[0048] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings.
[0050] The purpose of this invention is to provide a method for controlling airway pressure and solenoid valve drive in a high-frequency ventilator. By using feedforward-feedback coupling control, vectorized error calculation, and time-domain convolutional network to predict clock switching, this method solves problems such as pressure control lag, insufficient dynamic accuracy, and potential clock failure.
[0051] Example 1
[0052] See Figure 1 Embodiment 1 of the present invention provides a method for controlling airway pressure and solenoid valve drive in a high-frequency ventilator, comprising the following steps:
[0053] S10, calculate the basic duty cycle of PWM based on the ventilation frequency, target tidal volume, and respiratory circuit impedance model; that is, based on the preset ventilation frequency, target tidal volume, and respiratory circuit impedance model, calculate the basic duty cycle of pulse width modulation (PWM) required to maintain the target airway pressure through feedforward calculation. ;
[0054] S20: Real-time acquisition of airway pressure, calculation of pressure deviation and generation of duty cycle fine-tuning using a feedback algorithm; Real-time acquisition of airway pressure with an adjustment period of 1ms to 5ms, calculation of deviation ΔP from the target pressure, and generation of PWM duty cycle fine-tuning ΔD using a feedback control algorithm.
[0055] S30, the base duty cycle and the fine-tuning amount are superimposed to obtain the target duty cycle; the PWM base duty cycle is... The target drive duty cycle is obtained by superimposing the PWM duty cycle fine-tuning amount ΔD. ;
[0056] S40 outputs a PWM signal with the first duty cycle when the valve is opened, so that the coil current quickly reaches the pull-in threshold.
[0057] S50: After the pull-in condition is met, switch to the target duty cycle drive and maintain the holding current using a current closed loop; when the coil current reaches the pull-in threshold current or the preset peak time period expires, switch to the target drive duty cycle. Output a PWM signal and maintain the coil current within the holding threshold range through a current closed loop;
[0058] S60, when shutting down, activates the active discharge circuit to force the current to zero. Upon receiving the valve closing command, it stops outputting the PWM signal and activates the active discharge circuit to force the coil current to zero within a preset shutdown time.
[0059] In the high-frequency ventilator airway pressure and solenoid valve drive control method provided in this embodiment of the invention, the main control quantity is output in advance through feedforward calculation in S10 to compensate for gas conduction delay; the feedback correction in S20 eliminates deviation in real time, and the superposition of the two makes pressure tracking have both response speed and steady-state accuracy. The high-pressure rapid adsorption in S40 and the current holding in S50 ensure the timeliness and reliability of valve action, and the active ventilator release in S60 makes the shut-off rapid, thereby ensuring the accurate conversion of the inspiratory-expiratory ratio.
[0060] Furthermore, the impedance model in step S10 consists of pipeline flow resistance and compliance, and the basic duty cycle is obtained through linear fitting by combining the solenoid valve flow-duty cycle curve. Step S20 adopts incremental PID and introduces dead zone threshold and safety pressure relief logic. Step S30 achieves smooth limiting of the duty cycle fine-tuning amount through error state vector and hyperbolic tangent compensation term. The invention also includes a clock monitoring step, which uses a time-domain convolutional network to predict the frequency deviation sequence of the master clock source, actively switches to an internal low-speed clock source before the prediction exceeds the limit, and performs graded safety protection according to the severity of the deviation.
[0061] Preferably, as one possible implementation; in step S10, the breathing circuit impedance model includes the flow resistance R and compliance C of the breathing tubing, and the target airway pressure. The relationship with the required flow rate Q is as follows = R·Q + V / C, combined with the flow-duty cycle characteristic curve of the solenoid valve, the basic duty cycle of the PWM is obtained through a linear fitting algorithm. =a· + b, where a and b are fitting coefficients.
[0062] It should be noted that the process of executing step S10 above converts the complex gas path impedance model into a linear relationship. = a· + b, by using the flow-duty cycle curve fitting coefficients, avoids online iterative solutions, reduces computational overhead, and preserves the main dynamic characteristics of the model.
[0063] Preferably, as one possible implementation; preferably, as one possible implementation; in step S20, the feedback control algorithm is an incremental PID algorithm, and the increment of the PWM duty cycle fine-tuning ΔD is... And limit the integral term to prevent integral saturation; where e(k) is the pressure deviation of the current cycle, and Kp, Ki, and Kd are the proportional, integral, and derivative coefficients, respectively.
[0064] It should be noted that the feedback control algorithm described in the above execution steps is preferably an incremental PID algorithm. This incremental PID only outputs the increment, which facilitates amplitude limiting and anti-saturation processing. Limiting the integral term directly truncates the excess part, eliminating sudden changes in control quantity caused by long-term deviation accumulation and improving the stability of pressure control.
[0065] Preferably, as one possible implementation: in step S40, the PWM signal of the first duty cycle is output through the high-voltage drive branch, and its voltage is 1.5 to 3 times the rated drive voltage, so as to realize the rapid rise of the coil current; in step S50, the switched PWM signal is output through the low-voltage drive branch, and its voltage is the rated drive voltage; in step S60, the active discharge circuit includes a series freewheeling diode and a transient voltage suppressor diode (TVS), and the clamping voltage of the TVS is higher than the output voltage of the drive branch and lower than the withstand voltage of the switching element, so as to realize that the coil current returns to zero within a preset off time that is less than the mechanical reset time of the solenoid valve.
[0066] It should be noted that in the above execution steps, the high-voltage drive branch provides 1.5 to 3 times the rated voltage, which allows the coil current to rise rapidly to the pull-in point; after switching, the low-voltage branch supplies power, reducing coil heating and power consumption; the TVS tube in the active discharge circuit provides a high clamping voltage, which can quickly consume the coil's stored energy, making the current drop time less than the mechanical reset time, ensuring that the valve is completely closed before the next command.
[0067] Preferably, as one possible implementation; in step S30, the target drive duty cycle Determined through the following vectorization operations:
[0068] Define the error state vector Where e(k) is the current pressure deviation, Δe(k) = e(k) - e(k-1), ;
[0069] coefficient vector , It is a preset nonnegative constant;
[0070] Then the PWM duty cycle fine-tuning amount Where λ is a preset amplitude constant, It is the hyperbolic tangent function. It is an infinite norm. It is a symbolic function;
[0071] The target drive duty cycle .
[0072] It should be noted that the above execution steps set an error state vector E(k); this error state vector E(k) integrates the proportional, incremental, and integral characteristics of the deviation, and the coefficient vector C realizes multi-dimensional adjustment; When the deviation is large, the gain is saturated to avoid excessive duty cycle adjustment caused by linear gain. When the deviation is small, the gain is approximately linear, thus ensuring a balance between adjustment sensitivity and stability.
[0073] Preferably, as one possible implementation, in step S20, a pressure deviation dead zone threshold ε is also set. When |e(k)| < ε, the increment δu(k) is set to zero to avoid frequent adjustments caused by small deviations. Furthermore, when the airway pressure is detected to exceed the safety limit, ΔD is forcibly set to the negative maximum amplitude value to quickly relieve pressure.
[0074] It should be noted that the aforementioned dead zone threshold ε filters out sensor noise and minor fluctuations, avoiding unnecessary PWM adjustments; when the pressure exceeds the safe upper limit, ΔD is forced to the negative maximum amplitude, rapidly reducing the duty cycle to relieve pressure, thus prioritizing pressure risk control.
[0075] Preferably, as one possible implementation; in step S50, the frequency of the PWM signal output with the target drive duty cycle is set in the range of 20kHz to 40kHz, avoiding the mechanical resonance frequency of the high-frequency ventilator tubing system; and the method further includes: monitoring the PWM signal output by the microprocessor by a hardware watchdog circuit, and forcibly cutting off the drive output when the signal is abnormal or lost for more than a preset time;
[0076] This also includes: dynamically determining the transmission timing of the valve opening and closing commands based on the ventilation frequency and inspiratory-expiratory ratio; updating the PWM base duty cycle D_base at a preset time before the start of each inspiratory phase based on the latest acquired ventilation frequency and target tidal volume to achieve synchronization between feedforward calculation and the respiratory cycle. It should be noted that since frequencies above 20kHz are beyond the range of human hearing, the above scheme avoids the mechanical resonance points of the tubing, reducing vibration and noise. The hardware watchdog is independent of the microprocessor and can directly cut off the drive output in case of program crashes or clock anomalies, preventing uncontrollable ventilation actions. This step eliminates the impact of high-frequency noise on the human ear, avoids tubing vibration caused by mechanical resonance, and provides hardware-level fault protection.
[0077] Preferably, as one possible implementation; in step S50, the coil current is monitored in real time by a sampling resistor and a comparator. When the real-time current value is greater than or equal to the pull-in threshold current, a hardware interrupt is generated to trigger the switch to output with the target drive duty cycle; the preset peak time period is used as a redundancy switching condition, and its duration is set to 1.2 to 1.5 times the pull-in time under rated voltage.
[0078] The hardware comparator directly triggers interrupts, responds quickly, and has no software polling delay. The preset peak time period serves as a redundancy backup. When the comparator or detection circuit malfunctions, it can still force a switch to hold mode after a slightly longer period of time to prevent the coil from being damaged by high voltage and high current for an extended period of time.
[0079] Preferably, as one possible implementation, it also includes a clock monitoring step:
[0080] Real-time comparison of the frequency deviation between the microprocessor's main clock source and the reference clock source;
[0081] If the frequency deviation exceeds the first preset threshold but the hardware watchdog is not triggered, the system switches to an internal low-speed clock source to maintain basic ventilation function in a degraded mode that reduces the sampling and control rates.
[0082] If the frequency deviation exceeds the second preset threshold, or the airway pressure exceeds the safety limit and the duration exceeds the preset tolerance, the hardware watchdog is triggered to forcibly cut off the drive output.
[0083] It should be noted that the above steps are used to achieve early detection and graded processing of clock source degradation. Specifically, frequency deviation monitoring distinguishes between slight and severe offsets. A first preset threshold triggers degraded operation to maintain basic functions. Only when the second preset threshold or pressure continuously exceeds the limit is the watchdog triggered. This avoids unnecessary downtime and executes the most stringent protection when a real danger is confirmed, thus balancing safety and availability.
[0084] Preferably, as one possible implementation: in the clock monitoring step, a pre-trained temporal convolutional network is used to process the historical frequency deviation sequence of the master clock source and output the frequency deviation prediction value for the next time period; when the prediction value exceeds a first preset threshold, the system actively switches to an internal low-speed clock source before the predicted over-limit time to prevent clock failure.
[0085] See Figure 2 The pre-trained temporal convolutional network's processing of historical frequency deviation sequences includes the following sub-steps:
[0086] S111: Collect the frequency deviation between the master clock source and the reference clock source within a fixed time window, and construct a deviation sequence of length N. ,in Let be the deviation value at the i-th sampling time.
[0087] S112: The bias sequence x is input into a temporal convolutional network. The network contains multiple dilated convolutional layers. The dilation factor d of each layer increases exponentially with the number of layers. Each layer performs a one-dimensional causal convolution operation, so that the output depends only on the input at the current and past times. The shallow features are directly passed to the deep layers through residual connections.
[0088] S113: The output layer of the temporal convolutional network generates a sequence of predicted frequency deviations for the next M time steps. ;
[0089] S114: Take the maximum value from the predicted value sequence. ,like If the prediction exceeds the first preset threshold, a prediction over-limit flag is generated, and the moment of prediction over-limit is recorded as the first time the condition is met. The future time corresponding to j of the first preset threshold;
[0090] The step of actively switching to the internal low-speed clock source before the predicted timeout includes:
[0091] S115: After the predicted over-limit flag is generated, calculate the time interval from the current time to the predicted over-limit time. ;
[0092] S116: If Greater than the minimum preparation time required for internal clock switching Then delay at the current time. The clock will then be switched.
[0093] like Less than or equal to If so, the clock switch will be executed immediately;
[0094] S117: After the clock switch is executed, the actual frequency deviation value is still continuously collected. If the actual deviation exceeds the first preset threshold before the predicted over-limit time is reached, the subsequent prediction sequence is ignored, the current internal low-speed clock source is maintained, and the clock health abnormality flag is set for use by the upper-layer security logic.
[0095] Steps S111-S114 above ensure input consistency by collecting the deviation sequence within a fixed time window; the exponentially growing receptive field of dilated convolution takes into account both short-term fluctuations and long-term trends; causal convolution ensures that predictions do not depend on future information; residual connections prevent deep network degradation and improve training stability; and taking the maximum value and recording the time of exceeding the limit provide clear triggering conditions and timing basis for subsequent switching. This process is used to accurately extract the temporal features of the frequency deviation sequence through dilated convolution and residual connections, achieving accurate prediction of future time of exceeding the limit.
[0096] The above steps S115-S117 compare the prediction time interval with the minimum preparation time. If there is enough time, the switch is delayed until the moment of exceeding the limit, maximizing the high performance of the master clock. If it is urgent, the switch is made immediately to ensure safety. After the switch, the actual deviation is still monitored. If the prediction is wrong and the actual limit has been exceeded, the prediction is ignored and the internal clock is maintained to prevent repeated switching between clock sources and ensure the stability of the control state.
[0097] Preferably, as one possible implementation, the degradation mode includes: extending the airway pressure adjustment period from 1ms to 5ms to 10ms to 20ms, fixing the PWM base duty cycle to the feedforward calculation result based on the last normal clock, and pausing the update of the duty cycle fine-tuning amount, maintaining only the current drive state.
[0098] Preferably, as one possible implementation, the frequency deviation between the master clock source and the reference clock source is obtained by period counting, and the moving average of the deviation over multiple counting periods is calculated continuously. Both the first and second preset thresholds are expressed in parts per million (ppm), and the second preset threshold is 3 to 5 times the first preset threshold. The above steps utilize the period counting method for high measurement accuracy, and the moving average filters out transient interference. Expressing the threshold in ppm facilitates comparison with crystal oscillator accuracy indicators. The second preset threshold being 3 to 5 times the first threshold creates a reasonable gradient, ensuring that slight drift triggers an early warning, while severe drift is directly cut off.
[0099] In summary, in the high-frequency ventilator airway pressure and solenoid valve drive control method provided in this embodiment of the invention, the feedforward calculation in S10 outputs the main control quantity in advance, compensating for the gas conduction delay; the feedback correction in S20 eliminates deviations in real time, and the superposition of the two makes pressure tracking have both response speed and steady-state accuracy. The high-pressure rapid adsorption in S40 and the current holding in S50 ensure the timeliness and reliability of valve action, and the active ventilator release in S60 makes the shut-off rapid, thereby ensuring the accurate conversion of the inspiratory-expiratory ratio.
[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; those skilled in the art can modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for controlling airway pressure and solenoid valve drive in a high-frequency ventilator, characterized in that, Includes the following steps: S10: Based on the preset ventilation frequency, target tidal volume, and respiratory circuit impedance model, the pulse width modulation (PWM) base duty cycle required to maintain the target airway pressure is obtained through feedforward calculation. ; S20: Real-time acquisition of airway pressure with an adjustment period of 1ms to 5ms, calculation of the deviation ΔP from the target pressure, and generation of PWM duty cycle fine adjustment ΔD using a feedback control algorithm; S30: Set the PWM base duty cycle The target drive duty cycle is obtained by superimposing the PWM duty cycle fine-tuning amount ΔD. ; S40: When a valve opening command is received, a PWM signal with the first duty cycle is output to the coil of the high-speed solenoid valve, so that the coil current rises to the pull-in threshold current within a preset peak time period. S50: When the coil current reaches the pull-in threshold current or the preset peak time period expires, switch to the target drive duty cycle. Output a PWM signal and maintain the coil current within the holding threshold range through a current closed loop; S60: Upon receiving a valve closing command, stop outputting the PWM signal and activate the active discharge circuit to force the coil current to zero within a preset turn-off time.
2. The method according to claim 1, characterized in that, In step S10, the breathing circuit impedance model includes the flow resistance R and compliance C of the breathing tubing, and the target airway pressure. The relationship with the required flow rate Q is as follows = R·Q +V / C, combined with the flow-duty cycle characteristic curve of the solenoid valve, the basic duty cycle of the PWM is obtained through a linear fitting algorithm. = a· + b, where a and b are fitting coefficients.
3. The method according to claim 1, characterized in that, In step S20, the feedback control algorithm is an incremental PID algorithm, and the increment of the PWM duty cycle fine-tuning ΔD is... And limit the integral term to prevent integral saturation; where e(k) is the pressure deviation of the current cycle, and Kp, Ki, and Kd are the proportional, integral, and derivative coefficients, respectively.
4. The method according to claim 1, characterized in that, In step S40, the PWM signal with the first duty cycle is output through the high-voltage drive branch, and its voltage is 1.5 to 3 times the rated drive voltage to achieve a rapid rise in coil current; in step S50, the switched PWM signal is output through the low-voltage drive branch, and its voltage is the rated drive voltage; in step S60, the active discharge circuit includes a series freewheeling diode and a transient voltage suppressor diode (TVS), and the clamping voltage of the TVS is higher than the output voltage of the drive branch and lower than the withstand voltage of the switching element to achieve zero coil current within a preset off time that is less than the mechanical reset time of the solenoid valve.
5. The method according to claim 1, characterized in that, In step S30, the target drive duty cycle Determined through the following vectorization operations: Define the error state vector Where e(k) is the current pressure deviation, Δe(k) = e(k) - e(k-1), ; coefficient vector , It is a preset nonnegative constant; Then the PWM duty cycle fine-tuning amount Where λ is a preset amplitude constant, It is the hyperbolic tangent function. It is an infinite norm. It is a symbolic function; The target drive duty cycle .
6. The method according to claim 3, characterized in that, In step S20, a pressure deviation dead zone threshold ε is also set. When |e(k)| < ε, the increment δu(k) is set to zero to avoid frequent adjustments caused by small deviations. Furthermore, when airway pressure is detected to exceed the safety limit, ΔD is forcibly set to the negative maximum limit value to quickly relieve pressure.
7. The method according to claim 4, characterized in that, In step S50, the frequency of the PWM signal output with the target drive duty cycle is set in the range of 20kHz to 40kHz, avoiding the mechanical resonance frequency of the high-frequency ventilator tubing system; and the method further includes: monitoring the PWM signal output by the microprocessor by a hardware watchdog circuit, and forcibly cutting off the drive output when the signal is abnormal or lost for more than a preset time; It also includes: dynamically determining the timing of sending the valve opening and closing commands based on the ventilation frequency and the inspiratory-expiratory ratio; and updating the PWM base duty cycle D_base based on the latest acquired ventilation frequency and target tidal volume at a preset time before the start of each inspiratory phase, so as to achieve synchronization between feedforward calculation and respiratory cycle.
8. The method according to claim 1, characterized in that, In step S50, the coil current is monitored in real time by a sampling resistor and a comparator. When the real-time current value is greater than or equal to the pull-in threshold current, a hardware interrupt is generated to trigger a switch to output with the target drive duty cycle. The preset peak time period serves as a redundancy switching condition, and its duration is set to 1.2 to 1.5 times the pull-in time under rated voltage.
9. The method according to claim 1, characterized in that, It also includes a clock monitoring step: Real-time comparison of the frequency deviation between the microprocessor's main clock source and the reference clock source; If the frequency deviation exceeds the first preset threshold but the hardware watchdog is not triggered, the system switches to an internal low-speed clock source to maintain basic ventilation function in a degraded mode that reduces the sampling and control rates. If the frequency deviation exceeds the second preset threshold, or the airway pressure exceeds the safety limit and the duration exceeds the preset tolerance, the hardware watchdog is triggered to forcibly cut off the drive output.
10. The method according to claim 9, characterized in that, In the clock monitoring step, a pre-trained temporal convolutional network is used to process the historical frequency deviation sequence of the master clock source and output the frequency deviation prediction value for the next time period. When the prediction value exceeds the first preset threshold, the system actively switches to the internal low-speed clock source before the predicted over-limit time to prevent clock failure. The pre-trained temporal convolutional network's processing of historical frequency deviation sequences includes the following sub-steps: S111: Collect the frequency deviation between the master clock source and the reference clock source within a fixed time window, and construct a deviation sequence of length N. ,in Let be the deviation value at the i-th sampling time. S112: The bias sequence x is input into a temporal convolutional network. The network contains multiple dilated convolutional layers. The dilation factor d of each layer increases exponentially with the number of layers. Each layer performs a one-dimensional causal convolution operation, so that the output depends only on the input at the current and past times. The shallow features are directly passed to the deep layers through residual connections. S113: The output layer of the temporal convolutional network generates a sequence of predicted frequency deviations for the next M time steps. ; S114: Take the maximum value from the predicted value sequence. ,like If the prediction exceeds the first preset threshold, a prediction over-limit flag is generated, and the moment of prediction over-limit is recorded as the first time the condition is met. The future time corresponding to j of the first preset threshold; The step of actively switching to the internal low-speed clock source before the predicted timeout includes: S115: After the predicted over-limit flag is generated, calculate the time interval from the current time to the predicted over-limit time. ; S116: If Greater than the minimum preparation time required for internal clock switching Then delay at the current time. The clock will then be switched. like Less than or equal to If so, the clock switch will be executed immediately; S117: After the clock switch is executed, the actual frequency deviation value is still continuously collected. If the actual deviation exceeds the first preset threshold before the predicted over-limit time is reached, the subsequent prediction sequence is ignored, the current internal low-speed clock source is maintained, and the clock health abnormality flag is set for use by the upper-layer security logic.