An impedance matching method based on dynamic frequency tracking of ultrasonic piezoelectric transducer
By using voltage and current phase difference feedback and fuzzy PID control algorithm in ultrasonic piezoelectric transducer, the excitation frequency is dynamically adjusted, which solves the impedance matching problem caused by resonant frequency drift, and improves the performance and stability of ultrasonic equipment.
Patent Information
- Application Number
- CN202411163144.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-08-23
AI Technical Summary
The resonant frequency of ultrasonic piezoelectric transducers is susceptible to factors such as temperature changes, resulting in a decrease in impedance matching accuracy and affecting the working performance and stability of ultrasonic equipment.
Using the frequency dynamic tracking method based on ultrasonic piezoelectric transducer, by obtaining the voltage and current phase difference as the feedback amount of frequency adjustment, combining the fuzzy PID control algorithm and the segmented trapezoid membership function, the excitation frequency is dynamically adjusted to match the resonant frequency to achieve impedance dynamic matching.
It improves impedance matching accuracy, enhances the response speed and accuracy of frequency tracking, reduces energy losses, and ensures the stable operation of ultrasonic equipment.
Smart Images

Figure CN118663538B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and in particular to an impedance matching method based on dynamic frequency tracking of an ultrasonic piezoelectric transducer. Background Art
[0002] Ultrasonic technology has been widely used in industry, medicine, military and other fields due to its unique advantages. As the core component of the ultrasonic system, the performance of the piezoelectric transducer directly affects the working effect of the ultrasonic equipment. In order to achieve efficient transmission and conversion of ultrasonic energy, the impedance matching of the transducer is crucial. Ideally, the best energy transmission effect can be achieved when the resonant frequency of the transducer matches the excitation frequency of the ultrasonic generator.
[0003] However, in practical applications, the resonant frequency of the transducer is not constant, but will drift with changes in working environment temperature, load status, etc. When the resonant frequency of the transducer does not match the excitation frequency, it will lead to increased energy reflection and loss, reduced impedance matching accuracy, and seriously affect the working performance and stability of the ultrasonic equipment.
[0004] At present, there are many solutions to the transducer impedance matching problem. Among them, the more common one is to use an inductor-capacitor (LC) matching circuit to compensate for the offset of the transducer resonant frequency by adjusting the value of the inductor or capacitor. However, since the LC element itself is easily affected by factors such as temperature and vibration, it is difficult to adapt to dynamically changing working conditions. Another idea is to integrate impedance conversion devices, such as transformers, autotransformers, etc., at the transducer end or generator end to achieve impedance matching by changing the conversion ratio. However, this method will increase the size and cost of the system, and the matching accuracy and scope of application are also limited.
[0005] In addition, some studies have attempted to use intelligent algorithms to achieve adaptive impedance matching, such as genetic algorithms, particle swarm algorithms, etc. These algorithms have improved the impedance matching effect to a certain extent by optimizing matching circuit parameters or control strategies. However, the convergence speed and stability of the algorithm still need to be improved, and the real-time and robustness are difficult to meet the needs of dynamic frequency tracking. Summary of the invention
[0006] In view of the problem in the prior art that the resonant frequency of the transducer drifts with temperature, resulting in low impedance matching accuracy, the present application provides an impedance matching method based on dynamic frequency tracking of an ultrasonic piezoelectric transducer. By obtaining the voltage and current phase difference as feedback for frequency regulation, and combining the introduction of the phase difference and its rate of change and the piecewise trapezoidal membership function of acceleration in the fuzzy PID control algorithm, the impedance matching accuracy is improved.
[0007] Technical solution, the purpose of this application is achieved through the following technical solution.
[0008] The present specification provides an impedance matching method based on dynamic frequency tracking of an ultrasonic piezoelectric transducer, including: sampling the voltage and current of an ultrasonic piezoelectric transducer; wherein, the current sampling is performed by connecting a sampling resistor in series with a load circuit of the piezoelectric transducer to convert the current signal into a voltage signal for sampling; amplifying and filtering the obtained voltage sampling signal and current sampling signal; wherein, the amplification process uses a common-phase amplifier circuit, and the filtering process uses an active bandpass filter circuit; the amplified and filtered voltage sampling signal and current sampling signal are converted into a voltage square wave signal and a current square wave signal through a zero comparison circuit; wherein, the zero comparison circuit includes a voltage follower and a zero-crossing comparator; the voltage follower is used to isolate the back The invention discloses a method for controlling the phase difference of the voltage square wave signal and the current square wave signal by using a phase comparison circuit to avoid mutual interference; the zero-crossing comparator adopts an LM311N comparator to convert the sine wave into a square wave; the phase difference pulse signal of the voltage square wave signal and the current square wave signal is obtained by using a phase comparison circuit; wherein the voltage square wave signal is connected to the in-phase end of the phase comparison circuit; the current square wave signal is connected to the inverting end of the phase comparison circuit; the phase difference digital quantity of the phase difference pulse signal is calculated as the feedback quantity of the frequency adjustment; according to the obtained phase difference digital quantity, the output of the excitation frequency of the ultrasonic signal source is controlled by a frequency adjustment algorithm, and the excitation frequency is adjusted to be consistent with the resonant frequency of the piezoelectric transducer; the above steps are repeated to make the excitation frequency and the resonant frequency of the piezoelectric transducer change synchronously, and the impedance is dynamically matched.
[0009] Among them, the in-phase amplifier circuit: an amplifier circuit whose output signal does not change phase relative to the input signal. It is used to amplify voltage or current signals and increase the amplitude of the signal for subsequent processing. Common in-phase amplifier circuits include non-inverting amplifiers, differential amplifiers, etc. Active bandpass filter circuit: a bandpass filter circuit implemented using active devices (such as operational amplifiers). It allows signals within a specific frequency range to pass through, while attenuating or filtering out signals outside the range. It is often used to extract specific frequency components and suppress noise interference. The zero comparison circuit is a circuit that compares the input signal with the zero level and outputs a high level or a low level. It can realize the conversion from sine wave to square wave, as well as the zero crossing detection of the signal. The zero comparison circuit is usually composed of a comparator and an auxiliary circuit. LM311N comparator: a high-speed voltage comparator chip that can compare two analog voltage signals and output a digital level signal. It has the characteristics of fast speed, small delay, high sensitivity, etc., and is suitable for signal processing, pulse generation, etc. Voltage follower: an operational amplifier circuit with a gain of 1, and the output voltage always follows the input voltage change. It has the characteristics of high input impedance and low output impedance, and is often used for signal buffering, impedance matching, isolation, etc. Excitation frequency: The frequency of the alternating electrical signal applied to the piezoelectric transducer. By adjusting the excitation frequency, the vibration state of the piezoelectric transducer can be controlled to achieve efficient transmission and conversion of energy. Resonance frequency: The vibration frequency of the piezoelectric transducer in the resonant state. At the resonant frequency, the impedance of the piezoelectric transducer is the smallest, the vibration amplitude is the largest, and it can most effectively convert electrical energy into mechanical energy. The resonant frequency depends on the material properties and structural dimensions of the piezoelectric transducer.
[0010] Further, the center frequency of the active bandpass filter circuit is set to the operating frequency of the ultrasonic transducer. Among them, in the filter circuit, the center frequency refers to the frequency point with the minimum amplitude attenuation (or maximum gain) on the frequency response curve of the filter. For a bandpass filter, the center frequency is located at the center of the passband, and the distances from the cutoff frequencies on both sides to the center frequency are equal. The center frequency determines the frequency selection characteristics of the filter, that is, which frequency range of signals are allowed to pass. In the active bandpass filter circuit, the center frequency can be set by adjusting the parameters of the active device (such as an operational amplifier) and the resistance and capacitance values of the peripheral circuit. Common adjustment methods include changing the resistance value, the capacitance value, or using components such as variable resistors and variable capacitors. By adjusting the center frequency, the passband of the filter can be matched with the required signal frequency range, and the interference of other frequency components can be filtered out. The operating frequency refers to the vibration frequency of the ultrasonic transducer in the actual working state. An ultrasonic transducer is a device that converts electrical energy into mechanical vibration energy using the piezoelectric effect or the magnetostrictive effect. When an alternating electric field of a certain frequency is applied to the transducer, the transducer will generate mechanical vibrations of the corresponding frequency and radiate ultrasonic waves to the surrounding medium.
[0011] Furthermore, the obtained voltage sampling signal and current sampling signal are amplified, including: the amplification process adopts a common-phase amplifier circuit, which is composed of an OPA846 operational amplifier; the common-phase input terminal of the OPA846 operational amplifier is connected to the voltage sampling signal or the current sampling signal, and the inverting input terminal is connected to a feedback circuit composed of a resistor and a potentiometer; the amplification factor is changed by adjusting the potentiometer so that the amplification factors of the voltage sampling signal and the current sampling signal are the same to maintain the phase relationship between the voltage sampling signal and the current sampling signal; the output terminal of the OPA846 operational amplifier outputs the amplified voltage sampling signal and the current sampling signal.
[0012] Among them, OPA846 is a high-speed, high-precision operational amplifier produced by Texas Instruments. It is an integrated circuit chip with high-performance analog circuits integrated inside, which can amplify, filter, buffer and other processing of input voltage signals. In the non-inverting amplifier circuit, the non-inverting input terminal of the OPA846 operational amplifier is connected to the signal to be amplified (such as a voltage sampling signal or a current sampling signal), and the inverting input terminal is connected to the output terminal of the operational amplifier through a feedback circuit (composed of a resistor and a potentiometer). By adjusting the potentiometer, the size of the feedback resistor can be changed, thereby adjusting the gain of the amplifier circuit.
[0013] Furthermore, a phase comparison circuit is used to obtain a phase difference pulse signal between a voltage square wave signal and a current square wave signal, including: the phase comparison circuit uses an LM311N comparator; the voltage square wave signal is connected to the same-phase input terminal of the LM311N comparator, and the current square wave signal is connected to the inverting input terminal of the LM311N comparator; the output terminal of the LM311N comparator is connected to a pull-up resistor, and when the voltage square wave signal leads the current square wave signal, the LM311N comparator outputs a high-level pulse, indicating that the piezoelectric transducer load is inductive; otherwise, the LM311N comparator outputs a low-level pulse, indicating that the piezoelectric transducer load is capacitive; the high-level pulse and the low-level pulse output by the LM311N comparator form a phase difference pulse signal.
[0014] Among them, in an AC circuit, if the phase of the current lags behind the phase of the voltage, the circuit is said to be inductive. The impedance of an inductive element such as an inductor increases with the increase of frequency, which will cause the current to lag behind the voltage in the circuit. An inductive load will cause a certain delay in the current waveform relative to the voltage waveform. In an AC circuit, if the phase of the current leads the phase of the voltage, the circuit is said to be capacitive. The impedance of a capacitive element such as a capacitor decreases with the increase of frequency, which will cause the current to lead the voltage in the circuit. A capacitive load will cause a certain advance in the current waveform relative to the voltage waveform. In an AC circuit, if the phase of one signal is ahead of the phase of another signal, the signal is said to lead the other signal. The magnitude of the advance can be expressed by a phase angle, usually in degrees or radians. When the piezoelectric transducer load is capacitive, the current signal will lead the voltage signal. In a digital circuit, a high-level pulse refers to a pulse signal whose voltage amplitude reaches the high-level threshold of the logic circuit. The high level is usually close to the power supply voltage, indicating a logical "1" state. In the LM311N comparator, when the voltage at the non-inverting input is higher than that at the inverting input, a high level pulse will be generated at the output. In digital circuits, a low level pulse refers to a pulse signal with a voltage amplitude close to the ground potential. The low level is usually close to 0V, indicating a logical "0" state. In the LM311N comparator, when the voltage at the non-inverting input is lower than that at the inverting input, a low level pulse will be generated at the output.
[0015] Furthermore, the phase difference digital quantity of the phase difference pulse signal is calculated, including: connecting the phase difference pulse signal output by the phase comparison circuit to the external interrupt pin of the single-chip microcomputer; setting the external interrupt trigger mode of the single-chip microcomputer to falling edge trigger, and triggering an interrupt when the phase difference pulse signal jumps from a high level to a low level; during the interrupt process, using the timer of the single-chip microcomputer to count the high level duration of the phase difference pulse signal; the counting frequency of the timer is consistent with the clock frequency of the single-chip microcomputer; by setting the pre-division coefficient and the initial counting value of the timer, the phase difference pulse width count value is obtained; at the moment when the phase difference pulse signal jumps from a high level to a low level, the timer count stops, and the phase difference pulse width count value is obtained by reading the value of the timer count register; the phase difference pulse width count value is used as the analog signal input of the A / D converter; the input analog signal is sampled, held and quantized by the successive approximation A / D converter built into the single-chip microcomputer, and the phase difference pulse width count value is converted into the corresponding phase difference digital quantity.
[0016] Among them, the pin on the microcontroller is specifically used to receive external interrupt signals. When the external interrupt pin detects a specific level jump (such as a rising edge or a falling edge), it will trigger the microcontroller to execute the corresponding interrupt service program. Through external interrupts, real-time communication and synchronization between the microcontroller and external devices can be achieved. Microcontroller: A microcomputer system that integrates functional modules such as CPU, RAM, ROM, timer, I / O interface, etc. Microcontrollers are small in size, low in cost, and low in power consumption. They are widely used in embedded systems and industrial control fields. Through programming, microcontrollers can achieve various complex control and data processing tasks. The moment when a signal jumps from a high level to a low level. In digital circuits, the falling edge is usually used as a trigger signal or a synchronous clock. When the external interrupt pin is set to a falling edge trigger, the microcontroller will trigger the interrupt service program when it detects that the input signal jumps from a high level to a low level. In the timer of the microcontroller, the prescaler coefficient is used to reduce the counting frequency of the timer. By dividing the clock frequency of the microcontroller by the prescaler coefficient, the actual counting frequency of the timer can be obtained. Adjusting the pre-scaling coefficient can change the counting cycle of the timer to meet different timing requirements. The duration of the high level in the phase difference pulse signal output by the phase comparison circuit. The phase difference pulse width is proportional to the phase difference between the voltage signal and the current signal. By measuring the pulse width, quantitative information of the phase difference can be obtained. The microcontroller counts the phase difference pulse width through the timer to obtain the phase difference pulse width count value. Analog-to-digital converter, a circuit that converts analog signals into digital signals. The A / D converter obtains a digital quantity corresponding to the amplitude of the analog signal by sampling, quantizing and encoding the analog signal. The successive approximation A / D converter built into the microcontroller can convert the phase difference pulse width count value into a phase difference digital quantity, which is convenient for subsequent digital signal processing. The sample-and-hold circuit samples the input analog signal instantaneously and holds the sampled value after the sampling is completed, providing a stable input signal for the A / D conversion. The performance of the sample-and-hold circuit, such as the sampling rate and the holding time, determines the accuracy and speed of the A / D conversion. The successive approximation A / D converter determines the digital output code bit by bit by comparing with a series of reference voltages. The number of bits of quantization coding (such as 8 bits, 12 bits, etc.) determines the resolution of A / D conversion. Through quantization coding, the phase difference pulse width count value is converted into the corresponding phase difference digital quantity.
[0017] Further, according to the obtained phase difference digital quantity, the output of the excitation frequency of the ultrasonic signal source is controlled by a frequency adjustment algorithm, and the excitation frequency is adjusted to be consistent with the resonant frequency of the piezoelectric transducer, including: using a fuzzy PID control algorithm as a frequency adjustment algorithm; adjusting the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm according to the size, change rate and change acceleration of the phase difference digital quantity; when the absolute value of the phase difference digital quantity is greater than a preset first threshold, the proportional coefficient is amplified according to a preset first multiple; otherwise, the proportional coefficient is reduced according to a preset second multiple; when the change rate of the phase difference digital quantity is greater than a preset second threshold, the differential coefficient is amplified according to a preset third multiple; otherwise, the differential coefficient is reduced according to a preset fourth multiple; when the change acceleration of the phase difference digital quantity is greater than a preset third threshold, the integral coefficient is amplified according to a preset fifth multiple; otherwise, the integral coefficient is reduced according to a preset sixth multiple; and a piecewise trapezoidal membership function is used to fuzzy process the phase difference digital quantity, the change rate of the phase difference digital quantity and the change acceleration of the phase difference digital quantity to obtain the corresponding membership degree.
[0018] Among them, the setting of the first threshold: the first threshold is used to determine whether the absolute value of the phase difference digital quantity is large, so as to decide whether to enlarge or reduce the proportional coefficient. The setting of the first threshold needs to take into account the quality factor, resonant frequency range and required frequency tracking accuracy of the piezoelectric transducer. Preferably, the first threshold is set to 10% of the full scale of the phase difference digital quantity. The second threshold is used to determine whether the rate of change of the phase difference digital quantity is large, so as to decide whether to enlarge or reduce the differential coefficient. The setting of the second threshold needs to take into account the resonant frequency change rate of the piezoelectric transducer and the response speed of the system. Preferably, the second threshold is set to 1% of the full scale of the phase difference digital quantity. The setting of the third threshold: the third threshold is used to determine whether the acceleration of the change of the phase difference digital quantity is large, so as to decide whether to enlarge or reduce the integral coefficient. The setting of the third threshold needs to take into account the acceleration of the resonant frequency change of the piezoelectric transducer and the stability of the system. Preferably, the third threshold is set to 0.1% of the full scale of the phase difference digital quantity.
[0019] Furthermore, it also includes: according to preset fuzzy reasoning rules, fuzzy reasoning is performed on the membership of the phase difference digital quantity, the membership of the change rate of the phase difference digital quantity, and the membership of the change acceleration of the phase difference digital quantity to obtain the membership of the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm; the centroid method is used to defuzzify the membership of the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm to obtain the adaptively adjusted proportional coefficient, integral coefficient and differential coefficient; the adaptively adjusted proportional coefficient, integral coefficient and differential coefficient are substituted into the PID control algorithm, and the phase difference digital quantity is used as input to calculate the frequency adjustment value; the frequency adjustment value is converted into a frequency control word of a DDS direct digital frequency synthesizer, and the DDS direct digital frequency synthesizer is controlled to output an excitation signal with a frequency corresponding to the frequency control word, so as to dynamically adjust the excitation frequency of the piezoelectric transducer.
[0020] Among them, in fuzzy control, the language rules used to describe the relationship between input variables and output variables. Fuzzy reasoning rules usually take the form of "IF-THEN", such as "IF the phase difference digital quantity is positive AND the rate of change of the phase difference digital quantity is positive THEN the proportional coefficient is large". By setting a series of fuzzy reasoning rules, the membership of the output variable can be inferred according to the membership of the input variable to achieve fuzzy control. In fuzzy set theory, it represents the degree of belonging of an element to a fuzzy set. The value range of membership is usually [0, 1], 0 means that it does not belong to the set at all, 1 means that it belongs to the set completely, and values between 0 and 1 mean that it partially belongs to the set. In fuzzy control, the input variable is mapped to the membership of the corresponding fuzzy set through the membership function as the basis of fuzzy reasoning. The process of converting the membership of the input variable to the membership of the output variable according to the fuzzy reasoning rules. Commonly used fuzzy reasoning methods include Mamdani reasoning and Sugeno reasoning. In the fuzzy PID control algorithm, through fuzzy reasoning, according to the phase difference digital quantity, the rate of change of the phase difference digital quantity and the degree of membership of the change acceleration, the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm are obtained. A control algorithm that combines fuzzy control with PID control.
[0021] Through fuzzy reasoning, the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm are adaptively adjusted according to the input and output states of the system to achieve better control performance. The fuzzy PID control algorithm has strong robustness and adaptability, and can effectively handle nonlinear, time-varying and uncertain systems. A commonly used fuzzy control defuzzification method. By calculating the barycentric coordinates of the fuzzy set, the fuzzy quantity is converted into an accurate quantity. In the fuzzy PID control algorithm, the barycentric method is used to defuzzify the membership of the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm to obtain the adaptively adjusted control parameters. DDS direct digital frequency synthesizer: a device that uses digital technology to generate a sinusoidal signal with arbitrary frequency and controllable phase. DDS converts the digital frequency control word into an analog sinusoidal signal output through components such as accumulators, phase mapping, waveform memory and D / A converters. By changing the frequency control word, the frequency can be accurately adjusted. DDS has the advantages of high frequency resolution, fast conversion speed and continuous phase, and is widely used in communications, radar, instrumentation and other fields. In a DDS direct digital frequency synthesizer, the digital quantity used to control the frequency of the output signal. The number of bits in the frequency control word determines the frequency resolution of the DDS. The higher the number of bits, the smaller the adjustable frequency step.
[0022] Furthermore, a piecewise trapezoidal membership function is used to perform fuzzy processing on the phase difference digital quantity, the rate of change of the phase difference digital quantity and the acceleration of the change of the phase difference digital quantity to obtain a corresponding membership degree, including: determining the domain range of the phase difference digital quantity, the rate of change of the phase difference digital quantity and the acceleration of the change of the phase difference digital quantity; dividing the domain range into multiple fuzzy subsets; for each fuzzy subset, a piecewise trapezoidal membership function is used to represent the corresponding membership function, and the piecewise trapezoidal membership function contains four parameters, which are the left bottom boundary, the upper left boundary, the upper right boundary and the right bottom boundary of the trapezoid; according to the size of the phase difference digital quantity, the domain range of the phase difference digital quantity, the rate of change of the phase difference digital quantity and the acceleration of the change of the phase difference digital quantity is determined. Determine the corresponding fuzzy subset, substitute the phase difference digital quantity into the piecewise trapezoidal membership function corresponding to the determined fuzzy subset, and calculate the membership of the phase difference digital quantity; determine the corresponding fuzzy subset according to the magnitude of the rate of change of the phase difference digital quantity, substitute the phase difference digital quantity into the piecewise trapezoidal membership function corresponding to the determined fuzzy subset, and calculate the membership of the rate of change of the phase difference digital quantity; determine the corresponding fuzzy subset according to the magnitude of the acceleration of change of the phase difference digital quantity, substitute the phase difference digital quantity into the piecewise trapezoidal membership function corresponding to the determined fuzzy subset, and calculate the membership of the acceleration of change of the phase difference digital quantity.
[0023] Among them, in fuzzy set theory, a fuzzy set can be divided into multiple fuzzy subsets, each of which represents the value range of a language variable. For example, the domain of the phase difference digital quantity is divided into fuzzy subsets such as "negative large", "negative medium", "negative small", "zero", "positive small", "positive medium", and "positive large". Each fuzzy subset corresponds to a membership function, which represents the degree of membership of the input variable to the subset. Through the division of fuzzy subsets, continuous input variables can be converted into discrete language descriptions, which is convenient for fuzzy reasoning. In the piecewise trapezoidal membership function, the boundary value of the bottom left side of the trapezoid. For a fuzzy subset, the left bottom boundary indicates that the input variable does not belong to the lower limit value of the subset at all. When the input variable is less than the left bottom boundary, its membership is 0. The setting of the left bottom boundary determines the starting position and degree of fuzzification of the fuzzy subset. In the piecewise trapezoidal membership function, the boundary value of the upper left side of the trapezoid. For a fuzzy subset, the upper left boundary indicates that the input variable begins to completely belong to the lower limit value of the subset. When the input variable is greater than or equal to the upper left boundary, its membership is 1. The setting of the upper left boundary determines the starting position of the core area of the fuzzy subset. In the piecewise trapezoidal membership function, the boundary value of the upper right side of the trapezoid. For a fuzzy subset, the upper right boundary indicates that the input variable no longer completely belongs to the upper limit of the subset. When the input variable is less than or equal to the upper right boundary, its membership is 1. The setting of the upper right boundary determines the ending position of the core area of the fuzzy subset. In the piecewise trapezoidal membership function, the boundary value of the bottom right side of the trapezoid. For a fuzzy subset, the bottom right boundary indicates that the input variable does not completely belong to the upper limit of the subset. When the input variable is greater than the bottom right boundary, its membership is 0. The setting of the bottom right boundary determines the ending position and degree of fuzzification of the fuzzy subset.
[0024] Furthermore, the piecewise trapezoidal membership function expression is as follows:
[0025]
[0026] in, represents the membership function, x represents the input variable; a represents the left bottom boundary of the trapezoid, that is, the left boundary where the membership is 0; b represents the upper left boundary of the trapezoid, that is, the inflection point where the membership starts to rise from 0; c represents the upper right boundary of the trapezoid, that is, the inflection point where the membership starts to drop from 1; d represents the right bottom boundary of the trapezoid, that is, the right boundary where the membership drops to 0; Represents the rate of change factor, which is used to adjust the sensitivity of the membership function to the rate of change of the input variable; represents the acceleration factor, which is used to adjust the sensitivity of the membership function to the acceleration of the input variable; r represents the rate of change of the input variable x, and a represents the acceleration of the input variable x.
[0027] Furthermore, the calculation formulas for r and a are as follows: , By introducing the rate of change factor k1 and the acceleration factor k2, the piecewise trapezoidal membership function can be made more sensitive to the dynamic changes of the input variables, thereby improving the adaptability and robustness of the fuzzy control. At the same time, by adjusting the values of k1 and k2, the shape of the membership function can be flexibly controlled to adapt to different control requirements.
[0028] Compared with the prior art, the advantages of this application are:
[0029] By sampling, amplifying, filtering, and square-wave converting the voltage and current signals of the ultrasonic piezoelectric transducer, the voltage and current phase difference is obtained as the feedback for frequency adjustment, which can accurately reflect the impedance characteristics and resonant frequency changes of the transducer, provide a reliable frequency adjustment basis for achieving dynamic impedance matching, and avoid the impedance mismatch problem caused by the drift of the transducer resonant frequency.
[0030] The voltage and current sampling signals are amplified and filtered using a common-phase amplifier circuit and an active bandpass filter circuit, which effectively improves the signal-to-noise ratio and amplitude-frequency characteristics of the signal and ensures the accuracy and reliability of phase difference detection.
[0031] The sine wave signal is converted into a square wave signal by a zero-crossing comparator, which simplifies the phase difference detection circuit and reduces the system complexity and cost. At the same time, the subsequent circuit is isolated by a voltage follower to avoid mutual interference and improve the detection accuracy.
[0032] The fuzzy PID control algorithm is used to adaptively adjust the frequency. The parameters of the PID controller are dynamically adjusted according to the size, change rate and acceleration of the phase difference digital quantity, thereby improving the response speed and accuracy of frequency tracking.
[0033] The piecewise trapezoidal membership function of phase difference, its change rate and acceleration is introduced into the fuzzy PID control algorithm. The adaptability of the algorithm to the dynamic change of phase difference is enhanced through the change rate factor and acceleration factor, and the frequency tracking performance is improved.
[0034] The single-chip timer and A / D converter are used to realize the measurement and digital conversion of phase difference pulse signal, avoiding the additional phase difference detection chip and reducing the hardware cost of the system.
[0035] The output of the PID control algorithm is converted into the frequency control word of the DDS direct digital frequency synthesizer, which realizes the precise adjustment of the excitation frequency and synchronizes the change with the resonant frequency of the transducer, ensuring the dynamic impedance matching of both parties, thereby effectively improving the energy conversion efficiency of the transducer and reducing energy loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a circuit diagram of a frequency dynamic tracking module according to some embodiments of this specification;
[0037] Figure 2 It is a voltage and current sampling circuit according to some embodiments of this specification;
[0038] Figure 3 The signal amplification circuit according to some embodiments of the present specification;
[0039] Figure 4 are oscilloscope input and output waveforms of a signal amplifier circuit according to some embodiments of this specification;
[0040] Figure 5 It is a signal filtering circuit according to some embodiments of this specification;
[0041] Figure 6 is the input and output signal of the filter circuit according to some embodiments of this specification;
[0042] Figure 7 A pulse conversion circuit according to some embodiments of this specification;
[0043] Figure 8 is an oscilloscope waveform output of a conversion circuit according to some embodiments of this specification;
[0044] Fig. 9 This is a phase difference detection circuit shown in some embodiments of this specification. DETAILED DESCRIPTION
[0045] The method and system provided in the embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0046] Figure 1 According to the frequency dynamic tracking module circuit diagram shown in some embodiments of this specification, dynamic matching technology is used to compare the matching inductor dynamic adjustment and frequency dynamic tracking schemes, respectively, considering that the hardware circuit complexity of the matching digital inductor dynamic adjustment is high and the implementation difficulty is relatively large. The frequency dynamic tracking technology is selected to realize the dynamic matching of the piezoelectric transducer impedance to solve a series of problems such as impedance detuning caused by the resonant frequency drift of the piezoelectric transducer caused by external environmental factors. The frequency dynamic tracking scheme adopted in this application is based on the phase detection method, that is, by detecting the voltage and current phase information of the piezoelectric transducer loop as the feedback amount, the ultrasonic signal excitation frequency is adjusted by the phase difference between the two, until the phase difference is zero, and the load system reaches a resonant state at this time. Therefore, in order to achieve the purpose of phase detection, it is first necessary to have a voltage and current sampling circuit to collect the voltage and current signals of the transducer, and after sampling, it is necessary to perform signal preprocessing such as amplification and filtering, and finally detect the phase difference information in the voltage and current, and feed it back to the MCU single-chip computer, and the MCU regulates the frequency of the excitation pulse in the ultrasonic signal generation circuit to achieve the effect of frequency dynamic tracking.
[0047] like Figure 2 As shown, in order to sample the voltage and current signals of the ultrasonic piezoelectric transducer, a precision sampling resistor R is connected in series in the transducer load circuit. Due to the limitations of the experimental equipment, it is inconvenient to directly collect the current signal, so the sampling resistor is used to convert the current signal into a voltage signal proportional to it. According to Ohm's law, the voltage drop across the sampling resistor R is proportional to the current flowing through the resistor, that is, U=IR, where U is the voltage drop, I is the current, and R is the resistance of the sampling resistor. The voltage sampling point is set between the piezoelectric transducer and the input end of the impedance matching module to obtain the voltage signal across the transducer. By connecting the voltage sampling point through channel 1 of the oscilloscope, the voltage waveform of the transducer can be directly observed. The current sampling point is located at both ends of the sampling resistor R. The current sampling point is connected by channel 2 of the oscilloscope to measure the voltage drop across the sampling resistor. Since the voltage drop is proportional to the current, the current signal flowing through the transducer can be indirectly reflected by the measured voltage waveform. In order to ensure sampling accuracy and signal integrity, the selected precision sampling resistor should meet the following requirements: high resistance accuracy, error less than 1%; large enough power to withstand the heat loss caused by current; good frequency response, able to accurately present the detailed changes of the current waveform. After obtaining the voltage signal and current signal of the piezoelectric transducer, they are respectively input into the subsequent amplification and filtering circuit and phase detection circuit for signal conditioning and processing. The amplification and filtering circuit is used to increase the amplitude and signal-to-noise ratio of the signal, and the phase detection circuit is used to extract the phase difference between the voltage signal and the current signal, providing feedback basis for subsequent frequency tracking and impedance matching.
[0048] Figure 3 According to the signal amplification circuit shown in some embodiments of this specification, a boost circuit has been used in the ultrasonic signal generation circuit to raise the excitation voltage. However, due to the large impedance of the load system, the current signal collected in the sampling circuit is relatively small, about the millivolt level, which is not convenient for direct comparison and measurement with the voltage signal. Therefore, a signal amplification circuit is designed to amplify the waveform. This circuit uses a common-mode amplifier circuit based on the op amp chip OPA846. According to the common-mode amplifier gain calculation formula, the circuit gain is: , and verified it using the simulation platform. Figure 4 The results shown in the figure show that the input signal is set to 1V and the frequency is 200KHz. The output signal is in phase with the input and is approximately 10V, indicating that the amplifier circuit can work normally.
[0049] The obtained voltage sampling signal and current sampling signal are amplified, including: the amplification process adopts a common-phase amplifier circuit, which is composed of an OPA846 operational amplifier; the common-phase input terminal of the OPA846 operational amplifier is connected to the voltage sampling signal or the current sampling signal, and the inverting input terminal is connected to a feedback circuit composed of a resistor and a potentiometer; the amplification factor is changed by adjusting the potentiometer to make the amplification factors of the voltage sampling signal and the current sampling signal the same, so as to maintain the phase relationship between the voltage sampling signal and the current sampling signal; the output terminal of the OPA846 operational amplifier outputs the amplified voltage sampling signal and the current sampling signal.
[0050] When the circuit is working, the sampled voltage and current signals will inevitably be mixed with some noise interference, which will cause inconvenience to the subsequent signal processing. Therefore, it is necessary to introduce a filter circuit to filter the signal and extract the effective signal before that. According to the composition of the circuit components, it is divided into passive filtering and active filtering. Compared with the passive, the active filter circuit has the advantages of small size and stable performance, and the integrated operational amplifier has high gain and input impedance, low output impedance, and also has the function of signal amplification and isolation buffer. In addition, the amplification factor of the pre-signal amplifier circuit is limited. In order to further amplify the sampled signal for subsequent signal processing operations, an active filter circuit is selected for filtering. In the active filter circuit, according to different functions, it can be divided into four types of filter circuits: low-pass, high-pass, band-pass, and band-stop. Through signal spectrum analysis, it is found that the effective signal is concentrated in the frequency band of about 200KHz, so it is necessary to design an active bandpass filter circuit, such as Figure 5 As shown, generally, C1=C2=C0. According to the circuit principle, the gain of the filter circuit can be obtained as: , where B is the passband width of the filter circuit. The center frequency is: ; Passband width B: ; The quality factor Q is: .
[0051] In the process of debugging the circuit using the simulation platform, it was found that changing the resistance values of R1, R2 and R3 can change the center frequency of the bandpass filter, and changing the resistance values of R4 and Rf will change the bandwidth of the bandpass filter. It was also found that the quantitative relationship between R4 and Rf, that is, the resistance value of Rf cannot be greater than twice the resistance value of R4, otherwise the bandpass filter will lose its filtering function. Based on this conclusion and combined with the results of signal spectrum analysis, the center frequency of the filter circuit is set to 200kHz, and the passband is set to the range of 20kHz before and after, that is, the bandwidth is 40kHz.
[0052] According to the above filtering conditions and formulas, the filtering parameters in the circuit are calculated. To simplify the calculation process, let R1=R31 / 2R2=R, then the center frequency is: Substituting the center frequency and bandwidth into the above formula, we can get R1=R3=800Ω, R2=1.6k, C=lnF, R4=lk, Rf=1.9k.
[0053] The active bandpass filter circuit is drawn in the simulation software, and transient analysis is performed to obtain the input and output signals of the circuit as shown in Figure 6 As shown in the figure, the red waveform is the input signal, which is set to a frequency of 200kHz and a positive and negative oscillation amplitude of 50mV; the green waveform is the filter output, which starts from 0 and reaches a steady state after about 6-7T. It can be seen that the circuit has a fast response speed, and has a steady-state amplitude of about 1.3V, with an amplification factor of about 26. Therefore, the circuit will further amplify the sampled signal to meet the requirements of subsequent signal processing.
[0054] like Figure 7As shown in the figure, the function of the pulse conversion circuit is to convert the voltage signal and current signal after amplification and filtering into a square wave signal, and obtain the phase difference pulse signal between the two through the phase comparison circuit. First, the voltage signal and current signal after amplification and filtering are respectively input into the zero comparison circuit composed of a voltage follower and a zero-crossing comparator. The voltage follower is composed of an operational amplifier, whose input end is connected to the voltage signal or current signal, and whose output end is connected to the input end of the zero-crossing comparator. The voltage follower has the characteristics of high input impedance and low output impedance, and can isolate the signal source and reduce the impact on the signal. The zero-crossing comparator is also implemented using an operational amplifier, whose inverting input end is grounded, and the non-inverting input end is connected to the output of the voltage follower. When the instantaneous value of the input signal is greater than zero, the output of the zero-crossing comparator is high; when the instantaneous value of the input signal is less than zero, the output of the zero-crossing comparator is low. Through the zero-crossing comparator, the sine wave signal is converted into a square wave signal to obtain a voltage square wave signal and a current square wave signal. Next, the voltage square wave signal and the current square wave signal are introduced into the phase comparison circuit to detect the phase difference between the two. The phase comparison circuit uses the LM311N comparator, which has the advantages of high speed, low power consumption, and output compatible with TTL / CMOS. The voltage square wave signal is connected to the non-inverting input terminal (+) of the LM311N comparator, and the current square wave signal is connected to the inverting input terminal (-) of the LM311N comparator. The output terminal of the LM311N comparator is connected to a pull-up resistor. When the voltage at the non-inverting input terminal is higher than the inverting input terminal, the comparator outputs a high level; otherwise, the comparator outputs a low level. According to the phase relationship between the voltage square wave signal and the current square wave signal, the nature of the piezoelectric transducer load can be judged: when the voltage square wave signal leads the current square wave signal, the LM311N comparator outputs a high level pulse, indicating that the piezoelectric transducer load is inductive; when the current square wave signal leads the voltage square wave signal, the LM311N comparator outputs a low level pulse, indicating that the piezoelectric transducer load is capacitive. The high level pulse and low level pulse output by the LM311N comparator are combined to form a phase difference pulse signal, which is used as the feedback for subsequent frequency tracking and impedance matching.
[0055] In order to verify the performance of the pulse conversion circuit, a circuit model was built on the simulation platform and simulation tests were performed. Figure 8 As shown in the figure, the circuit input is set to a sine wave pulse signal source with a frequency of 200kHz and an amplitude of 3V. After passing through the pulse conversion circuit, the oscilloscope output waveform is a square wave pulse, indicating that the conversion circuit can effectively convert the sine wave signal into a square wave signal. At the same time, it can be seen from the simulation results that the circuit has a fast response speed and a small conversion delay, which meets the real-time requirements of phase difference detection.
[0056] like Fig. 9As shown, the purpose of the phase difference detection circuit is to convert the phase difference pulse signal output by the phase comparison circuit into the corresponding phase difference digital quantity, so that the subsequent fuzzy PID control algorithm can adjust the frequency. First, the phase difference pulse signal output by the phase comparison circuit is connected to the external interrupt pin of the single-chip microcomputer. The external interrupt trigger mode of the single-chip microcomputer is set to falling edge trigger, that is, the interrupt is triggered when the phase difference pulse signal jumps from high level to low level. In this way, the high level duration of the phase difference pulse signal can be captured to obtain the phase difference information. In the interrupt service program, the high level duration of the phase difference pulse signal is counted by the timer of the single-chip microcomputer. The counting frequency of the timer is consistent with the clock frequency of the single-chip microcomputer. By setting the pre-scaling coefficient and the initial count value of the timer, the counting accuracy and range of the timer can be adjusted to adapt to phase difference pulse signals of different frequencies. When the phase difference pulse signal jumps from high level to low level, the external interrupt is triggered and the timer starts counting. At the moment when the phase difference pulse signal jumps from low level to high level again, the timer stops counting. By reading the value of the timer count register, the phase difference pulse width count value can be obtained, which is proportional to the high level duration of the phase difference pulse. In order to convert the phase difference pulse width count value into a digital quantity, it is used as the analog signal input of the successive approximation A / D converter built into the microcontroller. The A / D converter samples and holds the input analog signal and converts it into the corresponding digital quantity through quantization coding. The successive approximation A / D converter has the characteristics of fast conversion speed and high precision, which can meet the real-time and precision requirements of phase difference detection.
[0057] The conversion process of the A / D converter is as follows: First, the input analog signal is sampled through the sample-and-hold circuit, and the sampled value is temporarily stored in the holding stage. Then, the amplitude of the analog signal is compared with the reference voltage output by the DAC through comparison and approximation by the successive approximation register (SAR) and the digital-to-analog converter (DAC), and the value of the digital quantity is determined bit by bit. After multiple iterative comparisons, the digital quantity corresponding to the amplitude of the analog signal is obtained, that is, the phase difference digital quantity. Finally, the converted phase difference digital quantity is obtained by reading the data register of the A / D converter. This digital quantity is linearly related to the high-level duration of the phase difference pulse signal, reflecting the impedance characteristics and resonant frequency offset of the piezoelectric transducer.
[0058] After obtaining the phase difference digital quantity, it is necessary to control the excitation frequency output of the ultrasonic signal source through the frequency adjustment algorithm so that it is consistent with the resonant frequency of the piezoelectric transducer, thereby achieving dynamic impedance matching. This embodiment adopts a fuzzy PID control algorithm as a frequency adjustment algorithm, and adaptively adjusts the proportional coefficient, integral coefficient and differential coefficient of the PID controller through parameters such as the size, rate of change and acceleration of the phase difference digital quantity to optimize the control performance. The basic principle of the fuzzy PID control algorithm is to combine classical PID control with fuzzy control, and use fuzzy reasoning rules to adjust the parameters of the PID controller online. First, according to the size, rate of change and acceleration of the phase difference digital quantity, the corresponding fuzzy linguistic variables and membership functions are set, and these parameters are fuzzified into corresponding fuzzy subsets. Then, according to the pre-set fuzzy control rule table, the fuzzified parameters are fuzzy inferenced to obtain the fuzzy control quantity of the PID controller parameters. Finally, the fuzzy control quantity is converted into the actual adjustment value of the proportional coefficient, integral coefficient and differential coefficient through defuzzification.
[0059] When adjusting the parameters of the PID controller, the proportional coefficient (Kp), integral coefficient (Ki) and differential coefficient (Kd) are adaptively adjusted according to the following rules: When the absolute value of the phase difference digital quantity is greater than the preset first threshold value, it indicates that the resonant frequency of the piezoelectric transducer is greatly different from the excitation frequency and needs to be adjusted quickly. At this time, the proportional coefficient is amplified according to the preset first multiple (such as 1.5 times) to speed up the control response speed. On the contrary, when the absolute value of the phase difference digital quantity is less than the first threshold value, it indicates that the frequency difference is small, and the proportional coefficient can be appropriately reduced. The proportional coefficient is reduced according to the preset second multiple (such as 0.8 times) to avoid oscillation caused by excessive adjustment amplitude. When the rate of change of the phase difference digital quantity is greater than the preset second threshold value, it indicates that the frequency difference changes rapidly and the role of differential control needs to be enhanced. At this time, the differential coefficient is amplified according to the preset third multiple (such as 1.2 times) to improve the rapidity and stability of the control system. On the contrary, when the rate of change is less than the second threshold value, the differential coefficient is reduced according to the preset fourth multiple (such as 0.9 times) to weaken the influence of differential control. When the acceleration of the change of the phase difference digital quantity is greater than the preset third threshold, it indicates that the trend of the frequency difference change is obvious, and the role of integral control needs to be enhanced. At this time, the integral coefficient is amplified according to the preset fifth multiple (such as 1.3 times) to speed up the elimination of steady-state errors. On the contrary, when the change acceleration is less than the third threshold, the integral coefficient is reduced according to the preset sixth multiple (such as 0.85 times) to reduce the risk of integral saturation. By adaptively adjusting the parameters of the PID controller according to the above rules, the performance of the control algorithm can be dynamically optimized according to the change of the resonant frequency of the piezoelectric transducer, and the speed and accuracy of frequency tracking can be improved. The adjusted PID controller outputs the frequency adjustment amount to control the excitation frequency output of the ultrasonic signal source, so that it is synchronized with the resonant frequency of the piezoelectric transducer in real time, and finally achieves dynamic impedance matching.
[0060] In the fuzzy PID control algorithm, it is necessary to perform fuzzy processing on the phase difference digital quantity, the rate of change of the phase difference digital quantity and the acceleration of the change of the phase difference digital quantity, and convert them into corresponding membership values. This embodiment adopts a piecewise trapezoidal membership function to implement fuzzy processing. By reasonably setting the parameters of the trapezoidal function, the shape of the membership function can be adjusted according to the characteristics of the input variables to improve the adaptability of fuzzy control. First, determine the domain range of the phase difference digital quantity, the rate of change of the phase difference digital quantity and the acceleration of the change of the phase difference digital quantity, that is, the value range of these variables. According to actual engineering experience and test data, set appropriate domain boundary values. Then, use the piecewise trapezoidal membership function to perform fuzzy processing on the input variables. The expression of the piecewise trapezoidal membership function is as follows: , by introducing a rate of change factor into the linear function and acceleration factor , the slope of the membership function can be dynamically adjusted according to the change of the input variable, making it more sensitive or more insensitive; when the input variable x is in the interval (b, c], the membership remains at 1; when the input variable x is in the interval (c, d), the membership decreases linearly from 1 to 0, and the speed of decrease is also affected by the rate of change and acceleration; when the input variable x is greater than or equal to d, the membership is 0. By reasonably setting the parameters of the piecewise trapezoidal membership function , the shape of the membership function can be adjusted according to the actual control requirements so that it can better reflect the fuzzy characteristics of the input variables. and The value of changes the sensitivity of the membership function to the rate of change and acceleration, thereby achieving adaptive control of different dynamic characteristics. The piecewise trapezoidal membership function is used to perform fuzzy processing on the phase difference digital quantity and its rate of change and acceleration. The shape of the membership function can be adaptively adjusted according to the dynamic characteristics of the input variable, thereby improving the flexibility and adaptability of fuzzy control. By reasonably setting the membership function parameters, the performance of the fuzzy PID control algorithm can be optimized, and efficient frequency tracking control in the dynamic impedance matching of the piezoelectric transducer can be achieved.
[0061] Specifically, in this embodiment, after actual engineering testing and data analysis, the following domain range and parameter settings are obtained: the domain range of the phase difference digital quantity is [-180, 180], and the unit is degree. The piecewise trapezoidal membership function parameters of the phase difference digital quantity are set as follows: a=-180, b=-90, c=90, d=180, k1=0.02, k2=0.01; the domain range of the rate of change of the phase difference digital quantity is [-20, 20], and the unit is degree / second. The piecewise trapezoidal membership function parameters of the rate of change of the phase difference digital quantity are set as follows: a=-20, b=-10, c=10, d=20, k1=0.05, k2=0.02; the domain range of the acceleration of the change of the phase difference digital quantity is [-5, 5], and the unit is degree / second². The piecewise trapezoidal membership function parameters of the change acceleration of the phase difference digital quantity are set as follows: a=-5, b=-2, c=2, d=5, k1=0.1, k2=0.05.
[0062] According to the above parameter settings, the input variables are fuzzified. Taking the digital quantity of phase difference as an example, the current digital quantity of phase difference is 60 degrees, its change rate is 5 degrees per second, and the acceleration is 1 degree per second². Calculate the membership degree of the digital quantity of phase difference. Here, x = 60, r = 5, a = 1; 60 belongs to the interval (b, c], that is, (90, 90], satisfying the condition b < x ≤ c; therefore, the membership degree u(x) of the digital quantity of phase difference is 1. Calculate the membership degree of the change rate of the digital quantity of phase difference. Here, x = 5, r = 1, a = 0.5, 5 belongs to the interval (b, c], that is, (10, 10], satisfying the condition b < x ≤ c, so the membership degree u(x) of the change rate of the digital quantity of phase difference is 1. Calculate the membership degree of the change acceleration of the digital quantity of phase difference. Here, x = 1, r = 0.5, a = 0.2, 1 belongs to the interval (b, c], that is, (2, 2], satisfying the condition b < x ≤ c, so the membership degree u(x) of the change acceleration of the digital quantity of phase difference is 1. In summary, when the digital quantity of phase difference is 60 degrees, the change rate is 5 degrees per second, and the acceleration is 1 degree per second², after fuzzification by the piecewise trapezoidal membership function, the following membership degree values are obtained: the membership degree of the digital quantity of phase difference is 1, the membership degree of the change rate of the digital quantity of phase difference is 1, and the membership degree of the change acceleration of the digital quantity of phase difference is 1. These membership degree values will be used as the inputs of the fuzzy controller. Through fuzzy reasoning and defuzzification, the adjustment amount of the PID controller parameters is generated to achieve adaptive frequency control.
[0063] The universe of discourse is divided into multiple fuzzy subsets; for each fuzzy subset, the corresponding membership function is represented by a piecewise trapezoidal membership function. Taking the digital quantity of phase difference as an example, its universe of discourse [-180, 180] is divided into the following 7 fuzzy subsets: NB (Negative Big), NM (Negative Medium), NS (Negative Small), ZO (Zero), PS (Positive Small), PM (Positive Medium), PB (Positive Big). Each fuzzy subset corresponds to a piecewise trapezoidal membership function, and its parameter settings are as follows:
[0064] Fuzzy subset Left bottom border (a) Upper left border (b) Upper right border (c) Right bottom border (d) NB -180 -180 -135 -90 NM -135 -90 -45 0 NS -90 -45 -10 0 ZO -45 -10 10 45 PS 0 10 45 90 PM 0 45 90 135 PB 90 135 180 180
[0065] The current digital quantity of phase difference is 60 degrees, its change rate is 5 degrees per second, and the acceleration is 1 degree per second². Calculate the membership degree of the digital quantity of phase difference. Here, x = 60. According to the magnitude of the digital quantity of phase difference, it is determined that it belongs to the fuzzy subset PM. Substitute x into the piecewise trapezoidal membership function corresponding to PM: u(x) = (d - x) / (d - c) = (135 - 60) / (135 - 90) = 0.833. Calculate the membership degree of the change rate of the digital quantity of phase difference. Similarly, the universe of discourse [-20, 20] of the change rate of the digital quantity of phase difference is divided into 7 fuzzy subsets: NB, NM, NS, ZO, PS, PM, PB. Each fuzzy subset corresponds to a piecewise trapezoidal membership function, and its parameter settings are as follows:
[0066] Fuzzy subset Left bottom border (a) Upper left border (b) Upper right border (c) Right bottom border (d) NB -20 -20 -15 -10 NM -15 -10 -5 0 NS -10 -5 -1 0 ZO -5 -1 1 5 PS 0 1 5 10 PM 0 5 10 15 PB 10 15 20 20
[0067] x=5, according to the magnitude of the phase difference digital quantity change rate, it is determined that it belongs to the fuzzy subset PM. Substitute x into the piecewise trapezoidal membership function corresponding to PM: u(x)=(xa) / (ba)=(5-0) / (5-0)=1. Calculate the membership of the phase difference digital quantity change acceleration. Similarly, the domain range of the phase difference digital quantity change acceleration [-5, 5] is divided into 7 fuzzy subsets: NB, NM, NS, ZO, PS, PM, PB. Each fuzzy subset corresponds to a piecewise trapezoidal membership function, and its parameters are set as follows:
[0068] Fuzzy subset Left bottom border (a) Upper left border (b) Upper right border (c) Right bottom border (d) NB -5 -5 -3.75 -2.5 NM -3.75 -2.5 -1.25 0 NS -2.5 -1.25 -0.25 0 ZO -1.25 -0.25 0.25 1.25 PS 0 0.25 1.25 2.5 PM 0 1.25 2.5 3.75 PB 2.5 3.75 5 5
[0069] x=1, according to the magnitude of the acceleration of the phase difference digital quantity change, it is determined that it belongs to the fuzzy subset PS. Substitute x into the piecewise trapezoidal membership function corresponding to PS: u(x)=(xa) / (ba)=(1-0) / (0.25-0)=0.8. The phase difference digital quantity, its rate of change and acceleration are fuzzy processed by the piecewise trapezoidal membership function, and the following membership values are obtained: the membership of the phase difference digital quantity is 0.833, corresponding to the fuzzy subset PM, the membership of the phase difference digital quantity change rate is 1, corresponding to the fuzzy subset PM, and the membership of the phase difference digital quantity change acceleration is 0.8, corresponding to the fuzzy subset PS. These membership values reflect the degree of belonging of the input variables in the corresponding fuzzy subsets, which can be used as the input of the fuzzy controller. Through fuzzy reasoning and defuzzification, the adjustment amount of the PID controller parameters is generated to achieve adaptive frequency control.
[0070] According to the preset fuzzy reasoning rules, the membership of the phase difference digital quantity, the membership of the change rate of the phase difference digital quantity and the membership of the change acceleration of the phase difference digital quantity are fuzzy reasoned to obtain the membership of the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm; the domain range and fuzzy subsets of the PID control algorithm parameters are set, and the domain range of the proportional coefficient Kp is [0, 10], which is divided into 5 fuzzy subsets: VS (very small), S (small), M (medium), B (large), VB (very large). The domain range of the integral coefficient Ki is [0, 1], which is divided into 5 fuzzy subsets: VS, S, M, B, VB. The domain range of the differential coefficient Kd is [0, 1], which is divided into 5 fuzzy subsets: VS, S, M, B, VB. Each rule in the fuzzy reasoning rule base is composed of the linguistic variables of the phase difference digital quantity, the change rate of the phase difference digital quantity and the change acceleration of the phase difference digital quantity as the premise, and the linguistic variables of the proportional coefficient, integral coefficient and differential coefficient as the conclusion. Rule 1: If the phase difference digital quantity is PM, the rate of change of the phase difference digital quantity is PM, and the acceleration of the phase difference digital quantity change is PS, then the proportional coefficient is B, the integral coefficient is S, and the differential coefficient is M. Rule 2: If the phase difference digital quantity is PS, the rate of change of the phase difference digital quantity is PS, and the acceleration of the phase difference digital quantity change is ZO, then the proportional coefficient is M, the integral coefficient is M, and the differential coefficient is S.
[0071] Fuzzy reasoning process, premise 1: the language variable of the phase difference digital quantity is PM, premise 2: the language variable of the rate of change of the phase difference digital quantity is PM, premise 3: the language variable of the acceleration of the change of the phase difference digital quantity is PS. According to the premise, find the matching rules in the fuzzy reasoning rule library. If rule 1 is matched, the conclusion is obtained: the language variable of the proportional coefficient Kp is B, the language variable of the integral coefficient Ki is S, and the language variable of the differential coefficient Kd is M. The language variables are converted into membership functions. According to the language variables of the proportional coefficient, integral coefficient and differential coefficient, the corresponding fuzzy subsets are determined, and the language variables are converted into corresponding membership functions. The membership function corresponding to each fuzzy subset is a triangular membership function, and its parameter settings are as follows:
[0072] Fuzzy subset Bottom left border vertex Right bottom border VS 0 0 2.5 S 0 2.5 5 M 2.5 5 7.5 B 5 7.5 10 VB 7.5 10 10
[0073] According to the linguistic variables, the membership of the PID control algorithm parameters is obtained: the proportional coefficient Kp belongs to the fuzzy subset B, and its membership function is the triangular membership function (5, 7.5, 10); the integral coefficient Ki belongs to the fuzzy subset S, and its membership function is the triangular membership function (0, 0.25, 0.5); the differential coefficient Kd belongs to the fuzzy subset M, and its membership function is the triangular membership function (0.25, 0.5, 0.75).
[0074] In summary, through fuzzy reasoning and language variable conversion, the membership function of the PID control algorithm parameters is obtained: the membership function of the proportional coefficient Kp is a triangular membership function (5, 7.5, 10), the membership function of the integral coefficient Ki is a triangular membership function (0, 0.25, 0.5), and the membership function of the differential coefficient Kd is a triangular membership function (0.25, 0.5, 0.75). These membership functions characterize the degree of belonging of the PID control algorithm parameters in the corresponding fuzzy subsets, which can be used in the subsequent defuzzification process to generate specific parameter values and realize adaptive PID control. Preferably, other fuzzy reasoning methods, such as Mamdani reasoning, Sugeno reasoning, etc., can also be used to meet different control requirements.
[0075] The centroid method is used to defuzzify the membership of the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm to obtain the adaptively adjusted proportional coefficient, integral coefficient and differential coefficient; the defuzzified value of the proportional coefficient Kp is calculated, and the area under the membership function curve of the proportional coefficient Kp is divided into two trapezoidal sub-areas, and the area and centroid abscissa of each sub-area are calculated respectively: Sub-area 1: trapezoid (5, 0, 7.5, 1), the area is S1 = (7.5-5) × 1 ÷ 2 = 1.25, and the centroid abscissa is x1 = (5 + 7.5) ÷ 3 = 4.17; Sub-area 2: trapezoid (7.5, 1, 10, 0), the area is S2 = (10-7.5) × 1 ÷ 2 = 1.25, and the centroid abscissa is x2 = (7.5 × 2 + 10) ÷ 3 = 8.33. Multiply the area of each sub-region by its centroid abscissa to get the product: P1 = S1 × x1 = 1.25 × 4.17 = 5.21, P2 = S2 × x2 = 1.25 × 8.33 = 10.41. Add the products of all sub-regions and divide them by the sum of the areas of all sub-regions to get the centroid abscissa of the membership function of the proportional coefficient Kp: Kp = (P1 + P2) ÷ (S1 + S2) = (5.21 + 10.41) ÷ (1.25 + 1.25) = 6.25. Therefore, the adaptively adjusted proportional coefficient Kp = 6.25.
[0076] Calculate the defuzzified value of the integral coefficient Ki. Similarly, divide the area under the membership function curve of the integral coefficient Ki into two trapezoidal sub-regions, and calculate the area and centroid abscissa of each sub-region respectively: Sub-region 1: trapezoid (0, 0, 0.25, 1), area S1 = (0.25-0) × 1 ÷ 2 = 0.125, centroid abscissa x1 = (0 + 0.25) ÷ 3 = 0.083; Sub-region 2: trapezoid (0.25, 1, 0.5, 0), area S2 = (0.5-0.25) × 1 ÷ 2 = 0.125, centroid abscissa x2 = (0.25 × 2 + 0.5) ÷ 3 = 0.333. Multiply the area of each sub-region by its centroid abscissa to obtain the product: P1 = S1 × x1 = 0.125 × 0.083 = 0.010, P2 = S2 × x2 = 0.125 × 0.333 = 0.042. Add the products of all sub-regions and divide them by the sum of the areas of all sub-regions to obtain the centroid abscissa of the membership function of the integral coefficient Ki: Ki = (P1 + P2) ÷ (S1 + S2) = (0.010 + 0.042) ÷ (0.125 + 0.125) = 0.208. Therefore, the adaptively adjusted integral coefficient Ki = 0.208.
[0077] Calculate the defuzzified value of the differential coefficient Kd. Similarly, divide the area under the membership function curve of the differential coefficient Kd into two trapezoidal sub-regions, and calculate the area and centroid abscissa of each sub-region respectively: Sub-region 1: trapezoid (0.25, 0, 0.5, 1), area S1 = (0.5-0.25) × 1 ÷ 2 = 0.125, centroid abscissa x1 = (0.25 + 0.5) ÷ 3 = 0.25, Sub-region 2: trapezoid (0.5, 1, 0.75, 0), area S2 = (0.75-0.5) × 1 ÷ 2 = 0.125, centroid abscissa x2 = (0.5 × 2 + 0.75) ÷ 3 = 0.583. Multiply the area of each sub-region by its centroid abscissa to obtain the product: P1=S1×x1=0.125×0.25=0.031, P2=S2×x2=0.125×0.583=0.073. Add the products of all sub-regions and divide them by the sum of the areas of all sub-regions to obtain the centroid abscissa of the membership function of the differential coefficient Kd: Kd=(P1+P2)÷(S1+S2)=(0.031+0.073)÷(0.125+0.125)=0.417, so the adaptively adjusted differential coefficient Kd=0.417. In summary, the membership function of the PID control algorithm parameters is defuzzified by the centroid method, and the adaptively adjusted parameter values are obtained: proportional coefficient Kp=6.25, integral coefficient Ki=0.208, and differential coefficient Kd=0.417. These parameter values can be directly applied to the PID control algorithm to achieve adaptive frequency control. Compared with fixed parameter PID control, adaptive PID control can automatically adjust the control parameters according to the dynamic characteristics of the system and external disturbances, thus improving the robustness and adaptability of the control system.
[0078] The adaptively adjusted proportional coefficient, integral coefficient and differential coefficient are substituted into the PID control algorithm, and the phase difference digital quantity is used as input to calculate the frequency adjustment value; the frequency adjustment value is converted into the frequency control word of the DDS direct digital frequency synthesizer, and the DDS direct digital frequency synthesizer is controlled to output an excitation signal with a frequency corresponding to the frequency control word, so as to dynamically adjust the excitation frequency of the piezoelectric transducer.
[0079] Calculate the output of the PID control algorithm. Assume that the current time is k and the phase difference digital quantity is e(k). Then the output u(k) of the PID control algorithm is: u(k)=Kp×e(k)+Ki×∑[i=0, k]e(i)+Kd×[e(k)-e(k-1)], where ∑[i=0, k]e(i) represents the cumulative sum of the phase difference digital quantity from time 0 to time k. At the current time k=10, the phase difference digital quantity e(10)=60, the phase difference digital quantity e(9)=55 at the previous time, and the cumulative sum ∑[i=0, 10]e(i)=550. Then: u(10)=6.25×60+0.208×550+0.417×(60-55)=491.35. Therefore, the frequency adjustment value at the current time is 491.35.
[0080] The frequency adjustment value is converted into the DDS frequency control word. The DDS direct digital frequency synthesizer generates a sine wave signal digitally, and its output frequency is determined by the frequency control word. Assuming the clock frequency of the DDS is fclk and the number of bits of the phase accumulator is N, the relationship between the frequency fout of the DDS output signal and the frequency control word M is: fout=M×fclk÷2^N, the clock frequency of the DDS is fclk=100MHz, the number of bits of the phase accumulator is N=32, and the frequency resolution is: Δf=fclk÷2^N=100MHz÷2^32≈0.023Hz. The frequency adjustment value 491.35 is converted into the frequency control word M: M=491.35÷Δf=491.35÷0.023≈21363, and the frequency control word M=21363 is obtained after rounding.
[0081] Control the DDS to output the excitation signal, write the frequency control word M=21363 into the frequency control register of the DDS, and the DDS will output the frequency: fout=M×fclk÷2^N=21363×100MHz÷2^32≈491.35Hz. The sine wave signal of this frequency is used as the excitation signal of the piezoelectric transducer to dynamically adjust its vibration frequency. In summary, by converting the output of the adaptive PID control algorithm into the DDS frequency control word, the dynamic adjustment of the excitation frequency of the piezoelectric transducer is realized. According to the phase difference digital quantity, the parameters Kp, Ki, and Kd of the adaptive PID control algorithm are calculated through fuzzy reasoning and defuzzification processing. The phase difference digital quantity is used as the input of the PID control algorithm to calculate the frequency adjustment value. The frequency adjustment value is converted into the DDS frequency control word and written into the DDS frequency control register. The DDS outputs a sine wave signal of the frequency corresponding to the frequency control word as the excitation signal of the piezoelectric transducer. Repeat the above steps to realize the dynamic adjustment of the excitation frequency of the piezoelectric transducer so that it always works in the optimal vibration state.
Claims
1. An impedance matching method based on dynamic frequency tracking of an ultrasonic piezoelectric transducer, comprising: The voltage and current of the ultrasonic piezoelectric transducer are sampled; wherein, the current sampling is performed by connecting a sampling resistor in series with the piezoelectric transducer load circuit to convert the current signal into a voltage signal for sampling; The obtained voltage sampling signal and current sampling signal are amplified and filtered; wherein the amplification process uses a common-phase amplifier circuit, and the filtering process uses an active bandpass filter circuit; The amplified and filtered voltage sampling signal and current sampling signal are converted into voltage square wave signal and current square wave signal through a zero comparison circuit; wherein the zero comparison circuit includes a voltage follower and a zero-crossing comparator; the voltage follower is used to isolate the subsequent circuit to avoid mutual interference; the zero-crossing comparator uses an LM311N comparator to convert the sine wave into a square wave; The phase difference pulse signal between the voltage square wave signal and the current square wave signal is obtained by using a phase comparison circuit; wherein the voltage square wave signal is connected to the in-phase terminal of the phase comparison circuit; and the current square wave signal is connected to the inverting terminal of the phase comparison circuit; The calculated phase difference digital quantity of the phase difference pulse signal is used as the feedback quantity for frequency regulation; According to the obtained phase difference digital quantity, the output of the excitation frequency of the ultrasonic signal source is controlled by the frequency adjustment algorithm, and the excitation frequency is adjusted to be consistent with the resonant frequency of the piezoelectric transducer: The fuzzy PID control algorithm is used as the frequency regulation algorithm; According to the size, change rate and change acceleration of the phase difference digital quantity, the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm are adjusted; When the absolute value of the phase difference digital quantity is greater than a preset first threshold value, the proportional coefficient is amplified according to a preset first multiple; otherwise, the proportional coefficient is reduced according to a preset second multiple; When the rate of change of the phase difference digital quantity is greater than a preset second threshold, the differential coefficient is amplified according to a preset third multiple; otherwise, the differential coefficient is reduced according to a preset fourth multiple; When the acceleration of the change of the phase difference digital quantity is greater than the preset third threshold value, the integral coefficient is amplified according to the preset fifth multiple; otherwise, the integral coefficient is reduced according to the preset sixth multiple; The piecewise trapezoidal membership function is used to perform fuzzy processing on the phase difference digital quantity, the rate of change of the phase difference digital quantity and the acceleration of the change of the phase difference digital quantity to obtain the corresponding membership degree; Repeat the above steps to make the excitation frequency and the resonant frequency of the piezoelectric transducer change synchronously to perform impedance dynamic matching.
2. The impedance matching method based on dynamic frequency tracking of ultrasonic piezoelectric transducer according to claim 1 is characterized in that: The center frequency of the active bandpass filter circuit is set to the operating frequency of the ultrasonic transducer.
3. The impedance matching method based on dynamic frequency tracking of ultrasonic piezoelectric transducer according to claim 1, characterized in that: The obtained voltage sampling signal and current sampling signal are amplified, including: The amplification process uses a common-mode amplifier circuit, which is composed of an OPA846 operational amplifier; The non-inverting input terminal of the OPA846 operational amplifier is connected to a voltage sampling signal or a current sampling signal, and the inverting input terminal is connected to a feedback circuit composed of a resistor and a potentiometer; By adjusting the potentiometer to change the amplification factor, the amplification factors of the voltage sampling signal and the current sampling signal are made the same, so as to maintain the phase relationship between the voltage sampling signal and the current sampling signal; The output end of the OPA846 operational amplifier outputs the amplified voltage sampling signal and current sampling signal.
4. The impedance matching method based on dynamic frequency tracking of ultrasonic piezoelectric transducer according to claim 1, characterized in that: The phase comparison circuit is used to obtain the phase difference pulse signal between the voltage square wave signal and the current square wave signal, including: The phase comparison circuit uses LM311N comparator; The voltage square wave signal is connected to the non-inverting input terminal of the LM311N comparator, and the current square wave signal is connected to the inverting input terminal of the LM311N comparator; The output end of the LM311N comparator is connected to a pull-up resistor. When the voltage square wave signal leads the current square wave signal, the LM311N comparator outputs a high-level pulse, indicating that the piezoelectric transducer load is inductive; otherwise, the LM311N comparator outputs a low-level pulse, indicating that the piezoelectric transducer load is capacitive. The high level pulse and low level pulse output by the LM311N comparator form a phase difference pulse signal.
5. The impedance matching method based on dynamic frequency tracking of ultrasonic piezoelectric transducer according to claim 1, characterized in that: The calculated phase difference digital quantity of the phase difference pulse signal includes: Connecting the phase difference pulse signal output by the phase comparison circuit to the external interrupt pin of the microcontroller; Set the external interrupt trigger mode of the MCU to falling edge trigger, and trigger an interrupt when the phase difference pulse signal jumps from high level to low level; During the interruption process, the high level duration of the phase difference pulse signal is counted by using the timer of the single chip microcomputer; the counting frequency of the timer is consistent with the clock frequency of the single chip microcomputer; by setting the pre-division coefficient and the initial counting value of the timer, the phase difference pulse width counting value is obtained; When the phase difference pulse signal changes from high level to low level, the timer stops counting, and the phase difference pulse width count value is obtained by reading the value of the timer count register; The phase difference pulse width count value is used as the analog signal input of the A / D converter; The input analog signal is sampled, held and quantized by the successive approximation A / D converter built into the microcontroller, and the phase difference pulse width count value is converted into the corresponding phase difference digital value.
6. The impedance matching method based on dynamic frequency tracking of ultrasonic piezoelectric transducer according to claim 1, characterized in that: According to the obtained phase difference digital quantity, the output of the excitation frequency of the ultrasonic signal source is controlled by a frequency adjustment algorithm, and the excitation frequency is adjusted to be consistent with the resonant frequency of the piezoelectric transducer, and also includes: According to the preset fuzzy reasoning rules, the membership of the phase difference digital quantity, the membership of the change rate of the phase difference digital quantity and the membership of the change acceleration of the phase difference digital quantity are subjected to fuzzy reasoning to obtain the membership of the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm; The centroid method is used to defuzzify the membership of the proportional coefficient, integral coefficient and differential coefficient of the PID control algorithm, and the adaptively adjusted proportional coefficient, integral coefficient and differential coefficient are obtained. Substitute the adaptively adjusted proportional coefficient, integral coefficient and differential coefficient into the PID control algorithm, use the phase difference digital quantity as input, and calculate the frequency adjustment value; The frequency adjustment value is converted into a frequency control word of a DDS direct digital frequency synthesizer, and the DDS direct digital frequency synthesizer is controlled to output an excitation signal of a frequency corresponding to the frequency control word, so as to dynamically adjust the excitation frequency of the piezoelectric transducer.
7. The impedance matching method based on dynamic frequency tracking of ultrasonic piezoelectric transducer according to claim 6, characterized in that: The piecewise trapezoidal membership function is used to perform fuzzy processing on the phase difference digital quantity, the rate of change of the phase difference digital quantity and the acceleration of the change of the phase difference digital quantity to obtain the corresponding membership degree, including: Determine the domain range of the phase difference digital quantity, the rate of change of the phase difference digital quantity and the acceleration of change of the phase difference digital quantity; Divide the domain into multiple fuzzy subsets; For each fuzzy subset, the piecewise trapezoidal membership function is used to represent the corresponding membership function. The piecewise trapezoidal membership function contains four parameters, namely the left bottom boundary, the upper left boundary, the upper right boundary and the right bottom boundary of the trapezoid. According to the size of the phase difference digital quantity, the corresponding fuzzy subset is determined, the phase difference digital quantity is substituted into the piecewise trapezoidal membership function corresponding to the determined fuzzy subset, and the membership degree of the phase difference digital quantity is calculated; According to the magnitude of the rate of change of the phase difference digital quantity, the corresponding fuzzy subset is determined, the phase difference digital quantity is substituted into the piecewise trapezoidal membership function corresponding to the determined fuzzy subset, and the membership degree of the rate of change of the phase difference digital quantity is calculated; According to the magnitude of the acceleration of the change of the phase difference digital quantity, the corresponding fuzzy subset is determined, the phase difference digital quantity is substituted into the piecewise trapezoidal membership function corresponding to the determined fuzzy subset, and the membership degree of the acceleration of the change of the phase difference digital quantity is calculated.
8. The impedance matching method based on dynamic frequency tracking of ultrasonic piezoelectric transducer according to claim 7, characterized in that: The expression of piecewise trapezoidal membership function is as follows: in, represents the membership function, x represents the input variable; a represents the left bottom boundary of the trapezoid, that is, the left boundary where the membership is 0; b represents the upper left boundary of the trapezoid, that is, the inflection point where the membership starts to rise from 0; c represents the upper right boundary of the trapezoid, that is, the inflection point where the membership starts to drop from 1; d represents the right bottom boundary of the trapezoid, that is, the right boundary where the membership drops to 0; Represents the rate of change factor, which is used to adjust the sensitivity of the membership function to the rate of change of the input variable; represents the acceleration factor, which is used to adjust the sensitivity of the membership function to the acceleration of the input variable; r represents the rate of change of the input variable x, and a represents the acceleration of the input variable x.
9. The impedance matching method based on dynamic frequency tracking of ultrasonic piezoelectric transducer according to claim 8, characterized in that: The calculation formulas for r and a are as follows: Among them, r represents the rate of change of the input variable x, and a represents the acceleration of the input variable x.
Citation Information
Patent Citations
Method for detecting phase difference between two channels of square wave input signals by using D trigger
CN101551418A
Portable and wearable ultrasonic physiotherapy instrument
CN103977507A
Frequency tracking system for output signals of ultrasonic power supply based on fuzzy PI control technology
CN110149056A
Frequency control circuit and ultrasonic transducer system
CN111375538A
Phase difference detection system and detection method, electronic equipment and storage medium
CN117849455A
