Actuator communication system, method and robot

By using serial port communication with STM32H7 series chips in robot actuators, the synchronization problem caused by actuator communication delay in the prior art is solved, and more efficient communication and better system synchronization are achieved.

CN119188786BActive Publication Date: 2025-03-21SHANGHAI FOURIER INTELLIGENCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411709386.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-21
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

The communication delay of existing robot actuators is large, resulting in poor synchronization when multiple actuators execute control instructions simultaneously, affecting system performance and stability.

Method used

STM32H7 series chips are used to realize serial communication between the first microcontroller and the second microcontroller, replacing the traditional CAN bus communication, and forming a daisy chain topological connection structure to simplify wiring and improve system reliability.

Benefits of technology

The delay is significantly reduced through serial communication, and the synchronization of multiple actuators when executing control instructions at the same time is improved, thereby improving the performance and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119188786B_ABST
    Figure CN119188786B_ABST
Patent Text Reader

Abstract

The present invention discloses an actuator communication system, method and robot, and relates to the field of robot technology. The actuator communication system is used to realize communication between multiple actuators and external control devices, and the actuator includes a first microcontroller, a second microcontroller and an execution unit, wherein the first microcontroller communicates with the external control device through a switch, the first microcontroller and the second microcontroller communicate through a serial port, and the second microcontroller communicates with the execution unit through a connection interface. The present invention can greatly reduce communication delay and improve the synchronization of multiple actuators executing control instructions at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of robot technology, and in particular to an actuator communication system, method and robot. Background Art

[0002] At present, robot technology is developing rapidly, and the application of robots has penetrated into various fields of society. At the same time, the requirements for robot miniaturization, communication bandwidth, control flexibility, and joint operation synchronization are also increasing. Most of the current robots are multi-joint robots with multi-degree-of-freedom control. The actuators of the robot joints use the CAN bus to communicate with the robot's external control equipment.

[0003] Figure 1 For a schematic diagram of the structure of using CAN bus to realize communication in the actuator, please refer to Figure 1 As shown, the actuator may include a first microcontroller, a second microcontroller and an execution unit, wherein the first microcontroller communicates with an external control device through a switch, the first microcontroller and the second microcontroller communicate through a CAN bus based on a CAN transceiver, and the second microcontroller communicates with the execution unit through a connection interface.

[0004] In the existing actuators, the first microcontroller and the second microcontroller adopt ESP32 series chips and STM32 series chips respectively, wherein the ESP32 series chips and the STM32 series chips are used for network processing and execution unit (generally motor) driving respectively. The ESP32 series chips and the STM32 series chips communicate through the CAN bus with a baud rate of 1MHz. However, in actual applications, affected by various factors (such as cable length, electromagnetic interference, etc.), the actual communication can only transmit 64KB per second, and it takes about 128us to transmit 8 bytes. The low bandwidth is the root cause of excessive delay.

[0005] Moreover, the communication mechanism of the CAN bus (such as frame structure, arbitration mechanism, etc.) may cause delays in data transmission, which is a disadvantage for application scenarios where robots require fast response and high synchronization. In particular, when multiple actuators receive and execute instructions from the controller at the same time, they may become out of sync, thus affecting the performance and stability of the entire system. Summary of the invention

[0006] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the purpose of the present invention is to provide an actuator communication system, method and robot to solve the problem in the prior art that the communication delay is large and causes poor synchronization when multiple actuators execute control instructions at the same time.

[0007] The purpose of the present invention is achieved by the following technical solutions:

[0008] A first aspect of the present invention discloses an actuator communication system for realizing communication between multiple actuators and an external control device, wherein the actuator includes a first microcontroller, a second microcontroller and an execution unit, wherein the first microcontroller communicates with the external control device through a switch, the first microcontroller and the second microcontroller communicate through a serial port, and the second microcontroller communicates with the execution unit through a connection interface.

[0009] The design of communicating between the first microcontroller and the second microcontroller through the serial port has a small delay caused by serial port communication, so that the first microcontroller can quickly pass control instructions to the second microcontroller and respond to instructions from external control devices more quickly. This is especially important for application scenarios that require fast response (such as robot control, etc.), and can basically ensure the synchronization of multiple actuators when performing actions at the same time.

[0010] Preferably, the first microcontroller and the second microcontroller are both STM32H7 series chips.

[0011] The STM32H7 series chip is a high-performance microcontroller with powerful processing capabilities, which can meet the needs of complex control algorithms and high-speed data processing in actuator communication systems. Moreover, its high-performance Cortex-M7 core and high-speed Flash memory ensure that the system can quickly respond to the instructions of external control devices and process the data returned by the actuator in real time.

[0012] In this system, the USART serial port interface of the STM32H7 series chip is used to realize the communication between the first microcontroller and the second microcontroller, which not only simplifies the system design but also improves the reliability and stability of communication.

