Method for drawing frequency characteristic curve, joint module and robot
Patent Information
- Application Number
- CN202611108532.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-10-30
AI Technical Summary
[0002]目前,现有伺服系统频率特性获取方法存在以下主要问题:(1) 低频辨识精度不足:采用单段扫频信号覆盖较宽频率范围时,受存储空间和通信带宽限制,低频段单位频率内有效采样数据不足,导致低频辨识分辨率较差,难以准确识别低频段的截止频率和带宽特征
[0015]根据本申请实施例的技术方案,至少具有如下有益效果:本申请频率特性曲线的绘制方法,应用于关节模组中的控制器,所述关节模组还包括伺服驱动器和电机,所述控制器通过所述伺服驱动器连接至所述电机,所述方法包括:在通过所述伺服驱动器生成至少两段采样点数相同且频率范围存在重叠的扫频激励信号、以及对所述电机进行控制的情况下,采集所述伺服驱动器的指令数据和所述电机的反馈数据;通过两段交叉扫频激励策略,增强中低频段的激励密度,能够更准确地识别低频段的截止频率和带宽特征。当所述采样点数和预设待辨识系统阶数满足预设辨识条件,根据所述指令数据和所述反馈数据构建离散方程以得到观测矩阵;根据所述观测矩阵进行辨识处理,得到预测输出数据以得到拟合优度;在所述拟合优度大于或等于预设拟合阈值的情况下,构建离散传递函数,通过拟合优度验证机制,自动判定辨识是否成功,避免因噪声或扰动导致的模型失配误导后续调试,确保频率特性曲线的可信度,根据所述传递函数和所述采样参数进行计算,得到幅频特性的幅值、相频特性的相位和频率间隔;根据所述频率间隔、所述幅频特性的幅值和所述相频特性的相位绘制频率特性曲线,其中,所述频率特性曲线包括幅频特性曲线和相频特性曲线。基于参数化模型计算频率特性,从而获得的幅频曲线和相频曲线平滑连续,并且不依赖第三方计算工具,从而降低调试成本和流程复杂度。
Smart Images

