Frequency tracking method, system and equipment of ultrasonic therapeutic apparatus and medium
By using particle swarm optimization algorithm to dynamically adjust PID parameters in an ultrasonic therapy device, the difficulty of resonant frequency locking caused by fixed parameters in frequency tracking is solved, achieving fast and stable frequency tracking and improving acoustic energy utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-05
AI Technical Summary
In existing frequency tracking methods for ultrasound therapy devices, the PID algorithm has fixed parameter values, making it difficult to quickly lock the resonant frequency, which leads to a decrease in output power and a reduction in acoustic energy utilization.
The parameters of the PID algorithm are dynamically adjusted using the Particle Swarm Optimization (PSO) algorithm. By monitoring the phase difference between the current and voltage signals of the transducer, the driving frequency is quickly determined using the improved PSO-PID algorithm, thus achieving frequency tracking.
This technology enables the transducer to quickly reach its resonant frequency, improving the frequency tracking efficiency and stability of the ultrasound therapy device and avoiding problems such as weak local search capability or too narrow global search range.
Smart Images

Figure CN121978900A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of control technology for ultrasound therapy devices, and specifically to a frequency tracking method, system, device, and medium for ultrasound therapy devices. Background Technology
[0002] In the clinical application of portable ultrasound therapy devices, the resonant frequency of the transducer often drifts due to factors such as temperature rise, load changes, and differences in tissue acoustic impedance. To avoid problems such as reduced output power and reduced acoustic energy utilization caused by resonant frequency shift, frequency tracking technology is usually introduced to stabilize the resonant frequency.
[0003] Traditional frequency tracking methods often employ a fixed-parameter proportional-integral-derivative (PID) algorithm, adjusting the frequency by detecting the phase difference between the transducer voltage and current. Although this method is simple in structure and easy to implement, its fixed control parameters make it difficult to adapt to the nonlinear characteristics of the system and environmental changes. It is prone to problems such as slow response speed, large steady-state error, and getting trapped in local optima, making it difficult to achieve fast and stable resonant frequency locking.
[0004] It should be noted that the transducer is the core component of an ultrasonic therapy device that converts electrical energy into ultrasonic waves. Its electrical characteristics can be equivalent to an RLC (resistor-inductor-capacitor) circuit. In an RLC equivalent circuit, when the input frequency equals the transducer's natural resonant frequency, the inductive reactance and capacitive reactance cancel each other out, and the total impedance of the circuit is the equivalent resistance (exhibiting "pure resistivity"). In a purely resistive circuit, the current and voltage are completely synchronized, i.e., the phase difference is zero. At this point, the impedance in the circuit is minimal, and the electrical energy input to the transducer can be converted into ultrasonic waves to the maximum extent. This is the ideal working state of an ultrasonic therapy device. Therefore, when performing frequency tracking of an ultrasonic therapy device, the phase difference between voltage and current is used as the basis. Summary of the Invention
[0005] The purpose of this invention is to provide a frequency tracking method, system, device and medium for an ultrasonic therapy device. By using a particle swarm optimization algorithm to determine the values of each parameter in the PID algorithm, the problem of difficulty in quickly locking the resonant frequency due to the fixed parameter values in existing PID algorithms is solved.
[0006] This invention is achieved through the following technical solution:
[0007] The first aspect of this application provides a frequency tracking method for an ultrasound therapy device, the method comprising:
[0008] Monitor the phase difference between the current and voltage signals of the transducer;
[0009] When the phase difference deviates from a preset threshold, the following operation is performed to determine the driving frequency of the transducer;
[0010] The optimal solution is determined by a particle swarm optimization algorithm. In each iteration, the particle swarm optimization algorithm updates the inertia weight and learning factor based on a preset parameter update rule. The optimal solution is characterized by: the values of each parameter of the proportional-integral-differential algorithm used to determine the driving increment of the driving frequency; and the objective function used to evaluate the quality of particle positions, which is determined based on the phase difference.
[0011] Based on the optimal solution, the driving increment of the driving frequency is determined by the proportional-integral-differential algorithm;
[0012] The driving frequency of the transducer is determined based on the driving increment and the current driving frequency.
[0013] In one feasible implementation, the parameter update rule specifically includes:
[0014] The value of the inertia weight decreases linearly with the increase of the number of iterations;
[0015] The learning factors include a first learning factor and a second learning factor, and the value of the first learning factor decreases linearly with the increase of the number of iterations, while the value of the second learning factor increases linearly with the increase of the number of iterations.
[0016] In one feasible implementation, the objective function is specifically the root mean square of the phase error measured within a preset time window;
[0017] The phase error is the deviation of the phase difference from the desired phase.
[0018] In one feasible implementation, the driving increment is represented as:
[0019] The proportional coefficient, integral coefficient, and derivative coefficient of the proportional-integral-differential algorithm are weighted sums of the first-order backward difference of the phase error at three consecutive sampling times, the phase error at the current sampling time, and the second-order backward difference of the phase error, respectively.
[0020] The phase error is the deviation of the phase difference from the desired phase.
[0021] In one feasible implementation, the phase difference between the current signal and the voltage signal of the monitoring transducer includes:
[0022] The current and voltage signals of the transducer are obtained separately through the phase detector circuit;
[0023] The zero-crossing comparator of the phase detector circuit converts the current signal and voltage signal into square wave signals respectively.
[0024] Based on the converted square wave signal, the phase difference between the current signal and the voltage signal is determined.
[0025] In one feasible implementation, the driving frequency is generated by a driving circuit, which includes an ultrasonic half-bridge driving circuit and a T-type impedance matching network; the driving circuit receives square waves and PWM waves respectively, and outputs a driving frequency to drive the transducer.
[0026] A second aspect of this application provides a frequency tracking system for an ultrasound therapy device, the system comprising:
[0027] The monitoring module is used to monitor the phase difference between the current and voltage signals of the transducer.
[0028] When the phase difference deviates from a preset threshold, the main control module performs the following operation to determine the driving frequency of the transducer;
[0029] The optimal solution is determined by a particle swarm optimization algorithm. In each iteration, the particle swarm optimization algorithm updates the inertia weight and learning factor based on a preset parameter update rule. The optimal solution is characterized by: the values of each parameter of the proportional-integral-differential algorithm used to determine the driving increment of the driving frequency; and the objective function used to evaluate the quality of particle positions, which is determined based on the phase difference.
[0030] Based on the optimal solution, the driving increment of the driving frequency is determined by the proportional-integral-differential algorithm;
[0031] The driving frequency of the transducer is determined based on the driving increment and the current driving frequency.
[0032] In one feasible implementation, the system further includes a driving circuit, which comprises an ultrasonic half-bridge driving circuit and a T-type impedance matching network; the driving circuit receives square waves and PWM waves respectively, and outputs a driving frequency to drive the transducer.
[0033] A third aspect of this application provides an electronic device, including: a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the above-described method.
[0034] A fourth aspect of this application provides a storage medium, comprising: storing a program or instructions on the storage medium, wherein the program or instructions, when executed by a processor, implement the steps of the above-described method.
[0035] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0036] This application embodiment uses a particle swarm optimization algorithm to determine the values of each parameter in the PID algorithm. The particle swarm optimization algorithm updates parameters such as inertia weight and learning factor in each iteration, avoiding situations where the local search capability is too weak or the global search range is too narrow during the particle swarm optimization process. Therefore, the parameter values of the PID algorithm determined by the particle swarm optimization algorithm can enable the transducer to quickly reach the resonant frequency, solving the problem that existing PID algorithms have difficulty in quickly locking the resonant frequency due to fixed parameter values. Attached Figure Description
[0037] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0038] Figure 1 A flowchart illustrating a frequency tracking method for an ultrasound therapy device provided in this application embodiment;
[0039] Figure 2 This is a schematic diagram of the phase detector circuit in a frequency tracking method for an ultrasonic therapy device provided in an embodiment of this application;
[0040] Figure 3 A schematic diagram illustrating the execution process of a particle swarm optimization algorithm in a frequency tracking method for an ultrasound therapy device provided in this application embodiment;
[0041] Figure 4 This application provides a schematic diagram of the hardware architecture used in a frequency tracking method for an ultrasound therapy device.
[0042] Figure 5 A schematic diagram of the circuit structure of the signal generation module in a frequency tracking method of an ultrasonic therapy device provided in an embodiment of this application;
[0043] Figure 6 This application provides a schematic diagram of the power supply circuit in a frequency tracking method for an ultrasonic therapy device.
[0044] Figure 7 This is a schematic diagram of the drive circuit in a frequency tracking method for an ultrasonic therapy device provided in an embodiment of this application;
[0045] Figure 8 A framework diagram of the PSO-PID algorithm in a frequency tracking method for an ultrasound therapy device provided in this application embodiment;
[0046] Figure 9 This application provides a schematic diagram of the structure of a frequency tracking system for an ultrasonic therapy device;
[0047] Figure 10 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments and accompanying drawings. The illustrative embodiments and descriptions of this invention are for explanation only and are not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments in this application without creative effort are within the scope of protection of this application.
[0049] As will be known to those skilled in the art, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0050] The terms “comprising” and “having”, and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not expressly listed or inherent to such process, method, product, or apparatus.
[0051] Example 1:
[0052] Embodiment 1 of this application provides a frequency tracking method for an ultrasonic therapy device, which solves the problem that existing PID algorithms are difficult to quickly achieve resonant frequency locking due to fixed parameter values.
[0053] The subject executing this method can be any computing device capable of implementing the method, such as a server, mobile phone, personal computer, smart wearable device, smart robot, etc.
[0054] Furthermore, the embodiments of this application do not limit the execution order of different steps. When using the method provided in the embodiments of this application, the execution order of different steps can be adjusted according to actual needs.
[0055] For ease of description, the following uses a frequency tracking device of an ultrasound therapy instrument as the subject of this method to provide a detailed description of the method provided in this application embodiment.
[0056] like Figure 1 The diagram shown is a flowchart illustrating the specific implementation of a frequency tracking method for an ultrasound therapy device according to an embodiment of this application, including the following steps 11-12:
[0057] Step 11: Monitor the phase difference between the current and voltage signals of the transducer.
[0058] This step is implemented using a phase detector circuit. The phase detector circuit acquires the current and voltage signals of the transducer respectively; the zero-crossing comparator of the phase detector circuit converts the current and voltage signals into square wave signals respectively; based on the converted square wave signals, the phase difference between the current and voltage signals is determined.
[0059] like Figure 2 As shown, the phase detector circuit includes a voltage follower, a zero-crossing comparator, a D flip-flop, and an XOR gate. The voltage follower uses a high-precision LF353 arithmetic logic unit (ALU), which has the advantages of low output voltage signal distortion and strong anti-interference capabilities. The signal acquired by the signal sampling circuit is used to adjust the amplitude of the signal by the high-precision ALU LF353. The zero-crossing comparator LM339 converts the input signal into a 3.3V square wave signal. When the current phase leads the voltage, the D flip-flop 74HC74 outputs "0"; otherwise, it outputs "1". The input signal is passed through an XOR gate 74LS86 to obtain the value 'out'. The phase difference between the current and voltage signals is determined based on the 'flag' output of the D flip-flop 74HC74 and the 'out' output of the XOR gate 74LS86.
[0060] Step 12: When the phase difference deviates from the preset threshold, execute the PSO-PID algorithm (steps 1201-1203 below) to determine the driving frequency of the transducer.
[0061] Ideally, the phase difference between the current signal and the voltage signal is zero. Typically, to ensure the transducer operates at its resonant frequency, a preset threshold is set to zero; that is, if there is a phase difference between the current signal and the voltage signal, the transducer drive frequency is adjusted.
[0062] Step 1201: Determine the optimal solution using a particle swarm optimization algorithm; the particle swarm optimization algorithm updates the inertia weight and learning factor in each iteration based on a preset parameter update rule; the optimal solution is characterized by: the values of each parameter of the proportional-integral-differential algorithm used to determine the driving increment of the driving frequency; and the objective function used to evaluate the quality of particle positions is determined based on the phase difference.
[0063] Particle Swarm Optimization (PSO) is inspired by the group behavior of flocks of birds and schools of fish. Its basic idea is to treat each candidate solution in the solution space as a "particle". During the search process, the particle remembers its own best position in history and perceives the best position currently found by the group. Under the combined effect of these two "experiences", it continuously adjusts its speed and position to approximate the optimal solution.
[0064] This embodiment improves upon existing particle swarm optimization algorithms to quickly determine the parameter values of a PID algorithm. In this embodiment, each set of parameters (including proportional, integral, and derivative coefficients) in the PID algorithm is treated as a particle. By adjusting the position of the particles in each iteration, the optimal solution is determined, i.e., the parameter values of the PID algorithm are determined.
[0065] like Figure 3 As shown, the specific implementation process of the particle swarm optimization algorithm includes the following steps: Step 1-Step:
[0066] Step 1: Initialize the number of particles, particle dimensions, number of iterations, and initial values for each parameter.
[0067] The number of particles is set based on the device's computing power and real-time requirements. In this embodiment, 20 is selected, which has been verified to achieve better tracking performance while ensuring real-time performance.
[0068] The particle dimension is set based on the number of PID parameters. PID parameters include three parameters: proportional coefficient, integral coefficient, and derivative coefficient. Therefore, the particle dimension is set to 3 dimensions, which can be represented as: .
[0069] The number of iterations can be selected as 20.
[0070] The parameters of the particle swarm optimization algorithm include at least inertia weights. and learning factors (first learning factor) Second learning factor ),initialization: , , .
[0071] Step 2: Based on the value range of the PID parameters or historical value data, determine the initial value of each particle, that is, determine the initial position of the particle;
[0072] Step 3: Update the inertia weight and learning factor according to the preset parameter update rules.
[0073] In the traditional PSO algorithm, the inertia weight is... Learning factor , It is fixed and unchanging, therefore, during system operation, it may lead to situations where the system's local search capability is too weak or the global search range is too narrow. Therefore, in this embodiment, , , Change to linear transformation, let , , It changes dynamically as the number of iterations increases.
[0074] To understand the early behavior of particles, it is necessary to explore them further, therefore... For large values, Slightly higher Slightly lower. Rapid particle convergence is required in the later stages, therefore... For small values, reduce, The parameters are increased to move closer to the optimal group. Based on this, the parameter update rule set in this embodiment is: inertia weight. The value decreases linearly with increasing iteration count; the first learning factor The value of the second learning factor decreases linearly with the increase of the number of iterations. The value increases linearly with the number of iterations.
[0075] It should be noted that the inertia weight and learning factor need to change linearly within a reasonable range. In this embodiment, based on research and experiments, the ranges of each parameter are limited to meet the following conditions:
[0076] .
[0077] The parameter update rules can be specifically expressed as follows:
[0078] , ;
[0079] , ;
[0080] , ;
[0081] In the formula, , , These represent the corresponding values for the current iteration number, where T represents the set iteration number and t is the current iteration number. This will... , , Setting it to follow the iteration count allows the system to escape local optima faster and more stably, improving convergence quality. In the early stages of iteration, taking a large value... ,big ,Small This allows for greater velocity inertia and greater individual diversity. In the later stages of iteration, smaller values are taken. ,Small ,big This allows particles to rely more on collective experience, resulting in more stable convergence. (Fallen) This prevents particles from shrinking too quickly and "sticking" together. It also allows the search radius to shrink naturally over time, reducing later-stage jitter.
[0082] Step 4: Calculate the latest position of the particle and update the optimal solution.
[0083] First, calculate the update rate of particle i:
[0084] ;
[0085] In the formula, , It is the speed after t and t+1 iterations. It is inertial weight. , It is a learning factor. , It is a random parameter between [0,1]. The optimal position for the current group This represents the optimal position for the current individual.
[0086] The latest position of particle i can be represented as:
[0087] ;
[0088] Let be the particle's position at times t and t+1. Let t be the particle velocity at time t+1.
[0089] Based on the particle's latest position, the value of the objective function (fitness function) is calculated. In this embodiment, the objective function for evaluating the quality of the particle's position is determined based on the phase difference; specifically, the objective function is the root mean square of the phase error measured within a preset time window; specifically, it can be:
[0090] Phase difference Represented as: ,in, , and These represent the moments when the current crosses zero, the moments when the voltage crosses zero, and the periods of the current (voltage), respectively.
[0091] With desired phase To control the target, a phase error is constructed, that is, the deviation of the phase difference relative to the desired phase:
[0092] ;
[0093] Design a 10ms time window and calculate the root mean square of the phase error within this time window:
[0094] ;
[0095] Where J is defined as the fitness value of the fitness function, and the smaller the value, the better the tracking effect.
[0096] The latest position of the particle determined above is used in the PID algorithm to obtain the objective function value—fitness value J—corresponding to a time window of 10ms; the fitness value of the latest position of the particle is compared with the historical best value, and the optimal solution between the two is selected as the optimal solution of the particle; based on the optimal solutions of each particle, the global optimal solution for the current iteration number is determined.
[0097] Step 5: Determine whether the global optimal solution at the current iteration number meets the termination condition: the global optimal solution is less than the preset fitness threshold, or the preset number of iterations has been reached; if the termination condition is met, terminate the iteration and output the global optimal solution; if the termination condition is not met, return to step 3 and repeat the iteration process until the termination condition is met.
[0098] Step 1202: Based on the optimal solution, determine the driving increment of the driving frequency using a proportional-integral-differential algorithm.
[0099] The global optimal solution is output to the PID algorithm.
[0100] PID stands for Proportional, Integral, and Differential. It organically combines these three control elements, utilizing the deviation between the controlled variable and the desired variable. Through proportional amplification, deviation accumulation, and deviation rate prediction, it comprehensively regulates the system output. Extensive engineering practice and theoretical research have shown that even when the mathematical model of the controlled object is incomplete or difficult to establish, PID control can achieve relatively ideal control results in terms of steady-state accuracy, dynamic response speed, and disturbance rejection performance. Therefore, it is widely used in various industrial process control systems. Essentially, it involves real-time acquisition of the input deviation, calculation based on the set proportional, integral, and derivative functional relationships, and conversion of the calculation results into the control quantity of the actuator, thereby achieving closed-loop automatic control.
[0101] In this embodiment, the control core uses an STM32 microcontroller, and the controlled system performs discrete sampling with a fixed sampling period, which is a typical discrete-time control system. To facilitate implementation in an embedded processor, reduce computational load, and improve numerical stability, this embodiment uses an incremental PID algorithm. The drive increment used to determine the drive frequency is a weighted sum of the proportional coefficient, integral coefficient, and derivative coefficient of the proportional-integral-derivative algorithm with respect to the first-order backward difference of the phase error at three consecutive sampling times, the phase error at the current sampling time, and the second-order backward difference of the phase error, respectively.
[0102] The specific incremental PID formula is as follows:
[0103] ;
[0104] In the formula: , , These are the proportional, integral, and differential coefficients, respectively. This represents the deviation between the current and the two previous sampling times (in this example, the voltage and current phase error). , These represent the first-order backward difference of the phase error and the second-order backward difference of the phase error, respectively. This represents the increment of the driving frequency within the current sampling period, and the actual output satisfies... Using the incremental approach described above, only a limited number of historical deviations and the previous control output need to be saved to complete the calculation. This reduces the consumption of storage space and computing resources, and avoids the risk of integral saturation and overflow caused by the long-term accumulation of absolute control quantities in positional PID controllers. This can be achieved through software adjustments. Setting upper and lower limits, combined with appropriate constraints on the integral element, can effectively suppress abrupt changes in the control quantity and improve the robustness and dynamic response performance of the system under complex operating conditions such as load disturbances and parameter changes. It is especially suitable for achieving accurate and stable closed-loop control on resource-constrained microcontroller platforms such as STM32.
[0105] Step 1203: Determine the driving frequency of the transducer based on the driving increment and the current driving frequency.
[0106] The sum of the current driving frequency and the driving increment calculated in step 1202 is calculated as the driving frequency of the transducer, which is output to the transducer through the driving circuit.
[0107] The hardware structure of this embodiment will be described below.
[0108] like Figure 4 As shown, the hardware structure for implementing the frequency tracking method in this embodiment includes a main control module, a signal generation module, a power supply circuit, a drive circuit, and the phase detector circuit mentioned above.
[0109] The main control module uses the STM32F405RGT6 as the main control chip. The STM32F405RGT6 is a 32-bit microcontroller based on the high-performance ARM Cortex-M4 core manufactured by STMicroelectronics. It has three high-precision ADCs (Analog-to-Digital Converters), which meet the requirements of this embodiment. When the system starts up, the drive signal generator module generates two 1MHz square waves, i.e., DDS (Direct Digital Synthesis) signals. These are then used by the main control chip to generate two PWM (Pulse Width Modulation) waves, which are simultaneously input into the ultrasonic drive circuit. The ultrasonic power is dynamically adjusted by regulating the duty cycle of the PWM waves.
[0110] like Figure 5 As shown, the signal generation module includes chip U7, model AD9833. This chip is programmable and can achieve high-precision frequency control with an accuracy of 0.004Hz. It also has the advantages of small size and low power consumption. In this embodiment, chip U7 generates a DDS signal (2MHz square wave), which is then divided by a dual D flip-flop chip U5 (to a 1MHz square wave) and output to the drive circuit to drive the ultrasonic therapy device to output the reference frequency (corresponding to the resonant frequency of the ultrasonic therapy device).
[0111] In addition, the signal generation module also includes a high-speed gate driver chip U6. Chip U6 is used to receive PWM signals and DDS signals. When the PWM duty cycle increases, the effective output time of the drive channel is extended; when the PWM duty cycle decreases, the effective output time is shortened. Based on this, an ultrasound drive signal with an adjustable duty cycle can be obtained, realizing multi-mode switching of ultrasound therapy, meeting the power requirements of different treatment modes, and adapting to the interface requirements of AD9833 and subsequent circuits.
[0112] In order to adapt to the power requirements of various components of the ultrasound therapy device, such as Figure 6The diagram shows the power supply circuit of the ultrasound therapy device. The ultrasound therapy system requires 3.3V, 5V, and 12V power supplies to power different modules. In this embodiment, a 12V lithium battery is used for external power, therefore a voltage regulator circuit is needed to convert the external 12V power supply into a suitable voltage for the system. The ultrasound drive circuit requires a stable 12V voltage. Since the external power supply is unstable, a 12V voltage regulator circuit is needed to convert it to a stable 12V voltage. The voltage regulator chip U13 used is an LM7812. Chips such as the AD9833 use 5V power, so the 12V external voltage needs to be converted to 5V. The voltage regulator chip U3 used is an LM7805. The main control chip requires 3.3V power, so a 3.3V voltage regulator circuit is needed to convert the 5V voltage to a stable 3.3V voltage. The voltage regulator chip U4 used is a TLV70033.
[0113] like Figure 7 As shown, the driving circuit used in this embodiment is a half-bridge driving circuit. The driving circuit is the core that provides precise electrical excitation to the transducer, and its design directly affects the intensity, frequency, and waveform characteristics of the ultrasonic waves. Essentially, this part of the circuit is a power amplifier circuit, used to amplify the small signal input from the signal generation module, enabling the ultrasonic waves to meet the power, voltage, and current requirements for driving the piezoelectric ceramics of the transducer. The ultrasonic driving circuit used in this embodiment includes a TPS28225 and a CSD88537, a T-type impedance matching network, and an ultrasonic half-bridge driving circuit composed of the TPS28225 and CSD88537. Using integrated chips to build the circuit reduces the size of the driving circuit, minimizes the impact of MOSFET overheating on the overall operation, and results in superior output accuracy.
[0114] The specific working process can be as follows: After the ultrasound therapy device is powered on, the signal generation module generates a DDS signal and sends it to the drive module. Based on the DDS signal, the drive module sends a drive signal to the transducer to drive the output resonant frequency of the transducer. The transducer operates at the corresponding resonant frequency based on the drive signal, converting electrical energy into ultrasound waves for clinical applications. During the operation of the transducer, its voltage and current signals are monitored in real time, and the phase difference between the two is calculated. When the phase difference deviates from the preset threshold, the frequency adjustment (PSO-PID algorithm) process is executed, which is the process in step 12 of this embodiment. Based on the drive frequency determined in step 12, the main control module uses software to adjust the output frequency of the DDS signal to drive the ultrasound transducer.
[0115] In this embodiment, the frequency adjustment process, namely the operation process of the particle swarm optimization algorithm and the PID algorithm, can be executed in the main control module or by setting a separate processor.
[0116] During the operation of the ultrasonic therapy device, the driving frequency of the driving circuit needs to be adjusted in real time to ensure that the transducer always operates at the resonant frequency, so that the acoustic-electric conversion frequency of the ultrasonic transducer reaches its maximum.
[0117] The resonant frequency of a transducer drifts with operating time and temperature changes. Therefore, if a fixed-coefficient PID algorithm is used to dynamically adjust the drive frequency, the tracking efficiency will decrease when the resonant frequency changes due to multiple or unknown reasons. Therefore, a method is needed that can automatically adjust the PID coefficients, dynamically updating the PID algorithm coefficients when the transducer's resonant frequency changes, resulting in higher and more stable system tracking efficiency.
[0118] like Figure 8 As shown, the frequency regulation process can be considered as a two-layer framework. The outer layer uses an improved PSO algorithm to tune the proportional, integral, and derivative coefficients of the PID algorithm; the inner layer PID algorithm determines the phase deviation based on the phase difference between the current and voltage across the transducer. and the current drive frequency Perform closed-loop frequency modulation to obtain the driving frequency, and continue tracking until the phase difference is 0.
[0119] The above is a complete description of the frequency tracking process of the frequency tracking method in this embodiment.
[0120] This application embodiment uses a particle swarm optimization algorithm to determine the values of each parameter in the PID algorithm. The particle swarm optimization algorithm updates parameters such as inertia weight and learning factor in each iteration, avoiding situations where the local search capability is too weak or the global search range is too narrow during the particle swarm optimization process. Therefore, the parameter values of the PID algorithm determined by the particle swarm optimization algorithm can enable the transducer to quickly reach the resonant frequency, solving the problem that existing PID algorithms have difficulty in quickly locking the resonant frequency due to fixed parameter values.
[0121] Example 2:
[0122] To address the problem of difficulty in quickly locking the resonant frequency in existing PID algorithms due to fixed parameter values, this application also provides a frequency tracking system for an ultrasonic therapy device, based on the same inventive concept as Embodiment 1.
[0123] A schematic diagram of the specific structure of the device is shown below. Figure 9 As shown, it includes the following functional units 91-92:
[0124] Monitoring module 91 is used to monitor the phase difference between the current signal and the voltage signal of the transducer.
[0125] The monitoring module is specifically used to: acquire the current signal and voltage signal of the transducer through the phase detector circuit; convert the current signal and voltage signal into square wave signals through the zero-crossing comparator of the phase detector circuit; and determine the phase difference between the current signal and voltage signal based on the converted square wave signal.
[0126] When the phase difference deviates from the preset threshold, the main control module 92 performs the following operation to determine the driving frequency of the transducer;
[0127] The optimal solution is determined using a particle swarm optimization algorithm. In each iteration, the particle swarm optimization algorithm updates the inertia weight and learning factor based on a preset parameter update rule. The optimal solution is characterized by: the values of each parameter in a proportional-integral-differential algorithm (PIA) used to determine the driving increment of the driving frequency; an objective function for evaluating the quality of particle positions determined based on the phase difference; the driving increment of the driving frequency is determined using the PIA based on the optimal solution; and the driving frequency of the transducer is determined based on the driving increment and the current driving frequency.
[0128] This embodiment also includes a driving circuit, which includes an ultrasonic half-bridge driving circuit and a T-type impedance matching network; the driving circuit receives square waves and PWM waves respectively, and outputs a driving frequency to drive the transducer.
[0129] The particle swarm optimization algorithm in this embodiment determines the values of each parameter in the PID algorithm. Furthermore, the particle swarm optimization algorithm updates parameters such as inertia weight and learning factor in each iteration, avoiding situations where the local search capability is too weak or the global search range is too narrow during the particle swarm optimization process. Therefore, based on the parameter values of the PID algorithm determined by the particle swarm optimization algorithm, the transducer can quickly reach the resonant frequency, solving the problem that existing PID algorithms have difficulty in quickly locking the resonant frequency due to fixed parameter values.
[0130] Based on the same inventive concept as the foregoing embodiments of this application, this application also provides a computing device.
[0131] like Figure 10As shown, the computing device includes a memory 1001 and a processor 1002. The memory 1001 can be configured to store various other data to support operation on the electronic device. Examples of such data include instructions for any application or method used to operate on the electronic device. The memory 1001 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0132] The processor 1002, coupled to the memory 1001, is used to execute the computer program stored in the memory 1001 to perform the frequency tracking method of an ultrasound therapy device described in the foregoing embodiments.
[0133] When the processor 1002 executes the computer program to perform a frequency tracking method for an ultrasound therapy device, the values of each parameter in the PID algorithm are determined by the particle swarm optimization algorithm. The particle swarm optimization algorithm updates parameters such as inertia weight and learning factor in each iteration to avoid situations where the local search capability is too weak or the global search range is too narrow during the particle swarm optimization process. Therefore, the parameter values of the PID algorithm determined by the particle swarm optimization algorithm enable the transducer to quickly reach the resonant frequency, solving the problem that existing PID algorithms have difficulty in quickly locking the resonant frequency due to fixed parameter values.
[0134] When the processor 1002 executes the computer program in the memory 1001, in addition to the functions described above, it can also perform other functions, as detailed in the descriptions of the preceding embodiments.
[0135] Furthermore, such as Figure 10 As shown, the computing device also includes other components such as a display 1004, a communication component 1003, a power supply component 1005, and an audio component 1006. Figure 10 The diagram only shows some components and does not mean that the computing device includes only these components. Figure 10 The components shown.
[0136] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a computer, can implement the methods provided in the above embodiments.
[0137] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments.
[0139] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A frequency tracking method for an ultrasonic therapy device, characterized in that, The method includes: Monitor the phase difference between the current and voltage signals of the transducer; When the phase difference deviates from a preset threshold, the following operation is performed to determine the driving frequency of the transducer; The optimal solution is determined by a particle swarm optimization algorithm. In each iteration, the particle swarm optimization algorithm updates the inertia weight and learning factor based on a preset parameter update rule. The optimal solution is characterized by: the values of each parameter of the proportional-integral-differential algorithm used to determine the driving increment of the driving frequency; and the objective function used to evaluate the quality of particle positions, which is determined based on the phase difference. Based on the optimal solution, the driving increment of the driving frequency is determined by the proportional-integral-differential algorithm; The driving frequency of the transducer is determined based on the driving increment and the current driving frequency.
2. The method according to claim 1, characterized in that, The parameter update rules specifically include: The value of the inertia weight decreases linearly with the increase of the number of iterations; The learning factors include a first learning factor and a second learning factor, and the value of the first learning factor decreases linearly with the increase of the number of iterations, while the value of the second learning factor increases linearly with the increase of the number of iterations.
3. The method according to claim 1, characterized in that, The objective function is specifically the root mean square of the phase error measured within a preset time window; The phase error is the deviation of the phase difference from the desired phase.
4. The method according to claim 1, characterized in that, The driving increment is represented as: The proportional coefficient, integral coefficient, and derivative coefficient of the proportional-integral-differential algorithm are weighted sums of the first-order backward difference of the phase error at three consecutive sampling times, the phase error at the current sampling time, and the second-order backward difference of the phase error, respectively. The phase error is the deviation of the phase difference from the desired phase.
5. The method according to claim 1, characterized in that, The phase difference between the current signal and voltage signal of the monitoring transducer includes: The current and voltage signals of the transducer are obtained separately through the phase detector circuit; The zero-crossing comparator of the phase detector circuit converts the current signal and voltage signal into square wave signals respectively. Based on the converted square wave signal, the phase difference between the current signal and the voltage signal is determined.
6. The method according to claim 1, characterized in that, The driving frequency is generated by a driving circuit, which includes an ultrasonic half-bridge driving circuit and a T-type impedance matching network. The driving circuit receives square waves and PWM waves respectively and outputs a driving frequency to drive the transducer.
7. A frequency tracking system for an ultrasonic therapy device, characterized in that, The system includes: The monitoring module is used to monitor the phase difference between the current and voltage signals of the transducer. When the phase difference deviates from a preset threshold, the main control module performs the following operation to determine the driving frequency of the transducer; The optimal solution is determined by a particle swarm optimization algorithm. In each iteration, the particle swarm optimization algorithm updates the inertia weight and learning factor based on a preset parameter update rule. The optimal solution is characterized by: the values of each parameter of the proportional-integral-differential algorithm used to determine the driving increment of the driving frequency; and the objective function used to evaluate the quality of particle positions, which is determined based on the phase difference. Based on the optimal solution, the driving increment of the driving frequency is determined by the proportional-integral-differential algorithm; The driving frequency of the transducer is determined based on the driving increment and the current driving frequency.
8. The system according to claim 7, characterized in that, The system also includes a drive circuit, which comprises an ultrasonic half-bridge drive circuit and a T-type impedance matching network; the drive circuit receives square waves and PWM waves respectively, and outputs a drive frequency to drive the transducer.
9. An electronic device, characterized in that, include: A processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method as claimed in any one of claims 1-6.
10. A storage medium, characterized in that, include: The storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1-6.