[0013] Preferably, the switches of the plurality of actuators form a daisy chain topology connection structure, wherein the switch of any actuator is communicatively connected with the external control device;

[0014] or / and;

[0015] The connection interface is any one of a serial port, an SPI interface and a PWM interface;

[0016] or / and;

[0017] The execution unit is a sensor and / or a driver.

[0018] The daisy chain topology connection structure allows multiple actuator switches to be connected in sequence to form a chain structure, which greatly simplifies the wiring work and reduces the complexity and cost of system installation. In this structure, even if a switch of an actuator fails, it will not affect the communication of the entire system, because other actuators can still communicate with external control devices through the remaining links, which can improve the reliability and fault tolerance of the system. In addition, the daisy chain topology makes the system easy to expand. You only need to add a new actuator switch at the end of the link, which provides users with a flexible system expansion solution to meet the demand for the number of actuators that may increase in the future.

[0019] The system provides a variety of connection interface options such as serial port, SPI interface and PWM interface, so that the actuator can choose the most suitable interface for communication according to specific application scenarios and requirements, improving the adaptability and flexibility of the system.

[0020] The system supports various types of actuators such as sensors and drivers, enabling the system to achieve real-time monitoring of environmental parameters and precise control of actuators, thus improving the functionality and practicality of the system.

[0021] The second aspect of the present invention discloses an actuator communication method, which adopts the above-mentioned actuator communication system to realize that an external control device sends a control instruction to a second microcontroller, so that the second microcontroller controls an execution unit to execute the control instruction, and comprises the following steps:

[0022] The external control device sends the control instruction to the first microcontroller through the switch;

[0023] The first microcontroller communicates with the second microcontroller via a serial port to send the control instruction to the second microcontroller;

[0024] The second microcontroller communicates with the execution unit via a connection interface to control the action of the execution unit according to the control instruction.

[0025] The design of communicating between the first microcontroller and the second microcontroller through the serial port has significant advantages compared with other communication protocols such as the CAN bus, which are mainly reflected in the following aspects:

[0026] 1. Fast transmission speed and low delay;

[0027] 2. Although serial communication is a relatively basic communication method, its transmission speed is usually sufficient to meet real-time requirements in short-distance and low-data-volume transmission scenarios, thereby ensuring that multiple actuators have good synchronization when performing actions.

[0028] Preferably, the external control device sends the control instruction to the first microcontroller through the switch, which is a full control mode or a subscription mode, wherein the full control mode is that the external control device sends the control instruction to the second microcontroller of all actuators; the subscription mode is that the external control device sends the control instruction to the second microcontroller of one or more specified actuators through subscription.

[0029] When all actuators need to be controlled at the same time, the external control device can send control instructions to the second microcontrollers of all actuators at once through an efficient global control (fast_get_pvc). This method avoids the tediousness and delay of sending instructions one by one, and significantly improves the efficiency of sending control instructions.

[0030] For scenarios that require control of specific actuators or actuator groups, the external control device can send control instructions to the second microcontroller of one or more specified actuators through subscription. This method achieves precise control of the actuators and avoids unnecessary instruction interference and waste of resources.

[0031] Preferably, the communication frequency of the full control mode is 500 Hz, and the communication frequency of the subscription mode is 1 KHz;

[0032] or / and;

[0033] The first microcontroller and the second microcontroller communicate via a full-duplex serial port or two half-simplex serial ports;

[0034] or / and;

[0035] The amount of data transmitted per second between the first microcontroller and the second microcontroller is 1500 KB.

[0036] Different communication frequency settings enable the system to be flexibly adjusted according to actual needs, which not only ensures the real-time control but also avoids unnecessary communication overhead.

[0037] The full-duplex serial port or two simplex serial ports are used for communication, so that the first microcontroller and the second microcontroller can send and receive data at the same time, which greatly improves the communication efficiency. This communication method is suitable for scenarios requiring two-way real-time communication, such as real-time collection and transmission of sensor data.

[0038] The serial port is used to realize the communication between the first microcontroller and the second microcontroller. The amount of data transmitted per second between the two is set to 1500KB, which ensures that the system can transmit a large amount of control instructions and sensor data in a short time. This high data transmission volume enables the system to respond more quickly to the instructions of the external control device and update the status information of the actuator in real time.

[0039] Preferably, when the external control device sends control instructions to a plurality of first microcontrollers simultaneously, the second microcontrollers corresponding to the plurality of first microcontrollers control the action of the execution unit according to the control instructions after delaying a preset time.

[0040] In a system that requires multiple actuators to work together, delaying the preset time can ensure that all actuators have a unified time base to start executing actions after receiving the control command, which helps to achieve more precise synchronous control and improve the overall performance and efficiency of the system.

