Discretization method for matching zero-pole of a notch filter based on taylor approximation
By employing an improved zero-pole matching discretization method based on Taylor approximation in the microcontroller unit, the complex calculations of the notch filter are simplified, achieving efficient notch filter discretization and improving the performance and efficiency of the control system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2024-01-16
- Publication Date
- 2026-07-21
AI Technical Summary
In microcontrollers that do not support mathematical operation libraries, it is difficult to discretize the zero-pole matching of notch filters, especially complex exponential operations and square root operations, which limits the performance of the control system.
An improved zero-pole matching discretization method based on Taylor approximation is adopted. Complex calculations are simplified to basic calculations through Taylor formula, and the notch filter is discretized in the microcontroller unit. The difference equation is obtained by using the inverse z-transform, and C program code is written and burned into the microcontroller unit.
It reduces reliance on mathematical function libraries, improves the operating efficiency of the control system, reduces memory consumption, and enhances the performance of the control system.
Smart Images

Figure CN117930653B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of zero-pole matching discretization technology, and more particularly to an improved zero-pole matching discretization method and its application in notch filters. Background Technology
[0002] Notch filter zero-pole matching discretization technology has wide applications in control systems, especially in situations requiring suppression of specific frequency noise or oscillations, including various control applications such as aircraft control, mechanical systems, power electronics, and communication systems. The task of a notch filter is to suppress specific frequency components to ensure the stability and performance of the control system. To implement control tasks on digital computing platforms such as MCUs (Microcontroller Units), it is typically necessary to convert continuous-time control systems into digital control systems.
[0003] Digital control systems require discretizing the outputs of continuous-time controllers and sensors, sending digital signals to the digital controller, and then controlling the system through actuators. Zero-pole matching is a technique used in notch filter design to ensure that the poles and zeros of the notch filter's transfer function match the desired suppression frequency, helping to achieve similar effects to continuous-time notch filters in digital control systems. However, in practical applications, especially for microcontrollers that do not support mathematical operation libraries, achieving zero-pole matching discretization is very difficult. Summary of the Invention
[0004] The purpose of this invention is to address the problems of complex exponential and square root operations required for the discretization of notch filter zero-pole matching, as well as the limited computing power and resources of the platform. It provides a Taylor approximation-based method for discretization of notch filter zero-pole matching, which simplifies the calculation of the discrete transfer function of the notch filter and improves the performance of the control system.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A method for discretizing the zero-pole matching of a notch filter based on Taylor approximation includes the following steps:
[0007] S1. Determine the notch filter type and parameters, and based on the principle of the notch filter, obtain the notch filter transfer function and the calculation formula for the transfer function parameters;
[0008] S2. Discretize the transfer function of the notch filter using the zero-pole matching method to obtain the expression of the discrete transfer function of the notch filter;
[0009] S3. Based on the expression of the discrete transfer function of the notch filter, the relevant parameters are approximated using the Taylor formula to obtain a simplified discrete transfer function, and the complex calculations are transformed into basic calculations.
[0010] S4. Based on the implementation of the notch filter in the microcontroller unit, the difference equation is obtained through the inverse z-transform. The Taylor approximation discretized notch filter is written into the microcontroller unit, and the effect of the notch filter is verified.
[0011] Furthermore, in step S1, the notch filter is a three-parameter notch filter, and the three key parameters of the notch filter are: notch center f... n The unit is Hz; notch width f BW The unit is Hz; notch depth D p The unit is dB;
[0012] The transfer function of the notch filter is:
[0013]
[0014] In the formula, s is a continuous time variable; d is the notch filter coefficient; ξ is the notch filter coefficient; ω n Indicates the notch filter frequency; G N (s) represents the notch filter in... s The transfer function of a domain;
[0015] The formula for calculating the transfer function parameters is:
[0016] ω n =2πf n
[0017]
[0018]
[0019] In the formula, ω n The ξ determines the notch center; d determines the notch depth; ξ determines the notch width.
[0020] Furthermore, in step S2, the transfer function of the notch filter is discretized using the zero-pole matching method, specifically as follows:
[0021] Determine the zeros and poles in the s-domain based on the transfer function of the notch filter;
[0022] Using the zero-pole matching method, the zeros and poles in the s-domain are mapped to the zeros and poles in the z-domain. The calculation formula is as follows:
[0023]
[0024] In the formula, z1 and z2 are the two zeros of the transfer function; p1 and p2 are the two poles of the transfer function.
[0025] The transfer function of the discretized notch filter is obtained using the zero-pole matching method. The gain of the discrete transfer function is then calculated. The formulas for calculating the discrete transfer function and the gain are as follows:
[0026]
[0027]
[0028] In the formula, zeros and poles are defined according to... Perform matching to transform the continuous-time variable s into a discrete-time variable z; T s K is the sampling period; z The gain of the discrete transfer function is obtained through equation G. N (s)| s=0 =G N (z)| z=1 To obtain.
[0029] Furthermore, in step S3, in the Taylor approximation of the notch filter transfer function, to simplify complex calculations, an improved zero-pole matching discretization method based on the Taylor approximation is adopted, specifically as follows:
[0030] Choosing the Taylor approximation with exponential terms, and considering the limited computational power of the microcontroller unit, a second-order exponential Taylor approximation is selected, with the following formula:
[0031]
[0032] In the formula, x represents the unknown; o(x 2 ) is an infinitesimal quantity, representing the second-order Taylor approximation;
[0033] The exponential term of the obtained discrete transfer function is replaced by a second-order Taylor approximation, and the resulting formula is:
[0034]
[0035]
[0036]
[0037]
[0038] Substituting the formula obtained by the second-order Taylor approximation into the discrete transfer function of the notch filter, we obtain the simplified discrete transfer function as follows:
[0039] β1=1-dξω n T s +(dξω n T s ) 2
[0040] β2=2(1+(ω n T s ) 2 (d 2 ξ2 -1) / 2)
[0041] α1=1-ξω n T s +(-ξω n T s ) 2
[0042] α2=2(1+(ω n T s ) 2 (ξ 2 -1) / 2)
[0043]
[0044]
[0045] In the formula, α1, α2, β1, and β2 are all coefficients of the discrete transfer function.
[0046] Furthermore, in step S4, based on the implementation method of the notch filter in the microcontroller unit, to reduce the error caused by numerical calculation, the notch filter is implemented with a series second-order transfer function, and the difference equation obtained after its inverse z-transform is:
[0047] y(k)=a1y(k-1)-a2y(k-2)+b0u(k)+b1u(k-1)+b2u(k-2)
[0048] In the formula, k represents the discrete variable of time, the kth sampling time; y(k) represents the output signal; u(k) represents the input signal; a1, a1, b0, b1, b2 are the coefficients of the difference equation.
[0049] Further, in step S4, the Taylor approximation discretized notch filter is written into the microcontroller unit, including:
[0050] Write the C program code for the notch filter, and burn the program code into the microcontroller's memory using a compiler and programmer. Before writing the notch filter into the microcontroller, the corresponding configuration and specifications need to be determined, and the operation should be strictly carried out according to the specifications to avoid damage or errors. When writing the program code, the resource and performance limitations of the microcontroller should be considered to ensure that the implementation of the notch filter is efficient and reliable, and the effect of the notch filter should be verified.
[0051] Compared with existing technologies, this invention combines the traditional zero-pole matching discretization method with an improved zero-pole matching discretization method based on Taylor approximation. This method is applied to the complex transfer function of notch filters and implemented in microcontrollers with limited computing power and resources. It reduces the dependence on mathematical function libraries, improves the operating efficiency of the control system, reduces memory consumption, and enhances the performance of the control system. Attached Figure Description
[0052] Figure 1 This is a flowchart of a method for discretizing a notch filter based on Taylor approximation zero-pole matching.
[0053] Figure 2 The frequency domain response diagram of the notch filter using the traditional zero-pole matching discretization method.
[0054] Figure 3 The frequency domain response diagram of the notch filter based on the zero-pole matching discretization method of the second-order Taylor approximation is shown.
[0055] Figure 4 A comparison diagram showing the addition of a Taylor approximation notch filter to the control system before and after its implementation. Detailed Implementation
[0056] The following description, in conjunction with the accompanying drawings and specific embodiments, further illustrates the application method of the notch filter zero-pole matching discretization based on Taylor approximation of the present invention.
[0057] Please see Figure 1 This invention discloses a method for discretizing the zero-pole matching of a notch filter based on Taylor approximation, comprising the following steps:
[0058] S1. Determine the notch filter type and parameters. Based on the principle of the notch filter, obtain the notch filter transfer function and the formula for calculating the transfer function parameters.
[0059] S2. Discretize the transfer function of the notch filter using the zero-pole matching method to obtain the expression of the discrete transfer function of the notch filter.
[0060] S3. Based on the expression of the discrete transfer function of the notch filter, the relevant parameters are approximated using the Taylor formula to obtain a simplified discrete transfer function, and the complex calculations are transformed into basic calculations.
[0061] S4. Based on the implementation of the notch filter in the microcontroller unit, the difference equation is obtained through the inverse z-transform. The Taylor approximation discretized notch filter is written into the microcontroller unit, and the effect of the notch filter is verified.
[0062] This invention provides an improved zero-pole matching discretization method and its application. By using Taylor's formula approximation, the transfer function of a notch filter with complex calculations is simplified to addition, subtraction, multiplication and division operations, and implemented in a microcontroller unit. By utilizing the characteristic of notch filters to suppress noise or oscillations at specific frequencies, the performance of the control system is improved.
[0063] Specifically, in step S1, the notch filter is a three-parameter notch filter, and the three key parameters of the notch filter are: notch center f. n The unit is Hz; notch width f BW The unit is Hz; notch depth D p The unit is dB.
[0064] The transfer function of the notch filter is:
[0065]
[0066] In the formula, s is a continuous time variable; d is the notch filter coefficient; ξ is the notch filter coefficient; ω n Indicates the notch filter frequency; G N (s) represents the notch filter in... s The transfer function of a domain.
[0067] Depend on
[0068] 20lo g |G N (jω n )|=20log|d|=-D p
[0069] achievable The value d determines the notch depth; the smaller d is, the deeper the notch depth D is. p The larger.
[0070] The notch width is defined as the frequency difference of the amplitude at -3dB, from which we obtain:
[0071]
[0072]
[0073] ω BW =2πf BW =ω2-ω1
[0074] The formula for calculating the transfer function parameters is:
[0075] ω n =2πf n
[0076]
[0077]
[0078] In the formula, w n The ξ determines the notch center; d determines the notch depth; ξ determines the notch width.
[0079] According to the formula for calculating the transfer function parameters, when d is fixed, ξ determines the notch width; the larger ξ is, the larger the notch width. It can also be seen that notch filters also have exponential and square root operations, but since the notch depth is usually limited to a certain range (e.g., the notch depth can be limited to 4dB-40dB, and its minimum spacing can be limited to 1dB), D can be... p and d and By storing data in tables, and using a lookup table to find the information, exponentiation and square root calculations can be avoided.
[0080] The zero-pole matching method is a very effective discretization method. The design of a notch filter involves designing in the continuous domain and then discretizing it into the discrete domain. The zero-pole matching method is generally more effective than other discretization methods such as the zero-order hold method and bilinear transform for notch filters.
[0081] In step S3, the transfer function of the notch filter is discretized using the zero-pole matching method, specifically as follows:
[0082] First, determine the zeros and poles in the s-domain based on the transfer function of the notch filter.
[0083] Then, using the zero-pole matching method, the zeros and poles in the s-domain are mapped to the zeros and poles in the z-domain. The calculation formula is:
[0084]
[0085] In the formula, z1 and z2 are the two zeros of the transfer function; p1 and p2 are the two poles of the transfer function.
[0086]
[0087] Finally, using the zero-pole matching method, the transfer function of the discretized notch filter is obtained, and the gain of the discrete transfer function is calculated. The formulas for calculating the discrete transfer function and the gain are as follows:
[0088]
[0089]
[0090] In the formula, zeros and poles are defined according to... Perform matching to transform the continuous-time variable s into a discrete-time variable z; T s K is the sampling period; z The gain of the discrete transfer function is obtained through equation G.N (s)| s=0 =G N (z)| z=1 The zero-pole matching method shown in the formula requires square root and exponentiation operations, which are very difficult to perform for some microcontrollers that do not support mathematical operation libraries. Therefore, this invention proposes an improved zero-pole matching discretization method based on Taylor approximation.
[0091] In step S3, to simplify complex calculations in the Taylor approximation of the notch filter transfer function, an improved zero-pole matching discretization method based on the Taylor approximation is adopted, specifically as follows:
[0092] First, we choose the Taylor approximation of the exponential term. Considering the limited computational power of the microcontroller unit, we choose the second-order exponential Taylor approximation, as shown in the formula:
[0093]
[0094] In the formula, x represents the unknown; o(x 2 ) is an infinitesimal quantity representing the second-order Taylor approximation.
[0095] Then, the exponential term of the obtained discrete transfer function is replaced by the above second-order Taylor approximation, and the replaced formula is:
[0096]
[0097]
[0098]
[0099]
[0100] Finally, substituting the formula obtained by the second-order Taylor approximation into the discrete transfer function of the notch filter, we obtain the simplified discrete transfer function as follows:
[0101] β1=1-dξω n T s +(dξω n T s ) 2
[0102] β2=2(1+(ω n T s ) 2 (d 2 ξ 2 -1) / 2)
[0103] α1=1-ξω n T s +(-ξω n Ts ) 2
[0104] α2=2(1+(ω n T s ) 2 (ξ 2 -1) / 2)
[0105]
[0106]
[0107] In the formula, α1, α2, β1, β c These are all coefficients of the discrete transfer function.
[0108] A notch filter is a type of controller in a digital control system. The controller is implemented in the microcontroller unit using difference equations, as follows:
[0109] y(k)=-a1y(k-1)-a2y(k*2)-…-a n y(kn)+b0u(k)+b1u(k-1)+…+b n u(kn)
[0110] The corresponding discrete transfer function is:
[0111]
[0112] In step S4, to reduce errors caused by numerical calculations, the notch filter in the microcontroller unit is implemented using a series second-order transfer function, expressed as:
[0113]
[0114] Its difference equation after inverse z-transform is:
[0115] y(k)=-a1y(k-1)-a2y(k-2)+b0u(k)+b1u(k-1)+b2u(k-2)
[0116] In the formula, k represents the discrete variable of time, the kth sampling time; y(k) represents the output signal; u(k) represents the input signal; a1, a1, b0, b1, b2 are the coefficients of the difference equation.
[0117] In step S4, the Taylor approximation discretized notch filter is written into the microcontroller unit, including:
[0118] Write the C code for the notch filter and then burn it into the microcontroller's memory using a compiler and programmer. Before writing the notch filter into the microcontroller, the appropriate configuration and specifications must be determined, and the operation must be strictly followed to avoid damage or errors. When writing the code, the resource and performance limitations of the microcontroller should be considered to ensure that the notch filter implementation is efficient and reliable, and the effect of the notch filter should be verified.
[0119] This invention starts with the controller (notch filter) of the microcontroller unit. Based on the principle of the notch filter, a mathematical model of its zero-pole matching discretization is obtained. Then, a simplified mathematical model is obtained using the Taylor approximation method. Finally, the difference equation is written into the microcontroller unit, and the effect of the notch filter is verified by the driver of the servo motor in the control system.
[0120] Please see Figure 2 and Figure 3 , Figure 2 The simulation results of the frequency domain response of the notch filter using the traditional zero-pole matching discretization method are shown. Figure 3 The frequency domain response simulation diagram of the notch filter based on the zero-pole matching discretization method of the second-order Taylor approximation is shown.
[0121] First, we can see a trough at the notch frequency, where the amplitude gain is a large negative value. In the Bode plot, the amplitude values at different frequencies represent the gain of the signal at that frequency; a negative gain indicates attenuation of the signal at that frequency. From the trough in the Bode plot, we can see that the notch filter can significantly attenuate the amplitude of the notch frequency signal, which precisely cancels out the resonance peak, thus suppressing resonance.
[0122] Secondly, the effect obtained by the zero-pole matching discretization method based on the second-order Taylor approximation is basically the same as the frequency response curve obtained by the traditional zero-pole matching discretization, indicating that the notch filter obtained by the zero-pole matching method based on the second-order Taylor approximation can also take into account the function of the traditional second-order notch filter.
[0123] The present invention provides a method for discretizing the zero-pole matching of notch filters based on Taylor approximation, which simplifies complex exponential operations and square root calculations. It is applied to the servo drive platform of digital control systems, including the selection of microcontroller units and application platforms, determination of notch filter type and parameters, implementation of notch filters, testing and adjustment, experimentation and data recording.
[0124] Selection of microcontroller unit and application platform: Select DSP (Digital Signal Processing) chip as the main control chip, and design notch filter control system on servo driver platform.
[0125] Determine the notch filter type and parameters: Select a three-parameter notch filter with a second-order transfer function. First, obtain the Bode plot of the controlled object and determine the resonant frequency, then set appropriate notch center, notch width, and notch depth parameters based on this.
[0126] Implementation of the notch filter: After determining the notch filter type and parameters, the discrete transfer function of the notch filter is obtained by using the Taylor approximation-based zero-pole matching discretization application method provided in this invention, and then implemented in C language on the DSP of the servo driver.
[0127] Testing and Adjustment: After the notch filter is implemented, it needs to be tested to verify that it meets the design requirements. If the performance does not meet the requirements, it may be necessary to adjust the filter parameters and reimplement it.
[0128] Experiments and data recording: Comparative experiments were conducted with a notch filter based on Taylor approximation added to the control system and with the control system without a notch filter added. Given the same current input, the waveform of the current feedback was tested. Multiple sets of test experiments were performed, and the experimental data were recorded.
[0129] Please see Figure 4 , Figure 4 The control effect of adding a notch filter based on Taylor approximation to the control system was demonstrated. After multiple experiments, it was found that the notch filter can effectively filter out interference at a specific frequency, thus verifying the effectiveness of the notch filter.
[0130] In summary, this invention combines the traditional zero-pole matching discretization method with an improved zero-pole matching discretization method based on Taylor approximation. This method is applied to the complex transfer function of notch filters and implemented in microcontrollers with limited computing power and resources. It reduces the dependence on mathematical function libraries, improves the operating efficiency of the control system, reduces memory consumption, and enhances the performance of the control system.
[0131] The above description is a detailed description of the preferred embodiments of the present invention. However, the embodiments are not intended to limit the scope of the patent application of the present invention. All equivalent changes or modifications made under the technical spirit disclosed in the present invention should fall within the patent scope covered by the present invention.
Claims
1. A method for discretizing the zero-pole matching of a notch filter based on Taylor approximation, characterized in that, Includes the following steps: S1. Determine the notch filter type and parameters, and based on the principle of the notch filter, obtain the notch filter transfer function and the calculation formula for the transfer function parameters; S2. Discretize the transfer function of the notch filter using the zero-pole matching method to obtain the expression of the discrete transfer function of the notch filter; S3. Based on the expression of the discrete transfer function of the notch filter, the relevant parameters are approximated using the Taylor formula to obtain a simplified discrete transfer function, and the complex calculations are transformed into basic calculations. S4. Based on the implementation of the notch filter in the microcontroller unit, the difference equation is obtained through the inverse z-transform. The Taylor approximation discretized notch filter is written into the microcontroller unit, and the effect of the notch filter is verified. In step S3, to simplify complex calculations in the Taylor approximation of the notch filter transfer function, an improved zero-pole matching discretization method based on the Taylor approximation is adopted, specifically as follows: Choosing the Taylor approximation with exponential terms, and considering the limited computational power of the microcontroller unit, a second-order exponential Taylor approximation is selected, with the following formula: ; In the formula, Represents an unknown; It is an infinitesimal quantity, representing the second-order Taylor approximation; The exponential term of the obtained discrete transfer function is replaced by a second-order Taylor approximation, and the resulting formula is: ; In the formula, Notch filter coefficient; Notch filter coefficient; Indicates the notch filter frequency; The sampling period; Substituting the formula obtained by the second-order Taylor approximation into the discrete transfer function of the notch filter, we obtain the simplified discrete transfer function as follows: ; In the formula, All are coefficients of the discrete transfer function; zeros and poles are defined according to... Perform matching, and match continuous time variables Transform into discrete-time variables ; The gain of the discrete transfer function is obtained through the equation Seek; Let be the transfer function of the notch filter in the s-domain.
2. The notch filter zero-pole matching discretization method based on Taylor approximation according to claim 1, characterized in that, In step S1, the notch filter is a three-parameter notch filter. The three key parameters of the notch filter are: notch center... The unit is Hz; notch width The unit is Hz; notch depth The unit is dB; The transfer function of the notch filter is: ; The formula for calculating the transfer function parameters is: ; In the formula, Determine the center of the trap wave; Determine the depth of the notch; Determine the notch width.
3. The notch filter zero-pole matching discretization method based on Taylor approximation according to claim 2, characterized in that, In step S2, the transfer function of the notch filter is discretized using the zero-pole matching method, specifically as follows: Determine the zeros and poles in the s-domain based on the transfer function of the notch filter; Using the zero-pole matching method, the zeros and poles in the s-domain are mapped to the zeros and poles in the z-domain. The calculation formula is as follows: ; In the formula, The two zeros of the transfer function; These are the two poles of the transfer function; The transfer function of the discretized notch filter is obtained using the zero-pole matching method. The gain of the discrete transfer function is then calculated. The formulas for calculating the discrete transfer function and the gain are as follows: 。 4. The notch filter zero-pole matching discretization method based on Taylor approximation according to claim 1, characterized in that, In step S4, based on the implementation method of the notch filter in the microcontroller unit, to reduce the error caused by numerical calculation, the notch filter is implemented with a series second-order transfer function. The difference equation obtained after the inverse z-transform is as follows: ; In the formula, The discrete variable representing time, at the k-th sampling time; Indicates the output signal; Indicates the input signal; The coefficients of the difference equation are denoted as .
5. The notch filter zero-pole matching discretization method based on Taylor approximation according to claim 1, characterized in that, In step S4, the Taylor approximation discretized notch filter is written into the microcontroller unit, including: Write the C program code for the notch filter, and burn the program code into the microcontroller's memory using a compiler and programmer. Before writing the notch filter into the microcontroller, the corresponding configuration and specifications need to be determined, and the operation should be strictly carried out according to the specifications to avoid damage or errors. When writing the program code, the resource and performance limitations of the microcontroller should be considered to ensure that the implementation of the notch filter is efficient and reliable, and the effect of the notch filter should be verified.