Remote control method for industrial robot
By using plug-in mechanisms and serialization technology in remote control of industrial robots, the problems of incomplete data frames and complex protocols in the existing technology are solved, and an efficient and flexible remote control method is realized.
Patent Information
- Application Number
- CN202411722603.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-25
AI Technical Summary
The existing remote control method of industrial robots has the problem of incomplete data frames caused by data frame conflicts, and the content of the protocol frame is complex, and it is inconvenient to expand specific applications and difficult to maintain.
The functional interface of the target program API library is encapsulated through the plug-in mechanism, and the minimum functional interface of the robot is called by serialization technology, FIFO queue technology and Socket communication technology to realize the remote control of the robot on the PC client.
It avoids communication data conflicts, ensures data frame integrity, simplifies the protocol of functional interfaces, supports the expansion and maintenance of specific applications, and facilitates the implementation of many-to-many working methods.
Smart Images

Figure CN119520578A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial robot control, and in particular to a remote control method for an industrial robot. Background Art
[0002] In industries with a high degree of automation, there are various devices such as robots, cameras, PLCs, lasers, etc. on the production line. The work of the robot on the production line is affected by other devices. For example, the robot's movement position is the camera's photo position, and the PLC's IO signal is the robot's logical control signal. In this case, the main control computer of the production line will send commands to the robot to dynamically control the robot's movement.
[0003] There are many ways to remotely control robots. The conventional one is a fixed protocol method: through TCP / IP network communication, fixed protocol data frames are exchanged frame by frame. In the prior art, the more functions a robot has, the more complex the protocol frame content is; when multiple data frames of parallel commands interact, there is a problem of incomplete data frames caused by data frame conflicts; there are also problems such as specific applications, inconvenient expansion, and difficult maintenance. Therefore, it is urgent to develop a way to remotely control robots. Summary of the invention
[0004] The purpose of the present invention is to provide an industrial robot remote control method, which can enable the robot to encapsulate the functional interface of the target program API library by using a plug-in mechanism without the intervention of a teaching program, and call the minimum functional interface of the robot side by using serialization technology, FIFO queue technology and Socket communication technology to realize PC client remote control of the robot.
[0005] The technical solution of the present invention is: a method for remotely controlling an industrial robot, comprising the following steps: S1: Establish socket command channel and socket status channel; S2: The PC client obtains the real-time status data of the robot through the socket status channel; S3: Based on the robot-side minimum functional interface and the robot-side real-time status data, the PC client uses the plug-in mechanism to encapsulate the functional module into the functional interface of the target program API library; S4: The PC client uses the socket command channel, serialization and FIFO queues, and calls the robot's minimum functional interface through the functional interface of the target program API library to achieve remote control of the robot.
[0006] Preferably, in step S1, establishing a socket command channel specifically involves, through the target program API library, creating a socket command client on the PC client, creating a socket command server on the robot side, and the socket command client and the socket command server are connected via a network; establishing a socket status channel specifically involves, through the target program API library, creating a socket status client on the PC client, creating a socket status server on the robot side, and the socket status client and the socket status server are connected via a network.
[0007] Preferably, step S2 comprises the following steps: S201: socket status server timing interval; S202: According to the timing interval, the socket status server obtains the status data of the robot in real time, and then packages it into a binary data frame according to the custom protocol and sends it to the socket status client; S203: The socket status client receives and parses the real-time status data frame, obtains the real-time status data of the robot side, and transmits the real-time status data of the robot side back to the target program API library of the PC client.
[0008] Preferably, in step S3, the plug-in mechanism comprises the following specific steps: Step 1: Organize the plug-in configuration file, including the plug-in file name, plug-in export priority, and plug-in startup order; Step 2: Parse the plug-in configuration file, and initialize the plug-in according to the priority exported by the plug-in and the startup order of the plug-in to complete the initial configuration of the plug-in; Step 3: Based on the initial configuration, the plug-in packages the function name, function pointer, and function parameters of the external function into a data packet and puts it into the global container to complete the registration of the external function, that is, to provide a calling interface to the outside world; Step 4: The plug-in calls the external function registered in the global container as needed and enters the running working state.
[0009] Preferably, in step S3, the functional modules include: a robot motion module, a robot control module, a robot state synchronization module, a robot error handling module, a robot authority module and a robot log module; The robot motion module is used to receive and execute robot motion commands, drive the robot to move, and synchronize the robot motion state to the robot state synchronization module in real time; The robot control module is used to receive commands sent by the PC client, analyze the commands and send them to the robot motion module, and coordinate other modules to control the normal operation of the robot; The robot state synchronization module is used to synchronize the real-time robot motion state and I / O state to the shared memory so that other modules can access and process them; The robot error handling module is used to monitor the robot's state memory, identify the robot's error state, perform error handling, and record error information in the robot log module.
[0010] The robot permission module is used to assign the robot's movement permissions; The robot log module is used to record command logs, event logs and error logs.
[0011] Preferably, in step S3, the functional interface of the target program API library includes: a motion control class interface, a state setting class interface and an auxiliary class interface.
[0012] Preferably, step S4 comprises the following steps: S401: The socket command client converts the function interface of the target program API library into a serialized string by serialization, and puts the serialized string at the end of the FIFO queue; S402: The socket command client sends the serialized character string to the socket command server in sequence according to the FIFO queue order; S403: The socket command server receives and parses the serialized string, and calls the minimum functional interface of the robot side.
[0013] Preferably, based on the real-time status data of the robot in step S2, the heartbeat handshake signal of the robot is detected in real time to keep the network connection between the PC client and the robot normal.
[0014] Preferably, the robot end maps different robot instances to different robot objects based on IP addresses, and implements a many-to-many working mode, i.e., one-to-many or many-to-one interaction, through a target program API library.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention uses the functional interface of the target program API library, serialization technology, FIFO queue technology, Socket communication technology, and plug-in technology to realize the remote control of the robot by the PC client. The present invention uses FIFO queue technology and Socket communication technology, serial communication channels, to avoid the situation where the communication data conflicts and is lost in the communication channel and causes incomplete data frames; uses serialization technology to obtain data frames of the functional interface of various complex parameters, and sends them to the PC client, simplifying the functional protocol of the functional interface; uses the plug-in mechanism to separate the various functional modules, and then uniformly manages and schedules them, which is conducive to the development of specific applications and is convenient for expansion and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0017] Figure 1 It is a schematic diagram of the process of the present invention; Figure 2 This is a block diagram of the industrial robot remote control system of the present invention; Figure 3 This is a schematic diagram of the implementation of the PC client API library interface of the present invention; Figure 4 It is a schematic diagram of the many-to-many interaction between the robot end and the client target program of the present invention. DETAILED DESCRIPTION
[0018] The following is a clear and complete description of the technical solutions in the embodiments of the present invention 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 the embodiments. Based on 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 present invention.
[0019] like Figure 1-2 As shown, the present invention discloses a remote control method for an industrial robot, including a robot end and a PC client, wherein the robot end is a server end and the PC client is a PC, and the robot end and the PC client communicate through a TCP / IP network, including the following steps: S1: Establish socket command channel and socket status channel.
[0020] The establishment of the socket command channel specifically includes creating a socket command client on the PC client and a socket command server on the robot side through the target program API library, wherein the socket command client and the socket command server are connected through a network; The establishment of the socket status channel is specifically to create a socket status client in the PC client through the target program API library, and to create a socket status server on the robot side, and the socket status client and the socket status server are connected through the network.
[0021] S2: The PC client obtains the real-time status data of the robot through the socket status channel, including the following steps: S201: socket status server timing interval, the interval is 30ms.
[0022] S202: According to the timing interval, the socket status server obtains the status data of the robot in real time, and then packages it into a binary data frame according to the custom protocol and sends it to the socket status client; the data frame includes a frame header, a frame length, a function code, data and a frame tail. The status data of the robot includes robot motion information, such as: robot speed, position and load; robot controller system information, such as: working mode, event, message and running status; robot IO data, such as: physical input and output IO, virtual IO and communication IO.
[0023] S203: The socket status client receives and parses the real-time status data frame, obtains the real-time status data of the robot side, and transmits the real-time status data of the robot side back to the target program API library of the PC client.
[0024] In the present invention, the robot end has a small amount of real-time status data, a high sending frequency, and does not require a response for each frame of data, and can quickly distinguish from the command channel.
[0025] In this embodiment, based on the real-time status data of the robot in step S2, the heartbeat handshake signal of the robot is detected in real time to keep the network connection between the PC client and the robot normal.
[0026] S3: Based on the minimum functional interface of the robot and the real-time status data of the robot, the PC client uses the plug-in mechanism to encapsulate the functional module into the functional interface of the target program API library.
[0027] The plug-in mechanism has the following specific steps: Step 1: Organize the plug-in configuration file, including the plug-in file name, plug-in export priority, and plug-in startup order; in actual applications, adding plug-in configuration can achieve plug-in expansion, which has strong scalability.
[0028] Step 2: Parse the plug-in configuration file, and initialize the plug-in according to the priority exported by the plug-in and the startup order of the plug-in to complete the initial configuration of the plug-in; Step 3: Based on the initial configuration, the plug-in packages the function name, function pointer, and function parameters of the external function into a data packet and puts it into the global container to complete the registration of the external function, that is, to provide a calling interface to the outside world; Step 4: The plug-in calls the external function registered in the global container as needed and enters the running working state; in actual applications, the combination and interoperability of plug-ins are realized, the reusability and flexibility between plug-ins are enhanced, and the coupling is reduced; as long as the registered function functions are not edited, the implementation method and working method upgrade within the plug-in will not be affected, which is easier to update and maintain.
[0029] The functional modules include: robot motion module, robot control module, robot state synchronization module, robot error handling module, robot authority module and robot log module. Figure 2 As shown; The robot motion module is used to receive and execute robot motion commands, drive the robot to move, and synchronize the robot motion state to the robot state synchronization module in real time; The robot control module is used to receive commands sent by the PC client, analyze the commands and send them to the robot motion module, and coordinate other modules to control the normal operation of the robot; The robot state synchronization module is used to synchronize the real-time robot motion state and I / O state to the shared memory so that other modules can access and process them; The robot error handling module is used to monitor the robot's state memory, identify the robot's error state, perform error handling, and record error information in the robot log module.
[0030] The robot permission module is used to assign the robot's movement permissions; The robot log module is used to record command logs, event logs and error logs.
[0031] In this embodiment, the permission module includes master permission and monitoring permission. The master permission is used to send command data of the functional interface without restriction, and the monitoring permission is used to limit the command data of the motion control interface in the functional interface. When multiple PC clients are connected to a robot at the same time, only one PC client has the master permission, and the rest of the PC clients have monitoring permissions. If the PC client with the master permission gives up the master permission, the rest of the PC clients can obtain the master permission in a first-come-first-served manner, but only one PC client with the master permission can exist at any time.
[0032] The functional interfaces of the target program API library include: motion control interface, state setting interface and auxiliary interface, such as Figure 3 shown.
[0033] In this embodiment, the implementation of the motion control interface needs to be combined with the state setting interface and the auxiliary interface, specifically: First, establish a communication connection and call the connection interface in the auxiliary class interface; Then, call the state setting class interface, configure the robot, and check the current robot state; call the motion control class interface and the state setting class interface according to the current robot state to set the robot to the ready state.
[0034] Finally, call the motion control interface to control the movement and stop of the robot.
[0035] At the same time, you can also view the current robot running status by calling the status setting interface; you can also view the log records by calling the auxiliary interface.
[0036] For example, in actual applications, the implementation of the linear motion interface first calls the permission interface in the auxiliary class interface to verify the permission; then calls the reset error interface, set robot mode interface, and enable interface in the state setting class interface to put the robot in a ready state; finally, calls the motion parameter interface (such as speed, transition parameters) and motion interface in the motion control class interface to send motion commands to the motion kernel to drive the robot to move. At the same time, the current motion state interface in the state setting class interface can be called to view the running status of the robot, and the view log interface in the auxiliary class interface can be called to view the interface execution log.
[0037] S4: The PC client uses the socket command channel, serialization and FIFO queues, and the function interface of the target program API library to call the robot's minimum function interface to achieve remote control of the robot, including the following steps: S401: The socket command client uses serialization to convert the functional interface of the target program API library into a serialized string, and puts the serialized string into the end of the FIFO queue; for example: the robot speed interface boolSetRobotSpeed (double speedValue), during serialization, first, establish a temporary buffer area, and put the serialized identification header at the beginning of the buffer area; then, read the interface number registered by SetRobotSpeed when the API library is initialized, and put the interface number in the buffer area behind the serialized identification header; then, put the value of speedValue in the buffer area behind the interface number; finally, the buffer area is the final serialized string, which is put into the end of the FIFO queue, and the buffer area is released.
[0038] In the present invention, no matter how complex the interface parameters are or how huge the interface data is, there is no need to modify the code in the communication protocol. It is only necessary to specify the description of the interface and obtain the data frame by serialization through the serialization technology. There is no need to add a communication protocol, thereby ensuring that the communication protocol is simple and single. In addition, it is only necessary to compile the modified module library, and it is not necessary to compile the entire function library to expand.
[0039] S402: The socket command client sends the serialized string to the socket command server in sequence according to the FIFO queue order; the FIFO queue is a first-in-first-out queue. For example: there are multiple serialized strings ["SS: SetSpeed 10", "SS: MOV P1", "SS: MOV P2", ...] in the queue, first send the first "SS: SetSpeed 10" string to the socket command server, the socket command server executes the command, and the socket command server responds "SS: SetSpeedret: true" to the socket command client to indicate that a FIFO command has been executed. The FIFO queue becomes ["SS: MOVP1", "SS: MOV P2", ...], and then the serialized command strings are taken out in sequence for execution.
[0040] S403: The socket command server receives and parses the serialized string, and calls the minimum functional interface of the robot. For example: the serialized string "SS: SetSpeed 10" calls the current robot state interface to check whether the robot is in the initialization state; calls the robot motion state interface to check whether the robot is in the stop state; calls the speed setting interface to set the speed of the next motion to 10; calls the log interface to record the command execution.
[0041] In this embodiment, Figure 4 As shown, the robot side maps different robot instances to different robot objects based on IP addresses, and implements a many-to-many working mode, i.e., one-to-many or many-to-one interaction, through the target program API library.
[0042] In the target program API library, the object technology of the high-level programming language is used to encapsulate the functional interface in the robot object, so that the robot exists as an object on the PC client. Several robot objects can exist on the PC client at the same time, and the same robot object can also exist on several PC clients at the same time. One robot object corresponds to one robot controller, and the robot controller is connected to the robot objects on different PC clients, which can realize data interconnection and robot sharing, and help the robot to work collaboratively with vision, MSE, etc.
[0043] The target program API library has developed corresponding API libraries for different programming languages and different development platforms, such as C++ API library, C# API library, etc. The robot side provides functional interface services of the API library without distinguishing between platforms and languages, which can enhance the adaptability of the API library, has lower requirements for platforms and programming languages, and has better compatibility with different equipment on the factory line.
[0044] The parts not involved in the present invention are the same as the prior art or are implemented by using the prior art.
[0045] The above contents are further detailed descriptions of the present invention in combination with specific implementation methods, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field of the present invention, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the scope of protection of the present invention.
Claims
1. A remote control method for an industrial robot, characterized in that: The steps include: S1: Establish socket command channel and socket status channel; S2: The PC client obtains the real-time status data of the robot through the socket status channel; S3: Based on the robot-side minimum functional interface and the robot-side real-time status data, the PC client uses the plug-in mechanism to encapsulate the functional module into the functional interface of the target program API library; S4: The PC client uses the socket command channel, serialization and FIFO queues, and calls the robot's minimum functional interface through the functional interface of the target program API library to achieve remote control of the robot.
2. The industrial robot remote control method according to claim 1, characterized in that: In step S1, establishing a socket command channel specifically involves, through the target program API library, creating a socket command client on the PC client, creating a socket command server on the robot side, and the socket command client and the socket command server are connected through a network; establishing a socket status channel specifically involves, through the target program API library, creating a socket status client on the PC client, creating a socket status server on the robot side, and the socket status client and the socket status server are connected through a network.
3. The industrial robot remote control method according to claim 1, characterized in that: Step S2 includes the following steps: S201: socket status server timing interval; S202: According to the timing interval, the socket status server obtains the status data of the robot in real time, and then packages it into a binary data frame according to the custom protocol and sends it to the socket status client; S203: The socket status client receives and parses the real-time status data frame, obtains the real-time status data of the robot side, and transmits the real-time status data of the robot side back to the target program API library of the PC client.
4. The industrial robot remote control method according to claim 1, characterized in that: In step S3, the plug-in mechanism includes the following specific steps: Step 1: Organize the plug-in configuration file, including the plug-in file name, plug-in export priority, and plug-in startup order; Step 2: Parse the plug-in configuration file, and initialize the plug-in according to the priority exported by the plug-in and the startup order of the plug-in to complete the initial configuration of the plug-in; Step 3: Based on the initial configuration, the plug-in packages the function name, function pointer, and function parameters of the external function into a data packet and puts it into the global container to complete the registration of the external function, that is, to provide a calling interface to the outside world; Step 4: The plug-in calls the external function registered in the global container as needed and enters the running working state.
5. The industrial robot remote control method according to claim 1, characterized in that: In step S3, the functional modules include: a robot motion module, a robot control module, a robot state synchronization module, a robot error handling module, a robot authority module and a robot log module; The robot motion module is used to receive and execute robot motion commands, drive the robot to move, and synchronize the robot motion state to the robot state synchronization module in real time; The robot control module is used to receive commands sent by the PC client, analyze the commands and send them to the robot motion module, and coordinate other modules to control the normal operation of the robot; The robot state synchronization module is used to synchronize the real-time robot motion state and I / O state to the shared memory so that other modules can access and process them; The robot error handling module is used to monitor the robot's state memory, identify the robot's error state, perform error handling, and record error information to the robot log module; The robot permission module is used to assign the robot's movement permissions; The robot log module is used to record command logs, event logs and error logs.
6. The industrial robot remote control method according to claim 1, characterized in that: In step S3, the functional interface of the target program API library includes: a motion control class interface, a state setting class interface and an auxiliary class interface.
7. The industrial robot remote control method according to claim 1, characterized in that: Step S4 includes the following steps: S401: The socket command client converts the function interface of the target program API library into a serialized string by serialization, and puts the serialized string at the end of the FIFO queue; S402: The socket command client sends the serialized character string to the socket command server in sequence according to the FIFO queue order; S403: The socket command server receives and parses the serialized string, and calls the minimum functional interface of the robot side.
8. The industrial robot remote control method according to claim 1, characterized in that: Based on the real-time status data of the robot in step S2, the heartbeat handshake signal of the robot is detected in real time to keep the network connection between the PC client and the robot normal.
9. The industrial robot remote control method according to claim 1, characterized in that: The robot side maps different robot instances to different robot objects based on IP addresses, and implements many-to-many working mode, i.e. one-to-many or many-to-one interaction, through the target program API library.