[0041] Moreover, the delay preset time can be flexibly adjusted according to the actual application scenarios and requirements. For example, in scenarios that require quick response, the delay time can be set shorter; while in scenarios that require more stable control, the delay time can be set slightly longer. This flexibility enables the system to better adapt to various complex and changing application requirements.

[0042] Preferably, the second microcontroller controls the action of the execution unit according to the control instruction after delaying a preset time, including:

[0043] The target second microcontroller obtains the data amount of the control instruction;

[0044] The target second microcontroller determines a first time, a second time, a third time and a fourth time based on the data volume; the first time is a transceiver delay time inside the external control device, the second time is a transceiver delay time of the switch; the third time is a transceiver delay time of the network protocol stack, and the fourth time is a communication delay time between the first microcontroller and the second microcontroller;

[0045] The target second microcontroller determines the preset time according to the first time, the second time, the third time, the fourth time and the location of the target second microcontroller;

[0046]

[0047] in, T k For the k a preset time of a second microcontroller, namely a target second microcontroller, T 1i , T 2i , T 3i , T 4i Respectively i The first time, the second time, the third time and the fourth time corresponding to the second microcontroller, 1≤ i ≤n,1≤k ≤n, n is the total number of actuators receiving control instructions, T 5k For the k A fifth time of delay of a second microcontroller, namely a target second microcontroller; and:

[0048]

[0049] T ji For the i The second microcontroller corresponds to the j time, 1≤j≤4, that is T 1i For the i The second microcontroller corresponds to the first time, b ji For the i The second microcontroller corresponds to the j The time delay coefficient is determined according to the actual scenario; H ji For the i The second microcontroller corresponds to the j The associated communication rate of time; C is the compression ratio; T 5k Determine the position of the execution unit corresponding to the target second microcontroller on the robot;

[0050] The target second microcontroller controls the action of the execution unit according to the control instruction after delaying the preset time.

[0051] In the actuator communication method, the second microcontroller controls the action of the execution unit according to the control instruction after a preset delay, wherein the preset time is determined by comprehensively considering multiple dimensional delay times (including the transceiver delay time inside the external control device, the transceiver delay time of the switch, the transceiver delay time of the network protocol stack, and the communication delay time between the first microcontroller and the second microcontroller) and the location of the target second microcontroller (specifically the location in the robot, such as the finger joint or wrist joint, etc.). This preset time control strategy based on multi-dimensional delay time determination brings the following significant beneficial effects:

[0052] 1. Improve the response accuracy of control instructions:

[0053] By accurately calculating the delay time of each link and comprehensively considering factors such as the location of the target second microcontroller, it is possible to ensure that the control instructions are executed at the right time, thereby improving the response accuracy, helping to avoid the defect of poor actuator synchronization caused by too long or too short delay time, and improving the overall performance of the system.

[0054] 2. Optimize system resource utilization:

[0055] This strategy allows the system to dynamically adjust the preset time according to the actual delay situation, thus avoiding unnecessary waiting time and resource waste. For example, when the delay time is short, the system can respond to control instructions more quickly and improve execution efficiency; when the delay time is long, the system can ensure the accurate execution of instructions by increasing the preset time.

[0056] 3. Enhance the adaptability and flexibility of the system:

[0057] This strategy takes into account a variety of possible delay factors, including network protocol stack delay, switch delay, etc., so that the system can better adapt to various complex and changing application scenarios. At the same time, by adjusting parameters such as delay coefficient and associated communication rate, the system can flexibly respond to different network environments and device performance differences.

[0058] 4. Improve user experience and security:

[0059] Precise delay control enables the system to respond to commands from external control devices more smoothly, reducing user-perceived delays and freezes. In addition, by ensuring that control commands are executed at the right time, the system's safety can be improved, avoiding risks such as equipment damage or personal injury caused by improper command execution.

[0060] 5. Support multi-executor collaboration:

[0061] In scenarios where multiple actuators need to work together, this strategy can ensure that all actuators start to execute actions according to their respective preset times after receiving control instructions, thereby achieving more precise synchronous control and helping to improve the overall performance and efficiency of the system, which is especially important in fields such as industrial automation and robotic control.

[0062] Preferably, the header file of the control instruction adds the method and data volume of the external control device sending the control instruction to the second microcontroller;

[0063] The target second microcontroller obtains the header file, and when the external control device sends a control instruction to the second microcontroller, the target second microcontroller extracts the data volume of the control instruction.

[0064] The target second microcontroller can directly calculate key parameters such as the preset time according to the sending mode and data volume information in the header file without performing additional measurements or estimates, thereby improving calculation efficiency and accuracy.

[0065] The third aspect of the present invention discloses a robot, which includes multiple actuators, which communicate with an external control device through a switch. The actuator includes a first microcontroller, a second microcontroller and an execution unit, wherein the first microcontroller communicates with the external control device through a topological structure formed by the switch, the first microcontroller and the second microcontroller communicate through a serial port, and the second microcontroller communicates with the execution unit through a connection interface.

