Robot position control method and device and medium
By increasing the position acquisition frequency in the robot's three-loop control cycle and achieving dual updates of encoder information through interleaved requests from the current loop and speed loop, the problem of insufficient position acquisition frequency and accuracy in the existing technology is solved, thereby improving the robot's response speed and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies are insufficient in terms of position acquisition frequency and accuracy for applications requiring high speed and high precision, resulting in insufficient robot response speed and accuracy, and the cost of replacing high-precision encoders is high.
In the robot's three-loop control cycle, the position acquisition frequency is increased by requesting position information from the encoder multiple times during the current loop interruption cycle and summing the position deviation information multiple times during the speed loop cycle, thereby achieving dual updates of encoder information.
It improves the phase margin and bandwidth of the speed loop control circuit, enhances system rigidity, improves encoder position feedback accuracy and current loop decoupling accuracy, and reduces pulse deviation during robot operation.
Smart Images

Figure CN121806708A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of servo control technology, and in particular to a robot position control method, device and medium. Background Technology
[0002] In servo systems, the position acquisition accuracy of the encoder is of paramount importance in the industrial robot industry. It not only affects servo control performance but also influences robot operational deviations, response speed, and cycle time. Therefore, improving the robot's position acquisition accuracy can effectively enhance its response speed and reduce operational deviations.
[0003] Current conventional location acquisition solutions are applicable to some scenarios, but for some high-speed and high-precision applications, the low location acquisition frequency and accuracy often fail to meet the high rigidity and accuracy requirements.
[0004] The accuracy of encoder position acquisition can be improved by replacing it with a higher resolution or higher precision absolute encoder, but this method requires sacrificing higher costs.
[0005] For example, Chinese patent CN117955390A discloses an FOC control method and a dual-sampling dual-update method. By adopting a new FOC control method in the control of permanent magnet synchronous motors, it only samples the vector position and updates the duty cycle, thus solving the problem of insufficient current loop bandwidth and improving the current loop bandwidth. However, this method does not improve the speed loop bandwidth and still has certain limitations.
[0006] Chinese patent CN119937653A discloses a dual-velocity loop position tracking control method for a servo system based on active disturbance rejection control (ADRC). By employing this method in the servo system, it solves the problem of suppressing disturbance effects in existing technologies, achieving high-precision, high-speed positioning and strong disturbance rejection for the servo. However, this method uses an ADRC algorithm, which increases adjustable parameters, resulting in a certain degree of complexity and limiting its application scenarios. Summary of the Invention
[0007] This application provides a robot position control method, device, and medium, which has the advantage of increasing the position acquisition frequency, thereby increasing the phase margin and bandwidth of the speed loop control loop, improving the system rigidity, enabling it to withstand stronger speed loop gain requirements, and providing a faster response.
[0008] The technical solution of this application is as follows: On one hand, this application provides a robot position control method, including the following steps: in the robot's three-loop control cycle: During the current loop interruption cycle, a position information request is sent to the encoder to obtain encoder information, and the position deviation information is obtained based on the obtained encoder information. In one velocity loop cycle, the position deviation information obtained by each axis in the current loop cycle is summed and used as the input for the three-loop control calculation task of that axis for the entire velocity loop cycle. In each velocity loop interruption task, each axis of the robot performs a three-loop control calculation task once.
[0009] Furthermore, during the current loop interruption cycle, each axis sequentially sends a position information request to the encoder to obtain encoder information, and obtains position deviation information based on the obtained encoder information.
[0010] Furthermore, in the robot's three-loop control cycle, the interruption cycle ratio of the current loop to the speed loop is 1:4.
[0011] Furthermore, the robot is a dual-axis robot. During the current loop interruption cycle, the two axes of the robot sequentially send position information requests to the encoder to obtain encoder information. During one speed loop cycle, each axis sends two position requests and updates the real-time position information twice.
[0012] Furthermore, in the robot's three-loop control cycle, the speed loop and current loop count synchronously, and when the count reaches the first time node, the current loop interrupt task is executed to obtain encoder information.
[0013] In another aspect, this application provides a robot position control device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is called and executed by the processor, it implements the robot position control method as described above.
[0014] In another aspect, this application provides a computer-readable medium storing a computer program, which, when executed by a computer, implements the robot position control method described above.
[0015] In summary, the beneficial effects of this application are as follows: 1. By increasing the position acquisition frequency, the phase margin and bandwidth of the speed loop control loop are improved, which enhances the system's rigidity, enabling it to withstand stronger speed loop gain requirements and respond faster.
[0016] 2. Due to the increased position acquisition frequency, the encoder position feedback and electrical angle are more accurate compared to single update, which increases the accuracy of servo magnetic field orientation control and makes the decoupling of the current loop more accurate.
[0017] 3. After increasing the position acquisition frequency, the deviation of the three-ring control is relatively smaller, and the fluctuation of the pulse deviation count value during robot operation will also be smaller. Attached Figure Description
[0018] Figure 1 This is a timing diagram of the robot position double update in one embodiment of the application; Figure 2 This is a flowchart of the tasks related to the dual-axis electrical cabinet current loop interrupt encoder in one embodiment of the application; Figure 3 It is a test of the robot location update software. Figure 1 ; Figure 4 It is a test of the robot location update software. Figure 2 ; Figure 5 It is a test of the robot's position dual update software. Figure 1 ; Figure 6 It is a test of the robot's position dual update software. Figure 2 . Detailed Implementation
[0019] The specific embodiments of this application are described in detail below with reference to the accompanying drawings.
[0020] Example 1: A robot position control method, comprising the following steps: In the robot's three-loop control cycle: During the current loop interruption cycle, a position information request is sent to the encoder to obtain encoder information, and the position deviation information is obtained based on the obtained encoder information. In one velocity loop cycle, the position deviation information obtained by each axis in the current loop cycle is summed and used as the input for the three-loop control calculation task of that axis for the entire velocity loop cycle. In each velocity loop interruption task, each axis of the robot performs a three-loop control calculation task once.
[0021] Specifically, the step "In the current loop interruption cycle, initiate a position information request to the encoder to obtain encoder information, and obtain position deviation information based on the obtained encoder information" means that in the current loop interruption cycle, each axis sequentially initiates a position information request to the encoder to obtain encoder information, and obtains position deviation information based on the obtained encoder information.
[0022] In the robot's three-loop control cycle, the interruption cycle ratio of the current loop to the speed loop is 1:4.
[0023] In this embodiment, the robot is a two-axis robot. During the current loop interruption cycle, the two axes of the robot sequentially send position information requests to the encoder to obtain encoder information. That is, in each speed loop interruption cycle, with the current loop interruption cycle as the interval, the two axes of the robot sequentially send position information requests to the encoder to obtain encoder information, and each axis sends two position requests and updates the real-time position information twice.
[0024] In the robot's three-loop control cycle, the speed loop and current loop count synchronously, and when the count reaches the first time node, the current loop interrupt task is executed to obtain encoder information.
[0025] This embodiment uses a dual-axis robot with an integrated control cabinet as an example to illustrate the method. The original scheme, which collected position information only once every 250µs in a three-loop control cycle, has been optimized. Instead, during a 62.5µs current loop interruption, both axes sequentially send position information requests to the encoder, meaning each axis sends a position request and updates its real-time position information every 125µs. The specific timing diagram is as follows: Figure 1 As shown.
[0026] Specifically: Each speed loop interruption cycle is approximately 250µs, and in each speed loop interruption task, each of the two axes performs a three-loop control calculation task once.
[0027] Meanwhile, each current loop interrupt cycle is approximately 62.5µs. The speed loop and current loop counts are synchronized. The current loop interrupt task begins execution when the count reaches approximately 15µs. Upon entering each current loop interrupt, encoder information is first acquired. Axis 0 sends encoder position requests in the T0 and T2 current loop cycles, while Axis 1 sends encoder position requests in the T1 and T3 current loop cycles. Here, Axis 0 and Axis 1 represent the first and second axes driven by the same DSP chip, respectively, and T0, T1, T2, and T3 represent the four current loop cycles within one speed loop cycle.
[0028] Therefore, compared to the original scheme where each of the two axes sends an encoder position information request once per speed loop cycle (250us), the encoder position information is sent alternately by axis 0 and axis 1 in step (2).
[0029] A single DSP chip interleaves encoder requests to the two communicating axes, allowing for increased position sampling frequency while fully utilizing the limited current loop interrupt cycles. This avoids excessive processing time for encoder information from two axes within a single cycle, which could negatively impact interrupt load. In the dual-update scheme, the position deviation for each axis is refreshed every two current loop interrupt cycles. This deviation is then used as position feedback increments for three-loop control calculations during the speed loop interrupt cycle, resulting in a maximum lag of two current loop cycles. In contrast, position feedback increment calculations during the lower-frequency speed loop interrupt cycle incur a maximum lag of one speed loop cycle (four current loop cycles). This reduces system latency and increases position loop bandwidth. Placing encoder position requests in the higher-frequency current loop interrupt cycles allows the actual encoder position and speed for each axis to be updated twice within a three-loop control cycle, improving position accuracy and speed calculation, thereby increasing system bandwidth.
[0030] Pulse deviation calculation: The original single update scheme sent a position request once every 250us for axis 0 and axis 1, and each axis only calculated the pulse position once every 250us, which was then sent to the three-loop control function to perform position loop and speed loop calculations.
[0031] In this embodiment, the dual-update scheme alternately sends encoder position information requests to axis 0 and axis 1 every 62.5µs, meaning that each axis receives encoder position information twice every 250µs. Based on the encoder position information or position error information, the two position deviations Pferr1 and Pferr2 are summed as the position deviation Pferr for the entire speed loop cycle and fed into the three-loop control calculation function. The task flow is as follows: Figure 2 As shown.
[0032] (5) The single update and double update modes were tested and compared on the robot. The comparison items are as follows: a) Continuously increase the Kp value of the velocity loop and the Kp value of the position loop to test the maximum rigidity that the single update algorithm can bear.
[0033] b) Continuously increase the Kp values of the velocity loop and the position loop to test the maximum rigidity that the double update algorithm can bear.
[0034] c) Comparing the results of a) and b), it can be seen that double update can obviously operate under larger rigid parameters while having smaller pulse deviation values.
[0035] The following is a comparison of the effects of single and dual update server software: 1. Single update While ensuring that the other PID parameters are consistent, the PN102 of the J3 axis of the robot ER20-1000-SR\HI, i.e. the speed loop Kp value, can only be adjusted up to 4000. If it is higher, the robot will produce abnormal noise.
[0036] The pulse deviation during operation follows the waveform as follows: Figure 3-4 As shown, Figure 3-4 As shown, the highest deviation pulse is 97565.00pluse, and the deviation pulse after the robot stabilizes is -253.00pluse.
[0037] 2. Double Update: While ensuring that all other PID parameters remain consistent, the J3 axis of the ER20-1000-SR / HI can only be adjusted to 4000 with the single-update software PN102. If it is higher, the robot will produce abnormal noises. However, with dual updates, it can be adjusted up to 7000, and the robot can run normally without abnormal noises. Furthermore, the tracking error will be smaller.
[0038] Data collected by dual-update software, such as Figure 5-6 As shown. Figure 5-6 As shown, the highest deviation pulse is 55354.00pluse, and the deviation pulse after the robot stabilizes is 126.00pluse.
[0039] 3. Data Comparison and Summary: PN102 maximum value highest point deviation pulse robot stabilization deviation pulse FollowErrs maximum value FollowErrs minimum value Single update 4000 97565.0pluse -253.0pluse 0.289 -0.291 Double Update 7000 55354.0pluse 126. 0pluse 0.170 -0.170 Example 2: A robot position control device includes a processor and a memory. The memory stores a computer program. When the computer program is called and executed by the processor, it implements the robot position control method as described in Example 1.
[0040] Example 3: A computer-readable medium storing a computer program, which, when executed by a computer, implements the robot position control method as described in Example 1.
[0041] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the inventive concept of this application, and these all fall within the protection scope of this application.
Claims
1. A robot position control method, characterized in that, The following steps are included in the robot's three-loop control cycle: During the current loop interruption cycle, a position information request is sent to the encoder to obtain encoder information, and the position deviation information is obtained based on the obtained encoder information. In one velocity loop cycle, the position deviation information obtained by each axis in the current loop cycle is summed and used as the input for the three-loop control calculation task of that axis for the entire velocity loop cycle. In each velocity loop interruption task, each axis of the robot performs a three-loop control calculation task once.
2. The robot position control method according to claim 1, characterized in that, During the current loop interruption cycle, each axis sequentially sends a position information request to the encoder to obtain encoder information, and obtains position deviation information based on the obtained encoder information.
3. The robot position control method according to claim 1, characterized in that, In the robot's three-loop control cycle, the interruption cycle ratio of the current loop to the speed loop is 1:
4.
4. The robot position control method according to claim 3, characterized in that, The robot is a dual-axis robot. During the current loop interruption cycle, the two axes of the robot sequentially send position information requests to the encoder to obtain encoder information. During one speed loop cycle, each axis sends two position requests and updates the real-time position information twice.
5. The robot position control method according to claim 1, characterized in that, In the robot's three-loop control cycle, the speed loop and current loop count synchronously, and when the count reaches the first time node, the current loop interrupt task is executed to obtain encoder information.
6. A robot position control device, comprising a processor and a memory, characterized in that, The memory stores a computer program, which, when executed by the processor, implements the steps of the robot position control method as described in any one of claims 1-5.
7. A computer-readable medium, characterized in that, The computer-readable medium stores a computer program, which, when executed by a computer, implements the steps of the robot position control method as described in any one of claims 1-5.
Citation Information
Patent Citations
FOC control method and double-sampling double-updating method
CN117955390A
Double-speed loop position tracking control method of servo system based on active disturbance rejection control
CN119937653A