An Embedded Robot Joint Motor Synchronous Control Method
By adopting the combined technology of ROS2 system, DDS protocol and PTPv2 service in the robot system, high-precision time synchronization of robot joint motors is achieved, time error problems caused by physical differences in data lines in traditional technology are solved, and synchronization control effect and flexibility are improved.
Patent Information
- Application Number
- CN202411777283.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-12-05
AI Technical Summary
In traditional robot joint motor synchronization control technology, physical differences between data lines cause physical time out of synchronization when each joint motor receives command information, causing time errors and reducing the synchronization control effect, especially during multi-joint synchronization operation.
The embedded robot joint motor synchronization control method is adopted, information is transmitted through the ROS2 system and DDS protocol, clock synchronization is used using PTPv2 service, and ROS2 programs are burned in the embedded microprocessor to realize the timestamp asynchronous control technology to ensure the time synchronization of motors of each joint.
It improves the time synchronization accuracy of the synchronous control of robot joint motors, reduces time errors, and enhances the effect of synchronous control. It is suitable for multi-joint synchronization operation scenarios, reduces hardware costs and improves the flexibility of maintenance and upgrades.
Smart Images

Figure CN119407790B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of robot joint motor synchronization, and particularly to an embedded robot joint motor synchronization control method. Background Art
[0002] Nowadays, various robots are gradually replacing humans to complete repetitive and labor-intensive tasks. Using robots to work can avoid the damage to human health caused by harsh working environments, and robots can work continuously without interruption, greatly improving production efficiency. With the increasing demands of production and life, people expect robots to be able to perform more complex and precise operations, which requires synchronous control of the motors of each joint of the robot to ensure that each joint can operate coordinately and accurately complete commands when the robot is working.
[0003] Currently, the robot joint motor synchronization control technology generally uses a serial bus or a parallel bus to connect the main control system with each joint motor. The main control system issues commands to each joint motor simultaneously through the bus to ensure that each joint motor can operate at the same time point, achieving the purpose of synchronous movement of the robot joints.
[0004] However, this traditional joint motor synchronization control technology has some deficiencies. For example, in the serial bus and the parallel bus, there are natural physical differences between the data lines responsible for connecting the main control system and each joint motor, including line length differences and material quality differences. These will affect the data transmission speed of the data lines, resulting in the physical time when each joint motor receives the command information not being synchronized, causing time errors and reducing the joint motor synchronization control effect. And such time errors will accumulate continuously with the increase in the number of robot joints. The more occasions where multiple joints of the robot need to be synchronized, the greater the impact of this accumulated time error on the working accuracy of the robot. Summary of the Invention
[0005] The purpose of the present invention is to provide an embedded robot joint motor synchronization control method to solve the following technical problems:
[0006] In the traditional robot joint motor synchronization control technology, there are natural physical differences between the data lines responsible for connecting the main control system and each joint motor, which affect the data transmission rate, resulting in the physical time when each joint motor receives the command information not being synchronized, causing time errors and reducing the joint motor synchronization control effect. The impact caused by such time errors will be more serious with the increase in the number of joints that need to be synchronized.
[0007] The purpose of the present invention can be achieved through the following technical solutions:
[0008] An embedded robot joint motor synchronization control method includes the following steps:
[0009] Set the internal clock of the computer as the master clock, run the ROS2 system in the computer, and compile joint nodes 1, joint nodes 2, ..., joint nodes N for each joint of the robot, where N is a positive integer. The joint nodes collect sensor information and motor operation feedback information in the corresponding robot joints, and generate command information for controlling the operation of the joint motors after calculation and processing;
[0010] Upload the information content of each joint node to the ROS2 system and create corresponding information topics. The types of the information content include sensor information, motor operation feedback information, and command information. The ROS2 system performs information transmission between joint nodes based on the DDS protocol. The joint nodes send the information content to the information topics based on the DDS protocol, and the ROS2 system then forwards the information content to all joint nodes that have subscribed to the corresponding information topics through the DDS protocol;
[0011] Use the Quality of Service (QoS) policy provided by DDS to set the communication metrics when the joint nodes perform information transmission, including: information sending mode, information saving method, information queue, information existence time limit;
[0012] Perform clock synchronization on the embedded microprocessor in the robot joint. Configure the PTPv2 service in the computer and the embedded microprocessor and set the clock synchronization interval SI = 2 -m seconds, where m is a natural number. After the configuration is completed, start the PTPv2 service, perform clock correction on the local clock of the embedded microprocessor according to the clock synchronization interval, and synchronize the local clock with the master clock;
[0013] Burn the ROS2 program code in the embedded microprocessor to achieve wireless communication with the joint nodes in the ROS2 system. Start the nodes in the ROS2 system. The joint nodes use the timestamp asynchronous control technology to send the generated command information to the corresponding embedded microprocessor, and the embedded microprocessor controls the operation of the joint motors after identifying the command information.
[0014] As a further solution of the present invention: The information transmission between joint nodes by the ROS2 system based on the DDS protocol is an asynchronous process. For any joint node, the joint node stamps the information content to be published with a timestamp and uploads it to the information topic of the corresponding information type, and then directly calculates and processes to generate command information for controlling the operation of the joint motors, without waiting for all other joint nodes that have subscribed to this information topic to receive the information content. At the same time, any joint node only receives the information content when the ROS2 system forwards the information content to this joint node.
[0015] As a further solution of the present invention: The process of setting the QoS policy is:
[0016] Set the information sending mode for the joint nodes according to the weights of the sent information content. The information sending modes include a reliable mode and an effort mode. The reliable mode ensures that the information content of each information topic of a joint node is always fully received by other joint nodes that have subscribed to that information topic. When it is not fully received, the information content is re-uploaded to the ROS2 system. The effort mode only uploads the information content to the ROS2 system once.
[0017] The information saving methods include the save-last method and the save-all method. The reliable mode corresponds to the save-all method, and the effort mode corresponds to the save-last method. The save-last method only retains the latest M pieces of information uploaded locally at the joint node, where M is a positive integer. The save-all method saves all the information uploaded at the joint node.
[0018] Obtain the data volume of the information content that the joint node cannot process temporarily, set an information queue with a corresponding length, and cache the information content that cannot be processed temporarily into the information queue, waiting for the joint node to process it in order.
[0019] Set an information existence time limit K. When the joint node receives sensor information and motor feedback information, calculate the difference between the current master clock and the timestamp of the information content. When the difference exceeds K, the information content is regarded as an expired message, and the joint node abandons processing the information content.
[0020] As a further solution of the present invention: When performing clock calibration on the local clock of the embedded microprocessor, first calculate the average link delay between each local clock and the master clock:
[0021] Set a clock synchronization interval SI in the PTP service of the computer and the embedded microprocessor. After starting the PTP service, perform the following operations within the clock synchronization interval SI:
[0022] The embedded microprocessor sends a Pdelay_Req message and generates the sending timestamp T of this message 1 ;
[0023] The computer receives the Pdelay_Req message and generates the receiving timestamp T of this message 2 ;
[0024] The computer sends a Pdelay_Resp message and generates the sending timestamp T of this message 3 ;
[0025] The embedded microprocessor receives the Pdelay_Resp message and generates a T 4 timestamp locally; finally, obtain a set of timestamps (T 1 , T 2 , T3 , T 4 );
[0026] Mark the transmission link delay from the embedded microprocessor to the computer as t-req, and the transmission link delay from the computer to the embedded microprocessor as t-res, to obtain the total link round-trip delay t from the embedded microprocessor to the computer 总 It is:
[0027] t 总 = t-req + t-res = (T 4 - T 1 ) - (T 3 - T 2 )
[0028] The average link delay AverageDelay between the embedded microprocessor and the computer is:
[0029] AverageDelay = [(T 4 - T 1 ) - (T 3 - T 2 )] / 2
[0030] The above calculation process is executed once in each clock synchronization period SI.
[0031] As a further solution of the present invention: The process of local clock correction according to the average link delay obtained above is:
[0032] After calculating the average link delay, the computer sends a Sync message to the embedded microprocessor, and generates the transmission timestamp T of this message 5 ;
[0033] The embedded microprocessor receives the Sync message and generates the reception timestamp T of this message 6 ;
[0034] The clock deviation Offset between the local clock of the embedded microprocessor and the master clock of the computer is:
[0035] Offset = T 6 - T 5 - AverageDelay
[0036] The embedded microprocessor performs clock synchronization correction once in each clock synchronization period SI according to the value of Offset, to keep the local clock of the embedded microprocessor synchronized with the master clock of the computer.
[0037] As a further solution of the present invention: The process of the embedded microprocessor receiving command information to control the operation of the joint motor is:
[0038] The joint node uses timestamp asynchronous technology to package a transmission timestamp a and an execution timestamp b in the command information sent to the embedded microprocessor, where a < b;
[0039] After receiving the command information, the embedded microprocessor compares the transmission timestamp a and the execution timestamp b with the local clock. When a < local clock < b, the embedded microprocessor waits for the local clock to reach b before executing the command information to control the operation of the joint motor;
[0040] When b ≤ local clock, the embedded microprocessor immediately executes the command information to control the operation of the joint motor.
[0041] As a further solution of the present invention: different joint groups are divided according to the attributes between the joints of the robot, and corresponding joint group nodes are compiled for each joint group, and the attributes include: joint function, joint sensor type, and joint motor drive mode.
[0042] As a further solution of the present invention: by modifying the code of the joint node or the joint group node in the ROS2 system, the function of the corresponding joint is adjusted. When adding or deleting any joint node or joint group node, the information topic of the joint node or the joint group node is synchronously created or deleted in the ROS2 system.
[0043] The beneficial effects of the present invention:
[0044] The present invention provides an embedded robot joint motor synchronous control method. By compiling corresponding joint nodes for the robot joints in the ROS2 system of the computer and burning the ROS2 program into the embedded microprocessor that controls the operation of the joint motor, wireless control of the robot joints is achieved; the local clock of the embedded microprocessor is synchronized with the computer main clock using the PTPv2 service; command information is sent to the embedded microprocessor using timestamp asynchronous technology, solving the problem that when the traditional serial-parallel bus is used to synchronously control the joint motors of the robot, the physical differences between the data lines cause time errors when each embedded microprocessor receives commands, reducing the effect of joint motor synchronous control. The present invention improves the time synchronization accuracy when synchronously controlling the robot joint motors. Compared with the traditional serial-parallel bus control method, the synchronous control method of the joint motors is more flexible, which is beneficial to the subsequent maintenance and upgrade of the robot and reduces the hardware cost. Brief Description of the Drawings
[0045] The following further describes the present invention with reference to the drawings.
[0046] Figure 1 is the flow schematic diagram of the present invention. Detailed Embodiment
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts belong to the scope of protection of the present invention.
[0048] Please refer to Figure 1 As shown, the present invention is an embedded robot joint motor synchronous control method, including the following steps:
[0049] Set the internal clock of the computer as the master clock, and both the command sending of the robot and the movement of the robot joints are based on the time of this master clock. Run the ROS2 system in the computer and compile joint nodes 1, joint nodes 2,..., joint nodes N for each joint of the robot, where N is a positive integer. The joint nodes collect sensor information and motor operation feedback information in the corresponding robot joints, and generate command information for controlling the operation of the joint motors after calculation and processing. The code for controlling the operation of the corresponding joint motors in the joint nodes is the main code and needs to be manually written, while other functions, such as node initialization and shutdown, publication and subscription of node messages, invocation of node services, node information processing, node loop, etc. can be directly invoked in the ROS2 system.
[0050] Upload the information content of each joint node to the ROS2 system and create corresponding information topics. The types of the information content include sensor information, motor operation feedback information, and command information. The ROS2 system performs information transmission between joint nodes based on the DDS protocol. The joint nodes send the information content to the information topics based on the DDS protocol, and the ROS2 system then forwards the information content to all joint nodes that have subscribed to the corresponding information topics through the DDS protocol. This DDS-based information transmission method allows each joint node to act as both an information sender and an information receiver at the same time, reducing the coupling between joint nodes, and thus reducing the coupling between robot joints, but improving the robustness of the overall process of robot joint synchronous control.
[0051] Use the Quality of Service (QoS) policy provided by DDS to set the communication metrics when the joint nodes perform information transmission, including: information sending mode, information saving method, information queue, and information existence time limit.
[0052] Perform clock synchronization on the embedded microprocessor in the robot joint. Configure the PTPv2 service in the computer and the embedded microprocessor. Note that the computer needs to support the Linux operating system, and select an embedded microprocessor that supports the PTPv2 service. Set the clock synchronization interval SI = 2 -mSeconds, where m is a natural number. For example, when m = 3, it means that the local clock of the microprocessor is corrected three times within one second, and the actual value is selected according to needs. After the configuration is completed, start the PTPv2 service, and correct the local clock of the embedded microprocessor at the clock synchronization interval to synchronize the local clock with the master clock. The purpose of correcting the local clock of the microprocessor is to enable all microprocessors to work with reference to a clock standard and ensure the time synchronization when multiple joint motors cooperate.
[0053] Burn the ROS2 program code in the embedded microprocessor to achieve wireless communication with the joint nodes in the ROS2 system. It supports selecting Bluetooth or WI-FI to start the nodes in the ROS2 system. The joint nodes use the timestamp asynchronous control technology to send the generated command information to the corresponding embedded microprocessor, and the embedded microprocessor controls the joint motor to operate after identifying the command information.
[0054] In a preferred embodiment of the present invention, the information transfer between joint nodes in the ROS2 system based on the DDS protocol is an asynchronous process. For any joint node, the joint node stamps the information content to be published with a timestamp and then uploads it to the information topic of the corresponding information type, and then directly calculates and processes it to generate the command information for controlling the operation of the joint motor, without waiting for all other joint nodes that have subscribed to this information topic to receive the information content. At the same time, any joint node only receives the information content when the ROS2 system forwards the information content to this joint node. This information transfer mode can improve the working efficiency of the joint nodes and avoid the extra time when the joint nodes wait for the response of other joint nodes.
[0055] In a preferred case of this embodiment, the process of setting the QoS policy is as follows:
[0056] Set the information sending mode for the joint nodes according to the weights of the sent information content. The weights of the information content are divided according to the importance of the tasks actually undertaken by the robot joints corresponding to the joint nodes. For example, for a welding robot, the wrist joint and the welding gun rotation joint that control the welding gun to perform welding tasks undertake the most important tasks in the welding task, so the information weights sent by the corresponding nodes of these two joints are the highest. The information sending mode includes a reliable mode and an effort mode. The reliable mode ensures that the information content of the information topic of each joint node is always received by all other joint nodes that have subscribed to this information topic. When it is not all received, the information content is re-uploaded to the ROS2 system; the effort mode only uploads the information content to the ROS2 system once.
[0057] The information storage methods include the last storage method and the all storage method. The reliable mode corresponds to the all storage method, and the effort mode corresponds to the last storage method. The last storage method only retains the latest M pieces of information uploaded locally at the joint node, where M is a positive integer. The all storage method stores all the uploaded information at the joint node. Selecting different information storage methods for information of different importance levels can avoid unnecessary waste of computing power and improve the node response speed.
[0058] Obtain the data volume of the information content that the joint node cannot process temporarily, set an information queue with a corresponding length, cache the information content that cannot be processed temporarily into the information queue, and wait for the joint node to process it in order. When setting the length of the information queue, it is also based on the weight of the information content. For the joint node that subscribes to important information, the length of its information queue can be appropriately increased. In addition, for the joint node with a large amount of information processing, the length of its information queue can also be appropriately increased. It should be noted that the length of the information queue cannot be set too long or too short. If it is too long, it will cause waste of memory space and an increase in information processing delay. If it is too short, the information queue will be quickly filled, resulting in the loss of subsequent messages.
[0059] Set an information existence time limit K. When the joint node receives sensor information and motor feedback information, calculate the difference between the current master clock and the timestamp of the information content. When the difference exceeds K, the information content is regarded as an overtime information, and the joint node abandons processing this information content. The purpose of this approach is to ensure the real-time nature of the commands generated by the joint node. For example, at a certain moment, joint node A sends an image information of a sensor. Joint node B first stores this information in the information queue. If when B starts to process this image information, the current time is quite different from the time when A sent it, then B cannot generate the next command based on this image information and needs to abandon the processing.
[0060] In another preferred embodiment of the present invention, when calibrating the local clock of the embedded microprocessor, first calculate the average link delay between each local clock and the master clock:
[0061] Set a clock synchronization interval SI in the PTP service of the computer and the embedded microprocessor. After starting the PTP service, perform the following operations within the clock synchronization interval SI:
[0062] The embedded microprocessor sends a Pdelay_Req message to the computer and generates the transmission timestamp T of this message 1 ;
[0063] The computer receives the Pdelay_Req message and generates the reception timestamp T of this message 2 ;
[0064] The computer sends a Pdelay_Resp message and generates the transmission timestamp T of this message 3 ;
[0065] The embedded microprocessor receives the Pdelay_Resp message and generates T 4 timestamp locally; finally, a set of timestamps (T 1 , T 2 , T 3 , T 4 ) is obtained;
[0066] Mark the transmission link delay from the embedded microprocessor to the computer as t-req, and the transmission link delay from the computer to the embedded microprocessor as t-res, and obtain the total link round-trip delay t from the embedded microprocessor to the computer 总 as:
[0067] t 总 = t-req + t-res = (T 4 - T 1 ) - (T 3 - T 2 )
[0068] The average link delay AverageDelay between the embedded microprocessor and the computer is:
[0069] AverageDelay = [(T 4 - T 1 ) - (T 3 - T 2 )] / 2
[0070] The above calculation process is executed once within each clock synchronization period SI
[0071] In a preferred case of this embodiment, the process of performing local clock correction according to the calculated average link delay is as follows:
[0072] After calculating the average link delay, the computer sends a Sync message to the embedded microprocessor and generates the transmission timestamp T of this message 5 ;
[0073] The embedded microprocessor receives the Sync message and generates the reception timestamp T of this message 6 ;
[0074] The clock deviation Offset between the local clock of the embedded microprocessor and the master clock of the computer is:
[0075] Offset = T 6 - T 5 - AverageDelay
[0076] The embedded microprocessor performs clock synchronization correction once within each clock synchronization period SI according to the value of Offset, so as to keep the local clock of the embedded microprocessor synchronized with the main clock of the computer.
[0077] In another preferred embodiment of the present invention, the process by which the embedded microprocessor receives command information to control the operation of the joint motor is as follows:
[0078] The joint node uses timestamp asynchronous technology to package a transmission timestamp a and an execution timestamp b in the command information sent to the embedded microprocessor, where a < b;
[0079] After receiving the command information, the embedded microprocessor compares the transmission timestamp a and the execution timestamp b with the local clock. When a < local clock < b, the embedded microprocessor waits for the local clock to reach b before executing the command information to control the operation of the joint motor;
[0080] When b ≤ local clock, the embedded microprocessor immediately executes the command information to control the operation of the joint motor. Using this timestamp asynchronous technology for the joint can reduce the impact of network latency on joint synchronization control, effectively solve the problem of time synchronization between multiple joint motors, and this method makes the actions of the joint motor have a certain degree of predictability, which is beneficial to the subsequent optimization of the operation of the joint motor.
[0081] In another preferred embodiment of the present invention, different joint groups are divided according to the attributes between the joints of the robot, and corresponding joint group nodes are compiled for each joint group. The attributes include: joint function, joint sensor type, joint motor drive mode. By directly creating the corresponding joint group nodes by packing some joints, the number of created nodes can be reduced and the system can be streamlined.
[0082] In a preferred case of this embodiment, by modifying the code of the joint node or joint group node in the ROS2 system, the adjustment of the functions of the corresponding joints is completed. When adding or deleting any joint node or joint group node, the information topic of the joint node or joint group node is synchronously created or deleted in the ROS2 system. This method enables the robot to be upgraded and maintained without modifying the entire robot control system, and only the parts that need to be adjusted are modified separately, greatly reducing the difficulty of upgrading and maintenance.
[0083] The above has described an embodiment of the present invention in detail, but the content described is only a preferred embodiment of the present invention and cannot be considered as limiting the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the application of the present invention should still fall within the scope covered by the patent of the present invention.
Claims
1. An embedded robot joint motor synchronization control method, characterized in that: The following steps are involved: The internal clock of the computer is set as the main clock, the ROS2 system is run in the computer, and joint nodes 1, joint nodes 2, ..., joint nodes N are compiled for each joint of the robot, where N is a positive integer. The joint nodes collect sensor information and motor operation feedback information in the corresponding robot joints, and generate command information for controlling the operation of the joint motors after calculation and processing; The information content of each joint node is uploaded to the ROS2 system and a corresponding information topic is created. The types of information content include sensor information, motor operation feedback information and command information. The ROS2 system transmits information between joint nodes based on the DDS protocol. The joint node sends the information content to the information topic based on the DDS protocol. The ROS2 system then forwards the information content to all joint nodes that have subscribed to the corresponding information topic through the DDS protocol. Use the QoS policy provided by DDS to set the communication indicators of joint nodes during information transmission, including: information sending mode, information storage method, information queue, and information existence time limit; Perform clock synchronization on the embedded microprocessor in the robot joint, configure the PTPv2 service in the computer and embedded microprocessor and set the clock synchronization interval SI = 2 -m seconds, m is a natural number. After the configuration is complete, the PTPv2 service is started, and the local clock of the embedded microprocessor is corrected according to the clock synchronization interval to synchronize the local clock with the master clock. Burn the ROS2 program code in the embedded microprocessor to realize wireless communication with the joint nodes in the ROS2 system, start the nodes in the ROS2 system, and the joint nodes use the timestamp asynchronous control technology to send the generated command information to the corresponding embedded microprocessor. After the embedded microprocessor recognizes the command information, it controls the operation of the joint motor.
2. The embedded robot joint motor synchronous control method according to claim 1 is characterized in that: The ROS2 system uses the DDS protocol to transmit information between joint nodes as an asynchronous process. For any joint node, the joint node will timestamp the information content to be published and upload it to the information topic of the corresponding information type, and then directly calculate and process it to generate command information for controlling the operation of the joint motor. There is no need to wait for all other joint nodes that have subscribed to the information topic to receive the information content. At the same time, any joint node only receives information content when the ROS2 system forwards the information content to the joint node.
3. The embedded robot joint motor synchronous control method according to claim 2 is characterized in that: The process of setting QoS policy is as follows: According to the weight of the information content to be sent, the information sending mode is set for each joint node. The information sending mode includes a reliable mode and an effort mode. The reliable mode ensures that the information content of the information topic of each joint node is always fully received by other joint nodes that have subscribed to the information topic. When the information content is not fully received, the information content is re-uploaded to the ROS2 system; the effort mode only uploads the information content to the ROS2 system once; The information saving modes include the last saving mode and the all saving mode. The reliable mode corresponds to the all saving mode, and the effort mode corresponds to the last saving mode. The last saving mode only retains the latest M pieces of information uploaded locally at the joint node, where M is a positive integer. The all saving mode saves all uploaded information at the joint node. Obtain the data volume of information content that the joint node cannot process temporarily, set an information queue of corresponding length, cache the information content that cannot be processed temporarily into the information queue, and wait for the joint node to process it in sequence; Set an information existence time limit K. When the joint node receives sensor information and motor feedback information, calculate the difference between the current master clock and the timestamp of the information content. When the difference exceeds K, the information content is regarded as timeout information, and the joint node abandons processing the information content.
4. The embedded robot joint motor synchronous control method according to claim 1, characterized in that: When calibrating the local clock of the embedded microprocessor, first calculate the average link delay between each local clock and the master clock: Set a clock synchronization interval SI in the PTP service of the computer and the embedded microprocessor. After starting the PTP service, perform the following operations within the clock synchronization interval SI: The embedded microprocessor sends a Pdelay_Req message to the computer and generates the transmission timestamp T1 of this message; The computer receives the Pdelay_Req message and generates the reception timestamp T2 of this message; The computer sends a Pdelay_Resp message and generates the transmission timestamp T3 of this message; The embedded microprocessor receives the Pdelay_Resp message and generates a T4 timestamp locally; finally, a set of timestamps (T1, T2, T3, T4) is obtained; The transmission link delay from the embedded microprocessor to the computer is marked as t-req, and the transmission link delay from the computer to the embedded microprocessor is marked as t-res, and the total link round-trip delay from the embedded microprocessor to the computer is obtained as t 总 for: t 总 =t-req+t-res=(T4-T1)-(T3-T2) The average link delay AverageDelay between the embedded microprocessor and the computer is: AverageDelay = [(T4 - T1) - (T3 - T2)] / 2 The above calculation process is executed once in each clock synchronization period SI.
5. The embedded robot joint motor synchronous control method according to claim 4 is characterized in that: The process of local clock calibration based on the average link delay calculated above is: After calculating the average link delay, the computer sends a Sync message to the embedded microprocessor and generates the transmission timestamp T5 of this message; The embedded microprocessor receives the Sync message and generates the reception timestamp T6 of this message; The clock deviation Offset between the local clock of the embedded microprocessor and the master clock of the computer is: Offset = T6 - T5 - AverageDelay The embedded microprocessor performs clock synchronization calibration once in each clock synchronization period SI according to the value of Offset to keep the local clock of the embedded microprocessor synchronized with the master clock of the computer.
6. The embedded robot joint motor synchronous control method according to claim 1, characterized in that: The process of the embedded microprocessor receiving command information to control the operation of the joint motor is: The joint node uses timestamp asynchronous technology to package a transmission timestamp a and an execution timestamp b in the command information sent to the embedded microprocessor, where a < b; After receiving the command information, the embedded microprocessor compares the transmission timestamp a and the execution timestamp b with the local clock. When a < local clock < b, the embedded microprocessor waits for the local clock to reach b before executing the command information to control the operation of the joint motor; When b ≤ local clock, the embedded microprocessor immediately executes the command information to control the operation of the joint motor.
7. The embedded robot joint motor synchronous control method according to claim 1, characterized in that: Divide different joint groups according to the attributes between the joints of the robot, and compile corresponding joint group nodes for each joint group. The attributes include: joint function, joint sensor type, and joint motor drive method.
8. The embedded robot joint motor synchronous control method according to claim 7, characterized in that: By modifying the code of the joint node or joint group node in the ROS2 system, the function of the corresponding joint is adjusted. When any joint node or joint group node is added or deleted, the information topic of the joint node or joint group node is synchronously created or deleted in the ROS2 system.
Citation Information
Patent Citations
Ground equipment performance test system
CN113595835A
Robot control system and robot
CN114407026A