[0066] Compared with the prior art, the present invention has the following beneficial effects:

[0067] 1. The embodiment of the present invention replaces the first microcontroller and the second microcontroller with a serial communication mode to improve the communication bandwidth of the first microcontroller and the second microcontroller. The baud rate of the CAN bus is 1 MHz, and the actual communication can only transmit 64 KB per second, and it takes about 128 us to transmit 8 bytes. The serial communication can be changed to a baud rate of 15 MHz, and 1500 KB can be transmitted per second, and it takes only 5.33 us to transmit 8 bytes. The bandwidth is increased by 28 times, which greatly reduces the communication delay and improves the synchronization of multiple actuators executing control instructions at the same time.

[0068] 2. The second microcontroller controls the action of the execution unit according to the control instruction after a preset delay time, wherein the preset time is achieved by accurately calculating the delay time of each link (comprehensively considering a collection of delay times in multiple dimensions, including the transceiver delay time inside the external control device, the transceiver delay time of the switch, the transceiver delay time of the network protocol stack, and the delay time of communication between the first microcontroller and the second microcontroller), and comprehensively considering factors such as the location of the target second microcontroller, so as to ensure that the control instruction is executed at the right time, thereby improving the response accuracy, helping to avoid the defect of poor actuator synchronization due to too long or too short delay time, and improving the overall performance of the system.

[0069] The drawings in the specification, which constitute a part of this application, are used to provide a further understanding of the present invention. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 It is a structural schematic diagram of an existing actuator communication system;

[0071] Figure 2 A schematic diagram of the structure of an actuator communication system according to an embodiment of the present invention;

[0072] Figure 3 is a schematic structural diagram of a humanoid robot according to an embodiment of the present invention;

[0073] Figure 4 A schematic diagram of a flow chart of an actuator communication method according to an embodiment of the present invention;

[0074] Figure 5 It is a flowchart of the executor delayed execution method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0075] This specific implementation manner is merely an explanation of the embodiments of the present invention, and it is not a limitation of the embodiments of the present invention. After reading this specification, those skilled in the art can make non-creative modifications to the embodiments as needed, but as long as it is within the scope of the claims of the embodiments of the present invention, it is protected by the patent law.

[0076] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments in the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present invention.

[0077] The term "comprise" and any variations thereof in the specification and claims of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.

[0078] In the embodiments of the present invention, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0079] In the embodiment of the present invention, the design of the first microcontroller and the second microcontroller communicating through the serial port has a small delay caused by the serial port communication, so that the first microcontroller can quickly transmit the control instructions to the second microcontroller, and can respond to the instructions of the external control device more quickly. This is especially important for application scenarios that require fast response (such as robot control, etc.), and can basically ensure the synchronization of multiple actuators when performing actions at the same time. It is described in detail below with reference to the accompanying drawings.

[0080] Embodiment 1

[0081] Please refer to Figure 2As shown, the actuator communication system is used to realize communication between multiple actuators and an external control device, wherein each one or more actuators corresponds to a joint of the robot and is used to drive the movement of the robot joint. Figure 3 1 shows a schematic structural diagram of a humanoid robot. It can be seen from the figure that each joint of the humanoid robot 100 is provided with an actuator 110 to control the movement of the joint of the humanoid robot.

[0082] The actuator mainly includes a first microcontroller, a second microcontroller and a corresponding execution unit. The first microcontroller is mainly used for network processing to realize communication with the first microcontroller of an external control device or other actuators, and the second microcontroller is a driving device for receiving control instructions from the external control device to control the action of the execution unit. The execution unit here is a driver, such as a motor, etc. The external control device can be a device with certain processing capabilities such as a PC.

[0083] In other embodiments, the execution unit may also be a sensor, such as a position sensor or a speed sensor, etc., for detecting the position or speed of the drive, etc. In this case, the sensing signal collected by the sensor may be transmitted to the external control device through the second microcontroller and the first microcontroller via the switch.

[0084] Specifically, the first microcontroller communicates with the external control device through switches, and the number of switches matches the number of actuators, that is, each actuator is configured with a corresponding switch, and a certain topological connection structure is formed between the switches, so that one of the switches can communicate directly with the external control device, while the other switches communicate with the external control device with the help of the topological connection structure.

[0085] Exemplarily, a daisy chain topology connection structure can be formed between switches, in which the switch of any actuator is communicatively connected to the external control device. The daisy chain topology connection structure allows multiple actuator switches to be connected in sequence to form a chain structure, thereby greatly simplifying the wiring work and reducing the complexity and cost of system installation. In this structure, even if a switch of an actuator fails, it will not affect the communication of the entire system, because other actuators can still communicate with the external control device through the remaining links, which can improve the reliability and fault tolerance of the system. Moreover, the daisy chain topology structure makes the system easy to expand, and only new actuator switches need to be added at the end of the link. This provides users with a flexible system expansion solution to meet the demand for the number of actuators that may increase in the future.

