Method, apparatus and machine device for compensating communication delay
Patent Information
- Application Number
- CN202611285794.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-09-22
AI Technical Summary
[0005]基于上述技术现状,本申请提出一种通信延迟的补偿方法、装置及机器设备,能够解决现有通信延迟补偿方案的针对性差,且容易发生过补偿或欠补偿的问题
本申请实施例中,通过获取机器设备在第一配置(绕过通信总线)下的第一延迟参数,以及在第二配置(经由通信总线)下的第二延迟参数,并基于两者之间的差值确定通信延迟的延迟时间,再基于该延迟时间对关节驱动器的电流环进行延迟补偿,将通信协议栈引入的延迟从关节驱动器内部电气延迟中精确分离出来,使后续补偿能够专门针对通信延迟进行设计,避免了现有技术中笼统补偿导致的过补偿或欠补偿问题,从而显著提升了补偿的精确性和针对性,有效解决了通信总线引入的延迟与关节驱动器内部电气延迟混叠、无法对通信延迟进行针对性补偿的技术问题。
Smart Images

Figure CN122802449A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine equipment control technology, and more specifically, to a method, apparatus, and machine equipment for compensating for communication delay. Background Technology
[0002] In the field of joint control for humanoid and industrial robots, the main controller and each joint actuator typically communicate via a bus for command issuance and feedback reporting. Due to the presence of communication protocol stack processing and bus transmission, a significant delay is always introduced. Therefore, it is necessary to compensate for this communication delay to offset its adverse effects.
[0003] Currently, the commonly used delay compensation scheme is the fixed delay compensation method. For example, during the system debugging phase, the nominal delay value of the communication bus between the main controller and the joint driver can be estimated and determined through engineering experience. Subsequently, a corresponding predictive compensation loop is introduced into the control law to offset the effect of the fixed delay on the closed-loop phase margin.
[0004] However, fixed compensation schemes cannot accommodate individual delay variations in different joints due to differences in bus topology and driver hardware. Therefore, fixed compensation schemes are too general, failing to provide targeted compensation and often resulting in over-compensation or under-compensation. Summary of the Invention
[0005] Based on the above-mentioned technological status, this application proposes a method, apparatus, and machine for compensating communication delay, which can solve the problems of poor targeting of existing communication delay compensation schemes and the tendency to overcompensate or undercompensate.
[0006] According to a first aspect of the embodiments of this application, a method for compensating for communication delay is provided, applied to a machine device having a joint mechanism, the machine device including: a main controller and a joint actuator for driving the joint mechanism; The method includes: The machine is equipped with a first delay parameter under a first configuration and a second delay parameter under a second configuration; wherein the first delay parameter and the second delay parameter are used to characterize phase lag information or time domain delay information. The first delay parameter is obtained by injecting a test signal locally into the joint actuator and collecting feedback from the test signal under the first configuration; the second delay parameter is obtained by injecting the test signal into the joint actuator through the communication bus and receiving feedback from the test signal sent by the joint actuator under the second configuration. The communication delay time is determined based on the difference between the first delay parameter and the second delay parameter; wherein, the communication delay includes the delay generated by the transmission of signals between the main controller and the joint driver via the communication bus; Based on the aforementioned delay time, delay compensation is applied to the current loop of the joint actuator.
[0007] According to a second aspect of the embodiments of this application, a communication delay compensation device is provided, applied to a machine device having a joint mechanism, the machine device including: a main controller and a joint actuator for driving the joint mechanism; the device includes: The acquisition module is used to acquire a first delay parameter of the machine under a first configuration and a second delay parameter under a second configuration; wherein the first delay parameter and the second delay parameter are used to characterize phase lag information or time domain delay information; The first delay parameter is obtained by injecting a test signal locally into the joint actuator and collecting feedback from the test signal under the first configuration; the second delay parameter is obtained by injecting the test signal into the joint actuator through the communication bus and receiving feedback from the test signal sent by the joint actuator under the second configuration. A delay determination module is used to determine the delay time of communication delay based on the difference between the first delay parameter and the second delay parameter; wherein, the communication delay includes: the delay generated by the transmission of signals between the main controller and the joint driver via the communication bus; A delay compensation module is used to perform delay compensation on the current loop of the joint actuator based on the delay time.
[0008] According to a third aspect of the present application, a machine device is provided, the machine device having a joint mechanism, the machine device including: a main controller and a joint actuator for driving the joint mechanism; the machine device is configured to perform a communication delay compensation method as described in the first aspect.
[0009] According to a fourth aspect of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect of the present application.
[0010] According to a fifth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the method described in the first aspect of the present application.
[0011] According to a sixth aspect of the present application, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described in the first aspect of the present application.
[0012] The beneficial effects of the technical solutions provided in this application are: In this embodiment, by obtaining the first delay parameter of the machine device under the first configuration (bypassing the communication bus) and the second delay parameter under the second configuration (via the communication bus), and determining the delay time of the communication delay based on the difference between the two, and then performing delay compensation on the current loop of the joint driver based on the delay time, the delay introduced by the communication protocol stack is accurately separated from the internal electrical delay of the joint driver, so that subsequent compensation can be specifically designed for the communication delay. This avoids the overcompensation or undercompensation problems caused by general compensation in the prior art, thereby significantly improving the accuracy and specificity of the compensation, and effectively solving the technical problem that the delay introduced by the communication bus is mixed with the internal electrical delay of the joint driver and cannot be specifically compensated for the communication delay.
[0013] Additional aspects and advantages of the embodiments of this application will be set forth in part in the description which follows, and will become apparent from the description or may be learned by practice of the application. Attached Figure Description
[0014] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 A flowchart illustrating the communication delay compensation method provided in this application embodiment; Figure 2 This is one of the schematic diagrams of the calibration process provided in the embodiments of this application; Figure 3 This is the second schematic diagram of the calibration process provided in the embodiments of this application; Figure 4 This is a schematic diagram of the architecture of the machine equipment provided in the embodiments of this application; Figure 5 A schematic diagram of the communication delay compensation device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0015] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0016] Those skilled in the art will understand that, unless otherwise stated, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in the embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “multiple” refers to two or more; therefore, in the embodiments of this application, “multiple” can also be understood as “at least two.” The term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / ", unless otherwise specified, generally indicates that the related objects before and after it are in an "or" relationship.
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0018] In the field of machine control with articulated mechanisms, to compensate for the signal transmission delay introduced on the communication bus between the main controller and the articulated actuator, the common practice is to estimate a fixed nominal delay value during the system commissioning phase using a single timestamp measurement or engineering experience. Subsequently, a corresponding predictive compensation element is introduced into the control law to counteract the impact of this fixed delay on the closed-loop phase margin. Specifically, the calibration personnel apply a step torque command to the joint and record the moment the command is issued. With encoder feedback response time , with difference This delay estimate is written into the controller parameter table after the entire machine is debugged and remains unchanged during subsequent operation. Its basic working principle assumes that the communication delay is constant and that all joints have the same delay characteristics. This method is widely used primarily because it requires low computing resources from the controller and can provide acceptable compensation in scenarios such as industrial robotic arms with a small number of joints.
[0019] However, when the above solution is applied to multi-joint humanoid robots (typically with dozens of joints) and where there are significant individual differences between joints due to bus topology location, driver firmware version, and hardware batch, its performance is less than ideal. The main reason is that, in pursuit of ease of debugging and low computational overhead, the inherent fixed compensation design of the above solution cannot adapt to latency differences ranging from 0.3ms to 1.5ms between joints. This results in insufficient compensation for joints with large latency and overcompensation for joints with small latency, ultimately causing severe differentiation in phase margin between different joints. Furthermore, the calibration results of the fixed compensation may become invalid with changes in operating conditions, requiring manual recalibration. For example, communication latency can drift due to factors such as temperature, bus load, and driver firmware upgrades. The fixed compensation values gradually become inaccurate over time after the robot leaves the factory, requiring professional intervention for recalibration, resulting in high maintenance costs.
[0020] To address the issues of low accuracy and insufficient specificity in fixed compensation, some solutions employ time-domain identification methods to measure the delay of each joint individually. This approach sends step or pulse torque commands to the joint actuators, records the time of command frame transmission and actuator feedback frame arrival using high-precision timestamps, calculates the round-trip delay using cross-correlation functions or timestamp differences, and then converts it to a one-way delay. However, it also has certain drawbacks. Its identification resolution is limited by the control cycle (usually on the order of milliseconds), and its identification error is relatively large for sub-millisecond communication delays. In the time-domain step response, the communication delay is related to the current loop bandwidth (determined by the motor inductance). , and resistance The phase lag caused by the determined electrical time constant is aliased in the time domain waveform and is difficult to separate. If the sum of the two is used as compensation for communication delay, it will lead to repeated compensation for electrical delay, introducing new instability factors.
[0021] To overcome the above contradictions, this application proposes a different technical approach. The core idea is to improve the situation of communication delay and electrical delay aliasing by introducing a comparison and identification mechanism of having / not having a communication link, thereby achieving effective differentiation and improving the accuracy and pertinence of delay identification.
[0022] The communication delay compensation method provided in this application embodiment can be applied to machine equipment with joint mechanisms, such as humanoid robots and industrial robots; the machine equipment includes: a main controller and a joint actuator for driving the joint mechanism.
[0023] The main controller connects to each joint actuator via a communication bus, which can use EtherCAT, CAN, or other serial bus protocols to send control commands and receive feedback data from each joint actuator. The joint actuator internally runs a Field-Oriented Control (FOC) algorithm, including current, speed, and position loops. The current loop receives d-axis and q-axis current reference values from the main controller, drives the motor via PWM modulation, and simultaneously acquires signals from current and position sensors as feedback. The signal transmission path between the main controller and the joint actuators includes a downward command channel and an upward feedback channel; the communication bus introduces delays in these two channels. For example, the delay introduced by the communication bus... The total communication loop delay exists between the main controller issuing a command and the joint actuator receiving the command, and between the joint actuator reporting feedback and the main controller receiving feedback. = + ,in, This is due to the delay during the command downlink process. To compensate for delays during the uplink process, this embodiment of the application can compensate for the total communication loop delay.
[0024] Understandably, a joint controller running the FOC algorithm can project the three-phase currents onto a rotating coordinate system via Clarke and Park transformations to obtain the d-axis current. (Fluid component) and q-axis current (Torque component). During steady-state operation, the d-axis and q-axis will be decoupled from each other at the control level. Injecting a test signal into the d-axis will not generate coupling torque in the q-axis, thus ensuring that the motor does not generate torque output during this period.
[0025] In some embodiments, each joint actuator has a local debugging interface, which can directly accept local signal injection without going through the communication bus, thereby enabling parameter measurement under different configurations. The entire machine can be calibrated by a host computer to perform process scheduling and data management for the main controller and joint actuators.
[0026] like Figure 1 As shown, this application embodiment provides a communication delay compensation method, which can be applied to the above-mentioned machine equipment. The communication delay compensation method may include: Step 101: Obtain the first delay parameter of the machine under the first configuration and the second delay parameter under the second configuration.
[0027] In this step, the first delay parameter is obtained by injecting test signals locally into the joint driver and collecting feedback from the test signals under the first configuration; the second delay parameter is obtained by injecting test signals into the joint driver through the communication bus and receiving feedback from the test signals sent by the joint driver under the second configuration.
[0028] The test signal, as the input signal, will be fed into the joint actuator. For example, the test signal can be the result of superimposing a preset signal onto the d-axis current reference value. This preset signal can be a sweep signal, such as a multi-frequency sinusoidal sweep signal. = · k = 1, 2, …, N This represents the frequency value at the k-th frequency point. Indicates the amplitude of a single-frequency component. This represents the initial phase of the k-th frequency component; correspondingly, the test signal... ;in, This indicates the d-axis current reference value or bias current. This indicates a multi-frequency sinusoidal sweep signal.
[0029] The test signal feedback is the output signal when the joint actuator takes the test signal as input. For example, it can be the d-axis current feedback. In some embodiments, the feedback of the test signal can be obtained by sampling a current sensor and performing a Park transform.
[0030] In some embodiments, the preset signal can also be a pseudo-random binary sequence. Correspondingly, the test signal is a d-axis current command sequence. The test signal feedback is a d-axis current feedback sequence. .
[0031] Understandably, in the first configuration, the joint driver injects a test signal locally or via a direct local connection and directly acquires the feedback from that test signal, bypassing the communication bus between the main controller and the joint driver. For example, the test signal can be generated by the joint driver's own digital signal processor (DSP) and directly applied to its internal control loop, followed by the acquisition of the corresponding feedback signal. Since the entire signal path is confined to within the joint driver, the first delay parameter can reflect the electrical delay within the joint driver, which may include at least one of: current loop control delay, pulse width modulation delay, and current sampling delay.
[0032] Similarly, in the second configuration, the main controller injects test signals into the joint driver via the communication bus and receives feedback from the joint driver regarding these test signals. For example, the main controller generates test commands and sends them to the designated joint driver via a fieldbus such as EtherCAT or CAN. After executing the commands, the joint driver sends feedback data back to the main controller via the fieldbus. Therefore, the second delay parameter can reflect the sum of the electrical delay and communication delay within the joint driver; for example, the communication delay can be the total delay caused by signal transmission between the main controller and the driver via the communication bus.
[0033] Both the first delay parameter and the second delay parameter are used to characterize phase lag information or time-domain delay information.
[0034] In some embodiments, both the first delay parameter and the second delay parameter are used to characterize phase lag information. For example, the two delay parameters can be the phase frequency characteristics of the frequency response function.
[0035] In some embodiments, both the first delay parameter and the second delay parameter are used to characterize time-domain delay information. For example, the two delay parameters can be delay estimates obtained under the cross-correlation method.
[0036] Step 102: Determine the communication delay time based on the difference between the first delay parameter and the second delay parameter.
[0037] In this step, the communication delay includes the delay caused by the transmission of signals between the main controller and the joint driver via the communication bus.
[0038] Since the first delay parameter reflects the internal electrical delay of the joint actuator, and the second delay parameter reflects the sum of the internal electrical delay and the communication delay, the difference between the two delay parameters is the communication delay or its duration. For example, if the second delay parameter is 1.5 milliseconds and the first delay parameter is 0.5 milliseconds, then the communication delay is 1.0 millisecond. This approach can accurately separate the delay introduced by the communication protocol stack from the phase lag caused by the motor's electrical time constant.
[0039] It is understandable that different parameter types of delay parameters correspond to different determination methods in order to determine the delay time of communication.
[0040] When the first delay parameter and the second delay parameter are used to characterize phase lag information, the difference between the delay parameters is the difference between the phase frequency characteristics of the frequency response function. The communication delay time is obtained by linearly fitting the difference.
[0041] When the first delay parameter and the second delay parameter are used to characterize phase lag information, the difference between the delay parameters is the difference between the phase frequency characteristics of the frequency response function. The communication delay time is obtained by linearly fitting the difference.
[0042] When the first delay parameter and the second delay parameter are used to characterize time-domain delay information, the difference between the delay parameters can be the difference between the delay estimates obtained by the cross-correlation method.
[0043] Step 103: Based on the delay time, perform delay compensation on the current loop of the joint actuator.
[0044] In this step, the purpose of delay compensation is to counteract the phase lag introduced by communication delay, thereby restoring or improving the phase margin of the current loop.
[0045] For example, a phase lead filter can be designed based on this delay time and embedded in the forward path of the current loop. This targeted compensation can significantly improve the dynamic response performance of machinery under conditions such as high-speed operation or sudden load changes, solving the overcompensation or undercompensation problems caused by general compensation in related technologies.
[0046] With typical communication delay Taking 1 ms as an example, at a frequency of 1 kHz, the phase lag introduced by the uncompensated communication delay is: Δφ = 360° × × = 360° × 1 ms × 1 kHz = 360°; This phase lag severely compresses the phase margin (PM) of the closed-loop system, forcing the controller gain to be reduced in order to maintain stability, and the equivalent control bandwidth is severely limited.
[0047] After delay compensation using the method provided in this embodiment, the phase lag introduced by communication delay is canceled out by feedforward, the compensation residual is less than 10°, and the phase margin and gain margin (GM) are restored to a safe range (e.g., PM>45°, GM>6 dB). Furthermore, the controller gain can be increased accordingly, the equivalent current loop control bandwidth is improved, and the response speed and tracking accuracy of the joint are improved in scenarios such as high-speed movement, contact collisions, and sudden load changes.
[0048] In this embodiment, by obtaining the first delay parameter of the machine device under the first configuration (bypassing the communication bus) and the second delay parameter under the second configuration (via the communication bus), and determining the delay time of the communication delay based on the difference between the two, and then performing delay compensation on the current loop of the joint driver based on the delay time, the delay introduced by the communication protocol stack is accurately separated from the internal electrical delay of the joint driver, so that subsequent compensation can be specifically designed for the communication delay. This avoids the overcompensation or undercompensation problems caused by general compensation in the prior art, thereby significantly improving the accuracy and specificity of the compensation, and effectively solving the technical problem that the delay introduced by the communication bus is mixed with the internal electrical delay of the joint driver and cannot be specifically compensated for the communication delay.
[0049] In some embodiments of this application, obtaining a first delay parameter of the machine device under a first configuration and a second delay parameter under a second configuration includes: In the first configuration, with the joint mechanism in a stationary state and the q-axis current reference value set to zero, a test signal is superimposed on the d-axis current reference value of the current loop of the joint actuator, and the first d-axis current input signal and the first d-axis current feedback signal are recorded; based on the first d-axis current input signal and the first d-axis current feedback signal, a first frequency response function is obtained, and the phase lag information represented by the first phase frequency characteristic curve of the first frequency response function is determined as the first delay parameter; In the second configuration, with the joint mechanism in a stationary state and the q-axis current reference value set to zero, a test signal is superimposed on the d-axis current reference value of the current loop of the joint actuator, and the second d-axis current input signal and the second d-axis current feedback signal are recorded. Based on the second d-axis current input signal and the second d-axis current feedback signal, a second frequency response function is obtained, and the phase lag information represented by the second phase frequency characteristic curve of the second frequency response function is determined as the second delay parameter.
[0050] Understandably, when the motor of the joint actuator is completely stationary and the q-axis current reference value is set to zero, superimposing a wideband multi-frequency sinusoidal sweep test signal onto the d-axis current reference of the joint actuator can utilize the physical decoupling characteristics between the d-axis (magnetic flux axis) and the q-axis (torque axis) to ensure that no torque output is generated during the entire process, and the motor body does not move or experience mechanical impact.
[0051] For example, the motor speed of the joint actuator is zero (ω = 0), the rotor position is fixed, and the q-axis current reference value is... = 0. Under this condition, the Park transformation matrix degenerates into a fixed rotation matrix, with the cross-coupling terms of the d-axis and q-axis being 0. and Since all values are zero, the d-axis current loop is equivalent to an independent first-order linear system with the following transfer function: ;in For d-axis inductance, For stator resistance, This represents the inverter gain.
[0052] In some embodiments, a wideband multi-frequency sinusoidal sweep test signal is superimposed on the d-axis current reference value of the joint actuator. ,as a result ; Wideband multi-frequency sinusoidal sweep test signal k = 1, 2, …, N; in, This represents the bias current or d-axis current reference value, for example, It can be set to 10% to 20% of the rated d-axis current to ensure that the motor is in a weak field pre-excitation state and to avoid the nonlinear dead zone of the current loop near zero affecting the identification accuracy.
[0053] This indicates the injected amplitude or the amplitude of a single frequency component, which is set to not exceed 5% of the rated d-axis current. The total amplitude after multi-frequency superposition does not exceed 15% of the rated d-axis current, ensuring that no perceptible torque is generated.
[0054] Set the frequency range to cover the current loop control bandwidth. For example, the frequency range is 10 Hz to 5000 Hz, and the frequency points are logarithmically evenly distributed, with N = 50 to 200 frequency points.
[0055] This represents the initial phase at frequency point k. For example, the Schroeder phase allocation method can be used to minimize the time-domain superposition peak of each frequency component, thereby reducing the instantaneous impact on the current loop.
[0056] Additionally, the signal duration of the first d-axis current input signal is set. For example, the sampling frequency can be at least 10 times the period of the lowest frequency component (e.g., 2-5 seconds) to ensure spectral resolution in the low-frequency band; set the sampling frequency. For example, it can be no less than 10 times the highest test frequency (such as the current loop control frequency, which is 10 kHz to 20 kHz).
[0057] It is worth noting that the process of obtaining the first delay parameter under the first configuration is similar to the process of obtaining the second delay parameter under the second configuration. The difference between the two lies in the transmission path of the test signal and its feedback. To avoid repetition, this explanation will only take the process of obtaining the first delay parameter as an example.
[0058] When determining the first delay parameter, first ensure the joint actuator motor is stationary and force the q-axis current reference value to zero via the joint controller. Then, superimpose a test signal, such as a wideband multi-frequency sinusoidal sweep signal, onto the d-axis current reference value of the joint actuator's current loop. Simultaneously record the time-series data of the first d-axis current input signal and the first d-axis current feedback signal. For example, the two time-series data are: input signal... d-axis current command (including injection component), i.e. Output signal (t): d-axis current feedback, i.e. The data is sampled by a current sensor and obtained through Park transformation. The data acquisition timestamp can be provided by the local clock of the joint driver to ensure that the time alignment error between the input and output signals does not exceed one control cycle (e.g., alignment error ≤ 0.1 ms).
[0059] Then, the frequency response function is calculated using the H1 estimator, which can suppress the influence of output noise. The collected time-series data can be divided into... Segment (for example, = 8~16), calculate the cross power spectral density and autopower spectral density after adding a Hanning window to each segment: Cross-power spectral density: m = 1, …, M; Self-power spectral density: m = 1, …, M; Frequency response function estimate: ; in and Let be the discrete Fourier transforms of the m-th input signal and the output signal, respectively. for . conjugate.
[0060] Therefore, the first delay parameter is the phase-frequency characteristic of the frequency response function or represents the phase lag information. For example, the first delay parameter = That is, the phase angle or phase spectrum of the frequency response function.
[0061] In this embodiment, the reference value of the q-axis current is zero, and the torque output of the current loop is determined only by the q-axis current. Therefore, injecting a test signal into the d-axis will not generate any actual electromagnetic torque, and the motor can remain completely stationary, thereby fundamentally eliminating the safety risks caused by mechanical shock.
[0062] In some embodiments of this application, the communication delay time is determined based on the difference between a first delay parameter and a second delay parameter, including: Based on the first phase frequency characteristic curve and the second phase frequency characteristic curve, the phase frequency difference values at multiple frequency points are calculated; Linear fitting is performed on the phase frequency difference values at multiple frequency points to obtain the fitting results; The phase frequency slope indicated by the fitting result is determined as the communication delay time.
[0063] It should be noted that after obtaining the first and second phase frequency characteristic curves, the phase frequency difference or phase difference value of these two phase frequency characteristic curves at the same frequency is calculated, thus obtaining a phase frequency difference value sequence at multiple frequency points. Since the phase frequency characteristic of the pure delay element is linearly related to the frequency, the phase frequency difference value sequence will theoretically appear as a straight line over a wide frequency band (e.g., 10Hz to 5kHz). Subsequently, a linear fit is performed on the calculated phase frequency difference values at multiple frequency points to obtain a fitted straight line. The slope of this fitted straight line, i.e., the phase frequency slope, represents the communication delay time.
[0064] For example, if the fitting results show that the phase frequency slope is -360 degrees per 1 kHz frequency change, the corresponding delay is 1 millisecond. This method elevates delay identification from the time domain, which is limited by the control cycle, to the frequency domain, making the identification resolution dependent on the frequency resolution and phase measurement accuracy, achieving a level better than 10 microseconds. Compared to the time-domain timestamp differential method in related technologies, which is limited by millisecond-level control cycles, the technical solution provided in this application improves accuracy by approximately 100 times and can effectively identify individual differences in sub-millisecond communication delays.
[0065] To facilitate understanding, the calculation process for the delay time is explained below using a calculation formula.
[0066] It is understandable that, since communication delay does not affect the amplitude, the amplitude-frequency characteristics of the first and second frequency response functions are the same. Therefore, the difference in phase-frequency characteristics between the two frequency response functions is: ; in, This represents the difference in phase frequency characteristics or the phase frequency difference value. The phase angle of the second frequency response function. Let f be the phase angle of the first frequency response function, and ω = 2π·f be the angular frequency. This is due to communication delay.
[0067] In this embodiment, when performing linear fitting on the phase frequency difference, weighted least squares linear fitting can be used, but it is not limited to this. For example, with the angular frequency ω as the independent variable, the phase frequency difference... Using a weighted least squares linear fit as the dependent variable, the communication delay can be obtained. : k is the frequency point; in, Due to communication delay, The weights of the frequency points, Let ω be the angular frequency at the k-th frequency point, and τ be the fitted variable.
[0068] Correspondingly, for electrical delay It can be obtained using the following formula: ; Among them, in the high frequency band ( The arctan term approaches -π / 2, and the phase frequency slope is mainly due to... It was determined that the electrical delay could be extracted through high-frequency linear fitting. . Let ω be the phase angle of the first frequency response function, and ω be the angular frequency. For d-axis inductance, This is the stator resistance of the motor.
[0069] In this embodiment, based on the principle that the phase-frequency characteristics of communication delay satisfy a linear relationship, the slope is extracted by linear fitting of multiple frequency points, thereby improving the delay identification from the time domain to the frequency domain. This makes the identification resolution dependent on the frequency resolution and the phase measurement accuracy, greatly improving the identification accuracy.
[0070] In order to eliminate the impact of noise and other interference factors on the accuracy of communication delay fitting, in some embodiments of this application, multiple frequency points are frequency points obtained based on signal coherence screening and whose coherence function values are greater than a preset threshold.
[0071] It should be noted that the multiple frequency points used for linear fitting are not all frequency points used directly, but rather selected.
[0072] In this embodiment, a coherence function is introduced as an evaluation index for the quality of frequency identification. The coherence function value is calculated simultaneously with the frequency response function. The coherence function value ranges from 0 to 1; the closer the value is to 1, the stronger the linear correlation between the input and output signals at that frequency point, indicating a more reliable or higher-quality identification result for that frequency point.
[0073] Therefore, this embodiment only retains frequency points where the coherence function value is greater than a preset threshold (e.g., 0.9, but not limited to this) for subsequent linear fitting of the phase frequency difference.
[0074] For example, coherence function The formula for calculating (f) is as follows: ; in, For coherence function or coherence function value, Let be the self-power spectral density of the d-axis current input signal. The power spectral density of the d-axis current feedback signal is... This represents the cross-power spectral density of the d-axis current input signal and the d-axis current feedback signal.
[0075] In some embodiments, the d-axis current input signal can be the input signal described in the above embodiments. d-axis current command (including injection component); the d-axis current feedback signal can be the output signal of the above embodiment. d-axis current feedback.
[0076] It is worth noting that after determining the first and second frequency response functions, their respective frequency points can be selected separately. For example, when selecting the frequency points for the first frequency response function, Let be the auto-power spectral density of the first d-axis current input signal. Let be the self-power spectral density of the first d-axis current feedback signal. For the second frequency response function, when selecting its frequency points, The power spectral density of the second d-axis current input signal is given. The power spectral density of the second d-axis current feedback signal is given.
[0077] In this embodiment of the application, by eliminating low-coherence frequency points, the robustness and accuracy of communication delay identification results can be significantly improved, and the impact of invalid data on the fitting results can be reduced.
[0078] In some embodiments of this application, delay compensation is performed on the current loop of the joint actuator based on the delay time, including: The coefficients of the compensation filter are calculated based on the delay time; The coefficients of the compensation filter are written into the joint driver to embed the compensation filter into the current loop of the joint driver.
[0079] It should be noted that the compensation filter can be an all-pass filter based on the Padé approximation or a phase-leading filter.
[0080] When calculating the coefficients of the compensation filter, the bilinear transformation (Tustin transform) can first be used to convert the continuous-domain transfer function of the compensation filter into a discrete-domain transfer function. That is, from the S-domain to the Z-domain: ; in: The Laplace operator for continuous fields; For discrete-domain shift operators; The sampling period is equal to the current loop control frequency. The reciprocal of, that is .
[0081] Then, the discrete-domain transfer function described above is converted into a difference equation that can be executed in the driver firmware: ; in, This is the filter output signal at the current sampling moment, i.e., the d-axis current loop command value after phase lead compensation; This is the filter output signal from the previous sampling time. This is the index of the current sampling time; The filter input signal at the current sampling moment is the original command value of the d-axis current loop; The filter input signal is the signal from the previous sampling time. , Forward coefficients, The feedback coefficient is based on communication delay. and adoption cycle Sure.
[0082] Finally, the feedforward coefficients calculated above are used... , and feedback coefficient The filter coefficient register is written to the firmware (such as Flash or EEPROM) of the joint driver. When the driver is powered on and initialized, the coefficients are automatically loaded from this register into the memory of the digital signal processor (DSP) for real-time difference equation calculation.
[0083] In this embodiment, communication delay compensation can be automatically achieved without the need for engineers to manually adjust complex parameters, thus reducing the risk of errors and inconsistencies introduced by human operation.
[0084] In some embodiments of this application, the compensation filter includes: a first phase lead filter constructed by the first-order Padé approximation, a second phase lead filter constructed by the second-order Padé approximation, and a Smith predictor. Embedding the compensation filter in the current loop of the joint driver includes: When the first condition is met, the first phase lead filter is embedded in the forward channel of the current loop of the joint driver; When the second condition is met, the second phase lead filter is embedded in the forward channel of the current loop of the joint driver; When the third condition is met, the Smith predictor is embedded in the feedback channel of the current loop of the joint driver. The first condition includes at least one of the following: The delay time is less than the first time threshold; The target compensation accuracy is less than the accuracy threshold; The second condition includes at least one of the following: The delay time is greater than or equal to the first time threshold and less than the second time threshold; The target compensation accuracy is greater than or equal to the accuracy threshold; The third condition includes: the delay time is greater than or equal to the second time threshold.
[0085] It should be noted that compensation filters can have various structural forms, and different structural forms are suitable for different application scenarios. Therefore, once the application scenario is determined, a suitable compensation filter can be selected. Furthermore, different conditions can be set for different application scenarios; meeting the corresponding conditions defines the appropriate application scenario.
[0086] In this application embodiment, at least three structural forms of compensation filters are designed to adapt to various application scenarios, considering the duration of the delay time and / or the compensation accuracy. For example, the compensation filter may include: a first phase lead filter constructed using the first-order Padé approximation, a second phase lead filter constructed using the second-order Padé approximation, and a Smith predictor. The first phase lead filter is suitable for application scenarios with shorter delay times and / or lower compensation accuracy, the second phase lead filter is suitable for application scenarios with longer delay times and / or higher compensation accuracy, and the Smith predictor is suitable for application scenarios with even greater delay times.
[0087] In this embodiment, the first time threshold and the second time threshold are two preset durations, and the first time threshold is less than the second time threshold. Therefore, the two time thresholds can be used to divide the time into three duration intervals: a shorter duration interval below the first time threshold, a longer duration interval between the two time thresholds, and an even longer duration interval above the second time threshold, corresponding to the aforementioned three application scenarios.
[0088] The accuracy threshold is a pre-set compensation accuracy parameter value. If the accuracy is below this threshold, it can be considered a low-precision compensation scenario; if it is above this threshold, it can be considered a high-precision compensation scenario. The target compensation accuracy is the target value in the current scenario, and its setting method is not limited.
[0089] To facilitate understanding, the following example illustrates the process of selecting an appropriate compensation filter for different application scenarios.
[0090] First, assume the communication delay or the delay time of the communication delay is... .
[0091] Scenario 1: If If the phase lag is relatively small, a first-order Padé approximation can be used to construct a phase lead filter, embedding a current loop forward channel to compensate for the phase lag introduced by communication delay.
[0092] The transfer function of the pure delay element is: Its first-order Padé approximation is: Where s is the Laplace operator, This is a delay time.
[0093] This phase-lead filter is an all-pass filter with an amplitude-frequency response of 1 (without changing the gain) and a phase-frequency response of: So, in the low frequency band ( ), It is out of phase with the pure delay element, thus enabling phase compensation, i.e., communication compensation.
[0094] Scenario 2: For scenarios with significant latency or requiring higher precision compensation, a second-order Padé approximation can be used: ; Similarly, the phase-frequency characteristics of the constructed phase-lead filter are opposite to those of the pure delay element, thus enabling phase compensation, i.e., communication compensation.
[0095] Scenario 3: For cases with significant communication delays (e.g.) In scenarios where the delay element is not explicitly stated, the Smith predictor structure can be used. The Smith predictor introduces a prediction model into the current loop feedback path, removing the delay element from the closed-loop characteristic equation. The equivalent control law is: ; in These are estimated values for the electrical model of the motor. For inverter gain, It is the original current loop PI controller. For the output of the PI controller, This is the d-axis current reference command, where 's' is the Laplace operator and the parameters of the Smith predictor. and It can be identified from the frequency response function.
[0096] In this embodiment, a hierarchical compensation strategy is established, which can automatically match the most suitable compensator structure according to the specific duration and accuracy requirements of the identified communication delay. For example, a filter constructed by the first-order Padé approximation is used when the delay is small, and a Smith predictor with better compensation effect is used when the delay is large, thereby achieving a balance between computational overhead and compensation performance.
[0097] To enhance the security of the communication compensation process, in some embodiments of this application, after writing the coefficients of the compensation filter into the joint driver, the method further includes: Obtain the open-loop frequency response function of the current loop after compensation; Determine the phase margin and gain margin based on the open-loop frequency response function; Repeat the following steps until the updated phase margin is greater than the first margin threshold and the updated gain margin is greater than the second margin threshold: Reduce the amount of delay compensation according to the target ratio, and update the phase margin and gain margin.
[0098] It should be noted that after the compensation filter coefficients are written into the joint driver, the machine will subsequently perform communication compensation / delay compensation accordingly. In some embodiments, the delay compensation process described above occurs during the calibration phase of the machine, i.e., before it is officially put into use. To avoid a series of problems caused by unreasonable delay compensation after it is officially put into use, this application embodiment adds a stability verification phase after the delay compensation in the calibration phase to verify whether the delay compensation is appropriate.
[0099] For example, the open-loop frequency response function of the compensated current loop can be obtained by injecting a signal and analyzing the feedback. Then, the phase margin and gain margin are determined from this open-loop frequency response function. Verification results are generated based on the phase margin and gain margin.
[0100] In this embodiment, a first margin threshold and a second margin threshold are preset. The verification result is generated by comparing the margin thresholds with the calculated phase margin and gain margin. The first and second margin thresholds can be determined based on experience or scenario requirements. For example, the first margin threshold can be 45 degrees, and the second margin threshold can be 6 dB. Furthermore, the target ratio is a positive number less than 1; for example, the target ratio is greater than or equal to 0.5 and less than 1.
[0101] It is worth noting that in this embodiment, the delay time can be dynamically adjusted during the verification process to obtain a suitable delay compensation result. For example, if the updated phase margin is not greater than the first margin threshold, or the updated gain margin is not greater than the second margin threshold, it indicates that the compensation is excessive or insufficient. In this case, the actual delay compensation amount (delay time) can be reduced by a target ratio (e.g., 0.8), and the filter coefficients, updated phase margin, and gain margin can be recalculated based on the reduced compensation amount, and the verification can be performed again. This process will be repeated until the updated phase margin and gain margin meet the conditions.
[0102] Specifically, the compensated open-loop transfer function is: ; in, For PI controller frequency response, For the frequency response of the electric motor's electrical transfer function, For communication delay frequency response, To compensate for the frequency response of the filter.
[0103] Gain Crossover Frequency At this point, the phase margin PM = 180° + ; Phase crossing frequency At this point, the gain margin GM = .
[0104] In this embodiment, a closed-loop verification and automatic correction mechanism is set at the end of the compensation process. This mechanism can automatically detect and prevent the introduction of new unstable factors by "overcompensation", ensuring that the compensated equipment always meets the preset stability margin and improving the security of the communication compensation process.
[0105] In some embodiments of this application, the method further includes: If the updated phase margin is greater than the third margin threshold, the target ratio is reduced by a preset step size.
[0106] It should be noted that if the phase margin is too large, it means that the compensation amount exceeds the actual delay. In this case, to prevent phase lead instability introduced by overcompensation, it is necessary to reduce the target ratio. For example, the target ratio can be reduced by a preset value. This preset value is usually small, such as 0.05, but is not limited to this.
[0107] In some embodiments of this application, obtaining a first delay parameter of the machine device under a first configuration and a second delay parameter under a second configuration includes: In the first configuration, with the joint mechanism in a stationary state and the q-axis current reference value set to zero, a test signal is superimposed on the d-axis current reference value of the current loop of the joint actuator, and the third d-axis current input signal and the third d-axis current feedback signal are recorded; based on the third d-axis current input signal and the third d-axis current feedback signal, a first cross-correlation function is obtained, and based on the time delay corresponding to the peak value of the first cross-correlation function and the sampling period, a first total delay estimate is determined, and the first total delay estimate is determined as the first delay parameter; In the second configuration, with the joint mechanism in a stationary state and the q-axis current reference value set to zero, a test signal is superimposed on the d-axis current reference value of the current loop of the joint actuator, and the fourth d-axis current input signal and the fourth d-axis current feedback signal are recorded. Based on the fourth d-axis current input signal and the fourth d-axis current feedback signal, a second cross-correlation function is obtained. According to the time delay corresponding to the peak value of the second cross-correlation function and the sampling period, a second total delay estimate is determined, and the second total delay estimate is determined as the second delay parameter.
[0108] It should be noted that when the motor of the joint actuator is completely stationary and the q-axis current reference value is set to zero, superimposing a wideband multi-frequency sinusoidal sweep test signal onto the d-axis current reference of the joint actuator can utilize the physical decoupling characteristics between the d-axis (magnetic flux axis) and the q-axis (torque axis) to ensure that no torque output is generated during the entire process, and the motor body does not move or experience mechanical impact.
[0109] Compared to the method described above, which uses the phase-frequency characteristic curve of the frequency response function to determine the communication delay, this embodiment uses a time-domain cross-correlation method to determine the communication delay. That is, instead of calculating the frequency response function, this embodiment calculates the first cross-correlation function between the input signal and the feedback signal. Then, the time delay corresponding to the peak value of this cross-correlation function is found, and this time delay is multiplied by the sampling period to obtain the first total delay estimate, which is then determined as the first delay parameter. Similarly, the above process is repeated in the second configuration to obtain the second delay parameter. It is worth noting that the process of injecting current into the d-axis and obtaining the feedback signal is the same in both cases, and will not be repeated here. The test signal can also be a pseudo-random binary sequence.
[0110] Furthermore, the process of obtaining the first delay parameter under the first configuration is similar to the process of obtaining the second delay parameter under the second configuration. The difference between the two lies in the transmission path of the test signal and its feedback. To avoid repetition, this explanation will only take the process of obtaining the first delay parameter as an example.
[0111] In this embodiment, the d-axis current command sequence can be acquired synchronously. (Third d-axis current input signal) and d-axis current feedback sequence (Third d-axis current feedback signal). Then, the cross-correlation function of the two sequences is calculated: Where τ is the number of time-delayed samples; the time delay corresponding to the peak value of the cross-correlation function is taken. Multiply by the sampling period The total delay estimate is obtained. Perform the above steps under both configurations, and the difference between the total delay estimates is the communication delay: ,in, This is the estimated total latency under the second configuration. The total latency estimate under the first configuration; based on communication latency or its latency time. The process of designing a compensation filter is the same as the process described above, and will not be repeated here.
[0112] The algorithm used in this embodiment is simpler, has a lower computational load, is more compatible with embedded processors, and does not require FFT operations. It has relatively relaxed requirements on the length of the sampled data, and can complete a single calculation of the communication delay in a short time. At the same time, it retains the d-axis static injection frame, fully preserves the zero torque characteristics, and maintains the same level of safety.
[0113] In this embodiment, a time-domain cross-correlation algorithm with lower computational complexity is used to calculate communication latency, thereby reducing the computational resources used in the processing and lowering the computational power requirements of the machine's processor.
[0114] In some embodiments of this application, obtaining a first delay parameter of the machine device under a first configuration and a second delay parameter under a second configuration includes: In the first configuration, with the joint mechanism in the position locked state, a test signal is superimposed on the q-axis current reference value, and the first q-axis current input signal and the first q-axis current feedback signal are recorded; based on the first q-axis current input signal and the first q-axis current feedback signal, the third frequency response function is obtained, and the phase lag information represented by the third phase frequency characteristic curve of the third frequency response function is determined as the first delay parameter; In the second configuration, with the joint mechanism in the locked position, a test signal is superimposed on the q-axis current reference value, and the second q-axis current input signal and the second q-axis current feedback signal are recorded. Based on the second q-axis current input signal and the second q-axis current feedback signal, the fourth frequency response function is obtained, and the phase lag information represented by the fourth phase frequency characteristic curve of the fourth frequency response function is determined as the second delay parameter.
[0115] It should be noted that when obtaining the first delay parameter and the second delay parameter, the injection axis of the test signal can be switched from the d-axis to the q-axis.
[0116] Specifically, in the first configuration, with the joint mechanism in a locked position, a small-amplitude test signal is superimposed on the q-axis current reference value, and the first q-axis current input and feedback signals are recorded. Subsequently, a third frequency response function is calculated based on these signals, and the phase lag information represented by its third phase frequency characteristic curve is determined as the first delay parameter. Similarly, the above process is repeated in the second configuration to obtain the second delay parameter.
[0117] In some embodiments, a small-amplitude test signal (e.g., a sinusoidal sweep signal) is injected with an amplitude not exceeding 2% of the rated torque current, corresponding to a torque disturbance typically less than 0.1 N·m.
[0118] It is understandable that, compared to the above embodiments where a test signal (d-axis current reference value superimposed on the test signal) is injected into the d-axis and the delay parameter is determined using a frequency response function, this embodiment will inject a test signal into the q-axis and similarly determine the delay parameter using a frequency response function. The process of determining the delay parameter is the same, as are the processes of determining the delay time based on the delay parameter and performing delay compensation; therefore, they will not be repeated here.
[0119] In this embodiment, the q-axis current loop and the d-axis current loop have a symmetrical transfer function structure under the FOC framework, thus the identification accuracy is comparable to that of the d-axis injection-based technical solution. Furthermore, it can still achieve high-precision online delay identification on hardware platforms where the driver firmware does not support an independent d-axis injection interface or cannot achieve completely zero torque injection.
[0120] To address the issue of inaccurate compensation parameters caused by the slow drift of communication delays due to environmental factors, in some embodiments, after performing delay compensation on the current loop of the joint actuator based on the delay time, the method further includes: With current tracking error as the optimization target, the communication delay time is updated periodically; During each update of the communication delay, the updated delay time is controlled to remain within a preset boundary constraint range.
[0121] It should be noted that in long-term continuous operation scenarios, communication delays may exhibit significant temperature drift or time-varying characteristics. Therefore, in this embodiment, the communication delay can be calibrated over a long period of time.
[0122] In some embodiments, the communication delay compensation process described above can occur during the calibration process of the machine equipment. The long-term calibration process for communication delay can occur after the machine equipment is put into use, allowing the compensation filter to be extended from a fixed-parameter structure to an adaptive structure, thus enabling online updates of the delay compensation parameters.
[0123] For example, in the offline calibration phase: the d-axis static injection test signal provided in the above embodiment is used, and the initial communication delay time is obtained using the frequency response function. and current loop transfer function model (s).
[0124] Online operation phase: A Smith predictor structure is embedded in the current loop, and the internal model of the predictor is as follows: Design recursive least squares (RLS) or gradient descent adaptive laws to track current errors. To optimize the target, fine-tune the delay time online. Where μ is the adaptive step size (typical value) ).
[0125] At the same time, set update boundary constraints for the delay time: ,in A typical value is 0.5ms to prevent adaptive divergence; Finally, offline recalibration can be triggered periodically (e.g., every 24 hours or every power-on) to update... Benchmark value.
[0126] In this embodiment, the communication delay can be tracked slowly due to changes in temperature, load, and firmware status, and the compensation accuracy remains stable over a long period. The online adaptive system only requires fine-tuning, has a fast convergence speed, and does not affect the normal operation of the machine. For multi-joint systems, each joint independently maintains adaptive parameters, further enhancing the individualized compensation capability.
[0127] For ease of understanding, the following example of communication delay compensation for all joints of a humanoid robot will be used to illustrate the method provided in this application.
[0128] The humanoid robot comprises multiple joints, for example, the number of joints can be greater than or equal to 20 and less than or equal to 40. A batch calibration state machine can be constructed, and the communication latency of each joint can be compensated using the method provided in this application.
[0129] like Figure 2 As shown, the calibration process includes: S201, initiate batch calibration command; S202, Initialize the joint list, which includes all the joints of the humanoid robot to be calibrated; S203, Select the current joint, and then select one of the joints to be calibrated; S204 enables the selected joint to be calibrated, and then sets the q-axis current reference to zero.
[0130] S205, In the local direct connection mode, inject the sweep frequency signal and collect related signals. The local direct connection mode is equivalent to the mode corresponding to the first configuration in the above embodiments. This step can obtain the first d-axis current input signal and the first d-axis current feedback signal in the above embodiments.
[0131] S206, In bus mode, inject a sweep frequency signal and acquire related signals. Here, bus mode corresponds to the mode corresponding to the second configuration in the above embodiments. This step can obtain the second d-axis current input signal and the second d-axis current feedback signal in the above embodiments.
[0132] S207, calculate the frequency response function for both modes and obtain the delay time accordingly. This process is the same as the process of obtaining the delay time based on the first and second frequency response functions in the above embodiment, and will not be repeated here.
[0133] S208, determine if the delay time is reasonable. If so, proceed to S209; otherwise, proceed to S205. The goodness-of-fit can be used to determine the reasonableness of the delay time. For example, a goodness-of-fit threshold can be set. After obtaining the delay time using linear fitting, the goodness-of-fit of this linear fit is calculated and compared with the goodness-of-fit threshold (e.g., 0.99). If the former is larger, the delay time is determined to be reasonable; otherwise, the delay time is determined to be unreasonable.
[0134] S209, Construct a compensation filter and adjust the compensation filter based on the margin. This process is the same as the process of using a compensation filter to perform delay compensation and dynamically adjust the filter coefficients in the above embodiments, and will not be repeated here.
[0135] S210 writes the coefficients of the compensation filter into the driver flash.
[0136] S211, enable the selected joint to be calibrated and mark it as a joint that has been calibrated. Then determine if it is the last joint to be calibrated. If yes, end the process; otherwise, execute S203 to select a new joint to be calibrated.
[0137] In this embodiment, a complete multi-joint batch automated calibration state machine is designed. It sequentially performs a closed-loop process for each joint: signal injection → data acquisition → frequency response estimation → delay identification → compensation parameter calculation → parameter writing to the driver, eliminating the need for manual intervention for each joint. In terms of calibration efficiency, the complete calibration time for a single joint is typically less than 30 seconds. Compared to existing technologies that require individual manual operation for each joint and rely on engineer experience for estimation, this application improves the overall calibration efficiency by an order of magnitude, supports production line integration and automated quality inspection processes, and reduces reliance on the technical skills of calibration personnel.
[0138] In some embodiments of this application, the calibration process of the machine equipment can be divided into multiple stages, and the calibration of all joints can be performed in a stage-by-stage manner. For example... Figure 3 As shown, the calibration process for machinery and equipment may also include: S0, Initialization: For example, when the machine system is powered on, the host computer establishes communication with the main controller, reads the joint topology configuration file, and determines the list of joints to be calibrated. Initialize the calibration result database.
[0139] S1, Joint Enabling and Safety Check: Select the joint to be calibrated. The system sends an enable command to the corresponding joint actuator and checks the following safety conditions: the joint position sensor signal is normal, the joint temperature is below the protection threshold (<80°C), there are no joint fault alarms, and the robot body is in a safe fixed posture. If any condition is not met, the system jumps to the abnormal state and then skips that joint. .
[0140] S2~S3, Dual-configuration measurement: In configuration A (the first configuration in the above embodiments), the system switches to local direct connection mode via the joint driver debugging interface, and the driver's local DSP performs signal injection and data acquisition, with an acquisition duration of [duration missing]. After data collection is complete, the data will be uploaded to the host computer. Data collection time. For example, it can be 2~5S. The frequency range of the injected signal can be, for example, 10 Hz to 5000 Hz, covering the current loop bandwidth, and the amplitude of the injected signal can be, for example, less than or equal to five percent of the amplitude of the single-frequency component of the rated d-axis current.
[0141] In configuration B (the second configuration in the above embodiments), the host computer sends an injection signal through the communication bus to synchronously collect the d-axis current feedback data reported by the joint actuator, with a collection duration of [duration missing]. The injection signal is, for example, the same as the injection signal under configuration A.
[0142] S4, Frequency Response Function Calculation and Delay Identification: The host computer performs H1 estimation on the collected data from configurations A and B respectively, and calculates two frequency response functions. and Then, the coherence function is used to filter the effective frequency points, and the phase frequency difference Δφ(ω) is extracted based on the effective frequency points. Weighted least squares fitting is then performed to obtain the communication delay time. Then, a reasonableness judgment is made. If the identification result exceeds the reasonable range (for example, or If the condition is not met, it is marked as abnormal and states S2 to S4 are retried, with a maximum of 3 retries. If the condition is within a reasonable range, the next stage is executed. The sampling frequency involved can be consistent with the current loop frequency, with a range of, for example, 10 kHz to 20 kHz. The number of sampling points can be, for example, logarithmic distribution, ranging from 50 to 200; the number of H1 estimation segments can be, for example, 8 to 16.
[0143] S5, Compensation filter generation and stability verification: Construct a compensation filter and calculate the coefficients of the difference equation, based on Calculate the Padé approximation filter coefficients, calculate the post-compensation stability margin (phase margin and gain margin), and perform stability verification. If PM>45° and GM>6dB are not satisfied, adjust the compensation ratio α and re-verify until the conditions are met. Then determine if PM>80°? If yes, overcompensate and continue to reduce the compensation ratio; otherwise, write the compensation coefficient value to the joint driver, for example, the joint driver's non-volatile memory (Flash / EEPROM).
[0144] S6, Parameter Writing and Verification: Read back to verify data consistency and record calibration results to the database (including joint number, identification delay value, compensation ratio, stability margin, and calibration timestamp).
[0145] S7, Joint de-enabling and toggle: joint Enable the joint; if the joint list has not been completely traversed, switch to the next joint. Then jump to state S1; if all joint calibrations are completed, a whole-machine calibration report is generated to report the calibration results. For example, the whole-machine calibration report may include a summary of the identification delay values (delay time) of each joint, a list of compensation parameters, stability margin statistics, and a list of abnormal joints.
[0146] In this embodiment, the typical calibration time for a single joint (S1 to S7) is 20 to 30 seconds, and the total calibration time for a batch of 30 joints usually does not exceed 15 minutes.
[0147] In this embodiment, the identification process is executed independently for each joint, and the delay time of each joint is stored in the non-volatile memory of the joint actuator. Based on this, compensation filter parameters are generated independently for each joint. This ensures that each joint receives compensation that precisely matches its actual delay, avoiding the problem of undercompensation or overcompensation on joints with large delay deviations when the compensation value is fixed.
[0148] In this embodiment, before the compensation filter parameters are written into the joint driver, the system automatically calculates whether the phase margin and gain margin of the compensated closed-loop system meet the preset safety threshold. If the verification fails, the system automatically reverts to conservative compensation parameters or issues an alarm to prevent overcompensation from introducing new oscillations or instability risks due to identification errors or abnormal operating conditions.
[0149] According to another aspect of this application, a humanoid robot is provided, which can be equipped with a multi-joint servo drive system. This humanoid robot is configured to perform the methods provided in the above embodiments, thereby being applicable to factory calibration after assembly, on-site maintenance calibration, and recalibration after firmware upgrades. Furthermore, the calibration process does not require disassembly of the mechanical structure; the robot remains stationary or in a fixed posture, and the calibration is triggered by a single click from the host computer software, automatically completing the identification and compensation parameters for communication delays of all joints throughout the body. The entire calibration process takes no more than 15 minutes.
[0150] Specifically, the robot can achieve one-click calibration of the entire machine: The operator selects the "Joint Delay Calibration" function through the host computer calibration software interface, and the system automatically performs the calibration process for each joint in a preset order. During the calibration process, the robot body does not move at all and no manual intervention is required. The calibration results are automatically written to the non-volatile memory of each joint actuator.
[0151] Each joint independently stores its communication delay compensation parameters. (j is the joint number). The parameters are configured differently depending on the joint driver firmware version and bus topology location to avoid the accuracy loss caused by uniform fixed value compensation.
[0152] Furthermore, after calibration, the host computer software can automatically generate frequency response function curves for each joint, delay identification result reports, and phase margin comparisons before and after compensation, allowing engineers to confirm the compensation effect. The calibration process also supports command-line interface calls, enabling integration into production line automated testing systems for automated calibration and pass / fail determination during production line offline inspections.
[0153] like Figure 4 As shown, the robot comprises the following components: Calibration control module: running on the host computer, responsible for calibration process scheduling, joint selection, status management and human-computer interaction; the calibration process can be referred to the above embodiment, and will not be repeated here; Signal injection module ( Figure 4 (Injection in the middle): Integrated into the joint driver firmware, it is responsible for superimposing the test signal on the d-axis current loop reference value. This test signal is the test signal in the above embodiments, which will not be described again here; Data acquisition module ( Figure 4 (Not shown in the image): Responsible for synchronously acquiring time-series data of d-axis current commands and feedback; Frequency response estimation module: runs on the host computer and performs frequency response function calculations on the time series data collected by the data acquisition module; Delay identification module: Calculates communication delay value (delay time) based on the phase frequency characteristics of the frequency response function; Compensation filter generation module: Automatically calculates compensation filter parameters based on the identified delay time; Parameter storage module: Writes compensation parameters to the driver's non-volatile memory and manages the version.
[0154] It should be noted that the robot's communication bus, while achieving bus communication through the bus protocol stack, introduces communication latency. Joint actuators may also include modules such as FOC controllers, motors, and current sampling, which will not be detailed here.
[0155] Based on the same principle as the method provided in the embodiments of this application, the embodiments of this application also provide a communication delay compensation device, such as... Figure 5 As shown, the communication delay compensation device includes: The acquisition module 501 is used to acquire a first delay parameter of the machine under a first configuration and a second delay parameter under a second configuration; wherein the first delay parameter and the second delay parameter are used to characterize phase lag information or time domain delay information; The first delay parameter is obtained by injecting a test signal locally into the joint actuator and collecting the feedback of the test signal under the first configuration; the second delay parameter is obtained by injecting a test signal into the joint actuator through the communication bus and receiving the feedback of the test signal sent by the joint actuator under the second configuration. The delay determination module 502 is used to determine the delay time of the communication delay based on the difference between the first delay parameter and the second delay parameter; wherein the communication delay includes the delay generated by the transmission of signals between the main controller and the joint driver via the communication bus; The delay compensation module 503 is used to perform delay compensation on the current loop of the joint actuator based on the delay time.
[0156] In some embodiments, the acquisition module 501 includes: The first acquisition unit is configured to, under a first configuration, when the joint mechanism is in a stationary state and the q-axis current reference value is set to zero, superimpose a test signal onto the d-axis current reference value of the current loop of the joint actuator, and record the first d-axis current input signal and the first d-axis current feedback signal; obtain a first frequency response function based on the first d-axis current input signal and the first d-axis current feedback signal, and determine the phase lag information represented by the first phase frequency characteristic curve of the first frequency response function as the first delay parameter; The second acquisition unit is used to, under the second configuration, when the joint mechanism is in a stationary state and the q-axis current reference value is set to zero, superimpose a test signal onto the d-axis current reference value of the current loop of the joint actuator, and record the second d-axis current input signal and the second d-axis current feedback signal; obtain the second frequency response function based on the second d-axis current input signal and the second d-axis current feedback signal, and determine the phase lag information represented by the second phase frequency characteristic curve of the second frequency response function as the second delay parameter.
[0157] In some embodiments, the delay determination module 502 is specifically used for: Based on the first phase frequency characteristic curve and the second phase frequency characteristic curve, the phase frequency difference values at multiple frequency points are calculated; Linear fitting is performed on the phase frequency difference values at multiple frequency points to obtain the fitting results; The phase frequency slope indicated by the fitting result is determined as the communication delay time.
[0158] In some embodiments, the multiple frequency points are frequency points obtained based on signal coherence screening and whose coherence function values are greater than a preset threshold.
[0159] In some embodiments, the delay compensation module 503 includes: The coefficient calculation unit is used to calculate the coefficients of the compensation filter based on the delay time. The coefficient writing unit is used to write the coefficients of the compensation filter into the joint driver so that the compensation filter is embedded in the current loop of the joint driver.
[0160] In some embodiments, the compensation filter includes: a first phase lead filter constructed by the first-order Padé approximation, a second phase lead filter constructed by the second-order Padé approximation, and a Smith predictor. The coefficient writing unit is specifically used for: When the first condition is met, the first phase lead filter is embedded in the forward channel of the current loop of the joint driver; When the second condition is met, the second phase lead filter is embedded in the forward channel of the current loop of the joint driver; When the third condition is met, the Smith predictor is embedded in the feedback channel of the current loop of the joint driver. The first condition includes at least one of the following: The delay time is less than the first time threshold; The target compensation accuracy is less than the accuracy threshold; The second condition includes at least one of the following: The delay time is greater than or equal to the first time threshold and less than the second time threshold; The target compensation accuracy is greater than or equal to the accuracy threshold; The third condition includes: the delay time is greater than or equal to the second time threshold.
[0161] In some embodiments, the apparatus further includes: a compensation verification module, configured to: Obtain the open-loop frequency response function of the current loop after compensation; Determine the phase margin and gain margin based on the open-loop frequency response function; Repeat the following steps until the updated phase margin is greater than the first margin threshold and the updated gain margin is greater than the second margin threshold: Reduce the amount of delay compensation according to the target ratio, and update the phase margin and gain margin.
[0162] In some embodiments, the device further includes a scaling module for reducing the target scaling ratio by a preset step size when the updated phase margin is greater than a third margin threshold.
[0163] In some embodiments, the acquisition module 501 includes: The third acquisition unit is used to, under the first configuration, when the joint mechanism is in a stationary state and the q-axis current reference value is set to zero, superimpose a test signal onto the d-axis current reference value of the current loop of the joint actuator, and record the third d-axis current input signal and the third d-axis current feedback signal; obtain a first cross-correlation function based on the third d-axis current input signal and the third d-axis current feedback signal, determine a first total delay estimate based on the time delay corresponding to the peak value of the first cross-correlation function and the sampling period, and determine the first total delay estimate as the first delay parameter; The fourth acquisition unit is used to, under the second configuration, when the joint mechanism is in a stationary state and the q-axis current reference value is set to zero, superimpose a test signal onto the d-axis current reference value of the current loop of the joint actuator, and record the fourth d-axis current input signal and the fourth d-axis current feedback signal; obtain a second cross-correlation function based on the fourth d-axis current input signal and the fourth d-axis current feedback signal, determine a second total delay estimate based on the time delay corresponding to the peak value of the second cross-correlation function and the sampling period, and determine the second total delay estimate as the second delay parameter.
[0164] In some embodiments, the acquisition module 501 includes: The fifth acquisition unit is used to, under the first configuration and with the joint mechanism in a locked position, superimpose a test signal onto the q-axis current reference value, record the first q-axis current input signal and the first q-axis current feedback signal; obtain the third frequency response function based on the first q-axis current input signal and the first q-axis current feedback signal, and determine the phase lag information represented by the third phase frequency characteristic curve of the third frequency response function as the first delay parameter; The sixth acquisition unit is used to, in the second configuration and with the joint mechanism in a locked position, superimpose a test signal onto the q-axis current reference value, record the second q-axis current input signal and the second q-axis current feedback signal; obtain the fourth frequency response function based on the second q-axis current input signal and the second q-axis current feedback signal, and determine the phase lag information represented by the fourth phase frequency characteristic curve of the fourth frequency response function as the second delay parameter.
[0165] In some embodiments, the device further includes: a maintenance module, configured to: With current tracking error as the optimization target, the communication delay time is updated periodically; During each update of the communication delay, the updated delay time is controlled to remain within a preset boundary constraint range.
[0166] The communication delay compensation device provided in this application embodiment can realize the various processes implemented in the above method embodiments, and will not be described again here to avoid repetition.
[0167] The communication delay compensation device of this application embodiment can execute the communication delay compensation method provided in this application embodiment. The implementation principle is similar. The actions performed by each module and unit in the communication delay compensation device in each embodiment of this application are corresponding to the steps in the communication delay compensation method in each embodiment of this application. For detailed functional descriptions of each module of the communication delay compensation device, please refer to the descriptions in the corresponding communication delay compensation methods shown above. They will not be repeated here.
[0168] Based on the same principles as the methods shown in the embodiments of this application, embodiments of this application also provide a machine device having a joint mechanism. The machine device includes: a main controller and a joint actuator for driving the joint mechanism; the machine device is configured to perform the communication delay compensation method provided in the above embodiments.
[0169] Based on the same principles as the methods shown in the embodiments of this application, embodiments of this application also provide an electronic device, which may include, but is not limited to: a processor and a memory; the memory for storing computer programs; and the processor for executing the communication delay compensation method shown in any optional embodiment of this application by calling the computer program.
[0170] In an alternative embodiment, an electronic device, such as Figure 6 As shown, Figure 6The illustrated electronic device 6000 includes a processor 6001 and a memory 6003. The processor 6001 and the memory 6003 are connected, for example, via a bus 6002. Optionally, the electronic device 6000 may further include a transceiver 6004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 6004 is not limited to one type, and the structure of the electronic device 6000 does not constitute a limitation on the embodiments of this application.
[0171] Processor 6001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 6001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0172] Bus 6002 may include a pathway for transmitting information between the aforementioned components. Bus 6002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 6002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0173] The memory 6003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0174] The memory 6003 stores computer programs that execute embodiments of this application, and its execution is controlled by the processor 6001. The processor 6001 executes the computer programs stored in the memory 6003 to implement the steps shown in the foregoing method embodiments.
[0175] Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0176] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding content of the aforementioned method embodiments.
[0177] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0178] The terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the illustrations or text descriptions.
[0179] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0180] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. A method for compensating for communication delay, characterized in that, Applied to machine equipment with a joint mechanism, the machine equipment includes: a main controller and a joint actuator for driving the joint mechanism; The method includes: The machine is equipped with a first delay parameter under a first configuration and a second delay parameter under a second configuration; wherein the first delay parameter and the second delay parameter are used to characterize phase lag information or time domain delay information. The first delay parameter is obtained by injecting a test signal locally into the joint actuator and collecting feedback from the test signal under the first configuration; the second delay parameter is obtained by injecting the test signal into the joint actuator through the communication bus and receiving feedback from the test signal sent by the joint actuator under the second configuration. The communication delay time is determined based on the difference between the first delay parameter and the second delay parameter; wherein, the communication delay includes the delay generated by the transmission of signals between the main controller and the joint driver via the communication bus; Based on the aforementioned delay time, delay compensation is performed on the current loop of the joint actuator; Obtaining the first delay parameter of the machine under a first configuration and the second delay parameter under a second configuration includes: In the first configuration, when the joint mechanism is in a stationary state and the q-axis current reference value is set to zero, the test signal is superimposed on the d-axis current reference value of the current loop of the joint actuator, and the first d-axis current input signal and the first d-axis current feedback signal are recorded; based on the first d-axis current input signal and the first d-axis current feedback signal, a first frequency response function is obtained, and the phase lag information represented by the first phase frequency characteristic curve of the first frequency response function is determined as the first delay parameter; In the second configuration, when the joint mechanism is stationary and the q-axis current reference value is set to zero, the test signal is superimposed on the d-axis current reference value of the current loop of the joint actuator, and the second d-axis current input signal and the second d-axis current feedback signal are recorded; based on the second d-axis current input signal and the second d-axis current feedback signal, the second frequency response function is obtained, and the phase lag information represented by the second phase frequency characteristic curve of the second frequency response function is determined as the second delay parameter; Based on the difference between the first delay parameter and the second delay parameter, the communication delay time is determined, including: Based on the first phase frequency characteristic curve and the second phase frequency characteristic curve, the phase frequency difference values at multiple frequency points are calculated; The phase frequency difference values at the multiple frequency points are linearly fitted to obtain the fitting results; The phase slope indicated by the fitting result is determined as the delay time of the communication delay; Based on the aforementioned delay time, delay compensation is performed on the current loop of the joint actuator, including: The coefficients of the compensation filter are calculated based on the delay time; The coefficients of the compensation filter are written into the joint driver to embed the compensation filter into the current loop of the joint driver.
2. The method according to claim 1, characterized in that, The multiple frequency points are frequency points obtained based on signal coherence screening, whose coherence function values are greater than a preset threshold.
3. The method according to claim 1, characterized in that, The compensation filter includes: a first phase lead filter constructed by the first-order Padé approximation, a second phase lead filter constructed by the second-order Padé approximation, and a Smith predictor. Embedding the compensation filter in the current loop of the joint driver includes: When the first condition is met, the first phase lead filter is embedded in the forward channel of the current loop of the joint driver; When the second condition is met, the second phase lead filter is embedded in the forward channel of the current loop of the joint driver; When the third condition is met, the Smith predictor is embedded into the feedback channel of the current loop of the joint driver. The first condition includes at least one of the following: The delay time is less than a first time threshold; The target compensation accuracy is less than the accuracy threshold; The second condition includes at least one of the following: The delay time is greater than or equal to the first time threshold and less than the second time threshold; The target compensation accuracy is greater than or equal to the accuracy threshold. The third condition includes: the delay time is greater than or equal to the second time threshold.
4. The method according to claim 1, characterized in that, After writing the coefficients of the compensation filter into the joint driver, the method further includes: Obtain the open-loop frequency response function of the current loop after compensation; The phase margin and gain margin are determined based on the open-loop frequency response function. Repeat the following steps until the updated phase margin is greater than the first margin threshold and the updated gain margin is greater than the second margin threshold: The compensation amount for the delay time is reduced by the target ratio, and the phase margin and the gain margin are updated.
5. The method according to claim 4, characterized in that, The method further includes: If the updated phase margin is greater than the third margin threshold, the target ratio is reduced by a preset step size.
6. The method according to claim 1, characterized in that, Obtaining the first delay parameter of the machine under the first configuration and the second delay parameter under the second configuration further includes: In the first configuration, when the joint mechanism is stationary and the q-axis current reference value is set to zero, the test signal is superimposed on the d-axis current reference value of the current loop of the joint actuator, and the third d-axis current input signal and the third d-axis current feedback signal are recorded; based on the third d-axis current input signal and the third d-axis current feedback signal, a first cross-correlation function is obtained, and based on the time delay corresponding to the peak value of the first cross-correlation function and the sampling period, a first total delay estimate is determined, and the first total delay estimate is determined as the first delay parameter; In the second configuration, when the joint mechanism is stationary and the q-axis current reference value is set to zero, the test signal is superimposed on the d-axis current reference value of the current loop of the joint actuator, and the fourth d-axis current input signal and the fourth d-axis current feedback signal are recorded. Based on the fourth d-axis current input signal and the fourth d-axis current feedback signal, a second cross-correlation function is obtained. According to the time delay and sampling period corresponding to the peak value of the second cross-correlation function, a second total delay estimate is determined, and the second total delay estimate is determined as the second delay parameter.
7. The method according to claim 1, characterized in that, Obtaining the first delay parameter of the machine under the first configuration and the second delay parameter under the second configuration further includes: In the first configuration, when the joint mechanism is in the position locked state, the test signal is superimposed on the q-axis current reference value, and the first q-axis current input signal and the first q-axis current feedback signal are recorded; based on the first q-axis current input signal and the first q-axis current feedback signal, a third frequency response function is obtained, and the phase lag information represented by the third phase frequency characteristic curve of the third frequency response function is determined as the first delay parameter; In the second configuration, when the joint mechanism is in the position locked state, the test signal is superimposed on the q-axis current reference value, and the second q-axis current input signal and the second q-axis current feedback signal are recorded; based on the second q-axis current input signal and the second q-axis current feedback signal, a fourth frequency response function is obtained, and the phase lag information represented by the fourth phase frequency characteristic curve of the fourth frequency response function is determined as the second delay parameter.
8. The method according to claim 1, characterized in that, Based on the aforementioned delay time, after performing delay compensation on the current loop of the joint actuator, the method further includes: With current tracking error as the optimization target, the delay time of the communication delay is updated periodically; During each update of the communication delay, the updated delay time is controlled to remain within a preset boundary constraint range.
9. A communication delay compensation device, characterized in that, A device for use in machine equipment having a joint mechanism, the machine equipment comprising: a main controller and a joint actuator for driving the joint mechanism; the device comprising: The acquisition module is used to acquire a first delay parameter of the machine under a first configuration and a second delay parameter under a second configuration; wherein the first delay parameter and the second delay parameter are used to characterize phase lag information or time domain delay information; The first delay parameter is obtained by injecting a test signal locally into the joint actuator and collecting feedback from the test signal under the first configuration; the second delay parameter is obtained by injecting the test signal into the joint actuator through the communication bus and receiving feedback from the test signal sent by the joint actuator under the second configuration. A delay determination module is used to determine the delay time of communication delay based on the difference between the first delay parameter and the second delay parameter; wherein, the communication delay includes: the delay generated by the transmission of signals between the main controller and the joint driver via the communication bus; A delay compensation module is used to perform delay compensation on the current loop of the joint actuator based on the delay time. The acquisition module includes: The first acquisition unit is configured to, under the first configuration, when the joint mechanism is in a stationary state and the q-axis current reference value is set to zero, superimpose the test signal onto the d-axis current reference value of the current loop of the joint actuator, and record the first d-axis current input signal and the first d-axis current feedback signal; obtain a first frequency response function based on the first d-axis current input signal and the first d-axis current feedback signal, and determine the phase lag information represented by the first phase frequency characteristic curve of the first frequency response function as the first delay parameter; The second acquisition unit is configured to, under the second configuration, when the joint mechanism is in a stationary state and the q-axis current reference value is set to zero, superimpose the test signal onto the d-axis current reference value of the current loop of the joint actuator, and record the second d-axis current input signal and the second d-axis current feedback signal; obtain a second frequency response function based on the second d-axis current input signal and the second d-axis current feedback signal, and determine the phase lag information represented by the second phase frequency characteristic curve of the second frequency response function as the second delay parameter; The delay determination module is specifically used for: Based on the first phase frequency characteristic curve and the second phase frequency characteristic curve, the phase frequency difference values at multiple frequency points are calculated; The phase frequency difference values at the multiple frequency points are linearly fitted to obtain the fitting results; The phase slope indicated by the fitting result is determined as the delay time of the communication delay; The delay compensation module includes: The coefficients of the compensation filter are calculated based on the delay time; The coefficients of the compensation filter are written into the joint driver to embed the compensation filter into the current loop of the joint driver.
10. A machine device, characterized in that, The machine device has a joint mechanism, and the machine device includes: a main controller and a joint actuator for driving the joint mechanism; the machine device is configured to perform a communication delay compensation method as described in any one of claims 1 to 8.
11. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the communication delay compensation method according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the communication delay compensation method according to any one of claims 1 to 8.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the communication delay compensation method according to any one of claims 1 to 8.