Device control method, device, terminal device and storage medium
By obtaining the robot configuration information and using the CANopen bus for communication, it solves the problem of bus control method of robot control equipment in the existing technology, realizes convenient access to master station data and ease of use of network configuration, and improves equipment control. efficiency and convenience.
Patent Information
- Application Number
- CN202210988086.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-17
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-08-17
AI Technical Summary
The existing bus control method of robot control equipment has problems such as troublesome wiring, low transmission efficiency, few application scenarios and crude configuration pages, making it difficult to achieve convenient access to master station data and network configuration.
By obtaining the robot's configuration information, including the memory address of the data area, process data object configuration information and service data object table, matching the master station and the slave station, using the CANopen bus for communication, and generating address mapping relationships, realizing the master station and the slave station. Data interaction from the slave station.
It improves the convenience of accessing the main station data and the ease of network configuration, reduces the difficulty of device control, and realizes digital control.
Smart Images

Figure CN115373354B
Abstract
Description
Technical Field
[0001] The present application relates to the field of device control technology, and in particular to a device control method, apparatus, terminal device and storage medium. Background Art
[0002] With the rapid development of industrial robot technology, process scenarios are becoming increasingly complex, and the requirements for peripheral control are becoming higher and higher. For example, with the development of welding machine digitization, welding process control requirements are becoming more refined.
[0003] Existing robot control equipment, such as welding machines, generally uses IO, Modbus, DeviceNet and other buses. However, for the IO bus, wiring is troublesome and is limited to transmitting high and low (0, 1) signals; for the Modbus bus, the interaction method is single and the transmission efficiency is not high; for the DeviceNet bus, there are fewer application scenarios, less open source information, and fewer people familiar with it. In other words, in actual application, the existing bus control has a relatively simple page for master station configuration, with only basic configurations such as slave station address and baud rate, and no configuration page; for bus data, it can only be used inside the controller software, and there is no external interface development, which is difficult when debugging and monitoring are required. Summary of the invention
[0004] The main purpose of this application is to provide a device control method, apparatus, terminal device and storage medium, aiming to improve the convenience of accessing master station data and the ease of use of master station networking configuration.
[0005] To achieve the above object, the present application provides a device control method, the device control method comprising:
[0006] Acquire configuration information of the robot, wherein the configuration information includes: a memory address of a data area of the robot, process data object configuration information, and a service data object table;
[0007] According to the service data object table, a master station corresponding to the robot and a slave station corresponding to the master station are matched, and the master station communicates with the slave station through a preset CANopen bus;
[0008] Generate a corresponding address mapping relationship according to the memory address and process data object configuration information;
[0009] Based on the address mapping relationship, the robot obtains data in the master station and communicates with the slave station.
[0010] Optionally, the data area includes an input data table and an output data table, the memory address includes an input address and an output address, the process data object configuration information includes a process data object address, and the step of generating a corresponding address mapping relationship according to the memory address and the process data object configuration information includes:
[0011] Point the pointer in the input data table to the input address, and the pointer in the output data table to the output address, to obtain a corresponding I / O data mapping table;
[0012] Point the pointer in the input data table to the process data object address, and point the pointer in the output data table to the process data object address, to obtain a corresponding process data object mapping table;
[0013] The address mapping relationship is obtained based on the I / O data mapping table and the process data object mapping table.
[0014] Optionally, the step of acquiring data in the master station and communicating with the slave station through the robot based on the address mapping relationship includes:
[0015] Transmitting the data in the slave station to the master station, obtaining first master station data and mapping it into the input data table; and / or
[0016] The data in the output data table is mapped to the master station to obtain second master station data and transmit the data to the slave station.
[0017] Optionally, the step of transmitting the data in the slave station to the master station to obtain the first master station data and mapping it into the input data table includes:
[0018] When the slave station performs an action, the data in the slave station is transmitted to the CANopen bus;
[0019] Based on a preset first communication cycle, reading data in the CANopen bus through the master station to obtain the first master station data;
[0020] The first master station data is mapped into the input data table.
[0021] Optionally, the step of mapping the data in the output data table to the master station to obtain the second master station data and transmitting the second master station data to the slave station includes:
[0022] Mapping the data in the output data table to the master station, obtaining the second master station data and transmitting the data to the CANopen bus;
[0023] Based on a preset second communication cycle, the second master station data in the CANopen bus is read by the slave station, so that the slave station performs corresponding operations according to the second master station data.
[0024] Optionally, the configuration information further includes hardware configuration information, and the step of matching a master station corresponding to the robot and a slave station corresponding to the master station according to the service data object table, wherein the master station communicates with the slave station through a preset CANopen bus includes:
[0025] Initialize corresponding hardware according to the hardware configuration information, the hardware including the robot;
[0026] According to the service data object table, establishing communication between the robot and the master station, and initializing the slave station;
[0027] Based on the CANopen bus, the master station and the slave station are connected via the corresponding CANopen bus and communicate with each other.
[0028] Optionally, before the step of acquiring the configuration information of the robot, wherein the configuration information includes: the memory address of the data area of the robot, the process data object configuration information, and the service data object table, the method further includes:
[0029] Connecting a preset host computer with the robot, wherein the host computer is provided with the configuration page;
[0030] The configuration information is set through the configuration page.
[0031] The present application also provides a device control device, the device control device comprising:
[0032] An acquisition module is used to acquire configuration information of the robot, wherein the configuration information includes: a memory address of a data area of the robot, process data object configuration information, and a service data object table;
[0033] A setting module, used for matching a master station corresponding to the robot and a slave station corresponding to the master station according to the service data object table, wherein the master station communicates with the slave station via a preset CANopen bus;
[0034] A mapping module, used to generate a corresponding address mapping relationship according to the memory address and process data object configuration information;
[0035] A control module is used to acquire data in the master station through the robot and communicate with the slave station based on the address mapping relationship.
[0036] An embodiment of the present application also proposes a terminal device, which includes a memory, a processor, and a device control program stored in the memory and executable on the processor, wherein the device control program implements the steps of the device control method described above when executed by the processor.
[0037] An embodiment of the present application further provides a computer-readable storage medium, on which a device control program is stored. When the device control program is executed by a processor, the steps of the device control method described above are implemented.
[0038] The device control method, apparatus, terminal device and storage medium proposed in the embodiment of the present application obtain the configuration information of the robot, and the configuration information includes: the memory address of the robot's data area, process data object configuration information, and service data object table; according to the service data object table, the master station corresponding to the robot and the slave station corresponding to the master station are matched, and the master station and the slave station communicate through a preset CANopen bus; according to the memory address and process data object configuration information, a corresponding address mapping relationship is generated; based on the address mapping relationship, the robot obtains the data in the master station and communicates with the slave station. By introducing the configuration information of the robot master station through the configuration page, the usability of the master station networking configuration can be improved; by mapping the master station data to the robot's data memory area, the external devices of the slave station can be controlled by the robot, and the convenience of accessing the master station data can be improved. Based on the scheme of this application, starting from the real-world problem of high difficulty in controlling equipment at the master station, a robot CANopen bus master station system is designed, and the effectiveness of the equipment control method proposed in this application is verified on the robot CANopen bus master station system, and digital control is realized. Finally, through the method of this application, the convenience of accessing the master station data and the ease of use of the master station networking configuration are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a schematic diagram of the functional modules of the terminal device to which the device control device of this application belongs;
[0040] Figure 2 This is a flow chart of a first exemplary embodiment of a device control method of the present application;
[0041] Figure 3 This is a flow chart of a second exemplary embodiment of a device control method of the present application;
[0042] Figure 4 The data mapping principle diagram of the device control method of this application;
[0043] Figure 5This is a flow chart of a third exemplary embodiment of a device control method of the present application;
[0044] Figure 6 A system diagram of the device control method of this application;
[0045] Figure 7 A data mapping system diagram for the device control method of this application;
[0046] Figure 8 This is a flow chart of a fourth exemplary embodiment of a device control method of the present application;
[0047] Fig. 9 This is a flowchart of a fifth exemplary embodiment of the device control method of the present application;
[0048] Fig.10 This is a flowchart of a sixth exemplary embodiment of the device control method of the present application;
[0049] Fig.11 Create a flow chart for the robot master station system involved in the device control method of this application;
[0050] Fig.12 This is a flow chart of a seventh exemplary embodiment of the device control method of the present application;
[0051] Fig.13 This is a flow chart for setting configuration information of the device control method of this application.
[0052] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] The main solution of the embodiment of the present application is: to obtain the configuration information of the robot, the configuration information includes: the memory address of the robot's data area, process data object configuration information, and service data object table; according to the service data object table, match the master station corresponding to the robot and the slave station corresponding to the master station, and the master station and the slave station communicate through a preset CANopen bus; according to the memory address and process data object configuration information, generate a corresponding address mapping relationship; based on the address mapping relationship, obtain the data in the master station through the robot to communicate with the slave station. By introducing the configuration information of the robot master station through the configuration page, the ease of use of the master station networking configuration can be improved; by mapping the master station data to the robot's data memory area, the external devices of the slave station can be controlled by the robot, and the convenience of accessing the master station data can be improved. Based on the scheme of this application, starting from the real-world problem of high difficulty in controlling equipment at the master station, a robot CANopen bus master station system is designed, and the effectiveness of the equipment control method proposed in this application is verified on the robot CANopen bus master station system, and digital control is realized. Finally, through the method of this application, the convenience of accessing the master station data and the ease of use of the master station networking configuration are improved.
[0055] Technical terms involved in the embodiments of this application:
[0056] CANopen bus (Controller Area Network, CAN): A high-level communication protocol built on a control area network, including communication sub-protocols and device sub-protocols. It is often used in embedded systems and is also a field bus commonly used in industrial control.
[0057] Service data object (SDO): A technology for accessing heterogeneous data in a unified way, providing robust support for common application modules, making it easier for applications, tools, frameworks, etc. to add, delete, query, modify, constrain, and update data.
[0058] Process data object (PDO): Process data represents data that can change over time, such as the inputs (i.e. sensors) and outputs (i.e. motor drives) of a node controller. Process data is also stored in the object dictionary. However, since service data object communication only allows access to one object dictionary index at a time, accessing constantly changing data can have a lot of overhead. In addition, the CANopen protocol requires nodes to send their own data without being polled by the CANopen master.
[0059] It should be noted that in the embodiment of the present application, the process data object refers to PDO, the service data object refers to SDO, and the data area of the robot refers to the I / O data of the robot.
[0060] The embodiments of the present application take into account that for existing robot control equipment, such as welding machines, buses such as IO, Modbus, and DeviceNet are generally used. However, for the IO bus, wiring is cumbersome and is limited to transmitting high and low (0, 1) signals; for the Modbus bus, the interaction method is single and the transmission efficiency is not high; for the DeviceNet bus, there are fewer application scenarios, less open source information, and fewer familiar personnel. That is, in actual application of existing bus control, the master station configuration page is relatively simple, including only basic configurations such as slave station address and baud rate, and no configuration page; for bus data, it can only be used within the controller software, and there is no external interface development, which is difficult when debugging and monitoring are required.
[0061] Therefore, the embodiment scheme of the present application starts from the problem of the high difficulty of controlling the equipment at the master station, combines the ease of configuration of configuration technology and the control capability of the CANopen bus, designs a robot CANopen bus master station system, and verifies the effectiveness of the equipment control method proposed in the present application on the robot CANopen bus master station system, realizes digital control, and finally, through the method of the present application, improves the convenience of accessing the master station data and the ease of the master station networking configuration.
[0062] Specifically, refer to Figure 1 , Figure 1 This is a functional module diagram of the terminal device to which the device control device of this application belongs. The device control device can be a device independent of the terminal device, capable of accessing the master station data and configuring the master station network, and can be carried on the terminal device in the form of hardware or software. The terminal device can be a smart mobile terminal with data processing functions such as a mobile phone or a tablet computer, or a fixed terminal device or server with data processing functions.
[0063] In this embodiment, the terminal device to which the device control apparatus belongs includes at least an output module 110 , a processor 120 , a memory 130 and a communication module 140 .
[0064] The memory 130 stores an operating system and a device control program. The device control device can obtain the configuration information, the memory address of the robot's data area, the process data object configuration information, and the service data object table. According to the service data object table, the master station corresponding to the robot and the slave station corresponding to the master station are set. The master station and the slave station communicate through a preset CANopen bus. According to the memory address and the process data object configuration information, a corresponding address mapping relationship is generated. Based on the address mapping relationship, the robot obtains data in the master station and communicates with the slave station. The information is stored in the memory 130; the output module 110 can be a display screen, etc. The communication module 140 can include a WIFI module, a mobile communication module, a Bluetooth module, etc., and communicates with an external device or server through the communication module 140.
[0065] When the device control program in the memory 130 is executed by the processor, the following steps are implemented:
[0066] Acquire configuration information of the robot, wherein the configuration information includes: a memory address of a data area of the robot, process data object configuration information, and a service data object table;
[0067] According to the service data object table, a master station corresponding to the robot and a slave station corresponding to the master station are matched, and the master station communicates with the slave station through a preset CANopen bus;
[0068] Generate a corresponding address mapping relationship according to the memory address and process data object configuration information;
[0069] Based on the address mapping relationship, the robot obtains data in the master station and communicates with the slave station.
[0070] Furthermore, when the device control program in the memory 130 is executed by the processor, the following steps are also implemented:
[0071] Point the pointer in the input data table to the input address, and the pointer in the output data table to the output address, to obtain a corresponding I / O data mapping table;
[0072] Point the pointer in the input data table to the process data object address, and point the pointer in the output data table to the process data object address, to obtain a corresponding process data object mapping table;
[0073] The address mapping relationship is obtained based on the I / O data mapping table and the process data object mapping table.
[0074] Furthermore, when the device control program in the memory 130 is executed by the processor, the following steps are also implemented:
[0075] The data in the slave station is transferred to the master station, the first master station data is obtained and mapped into the input data table.
[0076] Furthermore, when the device control program in the memory 130 is executed by the processor, the following steps are also implemented:
[0077] The data in the output data table is mapped to the master station to obtain second master station data and transmit the data to the slave station.
[0078] Furthermore, when the device control program in the memory 130 is executed by the processor, the following steps are also implemented:
[0079] When the slave station performs an action, the data in the slave station is transmitted to the CANopen bus;
[0080] Based on a preset first communication cycle, reading data in the CANopen bus through the master station to obtain the first master station data;
[0081] The first master station data is mapped into the input data table.
[0082] Furthermore, when the device control program in the memory 130 is executed by the processor, the following steps are also implemented:
[0083] Mapping the data in the output data table to the master station, obtaining the second master station data and transmitting the data to the CANopen bus;
[0084] Based on a preset second communication cycle, the second master station data in the CANopen bus is read by the slave station, so that the slave station performs corresponding operations according to the second master station data.
[0085] Furthermore, when the device control program in the memory 130 is executed by the processor, the following steps are also implemented:
[0086] Initialize corresponding hardware according to the hardware configuration information, the hardware including the robot;
[0087] According to the service data object table, establishing communication between the robot and the master station, and initializing the slave station;
[0088] Based on the CANopen bus, the master station and the slave station are connected via the corresponding CANopen bus and communicate with each other.
[0089] Furthermore, when the device control program in the memory 130 is executed by the processor, the following steps are also implemented:
[0090] Connecting a preset host computer with the robot, wherein the host computer is provided with the configuration page;
[0091] The configuration information is set through the configuration page.
[0092] This embodiment adopts the above scheme, specifically by acquiring the configuration information of the robot, the configuration information includes: the memory address of the robot's data area, process data object configuration information, and service data object table; according to the service data object table, the master station corresponding to the robot and the slave station corresponding to the master station are matched, and the master station and the slave station communicate through a preset CANopen bus; according to the memory address and process data object configuration information, a corresponding address mapping relationship is generated; based on the address mapping relationship, the robot acquires the data in the master station and communicates with the slave station. By introducing the configuration information of the robot master station through the configuration page, the usability of the master station networking configuration can be improved; by mapping the master station data to the robot's data memory area, the external devices of the slave station can be controlled by the robot, and the convenience of accessing the master station data can be improved. Based on the scheme of this application, starting from the real-world problem of high difficulty in controlling equipment at the master station, a robot CANopen bus master station system is designed, and the effectiveness of the equipment control method proposed in this application is verified on the robot CANopen bus master station system, and digital control is realized. Finally, through the method of this application, the convenience of accessing the master station data and the ease of use of the master station networking configuration are improved.
[0093] Based on the above terminal device architecture but not limited to the above architecture, an embodiment of the method of the present application is proposed.
[0094] Reference Figure 2 , Figure 2 This is a flow chart of the first exemplary embodiment of the device control method of the present application. The device control method comprises:
[0095] Step S210, obtaining configuration information of the robot, wherein the configuration information includes: a memory address of a data area of the robot, process data object configuration information, and a service data object table;
[0096] Specifically, when the robot control equipment is actually applied, such as a welding machine, the configuration page of its master station is relatively simple, including only basic configurations such as slave station address and baud rate, and no configuration page. Therefore, in this embodiment, the configuration information of the robot is introduced through the host computer, that is, by applying the configuration technology, an intuitive and visual configuration page is realized, and the configuration can be dragged, double-clicked to add hardware, and deleted by the Delete key, so that the user can set the configuration information of the robot master station more simply and conveniently, and improve the convenience of controlling the master station data. Among them, the configuration of the master station bus includes the configuration of the bus network and the device list of the bus network. For example, the configuration of the bus network includes a control cabinet (master station), node 1 and node 2 (slave station), and the control cabinet communicates with the two nodes through the CANopen bus. The device list of the bus network includes the corresponding interface of the CANopen bus.
[0097] More specifically, before setting the robot's configuration information, you need to connect the host computer and the robot. After the connection is successful, enter the configuration by clicking the configuration page. Figure 3 In the visual configuration interface shown, the user can set the configuration information, thereby dragging the corresponding hardware, double-clicking to add hardware, deleting with the Delete key, downloading and starting the corresponding master station. The configuration information includes but is not limited to process data object configuration information, service data object table, hardware configuration information, and memory address of the robot's data area.
[0098] Step S220, matching the master station corresponding to the robot and the slave station corresponding to the master station according to the service data object table, wherein the master station communicates with the slave station via a preset CANopen bus;
[0099] It should be noted that the I / O data of the robot is arranged in byte addresses, and the master data of the CANopen bus is arranged in indexes and sub-indexes. Among them, the robot divides the master data area from the I / O data area (divided into standard input / output, system input / output, bus slave, bus master, and custom input and output); the master data area can also be subdivided into CANopen bus area, Modbus area, etc., and the master data is mapped to the corresponding master data area; in this way, the user can access the master through robot programming and then control external devices. Service data objects and process data objects are two protocol modes for CANopen bus communication. Among them, service data objects are used to initialize slaves; process data objects are used for data interaction. Initialize the slave through the service data object, tell the slave which process data objects the master wants to interact with, and then regularly interact and refresh the process data object data.
[0100] Specifically, according to the service data object table, the master station corresponding to the robot and the slave station corresponding to the master station are matched. Taking a servo drive or a welding machine as an example, there are a lot of data (process data objects) inside the servo drive or welding machine. The master station wants to periodically obtain the specified (process data object) object data, and tells the slave station (servo drive or welding machine) through the service data object, and then the slave station will periodically send data to the master station; wherein the service data object information includes two-way interactive information, and the process data object information is one-way information. For the robot, the robot's I / O memory is mapped to the process data object address, so that the bus data can be easily accessed.
[0101] Step S230, generating a corresponding address mapping relationship according to the memory address and process data object configuration information;
[0102] Specifically, the memory address includes the input address and the output address, and the process data object configuration information includes the process data object address. The pointer in the input data table points to the input address, and the pointer in the output data table points to the output address to obtain the corresponding I / O data mapping table; the pointer in the input data table points to the process data object address, and the pointer in the output data table points to the process data object address to obtain the corresponding process data object mapping table; based on the I / O data mapping table and the process data object mapping table, the address mapping relationship is obtained. The service data object table, the I / O data mapping table, and the process data object mapping table are registered in the robot's protocol stack to associate the memory addresses of the master station data and the I / O data. It should be noted that according to the configuration information set by the external user, the I / O data can map all the process data object data, or it can map part of the process data object data.
[0103] That is, the software in the robot establishes the I / O data mapping table and the process data object mapping table as a pointer correspondence table, and associates the pointers of both parties to point to the I / O memory of the robot. In this way, when the master station data is updated, it is directly updated to the mapped robot I / O memory. In addition, the CANopen bus is mainly widely used in industrial control and automotive buses, and its operation is complex and has a high threshold. However, for the robot control scenario, there are relatively few slave stations and the application is simple. The CANopen bus has the advantages of open source, high real-time performance and good stability.
[0104] In addition, the mapping relationship includes at least one or more mapping relationships, for example, the ups and downs operation of the welding machine, the position movement operation of the welding machine, etc.
[0105] Step S240: Based on the address mapping relationship, the robot obtains data in the master station and communicates with the slave station.
[0106] Specifically, after the master station is running, the communication between the robot and the master station is first established through the information in the service data object table. After the connection is established, the T process data object or R process data object data from the CANopen bus is updated and stored based on the process data object table. Among them, the process data object table is not open to the outside; the I / O mapping table updates the data of the mapping part of the stored process data object for user access. In addition, since the robot is different from the PLC controller, there is no concept of registers, components, etc. in robot programming. Therefore, in this embodiment, the I / O data of the robot is used as the data area of the robot, and the master station is mapped to the I / O data. The robot controller software synchronizes the I / O master station data and the master station in real time. In this way, the user can access the I / O data through the programming and monitoring pages, and then interact with the master station data to control the slave station equipment in real time.
[0107] This embodiment adopts the above scheme, specifically by acquiring the configuration information of the robot, the configuration information includes: the memory address of the robot's data area, process data object configuration information, and service data object table; according to the service data object table, the master station corresponding to the robot and the slave station corresponding to the master station are matched, and the master station and the slave station communicate through a preset CANopen bus; according to the memory address and process data object configuration information, a corresponding address mapping relationship is generated; based on the address mapping relationship, the robot acquires the data in the master station and communicates with the slave station. By introducing the configuration information of the robot master station through the configuration page, the usability of the master station networking configuration can be improved; by mapping the master station data to the robot's data memory area, the external devices of the slave station can be controlled by the robot, and the convenience of accessing the master station data can be improved. Based on the scheme of this application, starting from the real-world problem of high difficulty in controlling equipment at the master station, a robot CANopen bus master station system is designed, and the effectiveness of the equipment control method proposed in this application is verified on the robot CANopen bus master station system, and digital control is realized. Finally, through the method of this application, the convenience of accessing the master station data and the ease of use of the master station networking configuration are improved.
[0108] Reference Figure 3 , Figure 3 This is a flow chart of the second exemplary embodiment of the device control method of this application. Figure 2 In the embodiment shown, the data area includes an input data table and an output data table, the memory address includes an input address and an output address, and the process data object configuration information includes a process data object address. In step S230, the step of generating a corresponding address mapping relationship according to the memory address and the process data object configuration information includes:
[0109] Step S410, pointing the pointer in the input data table to the input address, and the pointer in the output data table to the output address, to obtain a corresponding I / O data mapping table;
[0110] Specifically, the data area (I / O data area) of the robot can be divided into multiple data areas, which are used to output or input (send or receive) data interacting with different devices, and each data area can perform data unit conversion. For example, the robot I / O data area includes but is not limited to: standard input / output, system input / output, memory input / output, slave fieldbus input / output, master fieldbus input / output, and custom input / output. Among them, each divided area can convert units, as shown in the figure, Bit, Byte, Word. In addition, the I / O data area can also be subdivided into CANopen bus area, Modbus area, etc.
[0111] like Figure 4 As shown, Figure 4 The data mapping principle diagram of the device control method of this application is as follows: the pointer in the input data table points to the INPUT address (input address), and the pointer in the output data table points to the OUTPUT address (output address), to obtain the I / O data mapping table.
[0112] Step S420, pointing the pointer in the input data table to the process data object address, and pointing the pointer in the output data table to the process data object address, to obtain a corresponding process data object mapping table;
[0113] Specifically, Figure 4 As shown, Figure 4 In the data mapping schematic diagram of the device control method of the present application, the pointer in the input data table points to the process data object address, and at the same time, the pointer in the output data table points to the process data object address, that is, the pointer in the output data table and the pointer in the output data table point to the process data object address at the same time, and are registered in the robot's protocol stack to generate a process data object mapping table.
[0114] For example, OutB832, InB832, and 16#2100:01 are used as examples: OutB is the output address, InB is the output address, 16#2100:01 is the process data object address, and 832 is the number. In the process data object table, the output data table is pointed to the process data object address, and the input data table is also pointed to the process data object address, that is, the robot's output address OutB832 is corresponded to the process data object address 16#2100:01, and the robot's input address InB832 is corresponded to the process data object address 16#2100:01.
[0115] Step S430, obtaining the address mapping relationship based on the I / O data mapping table and the process data object mapping table.
[0116] Specifically, since robots are different from PLC controllers, robot programming does not have concepts such as registers and components. Therefore, in this embodiment, the robot's I / O data is used as the robot's data area, and the master station is mapped to the I / O data. The robot controller software synchronizes the I / O master station data and the master station in real time. In this way, the interaction can be accessed through programming and monitoring pages, and then the master station data is interacted.
[0117] This embodiment uses the above scheme to obtain the corresponding I / O data mapping table by pointing the pointer in the input data table to the input address and the pointer in the output data table to the output address; the pointer in the input data table points to the process data object address and the pointer in the output data table points to the process data object address to obtain the corresponding process data object mapping table; based on the I / O data mapping table and the process data object mapping table, the address mapping relationship is obtained. By mapping the master station data to the I / O data area of the robot, it is convenient for users to program and access the master station data of the master station, thereby improving the convenience of accessing the master station data.
[0118] Reference Figure 5 , Figure 5 This is a flow chart of the third exemplary embodiment of the device control method of this application. Figure 3 In the embodiment shown, step S240, based on the address mapping relationship, the step of acquiring data in the master station and communicating with the slave station through the robot includes:
[0119] Step S810, transferring the data in the slave station to the master station, obtaining the first master station data and mapping it into the input data table;
[0120] Specifically, after the master station is running, the communication between the robot and the master station is first established through the information in the service data object table. After the connection is established, the R process data object data from the bus is updated and stored based on the process data object table. Among them, the process data object table is not open to the outside; the I / O mapping table updates the data of the mapping part of the process data object for user access.
[0121] More specifically, when the slave station performs an action, the data in the slave station is transmitted to the CANopen bus, and the master station reads the data in the CANopen bus with a preset first timer to obtain the first master station data, and maps the first master station data to the input data table.
[0122] And / or step S820, mapping the data in the output data table to the master station, obtaining second master station data and transmitting it to the slave station.
[0123] Specifically, after the master station is running, the communication between the robot and the master station is first established through the information in the service data object table. After the connection is established, the T process data object data from the bus is updated and stored based on the process data object table, but the process data object table is not open to the outside world; the I / O mapping table updates the data of the mapping part of the stored process data object for user access.
[0124] More specifically, the data in the output data table is mapped to the master station to obtain the second master station data and transmit it to the CANopen bus; the slave station uses a preset second timer to read the second master station data on the CANopen bus so that the slave station can perform corresponding operations based on the second master station data.
[0125] This embodiment adopts the above scheme, specifically by transferring the data in the slave station to the master station, obtaining the first master station data and mapping it to the input data table; and / or mapping the data in the output data table to the master station, obtaining the second master station data and transmitting it to the slave station. By mapping the master station data to the I / O data area of the robot, it is convenient for users to program and access the master station data of the master station, thereby improving the convenience of accessing the master station data.
[0126] like Figure 6 As shown, Figure 6 This is a system diagram of the device control method of this application. The figure shows the configuration page, the robot's I / O data memory, the master station, the slave station, the CANopen bus, and the robot's monitoring and programming modules. By interacting with the robot's I / O data memory through the configuration page, the robot's configuration information can be set; by interacting with the robot's I / O data memory and the master station, the master station data can be mapped to the robot's I / O data memory, so that the user can monitor and program the robot, thereby controlling the slave station's equipment.
[0127] like Figure 7 As shown, Figure 7The data mapping system diagram of the device control method of this application. First, obtain the configuration information, and the configuration configuration file includes the hardware configuration information and process data object configuration information of the robot. Then, according to the configuration information, establish a mapping relationship for multiple robots, and the mapping relationship includes three tables: service data object (SDO, Service data object) table, process data object (PDO, Process data object) mapping table, and I / O data mapping table; wherein the process data object mapping table describes the address mapping relationship between the master station data and the I / O data. Then, register the three tables to the protocol stack to associate the master station data and the I / O data memory address; I / O data can map all process data objects or part of the process data objects, depending on the configuration of the configuration file. Finally, after the master station is running, the communication between the robot and the master station is first established through the information in the service data object table. After the connection is established, the TPDO\RPDO data from the bus is updated and stored based on the process data object table, but the process data object table is not open to the outside; the I / O mapping table updates the data of the mapped part of the stored process data object for user access.
[0128] Reference Figure 8 , Figure 8 This is a flow chart of the fourth exemplary embodiment of the device control method of this application. Figure 2 In the embodiment shown, step S810, the step of transmitting the data in the slave station to the master station, obtaining the first master station data and mapping it into the input data table includes:
[0129] Step S1110, when the slave station performs an action, transmitting the data in the slave station to the CANopen bus;
[0130] Specifically, in practical applications, for example, when using welding machines, servo drives and other equipment for digital control, it is necessary to monitor the welding machines, servo drives and other equipment, which can effectively analyze and process the equipment parameters and the equipment operation status in a timely manner to ensure the safety of equipment operation and realize remote monitoring. Therefore, when the external device of the slave station performs an action, data will be generated, that is, the slave station transmits the data generated by the external device to the CANopen bus, so that the master station can read the data in the CANopen bus with a timer, wherein the interval for the timer to read the data is set according to the actual situation.
[0131] Step S1120, based on a preset first communication cycle, reading data in the CANopen bus through the master station to obtain the first master station data;
[0132] Specifically, based on the first communication cycle, the master station reads the data in the CANopen bus to obtain the first master station data, that is, the external user controls the I / O data area of the robot, thereby obtaining the corresponding master station data by the master station reading the data in the CANopen bus with a timer, so that the master station maps the master station data to the I / O data area of the robot. In this embodiment, the data in the CANopen bus can be the data transmitted by the slave station through the CANopen bus. That is, the master station data is mapped to the input data table of the robot.
[0133] Step S1130: Map the first master station data into the input data table.
[0134] Specifically, the master station maps the master station data to the input data table through the address mapping relationship, so that the user can monitor the external devices of the slave station in real time. That is, by querying the input address of the input data table corresponding to the process data object address, the corresponding input data table is obtained.
[0135] This embodiment adopts the above scheme, specifically, when the slave station performs an action, the data in the slave station is transmitted to the CANopen bus; based on the preset first communication cycle, the master station reads the data in the CANopen bus to obtain the first master station data; and the first master station data is mapped to the input data table. By transmitting the data in the slave station to the master station and mapping it to the I / O data area of the robot, the device can be monitored in real time, the digital control of the device can be realized, and the convenience of accessing the master station data can be improved.
[0136] Reference Fig. 9 , Fig. 9 This is a flowchart of the fifth exemplary embodiment of the device control method of this application. Figure 2 In the embodiment shown, step 820, mapping the data in the output data table to the master station, obtaining the second master station data and transmitting the data to the slave station includes:
[0137] Step S1210, mapping the data in the output data table to the master station, obtaining the second master station data and transmitting it to the CANopen bus;
[0138] Specifically, in practical applications, for example, digital control using welding machines, servo drives, etc. requires control of welding machines, servo drives, etc. Therefore, external users program the robot, input data into the I / O data mapping table, and map the data to the master station data through the address mapping relationship, that is, by querying the output address of the output data table, and querying the process data object address corresponding to the output address, and transmitting to the corresponding master station data. In this way, the master station then transmits the master station data to the CANopen bus, so that the slave station can read the data in the CANopen bus with a timer and perform corresponding actions according to the data.
[0139] Step S1220: Based on a preset second communication cycle, the slave station reads the second master station data in the CANopen bus, so that the slave station performs corresponding operations according to the second master station data.
[0140] Specifically, based on the second communication cycle, the second master station data in the CANopen bus is read by the slave station. That is, the slave station reads the data in the CANopen bus with a timer, and performs corresponding actions according to the data. In this embodiment, the second master station data in the CANopen bus can be the data generated by robot programming mapped to the master station, and then transmitted from the master station to the CANopen bus. In this way, the user can access the master station through robot programming, and then control the external devices of the slave station.
[0141] This embodiment uses the above scheme to map the data in the output data table to the master station, obtain the second master station data and transmit it to the CANopen bus; based on the preset second communication cycle, the slave station reads the second master station data in the CANopen bus, so that the slave station can perform corresponding operations according to the second master station data. The robot is programmed by an external user, and the data generated by the programming is mapped to the master station and transmitted to the slave station, so that the equipment of the slave station can be controlled in real time, the digital control of the equipment can be realized, and the convenience of accessing the master station data is improved.
[0142] Reference Fig.10 , Fig.10 This is a flow chart of the sixth exemplary embodiment of the device control method of this application. Figure 2 In the embodiment shown, the configuration information also includes hardware configuration information. In step S220, according to the service data object table, matching the master station corresponding to the robot and the slave station corresponding to the master station, the master station and the slave station communicating through a preset CANopen bus include:
[0143] Step S1310, initializing corresponding hardware according to the hardware configuration information, the hardware including the robot;
[0144] Specifically, refer to Fig.11 , Fig.11 Create a flow chart for the robot master station system involved in the device control method of this application. First, parse the configuration file (configuration information); then, obtain the robot's hardware configuration information, process data object configuration, and mapping relationship; then, initialize the hardware (including but not limited to the robot, master station, and slave station); then, initialize the process data object table; then, initialize the mapping relationship; then, through the interaction between the master station and the slave station, obtain the master station data, and map the master station data to the robot's I / O data (output data table, input data table) for controlling the slave station through the robot.
[0145] It should be noted that the hardware can be any hardware in the robot CANopen master station system involved in the embodiments of the present application, including but not limited to robots, master stations, slave stations, host computers, etc.
[0146] Step S1320, establishing communication between the robot and the master station according to the service data object table, and initializing the slave station;
[0147] Specifically, taking a servo drive or welding machine as an example, there is a lot of data (process data objects) inside it. If the master station wants to periodically obtain the specified (process data object) object data, it needs to tell the slave station (servo drive or welding machine) through the service data object, and then the slave station will periodically send data to the master station; the service data object information is two-way interactive information, and the process data object information is one-way information.
[0148] Step S1330: Based on the CANopen bus, the master station and the slave station are connected via the corresponding CANopen bus to perform communication.
[0149] Specifically, because CANopen bus is an open and flexible higher-level protocol, it has an increasingly wide range of applications. Based on CANopen bus, it combines low cost and high performance, and provides distributed control solutions for industrial automation, medical equipment, public transportation, elevators, maritime electronics, and many other applications. Therefore, connecting the master station and the slave station through CANopen bus is an important solution for robot to solve equipment control.
[0150] This embodiment adopts the above scheme, specifically by initializing the corresponding hardware according to the hardware configuration information, the hardware including the robot; establishing communication between the robot and the master station according to the service data object table, and initializing the slave station; based on the CANopen bus, connecting the master station and the slave station through the corresponding CANopen bus, and communicating.
[0151] Reference Fig.12 , Fig.12 This is a flow chart of the seventh exemplary embodiment of the device control method of this application. Figure 2 In the embodiment shown, before the step S210 of acquiring the configuration information of the robot, the configuration information includes: the memory address of the data area of the robot, the process data object configuration information, and the service data object table, the method further includes:
[0152] Step S1510, connecting a preset host computer with the robot, wherein the host computer is provided with the configuration page;
[0153] Specifically, refer to Fig.13 , Fig.13 The configuration information setting flow chart of the device control method of this application. First, connect the host computer to the robot; then, configure the robot's hardware configuration information, PRO configuration information, and address mapping relationship through the visual configuration page in the host computer; then, generate the corresponding configuration file (configuration information); finally, download and start the master station through the visual configuration page in the host computer for data interaction. In addition, it is necessary to determine whether the robot and the host computer are successfully connected. If not, repeat the steps of connecting the host computer to the robot until the connection is successful and execute the next step.
[0154] Step S1520: setting the configuration information through the configuration page.
[0155] Specifically, through the configuration page in the host computer, the operation can be made intuitive and clear, and when the user sets the configuration information, it is convenient and simple. Among them, the configuration information includes but is not limited to: the hardware configuration information of the robot and the process data object configuration information.
[0156] This embodiment uses the above solution, specifically by connecting a preset host computer with the robot, the host computer is provided with the configuration page, and the configuration information is set through the configuration page. Through the configuration technology, the usability and convenience of the master station network configuration are improved.
[0157] In addition, an embodiment of the present application further provides a device control device, the device control device comprising:
[0158] An acquisition module is used to acquire configuration information of the robot, wherein the configuration information includes: a memory address of a data area of the robot, process data object configuration information, and a service data object table;
[0159] A setting module, used for matching a master station corresponding to the robot and a slave station corresponding to the master station according to the service data object table, wherein the master station communicates with the slave station via a preset CANopen bus;
[0160] A mapping module, used to generate a corresponding address mapping relationship according to the memory address and process data object configuration information;
[0161] A control module is used to acquire data in the master station through the robot and communicate with the slave station based on the address mapping relationship.
[0162] For the principle and implementation process of implementing device control in this embodiment, please refer to the above embodiments and will not be repeated here.
[0163] In addition, an embodiment of the present application also proposes a terminal device, which includes a memory, a processor, and a device control program stored in the memory and executable on the processor, and when the device control program is executed by the processor, the steps of the device control method described above are implemented.
[0164] Since all the technical solutions of all the aforementioned embodiments are adopted when the device control program is executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0165] In addition, an embodiment of the present application further proposes a computer-readable storage medium, on which a device control program is stored. When the device control program is executed by a processor, the steps of the device control method described above are implemented.
[0166] Since all the technical solutions of all the aforementioned embodiments are adopted when the device control program is executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0167] Compared with the prior art, the device control method, apparatus, terminal device and storage medium proposed in the embodiment of the present application obtain the configuration information of the robot, and the configuration information includes: the memory address of the robot's data area, process data object configuration information, and service data object table; according to the service data object table, the master station corresponding to the robot and the slave station corresponding to the master station are matched, and the master station and the slave station communicate through a preset CANopen bus; according to the memory address and process data object configuration information, a corresponding address mapping relationship is generated; based on the address mapping relationship, the robot obtains the data in the master station and communicates with the slave station. By introducing the configuration information of the robot master station through the configuration page, the ease of use of the master station networking configuration can be improved; by mapping the master station data to the robot's data memory area, the external devices of the slave station can be controlled by the robot, and the convenience of accessing the master station data can be improved. Based on the scheme of this application, starting from the real-world problem of high difficulty in controlling equipment at the master station, a robot CANopen bus master station system is designed, and the effectiveness of the equipment control method proposed in this application is verified on the robot CANopen bus master station system, and digital control is realized. Finally, through the method of this application, the convenience of accessing the master station data and the ease of use of the master station networking configuration are improved.
[0168] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0169] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to execute the method of each embodiment of the present application.
[0171] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A device control method, It is characterized in that The device control method comprises the following steps: Acquire configuration information of the robot, wherein the configuration information includes: a memory address of a data area of the robot, process data object configuration information, and a service data object table; According to the service data object table, a master station corresponding to the robot and a slave station corresponding to the master station are matched, and the master station communicates with the slave station through a preset CANopen bus; Generate a corresponding address mapping relationship according to the memory address and the process data object configuration information, wherein the data area includes an input data table and an output data table, the memory address includes an input address and an output address, the process data object configuration information includes a process data object address, and the step of generating a corresponding address mapping relationship according to the memory address and the process data object configuration information includes: point a pointer in the input data table to the input address, and point a pointer in the output data table to the output address, to obtain a corresponding I / O data mapping table; point a pointer in the input data table to the process data object address, and point a pointer in the output data table to the process data object address, to obtain a corresponding process data object mapping table; based on the I / O data mapping table and the process data object mapping table, obtain the address mapping relationship, the address mapping relationship includes a mapping relationship between the I / O data mapping table and the process data object mapping table; Based on the address mapping relationship, the robot obtains data in the master station and communicates with the slave station.
2. The device control method according to claim 1, It is characterized in that The step of acquiring data in the master station and communicating with the slave station through the robot based on the address mapping relationship includes: Transmitting the data in the slave station to the master station, obtaining first master station data and mapping it into the input data table; and / or The data in the output data table is mapped to the master station to obtain second master station data and transmit the data to the slave station.
3. The device control method according to claim 2, It is characterized in that The step of transmitting the data in the slave station to the master station, obtaining the first master station data and mapping it into the input data table comprises: When the slave station performs an action, the data in the slave station is transmitted to the CANopen bus; Based on a preset first communication cycle, reading data in the CANopen bus through the master station to obtain the first master station data; The first master station data is mapped into the input data table.
4. The device control method according to claim 3, It is characterized in that The step of mapping the data in the output data table to the master station, obtaining the second master station data and transmitting the data to the slave station comprises: Mapping the data in the output data table to the master station, obtaining the second master station data and transmitting the data to the CANopen bus; Based on a preset second communication cycle, the second master station data in the CANopen bus is read by the slave station, so that the slave station performs corresponding operations according to the second master station data.
5. The device control method according to claim 1, It is characterized in that The configuration information also includes hardware configuration information. The step of matching the master station corresponding to the robot and the slave station corresponding to the master station according to the service data object table, wherein the master station communicates with the slave station through a preset CANopen bus includes: Initialize corresponding hardware according to the hardware configuration information, the hardware including the robot; According to the service data object table, establishing communication between the robot and the master station, and initializing the slave station; Based on the CANopen bus, the master station and the slave station are connected via the corresponding CANopen bus and communicate with each other.
6. The device control method according to claim 1, It is characterized in that Before the step of obtaining the configuration information of the robot, wherein the configuration information includes: the memory address of the data area of the robot, the process data object configuration information, and the service data object table, the step further includes: Connecting a preset host computer with the robot, wherein the host computer is provided with the configuration page; The configuration information is set through the configuration page.
7. A device control device, It is characterized in that The equipment control device comprises: An acquisition module is used to acquire configuration information of the robot, wherein the configuration information includes: a memory address of a data area of the robot, process data object configuration information, and a service data object table; A setting module, used for matching a master station corresponding to the robot and a slave station corresponding to the master station according to the service data object table, wherein the master station communicates with the slave station via a preset CANopen bus; A mapping module, used for generating a corresponding address mapping relationship according to the memory address and the process data object configuration information, wherein the data area includes an input data table and an output data table, the memory address includes an input address and an output address, and the process data object configuration information includes a process data object address, and the step of generating the corresponding address mapping relationship according to the memory address and the process data object configuration information includes: pointing a pointer in the input data table to the input address, and pointing a pointer in the output data table to the output address, to obtain a corresponding I / O data mapping table; pointing a pointer in the input data table to the process data object address, and pointing a pointer in the output data table to the process data object address, to obtain a corresponding process data object mapping table; based on the I / O data mapping table and the process data object mapping table, obtaining the address mapping relationship, the address mapping relationship includes a mapping relationship between the I / O data mapping table and the process data object mapping table; A control module is used to acquire data in the master station through the robot and communicate with the slave station based on the address mapping relationship.
8. A terminal device, It is characterized in that The terminal device includes a memory, a processor, and a device control program stored in the memory and executable on the processor. When the device control program is executed by the processor, the steps of the device control method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a device control program, and when the device control program is executed by a processor, the steps of the device control method according to any one of claims 1 to 6 are implemented.