[0086] Specifically, the switch has a built-in PHY, i.e., a physical interface transceiver, so that each switch forms at least three or more network ports, wherein the first network port is used to connect to the corresponding first microcontroller through a network cable (or ETH bus), the second network port is used to connect to the switch of other actuators or an external control device, and the third network port is used to connect to the switch of other actuators (actuators not connected to the second network) or is left vacant. When the second network port is connected to the external control device, it can be connected to the network card of the external control device through a network cable, and the network card of the external control device and the processor of the external control device (such as an Intel i7 processor) can be connected through a PCIE bus. When the first network port is connected to the first microcontroller, it is connected to the ETH-PHY (Ethernet physical interface, which is connected to the first microcontroller body through an RMII bus) built into the first microcontroller through a network cable.

[0087] The first microcontroller and the second microcontroller communicate through a serial port (full-duplex serial port or two simplex serial ports), which can greatly improve the transmission speed compared to the CAN bus communication method in the prior art, thereby ensuring the synchronization when multiple actuators execute the same control instructions or related control instructions at the same time. In order to realize serial port communication, in a preferred embodiment of the present invention, the existing first microcontroller (ESP32 series chip) and the second microcontroller (STM32F405RGT6 chip) are replaced with STM32H7 series chips. The STM32H7 series chip is a high-performance microcontroller with powerful processing capabilities, which can meet the needs of complex control algorithms and high-speed data processing in the actuator communication system. Moreover, its high-performance Cortex-M7 core and high-speed Flash memory ensure that the system can quickly respond to the instructions of the external control device and process the data returned by the actuator in real time.

[0088] Moreover, ESP32 series chips, such as ESP32-PICO-D4, generally need to fetch instructions from icache during operation. If the cache hits, 1us*240MHz=240 instructions can be executed within 1us. When the cache misses, 240 instructions*24bit / instruction=5760bit need to be read from the external QSPI Flash. When the QSPI of the ESP32 series chips runs at the maximum speed of 80MHz, 5760bit requires at least (5760 / (32*8))*(32*8 / 4+8+8+4) / 80=23.625us. It takes 23.625+1=24.625us to execute 240 instructions, which is at least 24.625 times slower.

[0089] The above-mentioned shortcomings of the ESP32 series chips can be avoided by the STM32H7 series chips. From a hardware perspective, the STM32H7 series chips are designed with high real-time and low-latency industrial applications in mind. The Flash is integrated inside the chip and is directly connected to the CPU via a 240MHz 64-bit AXI bus. Even if the cache misses, the instruction receiving speed is 48 times that of the QSPI of the ESP32 series chips (80MHz).

[0090] When the first microcontroller and the second microcontroller communicate using the CAN bus, the baud rate is 1MHz, and the actual communication can only transmit 64KB per second, and it takes about 128us to transmit 8 bytes. When it is changed to serial communication, the baud rate can reach 15MHz, and 1500KB can be transmitted per second. It only takes 5.33us to transmit 8 bytes, and the bandwidth is increased by 28 times, which greatly reduces communication delays and improves the synchronization of multiple actuators executing control instructions at the same time.

[0091] The second microcontroller communicates with the execution unit through a connection interface, and the connection interface can be any one of a serial port, an SPI interface and a PWM interface. It is selected according to the connection interface of the execution unit, so that the actuator can select the most suitable interface for communication according to the specific application scenario and requirements, thereby improving the adaptability and flexibility of the system.

[0092] Embodiment 2

[0093] The second embodiment is a software optimization control algorithm based on the actuator communication system of the first embodiment. The actuator communication system can be regarded as a preliminary reduction of the poor synchronization defect of the existing actuator communication system, that is, it can ensure that the delay of each actuator is reduced to a certain extent, so that the synchronization of the actuators executing the same or related control instructions can be improved to a certain extent. The actuator communication method, on this basis, makes the actuators execute the same or related control instructions more synchronously by delaying the execution operation, thereby ensuring that the robot's movements are more coordinated.

[0094] The actuator communication method is implemented using the above-mentioned actuator communication system. Here, only the method of synchronous execution of multiple actuators by an external control device sending a control instruction to the execution unit, i.e., the driver, is explained and illustrated. The sensor signal collected by the sensor is transmitted to the external control device via the second microcontroller, the first microcontroller, and the switch, and does not involve synchronization performance. Therefore, it will not be specifically expanded.

[0095] Please refer to Figure 4 As shown, the method for an external control device to send a control instruction to an actuator may include the following steps:

[0096] S210: The external control device communicates with the first microcontroller via a switch based on Ethernet, and sends a control instruction to the first microcontroller via Ethernet.

[0097] There are two main ways for external control devices to send control instructions to execution units: full control and subscription.

[0098] For the full control (fast_get_pvc) method, the corresponding control instructions are sent to all actuators. The corresponding control instructions can be the same control instructions or related control instructions. For example, when sending a running instruction, the control instruction can be sent to the corresponding actuators of the wrist joint, hip joint, knee joint, ankle joint, elbow joint, etc. The control instructions can be different rotation angles or different execution times.

[0099] For the subscription method, it means that the control instructions are only sent to one or more specified actuators. For scenarios that require control of specific actuators or actuator groups, the external control device can send control instructions to the second microcontroller of the specified one or more actuators through the subscription method. This method realizes precise control of the actuators and avoids unnecessary instruction interference and waste of resources.

[0100] The two methods use different communication frequencies, with the full control method using a communication frequency of 500Hz and the subscription method using a communication frequency of 1KHz. Different communication frequency settings allow the system to be flexibly adjusted according to actual needs, ensuring real-time control while avoiding unnecessary communication overhead.

[0101] S220: The first microcontroller communicates with the second microcontroller through the serial port to send the control instruction sent by the external control device to the second microcontroller.

[0102] In the serial communication mode, the amount of data transmitted per second between the first microcontroller and the second microcontroller is 1500KB, and it only takes 5.33us to transmit 8 bytes. The bandwidth is increased by 28 times compared with the CAN bus communication mode, which greatly reduces the communication delay and improves the synchronization of multiple actuators executing control instructions at the same time. The first microcontroller and the second microcontroller can communicate through a full-duplex serial port or through two semi-simplex serial ports.

[0103] S230: The second microcontroller calculates a preset time according to the control instruction, and sends the control instruction to the execution unit after delaying the preset time.

[0104] In a system that requires multiple actuators to work together, delaying the preset time can ensure that all actuators have a unified time base to start executing actions after receiving the control command. This helps to achieve more precise synchronous control and improve the overall performance and efficiency of the system.

[0105] For example, when you need to raise your arm, you need to first control the rotation of the shoulder joint of the arm, then the elbow joint, and finally the wrist joint. When the second microcontroller receives the control instruction, due to the different delay times or execution times, if the wrist joint moves first, the imitation of human movements will look unnatural, affecting the user experience.

[0106] The preset delay time here includes the time of receiving the control instruction and the execution time corresponding to the position of the corresponding actuator, thereby ensuring the synchronization of the execution actions of each actuator and the realism of imitating human actions.

[0107] For details, please refer to Figure 5 As shown, the second microcontroller controls the action of the execution unit according to the control instruction after delaying the preset time, which may include the following steps:

[0108] S231. The target second microcontroller obtains the data volume of the control instruction.

[0109] The method and data volume of the external control device sending the control instruction to the second microcontroller are added to the header file of the control instruction; the target second microcontroller (i.e., the second microcontroller to control the action of the corresponding execution unit) obtains the header file, and when the external control device sends the control instruction to the second microcontroller, the data volume of the control instruction is extracted.

[0110] Of course, the control instruction may also include a fifth time delay for setting a delay for the corresponding actuator according to the position of the corresponding actuator (that is, the position of the target second microcontroller mentioned later). T 5k . Still taking the above-mentioned arm raising as an example, the fifth time set for the shoulder joint can be 0, the fifth time set for the elbow joint can be 50us, and the fifth time set for the wrist joint can be 100us. These fifth time setting values ​​can be pre-set when setting the action, that is, when the external control device sends a control instruction, first find the fifth time setting value corresponding to the control instruction, and then send the fifth time setting value to the corresponding actuator together with the control instruction.

[0111] S232: The target second microcontroller determines a first time, a second time, a third time, and a fourth time based on the data amount.

[0112] Please refer to Figure 2As shown, in the process of the external control device sending a control instruction to the second microcontroller, a total of four delays occur, namely the transceiver delay time T1 inside the external control device, the transceiver delay time T2 of the switch, the transceiver delay time T3 of the network protocol stack (the delay time between the switch and the first microcontroller) and the communication delay time T4 between the first microcontroller and the second microcontroller, which are respectively recorded as the first time, the second time, the third time and the fourth time.

[0113] The first to fourth times can be calculated by the communication bandwidth, that is, the communication rate:

[0114]

[0115] T ji For the i The second microcontroller corresponds to the j time, 1≤j≤4, that is T 1i For the i The second microcontroller corresponds to the first time, b ji For the i The second microcontroller corresponds to the j The time delay coefficient is determined according to the actual scenario; H ji For the i The second microcontroller corresponds to the j The associated communication rate of time; C is the data compression ratio.