Figure CN123015723A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of servo systems and motion control technology, and in particular to a method for plotting frequency response curves, a joint module, and a robot. Background Technology
[0002] Currently, the existing methods for obtaining the frequency characteristics of servo systems have the following main problems: (1) Insufficient low-frequency identification accuracy: When using a single-segment sweep frequency signal to cover a wide frequency range, due to limitations in storage space and communication bandwidth, there is insufficient effective sampling data per unit frequency in the low-frequency band, resulting in poor low-frequency identification resolution and difficulty in accurately identifying the cutoff frequency and bandwidth characteristics of the low-frequency band. (2) Poor smoothness of frequency characteristic curves: The method of directly calculating the frequency response based on FFT is affected by spectral leakage, and Bode plots are prone to spikes or local distortions, affecting the accuracy of judging key features such as cutoff frequency and resonant frequency; if further filtering is used to process the curve, it may cause distortion of the true frequency response characteristics. (3) Insufficient noise and disturbance resistance: The speed feedback signal may be affected by encoder quantization error, speed estimation filtering, mechanical disturbance and measurement noise, and the direct spectrum ratio method or peak detection method is prone to curve jitter, affecting the reliability of the identification results. Summary of the Invention
[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method for drawing frequency response curves, a joint module, and a robot, aiming to improve the accuracy of low-frequency identification and curve smoothness while reducing debugging costs and process complexity without relying on third-party numerical calculation tools.
[0004] In a first aspect, embodiments of this application provide a method for plotting frequency response curves, applied to a controller in a joint module. The joint module further includes a servo driver and a motor, and the controller is connected to the motor via the servo driver. The method includes: When the servo driver generates at least two frequency sweep excitation signals with the same number of sampling points and overlapping frequency ranges, and controls the motor, the servo driver's command data and the motor's feedback data are collected. When the number of sampling points and the preset order of the system to be identified meet the preset identification conditions, a discrete equation is constructed based on the instruction data and the feedback data to obtain the observation matrix. The observation matrix is used for identification processing to obtain predicted output data and thus the goodness of fit. If the goodness of fit is greater than or equal to a preset fitting threshold, a discrete transfer function is constructed, and the amplitude of the amplitude-frequency characteristic, the phase of the phase-frequency characteristic, and the frequency interval are calculated based on the discrete transfer function and preset sampling parameters. A frequency response curve is plotted based on the frequency interval, the amplitude of the amplitude-frequency response, and the phase of the phase-frequency response, wherein the frequency response curve includes an amplitude-frequency response curve and a phase-frequency response curve.
[0005] According to some embodiments of this application, the frequency sweep excitation signal includes a first frequency sweep excitation signal and a second frequency sweep excitation signal, wherein the number of sampling points corresponding to the first frequency sweep excitation signal is equal to the number of sampling points corresponding to the second frequency sweep excitation signal; the frequency sweep range of the first frequency sweep excitation signal is greater than or equal to a first preset frequency and less than or equal to a second preset frequency, and the frequency sweep range of the second frequency sweep excitation signal is greater than or equal to a third preset frequency and less than or equal to a fourth preset frequency; the first preset frequency is less than the third preset frequency, and the second preset frequency is greater than or equal to the third preset frequency and less than the fourth preset frequency.
[0006] According to some embodiments of this application, the step of constructing a discrete equation based on the instruction data and the feedback data to obtain the observation matrix includes: Discrete equations are constructed based on the instruction data and the feedback data, and first parameters and second parameters are calculated, wherein the first parameter corresponds to the feedback data and the second parameter corresponds to the instruction data; Based on the first parameter and the second parameter, the parameter vector to be identified is obtained; The observation equation is obtained based on the feedback data, the number of sampling points, and the preset order of the system to be identified; The observation matrix is obtained based on the observation equation and the parameter vector to be identified.
[0007] According to some embodiments of this application, the step of performing identification processing based on the observation matrix to obtain predicted output data to obtain goodness of fit includes: The observation matrix is normalized by calculating the maximum absolute value of each column vector of the observation matrix and dividing all elements of each column by the maximum absolute value to obtain the normalized observation matrix. The normalized observation matrix is processed to obtain a normalized parameter vector, wherein the processing includes LLT adaptive solution and SVD adaptive solution. Based on the normalized parameter vector and the maximum absolute value of each column, the predicted output data is obtained to determine the goodness of fit.
[0008] According to some embodiments of this application, obtaining the predicted output data based on the normalized parameter vector and the maximum absolute value of each column to obtain the goodness of fit includes: The true parameter vector is obtained by performing inverse normalization based on the normalized parameter vector and the maximum absolute value of each column. Based on the true parameter vector and the discrete equation, the predicted output data is obtained; The residual sum of squares and the total sum of squares are calculated based on the feedback data and the predicted output data. The goodness of fit is calculated based on the sum of squared residuals and the sum of squared total.
[0009] According to some embodiments of this application, the step of calculating the amplitude of the amplitude-frequency characteristic, the phase of the phase-frequency characteristic, and the frequency interval based on the transfer function and the sampling parameters includes: The sampling frequency and sampling period are obtained based on the sampling parameters; The frequency response is calculated based on the transfer function, the sampling period, and the preset analog angular frequency. The amplitude of the amplitude-frequency characteristic and the phase of the phase-frequency characteristic are obtained from the frequency response. The frequency interval is obtained based on the number of sampling points and the sampling frequency.
[0010] According to some embodiments of this application, the step of plotting a frequency response curve based on the frequency interval, the amplitude of the amplitude-frequency response, and the phase of the phase-frequency response includes: The frequency of each sampling point is obtained based on the frequency interval; Amplitude-frequency characteristic curves are plotted based on the frequency and the amplitude of the amplitude-frequency characteristic, wherein the horizontal axis of the amplitude-frequency characteristic curve is the frequency, and the vertical axis of the amplitude-frequency characteristic curve is the amplitude of the amplitude-frequency characteristic. A phase frequency characteristic curve is plotted based on the frequency and the phase of the phase frequency characteristic, wherein the horizontal axis of the phase frequency characteristic curve is the frequency, and the vertical axis of the phase frequency characteristic curve is the phase of the phase frequency characteristic.
[0011] According to some embodiments of this application, when the goodness of fit is less than a preset fitting threshold, the method further includes: Send a recognition failure message to the user to remind the user to check the instruction data and the feedback data, or remind the user to adjust the preset identification system order.
[0012] According to some embodiments of this application, after acquiring the instruction data and feedback data of the servo driver, the method further includes: If the number of sampling points and the preset order of the system to be identified do not meet the preset identification conditions, a reminder message is sent to the user to remind the user to increase the number of sampling points or decrease the preset order of the system to be identified.
[0013] Secondly, embodiments of this application provide a joint module, including a controller, a servo driver, a motor, and a reducer. The controller is connected to the reducer in sequence through the servo driver and the motor. The controller is used to execute the frequency response curve plotting method described in the first aspect above.
[0014] Thirdly, embodiments of this application provide a robot including the joint module described in the second aspect above.
[0015] According to the technical solution of the embodiments of this application, at least the following beneficial effects are achieved: The method for drawing the frequency response curve of this application is applied to the controller in a joint module. The joint module further includes a servo driver and a motor. The controller is connected to the motor through the servo driver. The method includes: when generating at least two frequency sweep excitation signals with the same number of sampling points and overlapping frequency ranges through the servo driver, and controlling the motor, collecting the command data of the servo driver and the feedback data of the motor; through the two-segment cross-frequency sweep excitation strategy, the excitation density of the mid-low frequency band is enhanced, and the cutoff frequency and bandwidth characteristics of the low frequency band can be identified more accurately. When the number of sampling points and the preset order of the system to be identified meet the preset identification conditions, a discrete equation is constructed based on the instruction data and the feedback data to obtain the observation matrix; identification processing is performed based on the observation matrix to obtain the predicted output data and obtain the goodness of fit; if the goodness of fit is greater than or equal to the preset fitting threshold, a discrete transfer function is constructed, and the identification success is automatically determined through a goodness of fit verification mechanism to avoid model mismatch caused by noise or disturbance misleading subsequent debugging, ensuring the credibility of the frequency response curve; the amplitude of the amplitude-frequency characteristic, the phase of the phase-frequency characteristic, and the frequency interval are calculated based on the transfer function and the sampling parameters; the frequency response curve is plotted based on the frequency interval, the amplitude of the amplitude-frequency characteristic, and the phase of the phase-frequency characteristic, wherein the frequency response curve includes the amplitude-frequency characteristic curve and the phase-frequency characteristic curve. The frequency characteristics are calculated based on the parametric model, and the obtained amplitude-frequency curve and phase-frequency curve are smooth and continuous, and do not rely on third-party calculation tools, thereby reducing debugging costs and process complexity. Attached Figure Description
[0016] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0017] Figure 1 This is a frequency response curve obtained using existing methods; Figure 2 This is a flowchart of a method for drawing frequency response curves according to an embodiment of this application; Figure 3 This is a flowchart illustrating the process of obtaining the observation matrix according to an embodiment of this application; Figure 4 This is a flowchart of obtaining predicted output data to obtain goodness of fit, provided in one embodiment of this application; Figure 5 This is a flowchart of obtaining predicted output data to obtain goodness of fit, provided in another embodiment of this application; Figure 6 This is a flowchart illustrating how to obtain the amplitude of the amplitude-frequency response and the phase and frequency interval of the phase-frequency response, according to one embodiment of this application. Figure 7 This is a flowchart of plotting frequency response curves provided in one embodiment of this application; Figure 8 This is an overall flowchart of drawing frequency response curves provided in one embodiment of this application; Figure 9 This is a waveform diagram of a sweep excitation signal provided in one embodiment of this application; Figure 10 This is a spectrum diagram of a sweep excitation signal provided in one embodiment of this application; Figure 11 This is a frequency response curve obtained according to an embodiment of this application. Detailed Implementation
[0018] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0019] In the description of this application, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0020] In the description of this application, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0021] In the description of this application, unless otherwise expressly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.
[0022] In some cases, existing methods for obtaining the frequency characteristics of servo systems have the following main problems: (1) Insufficient low-frequency identification accuracy: When using a single-segment sweep frequency signal to cover a wide frequency range, due to limitations in storage space and communication bandwidth, there is insufficient effective sampling data per unit frequency in the low-frequency band, resulting in poor low-frequency identification resolution and difficulty in accurately identifying the cutoff frequency and bandwidth characteristics of the low-frequency band. (2) Poor smoothness of frequency characteristic curves: The method of directly calculating the frequency response based on FFT is affected by spectral leakage, and Bode plots are prone to spikes or local distortions, affecting the accuracy of judging key characteristics such as cutoff frequency and resonant frequency; if further filtering is used to process the curve, it may cause distortion of the true frequency response characteristics. (3) Insufficient noise and disturbance resistance: The speed feedback signal may be affected by encoder quantization error, speed estimation filtering, mechanical disturbance and measurement noise, and the direct spectrum ratio method or peak detection method is prone to curve jitter, affecting the reliability of the identification results. See Figure 1 , Figure 1 This is a frequency response curve obtained using existing methods.
[0023] The following description, in conjunction with the accompanying drawings, further elaborates on various embodiments of the method for plotting the frequency response curves of this application.
[0024] like Figure 2 As shown, Figure 2 This is a flowchart of a method for drawing a frequency response curve according to an embodiment of this application; the method for drawing the frequency response curve may include, but is not limited to, steps S210 to S250.
[0025] Step S210: When generating at least two sweep excitation signals with the same number of sampling points and overlapping frequency ranges through the servo driver, and controlling the motor, the servo driver's command data and the motor's feedback data are collected. Step S220: When the number of sampling points and the preset order of the system to be identified meet the preset identification conditions, a discrete equation is constructed based on the instruction data and feedback data to obtain the observation matrix; Step S230: Perform identification processing based on the observation matrix to obtain the predicted output data and thus the goodness of fit. Step S240: When the goodness of fit is greater than or equal to the preset fitting threshold, construct a discrete transfer function, and calculate the amplitude of the amplitude-frequency characteristic, the phase of the phase-frequency characteristic, and the frequency interval based on the discrete transfer function and the preset sampling parameters. Step S250: Plot the frequency response curve based on the frequency interval, the amplitude of the amplitude-frequency response, and the phase of the phase-frequency response. The frequency response curve includes the amplitude-frequency response curve and the phase-frequency response curve.
[0026] Specifically, the host computer determines the frequency based on the sampling frequency f. s (Sampling period T) s Given the order n of the system to be identified, determine whether the number of sampling points M meets the identification condition: M≥3n+1.
[0027] Specifically, the servo driver controls the motor operation according to the sweep frequency excitation signal and collects command data u. k (k=0,1,2,…,M-1) and feedback data y k (k=0,1,2,…,M-1), and send the data to the host computer.
[0028] Specifically, the command data can be speed command data, position command data, or current command data, and the feedback data can be speed feedback data, position feedback data, or current feedback data.
[0029] In one embodiment, two frequency sweep excitation signals with a fixed number of points and overlapping frequency ranges are acquired to obtain command data, feedback data, sampling parameters, and the number of sampling points. By employing a two-segment cross-frequency sweep excitation strategy, the excitation density in the mid-to-low frequency band is enhanced, enabling more accurate identification of the cutoff frequency and bandwidth characteristics of the low-frequency band. When the number of sampling points and the preset order of the system to be identified meet preset identification conditions, a discrete equation is constructed based on the command data and feedback data to obtain an observation matrix. Identification processing is performed based on the observation matrix to obtain predicted output data and thus a goodness-of-fit. If the goodness-of-fit is greater than or equal to a preset fitting threshold, a discrete transfer function is constructed. A goodness-of-fit verification mechanism automatically determines whether the identification is successful, avoiding model mismatch caused by noise or disturbances that could mislead subsequent debugging and ensuring the reliability of the frequency response curve. The amplitude of the amplitude-frequency response, the phase of the phase-frequency response, and the frequency interval are calculated based on the transfer function and sampling parameters. A frequency response curve is plotted based on the frequency interval, the amplitude of the amplitude-frequency response, and the phase of the phase-frequency response. The frequency response curve includes both the amplitude-frequency response curve and the phase-frequency response curve. Frequency characteristics are calculated based on a parametric model, resulting in smooth and continuous amplitude and phase frequency curves that do not rely on third-party calculation tools, thereby reducing debugging costs and process complexity.
[0030] In one embodiment, the frequency sweep excitation signal includes a first frequency sweep excitation signal and a second frequency sweep excitation signal, wherein the number of sampling points corresponding to the first frequency sweep excitation signal is equal to the number of sampling points corresponding to the second frequency sweep excitation signal; the frequency range of the first frequency sweep excitation signal is greater than or equal to a first preset frequency and less than or equal to a second preset frequency, and the frequency range of the second frequency sweep excitation signal is greater than or equal to a third preset frequency and less than or equal to a fourth preset frequency; the first preset frequency is less than the third preset frequency, and the second preset frequency is greater than or equal to the third preset frequency and less than the fourth preset frequency.
[0031] It should be noted that the servo driver generates two frequency sweep excitation signals with a fixed number of points and overlapping frequency ranges. The frequency range of the first frequency sweep excitation signal is [f1, f2], with M sampling points, covering the low-frequency and mid-frequency bands; the frequency range of the second frequency sweep excitation signal is [f3, f4], with M sampling points, covering the mid-frequency and high-frequency bands.
[0032] Wherein, the overlapping intervals satisfy f1 <f3≤f2<f4。
[0033] Specifically, the first frequency sweep excitation signal ranges from 0Hz to 150Hz, and the second frequency sweep excitation signal ranges from 100Hz to 4000Hz. Both the first and second frequency sweep excitation signals have 4096 sampling points. By employing a two-stage cross-frequency sweep excitation strategy, the excitation density in the mid-to-low frequency band is enhanced, improving the low-frequency band identification accuracy by approximately 50%, and enabling more accurate identification of the cutoff frequency and bandwidth characteristics of the low-frequency band.
[0034] like Figure 3 As shown, Figure 3 This is a flowchart of obtaining the observation matrix provided in one embodiment of this application; regarding the above step S220, which constructs discrete equations based on instruction data and feedback data to obtain the observation matrix, it may include, but is not limited to, steps S310 to S340.
[0035] Step S310: Construct a discrete equation based on the instruction data and feedback data, and calculate the first parameter and the second parameter, wherein the first parameter corresponds to the feedback data and the second parameter corresponds to the instruction data; Step S320: Obtain the parameter vector to be identified based on the first parameter and the second parameter; Step S330: Obtain the observation equation based on the feedback data, the number of sampling points, and the preset order of the system to be identified; Step S340: Obtain the observation matrix based on the observation equation and the parameter vector to be identified.
[0036] In one embodiment, a discrete equation is constructed based on the instruction data and feedback data. The discrete equation is as follows: ,in, As the first parameter, This is the second parameter.
[0037] In one embodiment, a parameter vector to be identified is obtained based on the first parameter and the second parameter. The parameter vector is as follows:
[0038] Specifically, construct the observation matrix The k-th line is:
[0039] Specifically, the observation equation is obtained based on the feedback data, the number of sampling points, and the preset order of the system to be identified. The observation equation is as follows: ,
[0040] Specifically, based on the observation equation and the parameter vector to be identified, the observation matrix is obtained, which is:
[0041] like Figure 4 As shown, Figure 4 This is a flowchart of obtaining predicted output data to obtain goodness of fit provided in one embodiment of this application; regarding the above step S230, which performs identification processing based on the observation matrix to obtain predicted output data to obtain goodness of fit, it may include, but is not limited to, steps S410 to S430.
[0042] Step S410: Normalize the observation matrix by calculating the maximum absolute value of each column vector of the observation matrix and dividing all elements of each column by the maximum absolute value to obtain the normalized observation matrix. Step S420: Solve the normalized observation matrix to obtain the normalized parameter vector. The solution process includes LLT adaptive solution and SVD adaptive solution. Step S430: Based on the normalized parameter vector and the maximum absolute value of each column, obtain the predicted output data to obtain the goodness of fit.
[0043] In one embodiment, the observation matrix is normalized to obtain the maximum absolute value of each column and the normalized observation matrix. The maximum absolute value of the j-th column is:
[0044] The normalized observation matrix is:
[0045] Specifically, the normalized observation matrix is processed to obtain the normalized parameter vector. Calculate the least squares solution using a normalized matrix:
[0046] in, .
[0047] Specifically, an adaptive solution using LLT or SVD is employed. When matrix A is positive definite, Cholesky decomposition is used; if LLT decomposition fails, it reverts to SVD. LLT is a standard implementation of Cholesky decomposition in numerical computing libraries (such as Eigen). Its core method is to decompose a special matrix into the product of a lower triangular matrix and its transpose. SVD (Singular Value Decomposition) is a matrix decomposition method in linear algebra. Any matrix can be decomposed into the product of three matrices with a specific structure.
[0048] like Figure 5 As shown, Figure 5 This is a flowchart of obtaining predicted output data to obtain goodness of fit provided in another embodiment of this application; regarding the above step S430, obtaining predicted output data to obtain goodness of fit based on the normalized parameter vector and the maximum absolute value of each column, it may include, but is not limited to, steps S510 to S540.
[0049] Step S510: Perform inverse normalization based on the normalized parameter vector and the maximum absolute value of each column to obtain the true parameter vector; Step S520: Obtain the predicted output data based on the true parameter vector and discrete equations; Step S530: Calculate the residual sum of squares and the total sum of squares based on the feedback data and the predicted output data; Step S540: Calculate the goodness of fit based on the residual sum of squares and the total sum of squares.
[0050] Specifically, inverse normalization is performed based on the normalized parameter vector and the maximum absolute value of each column to obtain the true parameter vector θ:
[0051] Where j is 1, 2, ..., 2n+1.
[0052] Specifically, based on the true parameter vector and discrete equations, the predicted output data is obtained. Based on the feedback data and the predicted output data, the residual sum of squares (SSE) and the total sum of squares (SST) are calculated.
[0053]
[0054]
[0055] Specifically, the goodness of fit is calculated based on the sum of squared residuals and the total sum of squares. .
[0056]
[0057] It should be noted that the least squares fitting method has a strong ability to suppress encoder quantization errors, speed estimation filtering, mechanical disturbances, and measurement noise in the speed feedback signal, resulting in more robust and reliable identification results. Through a goodness-of-fit verification mechanism, the success of the identification is automatically determined, avoiding model mismatch caused by noise or disturbances from misleading subsequent debugging and ensuring the reliability of the frequency response curve.
[0058] like Figure 6 As shown, Figure 6 This is a flowchart of obtaining the amplitude of the amplitude-frequency characteristic, the phase of the phase-frequency characteristic, and the frequency interval according to an embodiment of this application; regarding the above step S240 of constructing a discrete transfer function, and calculating the amplitude of the amplitude-frequency characteristic, the phase of the phase-frequency characteristic, and the frequency interval according to the discrete transfer function and the preset sampling parameters, it may include, but is not limited to, steps S610 to S640.
[0059] Step S610: Obtain the sampling frequency and sampling period based on the sampling parameters; Step S620: Calculate the frequency response based on the transfer function, sampling period, and preset analog angular frequency; Step S630: Obtain the amplitude of the amplitude-frequency characteristic and the phase of the phase-frequency characteristic based on the frequency response; Step S640: Obtain the frequency interval based on the number of sampling points and the sampling frequency.
[0060] In one embodiment, when the goodness of fit is greater than or equal to a preset fitting threshold, a transfer function is constructed based on the first parameter and the second parameter. The transfer function is as follows:
[0061] In one embodiment, the sampling period T is obtained based on the sampling parameters. s In the discrete domain, Substitute the transfer function:
[0062] in, For frequency response, This is the preset simulated angular frequency.
[0063] In one embodiment, the amplitude of the amplitude-frequency characteristic is obtained from the frequency response. Phase of phase frequency response .
[0064] Specifically, the amplitude of the amplitude-frequency response:
[0065] Specifically, the phase of the phase-frequency characteristic:
[0066] In one embodiment, the sampling frequency f is obtained based on the sampling parameters. s The frequency interval is obtained based on the number of sampling points and the sampling frequency. Since the starting frequency of the excitation signal is 0Hz, fmax = 0.5fs is the Nyquist frequency, and the frequency interval is: =fmax / (M-1) like Figure 7 As shown, Figure 7 This is a flowchart of drawing a frequency response curve provided in one embodiment of this application; the above step S250 of drawing a frequency response curve based on the frequency interval, the amplitude of the amplitude-frequency response and the phase of the phase-frequency response may include, but is not limited to, steps S710 to S730.
[0067] Step S710: Obtain the frequency of each sampling point according to the frequency interval; Step S720: Plot the amplitude-frequency characteristic curve based on the frequency and the amplitude value of the amplitude-frequency characteristic, where the horizontal axis of the amplitude-frequency characteristic curve is the frequency and the vertical axis of the amplitude-frequency characteristic curve is the amplitude value of the amplitude-frequency characteristic. Step S730: Plot the phase frequency characteristic curve based on the frequency and the phase of the phase frequency characteristic, where the horizontal axis of the phase frequency characteristic curve is the frequency and the vertical axis of the phase frequency characteristic curve is the phase of the phase frequency characteristic.
[0068] In one embodiment, according to frequency interval The frequency of each sampling point is obtained; specifically, the frequency of the i-th point is fi = i .
[0069] In one embodiment, the horizontal axis represents frequency, and the vertical axis represents... Plot the amplitude-frequency response curve; with frequency on the x-axis and frequency on the y-axis. Plot the phase frequency response curve.
[0070] In one embodiment, if the goodness of fit is less than a preset fitting threshold, a recognition failure message is sent to the user to remind the user to check the instruction data and feedback data, or to remind the user to adjust the preset order of the system to be identified.
[0071] It should be noted that the preset fitting threshold r0 is a value pre-set by the system. When R² is greater than or equal to r0, the identification is considered successful; when R² is less than r0, the identification is considered unsuccessful. In the event of identification failure, a failure message is sent to the user to prompt them to check the data quality or adjust the system order. This goodness-of-fit verification mechanism ensures the reliability of the frequency response curve and avoids erroneous curves misleading subsequent control parameter tuning.
[0072] In one embodiment, after collecting instruction data and feedback data from the servo driver, if the number of sampling points and the preset order of the system to be identified do not meet the preset identification conditions, a reminder message is sent to the user to remind the user to increase the number of sampling points or decrease the preset order of the system to be identified.
[0073] It should be noted that the preset order of the system to be identified is a value set by the system in advance. When the number of sampling points M is greater than or equal to 3n+1, it is determined that the preset identification condition is met. When the number of sampling points M is less than 3n+1, it is determined that the preset identification condition is not met, and a reminder message is sent to the user to remind the user to increase the number of sampling points or decrease the preset order of the system to be identified.
[0074] Based on the frequency response curve plotting methods of the above embodiments, the following presents an overall embodiment of the frequency response curve plotting method of this application.
[0075] like Figure 8 As shown, Figure 8 This is an overall flowchart of drawing frequency response curves provided in one embodiment of this application.
[0076] Step S8001: Generate two segments of interleaved sweep frequency excitation signals; Step S8002: Acquire speed commands and speed feedback data; Step S8003: Determine whether the sampling length meets the identification conditions; Step S8004: Construct the observation matrix; Step S8005: Normalization of the observation matrix; Step S8006: Solve for the normalized parameters using LLT or SVD; Step S8007: Calculate the goodness of fit R²; Step S8008: Is R² greater than the threshold? If yes, proceed to step S8009; otherwise, proceed to step S8010. Step S8009: Construct the discrete transfer function; Step S8010, identification failure prompt; Step S8011: Calculate the amplitude frequency and phase frequency characteristics; Step S8012: Plot the frequency response curve.
[0077] like Figure 9, Figure 10 and Figure 11 As shown, Figure 9 This is a waveform diagram of a sweep excitation signal provided in one embodiment of this application. Figure 10 This is a spectrum diagram of a sweep excitation signal provided in one embodiment of this application. Figure 11 This is a frequency response curve obtained according to an embodiment of this application.
[0078] It should be noted that in the waveform diagram of the frequency sweep excitation signal, the horizontal axis represents the number of sampling points and the vertical axis represents the amplitude; in the spectrum diagram of the frequency sweep excitation signal, the horizontal axis represents the frequency and the vertical axis represents the amplitude.
[0079] In one embodiment, the servo driver is responsible for generating a speed sweep excitation signal. The speed sweep excitation signal includes two sweep signals with a fixed number of sampling points and overlapping frequency ranges. For example, the first segment has a frequency range of 0Hz to 150Hz and 4096 sampling points; the second segment has a frequency range of 100Hz to 4000Hz and 4096 sampling points. The two signals overlap within the 100Hz to 150Hz frequency range to ensure sufficient excitation density in the mid-to-low frequency band. The servo driver controls the motor operation according to the generated speed sweep excitation signal, and operates at a fixed sampling period T during operation. s Collect speed command data and speed feedback data. After collection, send the input / output data to the host computer.
[0080] It should be noted that the host computer uses software frameworks with GUI design capabilities, such as Qt, C++, and Python, to implement data processing, system identification, and curve display functions. The main processing flow includes: (1) Data preprocessing: After receiving the speed command data and speed feedback data sent by the servo driver, the bit machine performs a data integrity check to confirm the number of sampling points M and the sampling frequency f. s Parameters such as these.
[0081] (2) System order setting: Based on the complexity of the velocity loop system and prior knowledge, set the order n of the system to be identified. Typically, the velocity loop can be modeled as a second-order or third-order system. The number of sampling points must satisfy M≥3n+1. If not, prompt the user to adjust the parameters.
[0082] (3) System identification: After satisfying M≥3n+1, construct the observation matrix, perform normalized least squares solution, calculate the goodness of fit, and verify the effectiveness of the identification results.
[0083] (4) Frequency response calculation and plotting: After successful identification, construct the discrete transfer function, calculate the amplitude frequency response and phase frequency response, and plot and display the frequency response curve.
[0084] Comparison of effects in examples: Under the same data collection conditions, the existing method and this method were used for processing, and the results are as follows: Figure 1 and Figure 11 As shown in the figure. The comparison results show that the amplitude-frequency response curve plotted by the method of the present invention is smooth and continuous, and the cutoff frequency and resonant frequency characteristics are clear; the amplitude-frequency response curve plotted by the existing method has obvious spikes and fluctuations, and the key frequency characteristics are difficult to identify accurately.
[0085] It should be noted that the order n is chosen based on system complexity and prior knowledge, with typical values for velocity loops ranging from order 2 to 3. Alternatively, order identification methods (such as the AIC criterion or BIC criterion) can be used to determine the optimal order. The fitting threshold r0 ranges from 0.85 to 0.95. A threshold that is too high may reduce the identification success rate, while a threshold that is too low may lead to unreliable identification results. A default value of 0.90 is recommended. The overlapping interval should occupy 20% to 50% of the low-frequency range to ensure sufficient excitation density in the low-frequency band while avoiding resource waste.
[0086] Furthermore, one embodiment of this application also provides a joint module, including a controller, a servo driver, a motor, and a reducer. The controller is connected to the reducer sequentially via the servo driver and the motor. The controller is used to execute the frequency response curve plotting method of any of the above embodiments. Therefore, the specific implementation and technical effects of the joint module of this application embodiment can be referred to the specific implementation and technical effects of the frequency response curve plotting method of any of the above embodiments.
[0087] Understandably, joint modules are the core execution units for the movement of robots (especially humanoid robots). They typically use motors and reducers to form a small system that can output torque, achieve precise control, and provide dynamic response.
[0088] Furthermore, one embodiment of this application also provides a robot including the aforementioned joint module. Therefore, the specific implementation methods and technical effects of the joint module in this application can be referred to the joint module of any of the above embodiments.
[0089] Understandably, robots can be humanoid or in other forms.
[0090] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0091] The above provides a detailed description of the preferred embodiments of this application. However, this application is not limited to the above-described embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the embodiments of this application.
Claims
1. A method for plotting frequency response curves, characterized in that, A controller applied in a joint module, the joint module further comprising a servo driver and a motor, the controller being connected to the motor via the servo driver, the method comprising: When the servo driver generates at least two frequency sweep excitation signals with the same number of sampling points and overlapping frequency ranges, and controls the motor, the servo driver's command data and the motor's feedback data are collected. When the number of sampling points and the preset order of the system to be identified meet the preset identification conditions, a discrete equation is constructed based on the instruction data and the feedback data to obtain the observation matrix. The observation matrix is used for identification processing to obtain predicted output data and thus the goodness of fit. If the goodness of fit is greater than or equal to a preset fitting threshold, a discrete transfer function is constructed, and the amplitude of the amplitude-frequency characteristic, the phase of the phase-frequency characteristic, and the frequency interval are calculated based on the discrete transfer function and preset sampling parameters. A frequency response curve is plotted based on the frequency interval, the amplitude of the amplitude-frequency response, and the phase of the phase-frequency response, wherein the frequency response curve includes an amplitude-frequency response curve and a phase-frequency response curve.
2. The method according to claim 1, characterized in that, The frequency sweep excitation signal includes a first frequency sweep excitation signal and a second frequency sweep excitation signal, wherein the number of sampling points corresponding to the first frequency sweep excitation signal is equal to the number of sampling points corresponding to the second frequency sweep excitation signal; the frequency range of the first frequency sweep excitation signal is greater than or equal to a first preset frequency and less than or equal to a second preset frequency, and the frequency range of the second frequency sweep excitation signal is greater than or equal to a third preset frequency and less than or equal to a fourth preset frequency; the first preset frequency is less than the third preset frequency, and the second preset frequency is greater than or equal to the third preset frequency and less than the fourth preset frequency.
3. The method according to claim 1, characterized in that, The step of constructing a discrete equation based on the instruction data and the feedback data to obtain the observation matrix includes: Discrete equations are constructed based on the instruction data and the feedback data, and first parameters and second parameters are calculated, wherein the first parameter corresponds to the feedback data and the second parameter corresponds to the instruction data; Based on the first parameter and the second parameter, the parameter vector to be identified is obtained; The observation equation is obtained based on the feedback data, the number of sampling points, and the preset order of the system to be identified; The observation matrix is obtained based on the observation equation and the parameter vector to be identified.
4. The method according to claim 1, characterized in that, The step of performing identification processing based on the observation matrix to obtain predicted output data and thus obtain goodness of fit includes: The observation matrix is normalized by calculating the maximum absolute value of each column vector of the observation matrix and dividing all elements of each column by the maximum absolute value to obtain the normalized observation matrix. The normalized observation matrix is processed to obtain a normalized parameter vector, wherein the processing includes LLT adaptive solution and SVD adaptive solution. Based on the normalized parameter vector and the maximum absolute value of each column, the predicted output data is obtained to determine the goodness of fit.
5. The method according to claim 4, characterized in that, The step of obtaining the predicted output data based on the normalized parameter vector and the maximum absolute value of each column to obtain the goodness of fit includes: The true parameter vector is obtained by performing inverse normalization based on the normalized parameter vector and the maximum absolute value of each column. Based on the true parameter vector and the discrete equation, the predicted output data is obtained; The residual sum of squares and the total sum of squares are calculated based on the feedback data and the predicted output data. The goodness of fit is calculated based on the sum of squared residuals and the sum of squared total.
6. The method according to claim 1, characterized in that, The step of calculating the amplitude of the amplitude-frequency response, the phase of the phase-frequency response, and the frequency interval based on the transfer function and the sampling parameters includes: The sampling frequency and sampling period are obtained based on the sampling parameters; The frequency response is calculated based on the transfer function, the sampling period, and the preset analog angular frequency. The amplitude of the amplitude-frequency characteristic and the phase of the phase-frequency characteristic are obtained from the frequency response. The frequency interval is obtained based on the number of sampling points and the sampling frequency.
7. The method according to claim 1, characterized in that, The step of plotting the frequency response curve based on the frequency interval, the amplitude of the amplitude-frequency response, and the phase of the phase-frequency response includes: The frequency of each sampling point is obtained based on the frequency interval; Amplitude-frequency characteristic curves are plotted based on the frequency and the amplitude of the amplitude-frequency characteristic, wherein the horizontal axis of the amplitude-frequency characteristic curve is the frequency, and the vertical axis of the amplitude-frequency characteristic curve is the amplitude of the amplitude-frequency characteristic. A phase frequency characteristic curve is plotted based on the frequency and the phase of the phase frequency characteristic, wherein the horizontal axis of the phase frequency characteristic curve is the frequency, and the vertical axis of the phase frequency characteristic curve is the phase of the phase frequency characteristic.
8. The method according to claim 1, characterized in that, When the goodness of fit is less than the preset fitting threshold, the method further includes: Send a recognition failure message to the user to remind the user to check the instruction data and the feedback data, or remind the user to adjust the preset identification system order.
9. The method according to claim 1, characterized in that, After acquiring the command data and feedback data of the servo driver, the method further includes: If the number of sampling points and the preset order of the system to be identified do not meet the preset identification conditions, a reminder message is sent to the user to remind the user to increase the number of sampling points or decrease the preset order of the system to be identified.
10. A joint module, characterized in that, The device includes a controller, a servo driver, a motor, and a reducer. The controller is connected to the reducer in sequence through the servo driver and the motor. The controller is used to execute the method for plotting the frequency response curve as described in any one of claims 1 to 9.
11. A robot, characterized in that, Includes the joint module as described in claim 10.
