Servo system resonant frequency detection method and system and storage medium
By combining a high-pass filter, a band-pass filter, and a PID controller, along with iterative calculation and slope adjustment, the resonant frequency of a servo system can be quickly identified. This solves the problem of the long processing time of the sinusoidal sweep frequency method and achieves real-time and accurate resonant frequency detection, making it suitable for scenarios with high precision and high real-time requirements.
Patent Information
- Application Number
- CN202511175067.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-11-21
AI Technical Summary
Existing sinusoidal frequency sweep methods are time-consuming when detecting the resonant frequency of servo systems, cannot monitor structural dynamic changes in real time, and may lead to structural fatigue, making them particularly unsuitable for scenarios requiring rapid detection.
By combining a high-pass filter and a band-pass filter, low-frequency noise and DC components in the servo system are filtered out. The resonant frequency is quickly identified using a PID controller and a notch filter. Combined with iterative calculation and slope adjustment, fast and accurate resonant frequency detection is achieved.
It enables real-time monitoring of the resonant frequency of the servo system, with fast detection speed, no impact on normal equipment operation, improved work efficiency, and suitability for scenarios with high precision and high real-time requirements.
Smart Images

Figure CN120992016A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of mechanical control technology, specifically relating to a method, system, and storage medium for detecting the resonant frequency of a servo system. Background Technology
[0002] Currently, servo control systems are widely used in robotics, CNC machine tools, and automobile manufacturing. In practical applications, mechanical transmission components (such as couplings, lead screws, and guide rails) often possess a certain degree of flexibility and inertia, making them prone to mechanical resonance at specific frequencies. This resonance can lead to increased system vibration, decreased positioning accuracy, and even equipment damage or impact on production quality.
[0003] Resonant frequency detection in servo control systems is a crucial step in ensuring system stability and performance. The resonant frequency is the frequency at which the system's response amplitude reaches its maximum when subjected to external periodic excitation. When the operating frequency of a servo system approaches its natural resonant frequency, it may lead to system instability or performance degradation; therefore, accurately identifying and avoiding these frequencies is essential.
[0004] The sinusoidal sweep frequency method is a common method for detecting the resonant frequency of a mechanical structure. This method uses a signal generator to produce a variable-frequency sinusoidal signal, which is applied as an excitation source to the structure under test. The frequency of the excitation signal gradually changes within a set range; it can be a linear sweep (frequency increases or decreases linearly with time) or a logarithmic sweep (frequency changes logarithmically). Accelerometers, displacement sensors, etc., are used to record the vibration response of the structure at different excitation frequencies in real time. The response signal is analyzed, a frequency response curve is plotted, and the resonant frequency and corresponding amplitude are identified. While the sinusoidal sweep frequency method can accurately determine the resonant frequency and corresponding amplitude of a structure with reliable results, and can provide a complete frequency response curve, which helps in analyzing the dynamic characteristics of the structure, including mode shapes and damping ratios, this method requires scanning each frequency point individually, which is time-consuming, especially for large and complex structures; it cannot monitor the dynamic changes of the structure in real time, making it unsuitable for scenarios requiring rapid detection; and prolonged excitation may lead to structural fatigue, especially for fragile or damaged structures.
[0005] Therefore, there is an urgent need to develop a method, system, and storage medium for detecting the resonant frequency of a servo system to solve the above problems. Summary of the Invention
[0006] In view of the above problems, this application provides a method, system and storage medium for detecting the resonant frequency of a servo system. The technical solution adopted in the embodiments of this application is as follows:
[0007] A method, system, and storage medium for detecting the resonant frequency of a servo system, the method comprising the following steps:
[0008] Step 1: Collect and store a segment of the speed error ω in the servo system. err (t), and a high-pass filter is used to remove the velocity error ω. err The low-frequency components and DC components in (t);
[0009] Step 2, the speed error ω err (t) Filtering is performed using bandpass filters. Three bandpass filters are connected in parallel, and the center frequency ω is set sequentially for each of the three bandpass filters. b ω b -1、ω b -2 Extract the velocity error ω err (t) In the part at these three center frequencies, the difference between two center frequencies is the incremental frequency;
[0010] Step 3: Sum the amplitudes of the velocity errors at the three center frequencies and take the average to obtain the velocity error ω. err (t) Amplitude E(ω) at each center frequency point b ), E(ω) b -1) and E(ω b -2);
[0011] Step 4: By comparing E(ω) b -1) and E(ω b ), E(ω) b The magnitude of -2) is used to calculate the resonant frequency ω through iterative calculation. res .
[0012] High-pass filters are primarily used to suppress low-frequency noise while retaining high-frequency dynamic signals, thereby improving the accuracy of signal detection. Furthermore, they remove DC components, preventing steady-state errors from affecting the control loop and ensuring the system responds only to dynamic changes. Band-pass filters focus on the effective frequency band, retaining only the frequency range relevant to the system's dynamic response, thus improving the signal-to-noise ratio.
[0013] In a specific feasible implementation, when E(ω) b -1) is greater than E(ω) b ) and E(v b -2) time:
[0014] If E(ω) b -1) Higher than the spectrum detection threshold E set Then ω b -1 is considered the resonant frequency point;
[0015] If E(ω) b -1) Below the spectrum detection threshold E set Then ωb +1 is assigned to ω b , through ω b The iteration continues to detect the resonant frequency ω res ;
[0016] When E(ω) b -1) is less than or equal to E(ω) b ) and E(ω b -2)
[0017] Calculate E(ω) b ) and E(ω b The slope K between -1) is:
[0018] If the slope K is higher than the preset limit K_lim, then the incremental frequency is set to a lower value;
[0019] If the slope K is lower than the preset limit L_lim, then the incremental frequency is set to a higher value;
[0020] In determining the new ω b Then, through the new ω b The iteration continues to detect the resonance frequency; until the resonance frequency ω is detected. res .
[0021] In one specific feasible implementation, the velocity error ω err (t) By acquiring the set frequency output by the position controller and the actual frequency ω output by the speed calculation module m It is obtained by the first adder.
[0022] In one specific implementation, the position controller is a PID controller;
[0023] The position controller uses the following formula: Where t is the time variable. To integrate with respect to e(t), where t represents the current time variable, i.e., the real-time point at which the system is running, and e(t) is the set position. With actual position θ m difference, The position controller uses the proportional gain from the formula. The position controller uses the integral gain from the formula, where τ is an integral dummy variable representing any moment between a past time and the current time t. τ is used to avoid confusion with the current time t, especially during integration; d τThis represents the integration over the time variable τ; ∫e(τ)dτ represents the accumulation (integration) of the error from the beginning to the current time, which is the time integral of the error, representing the cumulative sum of the errors at all past times. The purpose of the integral term is to eliminate the steady-state error of the system (e.g., the system is always off by 1 degree), and to gradually correct the output by continuously "accumulating" small errors. The position controller uses the differential gain from the formula. To differentiate e(t); the formula for the velocity calculation module is: Where T is the measurement time, M is the number of encoder pulses collected within the time T, and C is the number of encoder pulses generated when the motor rotates one revolution.
[0024] In servo control system testing, the PID controller significantly improves position tracking accuracy and dynamic stability by rapidly responding to position deviations through the proportional (p) element, eliminating steady-state errors through the integral (i) element, and suppressing overshoot oscillations through the derivative (d) element. Its parameters are highly adjustable, adapting to different loads and mechanical characteristics. Furthermore, its simple structure and ease of implementation (hardware or software) allow for seamless integration with other control strategies (such as feedforward and filtering), ensuring strong anti-interference capabilities and accurate repeatability during testing. It is particularly suitable for servo testing scenarios requiring high precision and real-time performance.
[0025] In one specific implementation, the high-pass filter is a second-order high-pass filter, and the transfer function H1(s1) of the second-order high-pass filter is:
[0026]
[0027] Where ξ1 is the damping coefficient of the second-order high-pass filter, s1 is the Laplace variable of the transfer function of the second-order high-pass filter, and ω c This is the cutoff frequency of the second-order high-pass filter;
[0028] The transfer function H2(s2) of the bandpass filter is:
[0029]
[0030] Where ξ2 is the damping coefficient of the bandpass filter, s2 is the Laplace variable of the transfer function of the bandpass filter, and ω d The cutoff frequency of the bandpass filter is given.
[0031] A servo system resonant frequency detection system, the system comprising at least: a second adder, a position controller, a first adder, a speed controller, a motor driver, a motor, an encoder, a speed calculation module, and a resonant frequency detection module;
[0032] The motor driver is used to drive the motor to rotate;
[0033] The encoder measures the motor rotor angle (absolute) or displacement increment (incremental) in real time, and feeds back the actual position θ by measuring the rate of change of the motor rotor position. m The actual frequency ω is fed back through the speed calculation module. m .
[0034] In one specific implementation, the resonant frequency detection module is configured to perform the resonant frequency detection method for a servo system.
[0035] In one specific implementation, the input to the second adder is a set position. and the actual position θ of the motor output by the encoder. m The set position With the actual position θ m The calculation output of the second adder is given to the position controller;
[0036] The position controller outputs the set frequency of the motor. and the actual frequency ω of the motor output by the speed calculation module. m The speed error data ω is obtained through the calculation of the first adder. err Collect and store this segment of velocity error data to obtain the velocity error ω. err (t);
[0037] The velocity error ω err (t) The resonance frequency ω is obtained through the calculation of the resonance frequency detection module. res .
[0038] In one specific implementation, the servo system resonant frequency detection system further includes a notch filter;
[0039] The velocity error data ω err The current command i is obtained through the calculation of the speed controller. * ,
[0040] The speed controller is a PID controller;
[0041] The speed controller uses the following formula: Where e(t) is the set frequency. With actual frequency ω m difference, The speed controller uses the proportional gain from the formula. The speed controller uses the integral gain from the formula. The speed controller uses the differential gain from the formula;
[0042] Current command i * With resonant frequency ω res The input is fed to a notch filter, which filters out the portion of the current signal at the resonant frequency, thereby suppressing the current at the resonant frequency and suppressing system resonance.
[0043] In one specific implementation, the system further includes a notch filter, the transfer function of which is H3(s3):
[0044]
[0045] Where ξ3 is the damping coefficient, s3 is the Laplace variable of the transfer function of the hazardous filter, and ω res The frequency that the filter needs to attenuate is the resonant frequency ω. res .
[0046] Notch filters effectively suppress the impact of periodic interference on detection accuracy by precisely filtering out specific interference frequencies (such as mechanical resonance). Their narrowband filtering characteristics can eliminate interference at the target frequency while preserving the integrity of other frequency bands of the signal to the maximum extent, avoiding distortion of useful signals. In addition, their small phase disturbance and online parameter adjustment features make them adaptable to various working requirements, significantly improving the stability and signal-to-noise ratio of the system detection, and are especially suitable for high-precision encoder signal processing and vibration suppression scenarios.
[0047] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned method for detecting the resonant frequency of a servo system.
[0048] The beneficial effects of the technical solution provided in this application include at least the following: using this solution to detect the resonant frequency can monitor the changes in the resonant frequency of the structure in operation in real time; this solution can be used to detect the resonant frequency during normal equipment operation, without affecting production and work; the detection speed is fast; no complicated preparation work is required; and it can effectively improve work efficiency. Attached Figure Description
[0049] Figure 1 : Flowchart of the resonant frequency detection steps in an embodiment of this application;
[0050] Figure 2 : Flowchart of calculating the velocity error spectrum characteristics according to an embodiment of this application;
[0051] Figure 3 The velocity error ω in this embodiment of the application is calculated. err (t) Amplitude flow chart at each center frequency point;
[0052] Figure 4 Comparison of embodiments of this application E(ω)b -1) and E(ω b ), E(ω) b A flowchart showing the size of -2);
[0053] Figure 5 In the embodiments of this application, when E(ω) b -1) is greater than E(ω) b ) and E(ω b -2) Detect the resonance frequency ω res Flowchart;
[0054] Figure 6 In the embodiments of this application, when E(ω) b -1) is less than or equal to E(ω) b ) and E(ω b -2) Detect the resonance frequency ω res Flowchart;
[0055] Figure 7 : Flowchart of resonant frequency detection according to an embodiment of this application;
[0056] Figure 8 : A system example diagram of the servo control system in an embodiment of this application. Detailed Implementation
[0057] To enable those skilled in the art to better understand the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0058] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product or device.
[0059] The following is in conjunction with the appendix Figures 1-8 The present invention will be described in further detail below.
[0060] Embodiments of the present invention provide a method, system, and storage medium for detecting the resonant frequency of a servo system, such as... Figures 1-6 The following are included:
[0061] On one hand, one embodiment of the present invention provides a method, system, and storage medium for detecting the resonant frequency of a servo system, comprising the following steps:
[0062] Step 1: Collect and store a segment of the speed error ω in the servo system. err (t), and a high-pass filter is used to remove the velocity error ω. err The low-frequency component and DC component in (t); the servo system needs to track high-frequency signals quickly. The high-pass filter allows high-frequency signals to pass through while blocking low-frequency interference to ensure the system response speed.
[0063] Step 2, velocity error ω err (t) Filtering is performed using bandpass filters. Three bandpass filters are connected in parallel, and the center frequency ω is set sequentially for each of the three bandpass filters. b ω b -1、ω b -2 Extract the velocity error ω err (t) In the portion at these three center frequencies, the difference between two center frequencies is the incremental frequency; three bandpass filters with different center frequencies are connected in parallel to extract the velocity error ω. err (t) The components at these three center frequencies; the bandpass filter can reduce the velocity error ω. err (t) The components at the center frequency pass through, attenuate, and suppress signals at other frequencies in the velocity error.
[0064] Step 3: Sum the amplitudes of the velocity errors at the three center frequencies and take the average to obtain the velocity error ω. err (t) Amplitude E(ω) at each center frequency point b ), E(ω) b -1) and E(ω b -2).
[0065] Step 4: By comparing E(ω) b -1) and E(ω b ), E(ω) b The resonant frequency ω is obtained by iterative calculation using the value of -2). res .
[0066] High-pass filters are primarily used to suppress low-frequency noise while retaining high-frequency dynamic signals, thereby improving the accuracy of signal detection. Furthermore, they remove DC components, preventing steady-state errors from affecting the control loop and ensuring the system responds only to dynamic changes. Band-pass filters focus on the effective frequency band, retaining only the frequency range relevant to the system's dynamic response, thus improving the signal-to-noise ratio.
[0067] When E(ω) b -1) is greater than E(ω) b) and E(ω b -2): If E(ω) b -1) Higher than the spectrum detection threshold E set Then ω b -1 is considered the resonant frequency point; if E(ω) b -1) Below the spectrum detection threshold E set Then ω b +1 is assigned to ω b , through ω b The iteration continues to detect the resonant frequency ω res When E(ω) b -1) is less than or equal to E(ω) b ) and E(ω b When -2), calculate E(ω) b ) and E(ω b -1) The slope K between: If the slope K is higher than the preset limit K_lim, the incremental frequency is set to a lower value; if the slope K is lower than the preset limit K_lim, the incremental frequency is set to a higher value. The preset limit K_lim is adjusted according to actual needs; when determining the new ω b Then, through the new ω b The iteration continues to detect the resonant frequency until the resonant frequency ω is detected. res .
[0068] Speed error ω err (t) By acquiring the set frequency output by position controller 2 And the actual frequency ω output by speed calculation module 9 m It is obtained by the first adder 3.
[0069] Position controller 2 is a PID controller; position controller 2 uses the following formula: Where t is the time variable. To integrate with respect to e(t), where t represents the current time variable, i.e., the real-time point at which the system is running, and e(t) is the set position. With actual position θ m difference, The position controller 2 uses the proportional gain from the formula. For position controller 2, the integral gain in the formula is used. τ is an integral dummy variable, representing any moment between a past time and the current time t. τ is used to avoid confusion with the current time t, especially during integration; d τThis represents the integration over the time variable τ; ∫e(τ)dτ represents the accumulation (integration) of the error from the beginning to the current time, which is the time integral of the error, representing the cumulative sum of the errors at all past times. The purpose of the integral term is to eliminate the steady-state error of the system (e.g., the system is always off by 1 degree), and to gradually correct the output by continuously "accumulating" small errors. The position controller 2 uses the differential gain from the formula. To differentiate with respect to e(t); the formula in velocity calculation module 9 is as follows: Where T is the measurement time, M is the number of encoder pulses collected within the time T, and C is the number of encoder pulses generated when the motor rotates 7 revolutions per revolution.
[0070] In servo control system testing, the PID controller significantly improves position tracking accuracy and dynamic stability by rapidly responding to position deviations through the proportional (p) element, eliminating steady-state errors through the integral (i) element, and suppressing overshoot oscillations through the derivative (d) element. Its parameters are highly adjustable, adapting to different loads and mechanical characteristics. Furthermore, its simple structure and ease of implementation (hardware or software) allow for seamless integration with other control strategies (such as feedforward and filtering), ensuring strong anti-interference capabilities and accurate repeatability during testing. It is particularly suitable for servo testing scenarios requiring high precision and real-time performance.
[0071] The high-pass filter is a second-order high-pass filter, and the transfer function H1(s1) of the second-order high-pass filter is:
[0072]
[0073] Where ξ1 is the damping coefficient of the second-order high-pass filter, s1 is the Laplace variable of the transfer function of the second-order high-pass filter, and ω c This is the cutoff frequency of the second-order high-pass filter;
[0074] The transfer function H2(s2) of the bandpass filter is:
[0075]
[0076] Where ξ2 is the damping coefficient of the bandpass filter, s2 is the Laplace variable of the transfer function of the bandpass filter, and ω d This is the cutoff frequency of the bandpass filter.
[0077] like Figure 1 The flowchart of the resonant frequency detection steps in this embodiment of the application is shown below:
[0078] S100: Collects and stores a segment of the speed error ω in the servo system. err (t), and the amplitude-frequency characteristic data are obtained by calculation.
[0079] S200: Summate and average the amplitudes of the velocity error at different frequencies to obtain the amplitude of the velocity error at each frequency point.
[0080] S300: By comparing the amplitude of the velocity error at different frequencies, the resonant frequency ω is calculated iteratively. res .
[0081] The detailed process of S100 is as follows: Figure 2 The flowchart for calculating the velocity error spectrum characteristics of this application embodiment is shown below:
[0082] S110: Collect and store a segment of the speed error ω in the servo system. err (t).
[0083] S120: Use a high-pass filter to remove low-frequency and DC components from the velocity error data.
[0084] S130: Filtered by a bandpass filter.
[0085] S140: Set three center frequencies ω for each of the three parallel bandpass filters. b ω b -1、ω b -2, the difference between the two center frequencies is the incremental frequency.
[0086] S150: Filtered velocity error ω err (t) Perform spectrum analysis to obtain the amplitude-frequency characteristics of the three center frequency bands.
[0087] The detailed process of S200 is as follows: Figure 3 The velocity error ω shown in the embodiment of this application is calculated. err (t) Amplitude flow chart at each center frequency point:
[0088] S210: Sequentially check the velocity error ω at the three center frequencies. err The summation and average of the magnitudes of (t) are calculated.
[0089] S220: Obtain the velocity error ω err (t) Amplitude E(ω) at each center frequency point b ), E(ω) b -1) and E(ω b -2).
[0090] Detailed process of S300 is as follows: Figure 4 Comparison of embodiments of this application E(ω) b -1) and E(ω b ), E(ω) b The flowchart for the size of -2) is shown below:
[0091] S310: Compare E(ω)b -1) and E(ω b ), E(ω) b The size of -2).
[0092] S320: When E(ω b -1) is greater than E(ω) b ) and E(ω b -2)
[0093] S330: When E(ω) b -1) is less than or equal to E(ω) b ) and E(ω b -2)
[0094] Among them, S320, such as Figure 5 In the embodiments of this application, when E(ω) b -1) is greater than E(ω) b ) and E(ω b -2) Detect the resonance frequency ω res The flowchart is shown below:
[0095] S321: When E(ω) b -1) is greater than E(ω) b ) and E(ω b -2)
[0096] S322: If E(ω) b -1) Higher than the spectrum detection threshold E set Then ω b -1 is considered the resonant frequency point.
[0097] S323: If E(ω) b -1) If it is below the spectrum detection threshold, then ω b +1 is assigned to ω b .
[0098] S324: via ω b The iteration continues to detect the resonant frequency ω res .
[0099] S330 Figure 6 In the embodiments of this application, when E(ω) b -1) is less than or equal to E(ω) b ) and E(ω b -2) Detect the resonance frequency ω res The flowchart is shown below:
[0100] S331: When E(ω) b -1) is less than or equal to E(ω) b ) and E(ω b -2)
[0101] S332: Calculate E(ω) b ) and E(ω b The slope K between -1).
[0102] S333: If the slope K is higher than the preset limit K_lim, then the incremental frequency is set to a lower value.
[0103] S334: Otherwise, the incremental frequency can be increased.
[0104] S335: In determining the new ω b Then, through the new ω b The iteration continues to detect the resonant frequency ω res .
[0105] The center frequency of the bandpass filter is selected by calculating the slope K. If the slope K is lower than the preset limit K_lim, the velocity error ω is obtained. err (t) If the amplitude increases relatively gently at each center frequency point, the increment frequency can be increased (e.g., 5) to speed up the detection; if the slope K is higher than the preset limit K_lim, the obtained speed error ω err (t) If the amplitude increases rapidly at each center frequency point, then reduce the increment frequency (e.g., 1).
[0106] like Figures 7-8 As shown:
[0107] On the other hand, another embodiment of the present invention also provides a servo system resonant frequency detection system, comprising at least: a second adder 1, a position controller 2, a first adder 3, a speed controller 4, a motor driver 6, a motor 7, an encoder 8, a speed calculation module 9, and a resonant frequency detection module 10; the motor driver 6 is used to drive the motor to rotate 7; the encoder 8 measures the motor rotor angle (absolute) or displacement increment (incremental) in real time, and feeds back the actual position θ by measuring the rate of change of the motor rotor position. m The actual frequency ω is fed back through the speed calculation module 9. m .
[0108] The resonant frequency detection module 10 is configured to execute a servo system resonant frequency detection method, system, and storage medium. The input of the resonant frequency detection module 10 is the speed error ω. err (t), the output is the resonant frequency ω res .
[0109] The system's resonant frequency is detected by processing and analyzing the acquired velocity error. First, a high-pass filter is used to remove low-frequency and DC components from the velocity error, aiming to eliminate noise and highlight useful information within the velocity error. Then, frequencies are selected incrementally from low to high frequency, with three center frequencies ω set for each of the three parallel bandpass filters.b -2、ω b -1、ω b A bandpass filter is used to extract the velocity error components at these three frequencies. Then, the extracted frequency components are processed by summing and averaging each component, and the amplitude of each component is adjusted to obtain E(ω). b -2), E(ω) b -1) and E(ω b ), so that it is within a suitable range to facilitate subsequent processing; then compare E(ω) b -2), E(ω) b -1) and E(ω b The size of E(ω) b -1) is greater than E(ω) b ) and E(ω b -2) and higher than the set threshold E set When, ω b -1 represents the detected resonant frequency; otherwise, different center frequencies are selected, and the iteration continues until the resonant frequency is found; during the iteration process, E(ω) is monitored. b ) and E(ω b The slope K between -1) is used to adjust the incremental frequency and speed up the detection.
[0110] The input to the second adder 1 is the set position. And the actual position θ of motor 7 output by encoder 8 m Set location With actual position θ m The calculation output of the second adder 1 is sent to the position controller 2; the position controller 2 outputs the set frequency of the motor 7. And the actual frequency ω of motor 7 output by speed calculation module 9 m The speed error data ω is obtained through the calculation of the first adder 3. err Collect and store this segment of velocity error data to obtain the velocity error ω. err (t); velocity error ω err (t) The resonant frequency ω is obtained through calculation by the resonant frequency detection module. res .
[0111] The servo system resonant frequency detection system also includes a notch filter 5; velocity error data ω err The current command i is obtained through calculation by speed controller 4. * The speed controller is a PID controller; speed controller 4 uses the following formula: Where e(t) is the set frequency. With actual frequency ω m difference, The speed controller 4 uses the proportional gain from the formula. The speed controller 4 uses the integral gain from the formula. The speed controller 4 uses the differential gain from the formula; current command i * With resonant frequency ω res The input is fed to notch filter 5, which filters out the portion of the current signal at the resonant frequency, suppressing the portion of the current at the resonant frequency to suppress system resonance.
[0112] The system also includes a notch filter, in some embodiments of which the transfer function H3(s3) of the notch filter is:
[0113]
[0114] Where ξ3 is the damping coefficient, s3 is the Laplace variable of the transfer function of hazardous filter 5, and ω res The frequency that the filter needs to attenuate is the resonant frequency ω. res .
[0115] Notch filters effectively suppress the impact of periodic interference on detection accuracy by precisely filtering out specific interference frequencies (such as mechanical resonance). Their narrowband filtering characteristics can eliminate interference at the target frequency while preserving the integrity of other frequency bands of the signal to the maximum extent, avoiding distortion of useful signals. In addition, their small phase disturbance and online parameter adjustment features make them adaptable to various working requirements, significantly improving the stability and signal-to-noise ratio of the system detection, and are especially suitable for high-precision encoder signal processing and vibration suppression scenarios.
[0116] This embodiment also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described servo system resonant frequency detection method, system, and storage medium.
[0117] This solution enables real-time monitoring of resonant frequency changes in a structure during operation. It allows for detection during normal equipment operation without disrupting production or work, offers fast detection speeds, requires no complex preparation, and effectively improves work efficiency.
[0118] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0119] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0120] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0121] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, the computer-readable medium can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory. It should be understood that various parts of this application can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0122] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0123] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0124] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
[0125] The above are merely preferred embodiments of this application, and the present invention is not limited to the above embodiments. It is understood that other improvements and variations that are directly derived or conceived by those skilled in the art without departing from the spirit and concept of the present invention should be considered to be included within the protection scope of the present invention.
Claims
1. A method of detecting the resonant frequency of a servo system, characterized by, The method comprises the following steps: Step one, collect and store a segment of speed error ω err (t) in the servo system err (t) and use a high-pass filter to remove the low-frequency component and DC component in the speed error ω Step two, the speed error ω err (t) filtered by a band-pass filter, the band-pass filter is set to 3, the 3 band-pass filters are arranged in parallel, the center frequency ω b , ω b -1, ω b -2 is set for the three band-pass filters in turn err (t) at the three center frequencies, the difference between the two center frequencies is the incremental frequency; Step three, sum and average the magnitude of the velocity error at the three center frequencies to obtain the velocity error ω err (t) the magnitude E(ω b ), E(ω b -1) and E(ω b -2) at each center frequency point; Step four, by comparing the magnitude of E(ω b -1) and E(ω b ), E(ω b -2), the resonance frequency ω res is obtained by iteration calculation.
2. A method of detecting the resonant frequency of a servo system as claimed in claim 1, wherein when E(ω b -1) is greater than E(ω b ) and E(ω b -2): If E(ω b -1) is higher than the spectral detection threshold E set , then ω b -1 is considered as a resonance frequency point; if E(ω b -1) is below a spectral detection threshold E set , then ω b +1 is assigned to ω b , and the iteration of ω b continues to detect the resonance frequency ω res ; when E(ω b -1) is less than or equal to E(ω b ) and E(ω b -2), Calculate the slope K between E(ω b ) and E(ω b -1): If the slope K is higher than a preset limit value K_lim, the incremental frequency is set to a lower value; If the slope K is lower than a preset limit value K_lim, the incremental frequency is set to a higher value; In determining the new ω b Then, through the new ω b The iteration continues to detect the resonance frequency; until the resonance frequency ω is detected. res .
3. The method of claim 1, wherein: said speed error ω err (t) is calculated by a first adder (3) from the set frequency ω outputted by the position controller (2) and the actual frequency ω m outputted by the speed calculation module (9).
4. A method of detecting the resonant frequency of a servo system as claimed in claim 3, wherein: The position controller (2) is a PID controller; the position controller (2) uses the formula: where t is a time variable, is the integral of e(t), t represents the current time variable, and e(t) is the difference between the set position and the actual position θ m , is the proportional gain used in the formula by the position controller (2), is the integral gain used in the formula by the position controller (2), and τ is an integral dummy variable representing any time from a certain time in the past to the current time t; d τ represents the integral of the time variable τ; ∫e(τ)dτ represents the accumulation of the error from the start to the current time, which is the time integral of the error, is the derivative gain used in the formula by the position controller (2), is the derivative of e(t); The speed calculation module (9) is formulated as Where T is the measurement time, M is the number of pulses of the encoder (8) collected in T time, and C is the number of pulses generated by the encoder (8) for one revolution of the motor (7).
5. The method of claim 1, wherein: The high-pass filter adopts a second-order high-pass filter, and a transfer function H1(s1) of the second-order high-pass filter is: wherein ξ1is a damping coefficient of the second-order high-pass filter, s1is a Laplace variable of a transfer function of the second-order high-pass filter, ω c is a cut-off frequency of the second-order high-pass filter; A transfer function H2(s2) of the band-pass filter is: where ξ2is a damping coefficient of the bandpass filter, s2is a Laplace variable of a transfer function of the bandpass filter, ω d is a cutoff frequency of the bandpass filter.
6. A servo system resonance frequency detection system characterized by, The system at least comprises: a second adder (1), a position controller (2), a first adder (3), a speed controller (4), a motor driver (6), a motor (7), an encoder (8), a speed calculation module (9), and a resonance frequency detection module (10); The motor driver (6) is used for driving the motor (7) to rotate; The encoder (8) measures the motor rotor angle (absolute) or displacement increments (incremental) in real time, feeding back the actual position θ m by measuring the rate of change of the motor rotor position, and the actual frequency ω m by means of a speed calculation module (9).
7. The resonance frequency detection system of the servo system according to claim 6, characterized in that: The resonance frequency detection module (10) is configured to execute the resonance frequency detection method of the servo system according to claim 1.
8. The resonance frequency detection system of the servo system according to claim 6, characterized in that: the input of the second adder (1) is a set position and the actual position θ of the motor (7) output by the encoder (8) m the set position and the actual position θ m are calculated by the second adder (1) and output to the position controller (2) The position controller (2) outputs a set frequency of the motor (7) and the actual frequency ω of the motor (7) output by the speed calculation module (9) m The speed error data ω is obtained by calculation of the first adder (3) err A segment of speed error data is collected and stored to obtain the speed error ω err (t) said speed error ω err (t) a resonance frequency ω res is calculated by said resonance frequency detection module 9. A servo system resonant frequency detection system as claimed in claim 6, characterised in that: The resonance frequency detection system of the servo system further comprises a notch filter (5); said speed error data ω err current command i obtained by calculation of said speed controller (4) * , The speed controller is a PID controller; the speed controller (4) uses the formula: where e(t) is the difference between the set frequency and the actual frequency ω m , Kp is the proportional gain used in the formula by the speed controller (4), Ki is the integral gain used in the formula by the speed controller (4), Kd is the derivative gain used in the formula by the speed controller (4); Current command i * at the resonance frequency ω res is input to a notch filter (5) by means of which the portion of the current signal at the resonance frequency is filtered out, the portion of the current at the resonance frequency is suppressed, in order to suppress the system resonance.
10. A servo system resonant frequency detection system as claimed in claim 9, characterised in that: The system further comprises a notch filter, and a transfer function H3(s3) of the notch filter is: where ξ3 is a damping coefficient, s3 is a Laplace variable of a transfer function of the risk wave filter, ω res is a frequency to be attenuated by the filter, i.e. the resonance frequency ω res .
11. A computer readable storage medium, characterized in that, A computer program is stored thereon, and the program is executed by a processor to realize the resonance frequency detection method of the servo system according to claims 1-5.