[0116] The data compression rate is generally 1, and the delay coefficient can be obtained by averaging multiple tests based on the specific robot environment.

[0117] In some other embodiments, since the data volume of the control instructions is small, the first to fourth times of control instructions with different data volumes are not much different. Therefore, the first time, second time, third time and fourth time corresponding to each robot can be directly determined by averaging multiple tests.

[0118] Exemplarily, in the robot sample corresponding to the embodiment of the present invention, the internal transceiver delay of the external control device is generally 200us, the transceiver delay of the switch (the number of switches here is 9, adopting a daisy chain topology) is generally 600us, the transceiver delay of the network protocol stack is generally 20us (the maximum transceiver delay of the ESP32 series chip network protocol stack is generally 600us), and the serial port communication delay is generally 50us (the CAN bus communication delay is generally 900~1400us). Therefore, the first time, second time, third time and fourth time in the robot can be set to 200us, 600us, 20us and 50us respectively.

[0119] S233: The target second microcontroller determines the preset time according to the first time, the second time, the third time, the fourth time and the location of the target second microcontroller.

[0120] The calculation formula for the preset time is as follows:

[0121]

[0122] in, is the maximum value of the sum of the first time, the second time, the third time and the fourth time of all second microcontrollers that receive the control instruction; T k For the k a preset time of a second microcontroller, namely a target second microcontroller, T 1i , T 2i , T 3i , T 4i Respectively i The first time, the second time, the third time, and the fourth time corresponding to the second microcontroller, 1≤ i ≤n,1≤ k ≤n, n is the total number of actuators receiving control instructions, T 5k For the k The fifth time of delay of the second microcontroller, that is, the target second microcontroller, can be determined according to the position of the execution unit corresponding to the target second microcontroller in the robot.

[0123] S234 , the target second microcontroller controls the action of the execution unit according to the control instruction after delaying the preset time.

[0124] After the target second microcontroller calculates and determines the preset time, it can control the action of the driver through the serial port, SPI interface or PWM interface to complete the control instructions issued by the external control device, making the robot closer to human movement habits and more natural.

[0125] Embodiment 3

[0126] Embodiment 3 discloses a robot, which can be a humanoid robot or a robot of other shapes, and includes a shell and multiple actuators mounted on the shell for controlling the movement of the related shells, and of course other necessary components such as rotating shafts, etc. The multiple actuators communicate with an external control device through a switch, and specifically, each actuator includes a first microcontroller, a second microcontroller, and an execution unit, wherein the first microcontroller communicates with the external control device through a topological structure formed by the switch, the first microcontroller and the second microcontroller communicate through a serial port, and the second microcontroller communicates with the execution unit through a connection interface.

[0127] The above is a detailed introduction to an actuator communication system, method and robot disclosed in the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. An actuator communication method, which is implemented by an actuator communication system, wherein the actuator communication system is used to realize communication between multiple actuators and an external control device, wherein the actuator includes a first microcontroller, a second microcontroller and an execution unit, wherein: The first microcontroller communicates with the external control device through a switch, the first microcontroller and the second microcontroller communicate through a serial port, the second microcontroller communicates with the execution unit through a connection interface, and the actuator communication method is used to enable the external control device to send a control instruction to the second microcontroller so that the second microcontroller controls the execution unit to execute the control instruction, and is characterized in that it includes the following steps: The external control device sends the control instruction to the first microcontroller through the switch; The first microcontroller communicates with the second microcontroller via a serial port to send the control instruction to the second microcontroller; The second microcontroller communicates with the execution unit via a connection interface to control the action of the execution unit according to the control instruction; The external control device sends the control instruction to the first microcontroller through the switch, which is a full control mode or a subscription mode, wherein the full control mode is that the external control device sends the control instruction to the second microcontrollers of all actuators; the subscription mode is that the external control device sends the control instruction to the second microcontrollers of one or more specified actuators through subscription; When the external control device sends a control instruction to the plurality of first microcontrollers at the same time, the second microcontrollers corresponding to the plurality of first microcontrollers control the action of the execution unit according to the control instruction after a delay of a preset time; The second microcontroller controls the action of the execution unit according to the control instruction after delaying the preset time, including: The target second microcontroller obtains the data amount of the control instruction; The target second microcontroller determines a first time, a second time, a third time and a fourth time based on the data volume; the first time is a transceiver delay time inside the external control device, the second time is a transceiver delay time of the switch; the third time is a transceiver delay time of the network protocol stack, and the fourth time is a communication delay time between the first microcontroller and the second microcontroller; The target second microcontroller determines the preset time according to the first time, the second time, the third time, the fourth time and the location of the target second microcontroller; in, T k For the k a preset time of a second microcontroller, namely a target second microcontroller, T 1i , T 2i , T 3i , T 4i Respectively i The first time, the second time, the third time and the fourth time corresponding to the second microcontroller, 1≤ i ≤n,1≤ k ≤n, n is the total number of actuators receiving control instructions, T 5k For the k a fifth time of delay of a second microcontroller, namely the target second microcontroller; and: T ji For the i The second microcontroller corresponds to the j time, 1≤j≤4, that is T 1i For the i The second microcontroller corresponds to the first time, b ji For the i The second microcontroller corresponds to the j The time delay coefficient is determined according to the actual scenario; H ji For the i The second microcontroller corresponds to the j The associated communication rate of time; C is the compression ratio; T 5k Determine the position of the execution unit corresponding to the target second microcontroller on the robot; The target second microcontroller controls the action of the execution unit according to the control instruction after delaying the preset time.

2. The actuator communication method according to claim 1, characterized in that: The communication frequency of the full control mode is 500 Hz, and the communication frequency of the subscription mode is 1 KHz; or / and; The first microcontroller and the second microcontroller communicate via a full-duplex serial port or two half-simplex serial ports; or / and; The amount of data transmitted per second between the first microcontroller and the second microcontroller is 1500 KB.

3. The actuator communication method according to claim 1, characterized in that: The target second microcontroller obtains the data amount of the control instruction, including: Adding the method and data volume of sending the control instruction by the external control device to the second microcontroller in the header file of the control instruction; The target second microcontroller obtains the header file, and when the external control device sends a control instruction to the second microcontroller, the target second microcontroller extracts the data volume of the control instruction.

4. The actuator communication method according to claim 1, characterized in that: The first microcontroller and the second microcontroller are both STM32H7 series chips.

5. The actuator communication method according to claim 1, characterized in that: The switches of the plurality of actuators form a daisy chain topology connection structure, wherein the switch of any actuator is communicatively connected with the external control device; or / and; The connection interface is any one of a serial port, an SPI interface and a PWM interface; or / and; The execution unit is a sensor and / or a driver.

6. A robot, characterized in that It includes a plurality of actuators, the actuators communicate with an external control device through a switch, the actuators include a first microcontroller, a second microcontroller and an execution unit, wherein the first microcontroller communicates with the external control device through a topological structure formed by the switch, the first microcontroller and the second microcontroller communicate through a serial port, and the second microcontroller communicates with the execution unit through a connection interface; The method of implementing the external control device sending a control instruction to the second microcontroller so that the second microcontroller controls the execution unit to execute the control instruction includes the following steps: The external control device sends the control instruction to the first microcontroller through the switch; The first microcontroller communicates with the second microcontroller via a serial port to send the control instruction to the second microcontroller; The second microcontroller communicates with the execution unit via a connection interface to control the action of the execution unit according to the control instruction; The external control device sends the control instruction to the first microcontroller through the switch, which is a full control mode or a subscription mode, wherein the full control mode is that the external control device sends the control instruction to the second microcontrollers of all actuators; the subscription mode is that the external control device sends the control instruction to the second microcontrollers of one or more specified actuators through subscription; When the external control device sends a control instruction to the plurality of first microcontrollers at the same time, the second microcontrollers corresponding to the plurality of first microcontrollers control the action of the execution unit according to the control instruction after a delay of a preset time; The second microcontroller controls the action of the execution unit according to the control instruction after delaying the preset time, including: The target second microcontroller obtains the data amount of the control instruction; The target second microcontroller determines a first time, a second time, a third time and a fourth time based on the data volume; the first time is a transceiver delay time inside the external control device, the second time is a transceiver delay time of the switch; the third time is a transceiver delay time of the network protocol stack, and the fourth time is a communication delay time between the first microcontroller and the second microcontroller; The target second microcontroller determines the preset time according to the first time, the second time, the third time, the fourth time and the location of the target second microcontroller; in, T k For the k a preset time of a second microcontroller, namely a target second microcontroller, T 1i , T 2i , T 3i , T 4i Respectively i The first time, the second time, the third time and the fourth time corresponding to the second microcontroller, 1≤ i ≤n,1≤ k ≤n, n is the total number of actuators receiving control instructions, T 5k For the k a fifth time of delay of a second microcontroller, namely the target second microcontroller; and: T ji For the i The second microcontroller corresponds to j time, 1≤j≤4, that is T 1i For the i The second microcontroller corresponds to the first time, b ji For the i The second microcontroller corresponds to the j The time delay coefficient is determined according to the actual scenario; H ji For the i The second microcontroller corresponds to j The associated communication rate of time; C is the compression ratio; T 5k Determine the position of the execution unit corresponding to the target second microcontroller on the robot; The target second microcontroller controls the action of the execution unit according to the control instruction after delaying the preset time.

Citation Information

Patent Citations

  • Error compensation method based on time delay estimation and control system

    CN118061174A