method and system for graphically programming control robot

文档序号:1782618 发布日期:2019-12-06 浏览:34次 中文

阅读说明:本技术 图形化编程控制机器人的方法及系统 (method and system for graphically programming control robot ) 是由 侯冠楠 王乐 卜月丽 于 2019-08-30 设计创作,主要内容包括:本发明提供图形化编程控制机器人的方法及系统,包括图形化编程界面作为客户端,在图形化编程界面编写工业机器人的运动程序;通过源代码编辑工具编辑程序源代码,客户端建立与作为服务器端的工业机器人进行通信的C++程序库;生成脚本代码,执行并输出该脚本代码,调用C++程序库与工业机器人进行通信,将标准指令发送给工业机器人;工业机器人执行指令解析程序,将标准指令转换为指定指令名称;服务器端执行运动指令。本发明采用开放式的图形化编程,用户从模块库区拖拽模块至任务区,进行连线或者参数设置操作即可实现编程,大大提高了编程的灵活性和代码的可读性。(The invention provides a method and a system for controlling a robot by graphical programming, which comprises the steps that a graphical programming interface is used as a client, and a motion program of an industrial robot is compiled on the graphical programming interface; editing program source codes through a source code editing tool, and establishing a C + + program library which is communicated with an industrial robot serving as a server side by a client side; generating a script code, executing and outputting the script code, calling a C + + program library to communicate with the industrial robot, and sending a standard instruction to the industrial robot; the industrial robot executes the instruction analysis program and converts the standard instruction into an appointed instruction name; and the server executes the motion instruction. The invention adopts open graphical programming, and the user drags the module from the module library area to the task area to carry out wiring or parameter setting operation, thereby realizing programming and greatly improving the flexibility of programming and the readability of codes.)

1. A method of graphically programming a control robot, the method comprising:

step 1), taking a graphical programming interface as a client, and compiling a motion program of an industrial robot on the graphical programming interface;

step 2) editing program source codes through a source code editing tool, and establishing a C + + program library which is communicated with an industrial robot serving as a server side by a client side;

step 3) generating a script code, executing and outputting the script code, calling a C + + program library to communicate with the industrial robot, and sending a standard instruction to the industrial robot;

Step 4), the industrial robot executes an instruction analysis program and converts the standard instruction into an appointed instruction name;

And 5) executing the motion instruction by the server side.

2. the method of claim 1, wherein the graphical programming interface comprises a menu toolbar area, an engineering area, a schema area and an editing area, the menu toolbar area is used for creating or storing engineering, folders and files, all file display areas created by a user are arranged in the engineering area and used for achieving a quick opening or searching function, the schema area is divided into a tree display area and a graph area, so that the user can conveniently master the editing state of the whole task, and the editing area is used for the user to achieve editing operation.

3. the method for graphically programmatically controlling a robot according to claim 2, wherein said menu toolbar area is provided with undo, zoom-in, and delete functions.

4. A method for graphically programming a control robot as defined in claim 1, wherein the editing area includes a module library area, a parameter setting area, and a task area, the task area is displayed through a outline area, and a user drags a module from the module library area to the task area to perform a wire or parameter setting operation.

5. a method of graphically programming a control robot according to claim 1, wherein the instruction parser in step 4) comprises the steps of:

step 41) obtaining the ID of the standard instruction;

Step 42) searching and judging whether the standard instruction corresponding to the ID exists, if so, executing step 44), and if not, executing step 43);

Step 43) constructing a description file of the standard instruction;

Step 44), opening a description file corresponding to the standard instruction, and creating a DOM object;

step 45) loading a pointer list from the graph block description node to the DOM object, and traversing the graph blocks pointed by the pointers in the pointer list;

and step 46) displaying the graphic blocks into a graphic block list of the visual engineering management tree according to the graphic block types and the number, and closing the DOM object after the graphic blocks are read.

6. the method of claim 1, wherein the client sends a compiling configuration file as an intermediate file, the compiling configuration file is used for compiling and linking information configured by a mobile phone user at the client, the server receives the file and then places the file in a specified path, the file is analyzed by the engineering analysis script, the server adds the read engineering project into a prefabricated file template, the compiled target executable file is sent to the client through a network, and the user receives the target executable file in a current working directory and downloads the file to a target platform.

7. A method of graphically programming a control robot as defined in claim 1 wherein the C + + library supports a library of API classes for industrial robot programming.

8. The method of claim 1, wherein the user obtains all variable attributes of the graphic block by double clicking the graphic block according to the ID of the graphic block and transferring the graphic block to the intermediate file, and the variable attributes are displayed in a list for the user to modify and view.

9. a method for graphically programming a control robot as recited in claim 1, wherein the C + + library programming provides a JavaScript, python language interface.

10. A system for graphically programmatically controlling a robot, the system comprising:

The mould library management module is used for establishing a part mould library and importing or exporting part moulds according to the industrial production requirement;

the process parameter setting module is used for setting the action parameters and the process parameters of the mechanical arm;

The robot structure parameter setting module is used for reconstructing an industrial robot body so as to ensure the universality of a graphical programming interface;

The track planning module is used for fitting the generated task space collection or the mould motion track stored in the mould library and generating a joint space track through a high-precision track planning algorithm;

The graphical programming and instruction generating module is used for realizing man-machine interaction, generating script codes according to the operation of a user, analyzing standard instructions, converting the standard instructions into specified instructions and sending the specified instructions to an industrial robot serving as a server side to execute tasks; and

And the lower computer interface module is used for realizing data exchange between the client and the server.

Technical Field

the invention relates to the technical field of graphical programming, in particular to a method and a system for controlling a robot by graphical programming.

Background

The robot control technology is a key technology in the fields of robot application, industrial automation and the like, and aims to write a robot motion control program to enable the robot to automatically and accurately act according to the intention of human beings and have the capability of finishing certain human works, so that the robot replaces the human beings, and the human beings are liberated from repetitive, physical and mechanical works and put into more creative works. A good robot control method is the basis of robot application, is an important premise for realizing industrial 4.0 and has great practical significance.

The existing robot control method is that each robot manufacturer is in charge of each robot manufacturer, has own programming language, is not compatible with each other, and has no unified standard. The difficulties of programming through these languages are mainly (1) the programming process is complicated and the code readability is poor; (2) the robot has multiple application scenes, different technological requirements and difficult language flexibility meeting the requirements.

these difficulties result in high threshold of robot application, low development and deployment efficiency, and the development engineer is unable to design and optimize the process flow from a higher level because of the effort of the basic motion control.

the hardware structure and the robot programming language used by the closed control system are customized, and although the technology is mature and the structure is simple, the closed control system is gradually abandoned due to the defects that the closed control system cannot be expanded and reconstructed and the like, and the production requirement changes need to be met with extremely high cost. The open type drawing system can adapt to different application occasions, has the characteristic of flexibility of a production environment, and expands the whole structure through operations of correcting, adding, deleting or changing hardware parts and the like of software modules of the control system.

disclosure of Invention

In view of this, the present invention provides a method and a system for graphically programming a robot, so as to simplify the programming process of robot motion control, improve the readability of codes, and better meet the requirements of multiple scenes and multiple processes.

in order to solve the technical problems, the invention adopts the technical scheme that: the method and the system for controlling the robot by graphical programming comprise the steps that 1) a graphical programming interface is used as a client, and a motion program of the industrial robot is compiled on the graphical programming interface;

step 2) editing program source codes through a source code editing tool, and establishing a C + + program library which is communicated with an industrial robot serving as a server side by a client side;

Step 3) generating a script code, executing and outputting the script code, calling a C + + program library to communicate with the industrial robot, and sending a standard instruction to the industrial robot;

step 4), the industrial robot executes an instruction analysis program and converts the standard instruction into an appointed instruction name;

And 5) executing the motion instruction by the server side.

in the present invention, preferably, the graphical programming interface includes a menu toolbar area, an engineering area, a synopsis area and an editing area, the menu toolbar area is used for creating or storing engineering, folders and files, all file display areas created by a user are arranged in the engineering area and are used for realizing a quick opening or searching function, the synopsis area is divided into a tree form display area and a graph form display area, which is convenient for the user to master the editing state of the whole task, and the editing area is used for the user to realize editing operation.

In the present invention, preferably, the menu toolbar area is provided with a cancel, enlarge, and delete function.

in the present invention, preferably, the editing area includes a module library area, a parameter setting area and a task area, the task area is displayed through the outline area, and the user drags the module from the module library area to the task area to perform a connection or parameter setting operation.

in the present invention, preferably, the instruction parsing program in step 4) includes the following steps:

Step 41) obtaining the ID of the standard instruction;

Step 42) searching and judging whether the standard instruction corresponding to the ID exists, if so, executing step 44), and if not, executing step 43);

step 43) constructing a description file of the standard instruction;

step 44), opening a description file corresponding to the standard instruction, and creating a DOM object;

step 45) loading a pointer list from the graph block description node to the DOM object, and traversing the graph blocks pointed by the pointers in the pointer list;

And step 46) displaying the graphic blocks into a graphic block list of the visual engineering management tree according to the graphic block types and the number, and closing the DOM object after the graphic blocks are read.

In the invention, preferably, the client sends a compiling configuration file as an intermediate file, the compiling configuration file is used for compiling and linking information configured by a mobile phone user at the client, the server end receives the file and then places the file under a specified path, the file is analyzed by the project analysis script, the server end adds the read project into a prefabricated file template, the target executable file after compiling is sent to the client through a network, and the user receives the target executable file under the current working directory and downloads the file to the target platform.

in the present invention, preferably, the C + + library supports a library of API classes programmed by the industrial robot.

in the invention, preferably, the user transfers the ID of the graphic block into the intermediate file to obtain all the variable attributes of the graphic block by double clicking the graphic block, and the variable attributes are displayed in a list mode for the user to modify and view.

in the present invention, C + + library programming preferably provides JavaScript, python language interfaces.

In the present invention, preferably, the system includes: the mould library management module is used for establishing a part mould library and importing or exporting part moulds according to the industrial production requirement;

the process parameter setting module is used for setting the action parameters and the process parameters of the mechanical arm;

The robot structure parameter setting module is used for reconstructing an industrial robot body so as to ensure the universality of a graphical programming interface;

the track planning module is used for fitting the generated task space collection or the mould motion track stored in the mould library and generating a joint space track through a high-precision track planning algorithm;

the graphical programming and instruction generating module is used for realizing man-machine interaction, generating script codes according to the operation of a user, analyzing standard instructions, converting the standard instructions into specified instructions and sending the specified instructions to an industrial robot serving as a server side to execute tasks; and

And the lower computer interface module is used for realizing data exchange between the client and the server.

The invention has the advantages and positive effects that: the method greatly simplifies the development process of the control program of the industrial robot, firstly, a graphical programming interface is used as a client, and the motion program of the industrial robot is compiled on the graphical programming interface; editing program source codes through a source code editing tool, and establishing a C + + program library which is communicated with an industrial robot serving as a server side by a client side; generating a script code, executing and outputting the script code, calling a C + + program library to communicate with the industrial robot, and sending a standard instruction to the industrial robot; the industrial robot executes the instruction analysis program and converts the standard instruction into an appointed instruction name; the server executes the motion instruction, and the practical problems of high use threshold of the industrial robot, difficult programming, low development and deployment efficiency and the like are solved through the graphical programming method. The method is feasible, reduces the learning cost of industrial robot control program development, improves code readability, enables a development engineer to be liberated from complicated work, optimizes the overall process flow by focusing on a higher level, and has certain reference significance for the scheme design of related problems.

Drawings

the accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:

FIG. 1 is a block flow diagram of a method of graphically programming a control robot of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When a component is referred to as being "connected" to another component, it can be directly connected to the other component or intervening components may also be present. When a component is referred to as being "disposed on" another component, it can be directly on the other component or intervening components may also be present. The terms "vertical," "horizontal," "left," "right," and the like as used herein are for illustrative purposes only.

Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.

As shown in FIG. 1, the invention provides a method and a system for graphically programming a control robot, which comprises the steps of 1) using a graphical programming interface as a client, and programming a motion program of an industrial robot in the graphical programming interface;

step 2) editing program source codes through a source code editing tool, and establishing a C + + program library which is communicated with an industrial robot serving as a server side by a client side;

Step 3) generating a script code, executing and outputting the script code, calling a C + + program library to communicate with the industrial robot, and sending a standard instruction to the industrial robot;

step 4), the industrial robot executes an instruction analysis program and converts the standard instruction into an appointed instruction name;

And 5) executing the motion instruction by the server side.

The edge controller is used for completing the task of code generation, automatically generating script codes by recording user operation in a graphical programming interface and running the script codes according to actual requirements so as to send instructions to the industrial robot, and one edge controller can run a plurality of tasks to control a plurality of industrial robots. The edge controller divides the robot controller into an edge calculation controller and a motion controller to realize the decoupling of an application function and a motion control function, and the motion controller provides motion planning and control and provides a standard interactive interface for the edge calculation controller; the edge computing controller provides two functions, namely standard services of an industrial robot, such as monitoring safety and intelligent diagnosis; secondly, the software packages of specific industrial production, such as stacking, spot welding, arc welding and other process packages, and robot extension services of multi-robot coordination, scheduling and the like. In addition, the edge controller further improves the interface capability and the computing capability of the industrial robot, so that the industrial robot can conveniently complete data interaction with external equipment such as various sensors, instruments and meters, a PLC and the like, the edge controller can complete the control function of a workstation or a production line by providing the computing capability, and the applicability of the industrial robot is improved.

In this embodiment, the graphical programming interface further includes a menu toolbar area, an engineering area, a synopsis area, and an editing area, where the menu toolbar area is used to create or store engineering, folders, and files, all file display areas created by a user are provided in the engineering area to implement a quick opening or searching function, the synopsis area is divided into a tree display area and a graph display area, so that the user can conveniently master an editing state of a whole task, and the editing area is used for the user to implement editing operations.

in this embodiment, further, the menu toolbar area is provided with functions of canceling, enlarging and deleting.

In this embodiment, the editing area further includes a module library area, a parameter setting area, and a task area, where the task area is displayed by the outline area, and a user drags a module from the module library area to the task area to perform a connection or parameter setting operation.

In this embodiment, the instruction parsing procedure in step 4) further includes the following steps:

step 41) obtaining the ID of the standard instruction;

Step 42) searching and judging whether the standard instruction corresponding to the ID exists, if so, executing step 44), and if not, executing step 43);

Step 43) constructing a description file of the standard instruction;

Step 44), opening a description file corresponding to the standard instruction, and creating a DOM object;

step 45) loading a pointer list from the graph block description node to the DOM object, and traversing the graph blocks pointed by the pointers in the pointer list;

and step 46) displaying the graphic blocks into a graphic block list of the visual engineering management tree according to the graphic block types and the number, and closing the DOM object after the graphic blocks are read.

in this embodiment, the client sends a compiling configuration file as an intermediate file, the compiling configuration file is used for compiling and linking information configured by the mobile phone user at the client, the server receives the file and then places the file in a specified path, the file is analyzed by the engineering analysis script, the server adds the read engineering project into a prefabricated file template, the compiling completed target executable file is sent to the client through the network, and the user receives the target executable file in the current working directory and downloads the file to the target platform.

in this embodiment, further, the C + + library supports a library of API classes programmed by the industrial robot.

in this embodiment, further, the user obtains all variable attributes of the graphic block by double-clicking the graphic block and transferring the graphic block to the intermediate file according to the ID of the graphic block, and displays the variable attributes in a list manner for the user to modify and view.

In this embodiment, further, C + + library writing provides JavaScript, python language interface.

in this embodiment, further, the system includes: the mould library management module is used for establishing a part mould library and importing or exporting part moulds according to the industrial production requirement;

the process parameter setting module is used for setting the action parameters and the process parameters of the mechanical arm;

The robot structure parameter setting module is used for reconstructing an industrial robot body so as to ensure the universality of a graphical programming interface;

The track planning module is used for fitting the generated task space collection or the mould motion track stored in the mould library and generating a joint space track through a high-precision track planning algorithm;

The graphical programming and instruction generating module is used for realizing man-machine interaction, generating script codes according to the operation of a user, analyzing standard instructions, converting the standard instructions into specified instructions and sending the specified instructions to an industrial robot serving as a server side to execute tasks; and

and the lower computer interface module is used for realizing data exchange between the client and the server.

For the industrial robot to realize convenient communication, a socket is adopted to communicate and transmit data, the industrial robot is used as a server side, a graphical programming interface is used as a client side, further, the server side is divided into command service, console service and state service, and in order to guarantee communication efficiency, three servers are established by the three services to ensure that the three servers do not interfere with each other. All communication adopts a single message sending mode, and each message comprises a message header and a message parameter. Semicolons between messages "; "as split, message header and message parameters use colon"; "as split, if message parameter is null, colon": "may be omitted, commas are used for different message parameters" as a partition.

The command message sent in the command service is a message with preload, the message is not fed back after the industrial robot receives the command, the execution information is fed back when the command is executed, and the fed back execution information is also in a standard message format and is in a semicolon format; "end". The console information sent in the console service is an instant execution message, the industrial robot executes the message immediately after receiving the message, and immediately feeds back an execution result, wherein the fed back execution message is in a standard message format and is in a semicolon format; "end". The industrial robot sends state information including the IO state of the robot, the tail end position of the robot and the joint position of the robot outwards at regular time in the state service, and the state information does not need to be fed back.

The working principle and the working process of the invention are as follows: the method comprises the following steps that a graphical programming interface serves as a client, a motion program of the industrial robot is compiled on the graphical programming interface, a program source code is edited through a source code editing tool, the client establishes a C + + program library which is communicated with the industrial robot serving as a server, and the C + + program library has the following functions: (1) basic movement modes (such as LMOVE, JMOVE and the like) of different manufacturers can be called; (2) being able to communicate with an industrial robot; (3) providing multiple interfaces such as JavaScript and python.

Although the basic motion modes of the industrial robot are different from manufacturer to manufacturer, the expression modes of the same motion mode in the programming languages of different manufacturers are different, so that the C + + program library established by the inventor supports the API of the industrial robot programming, and the motion instruction data of the industrial robot is extracted by summarizing the industrial robot programming languages of different manufacturers, so that the aim of being compatible with multiple industrial robots can be achieved. The graphical programming interface is used as a client to realize man-machine interaction, a user drags a module from a module library area to a task area to carry out connection or parameter setting operation, the flow and the process are provided through the graphical programming interface, the user can design the motion flow of the industrial robot in a graphical programming mode, only the flow and the process need to be considered, specific motion instructions do not need to be considered, different graphical blocks are used for representing different code concepts, including variables, logical expressions, circulation and the like, and due to the fact that the graphical blocks are interlocked, only a splicing mode conforming to the programming principle can be accepted, and otherwise, splicing cannot be carried out. Therefore, a user can realize a programming concept like building a block through the graphic block without worrying about grammar errors, the graphical programming method can output various language codes, the readability of a program and the programming flexibility are improved, the user can transfer the ID of the graphic block into the intermediate file to obtain all variable attributes of the graphic block by double clicking the graphic block, and the variable attributes are displayed in a list mode for the user to modify, view and other editing operations. Background software records the operation of a user, generates script codes, calls a C + + program library to communicate with the industrial robot, sends standard instructions to the industrial robot, writes an instruction analysis program, operates the program through the industrial robot serving as a server end, analyzes the received standard instructions, converts the standard instructions into specified instruction names, corresponds to the programming language of the industrial robot of each manufacturer type, and controls the industrial robot to execute motion instructions by a control system of the industrial robot.

It can be seen that in the graphical programming interface of the system, for the user, the outer layer interface and the interface content are all of the system, and only they are directly connected with the user, and other parts are invisible and not necessarily visible to the user, the input of the user is the graph representing the motion mode of the industrial robot, the output of the system is the motion of the industrial robot expected by the user, and the core theme of graphical programming is fully embodied, that is, the output expected by the user is realized according to the input of the user. The output desired by the user is some combination of the actions of the industrial robot, so the most fundamental task is to implement the programmed function in the graphical idea, within the whole human-computer interaction system. In the task allocation of the system, the upper computer is used for finishing the interactive task, the lower computer is used for finishing the motor control task, and the upper computer transmits the information input by the user to the lower computer through serial communication. Therefore, for the human-computer interface program of the upper computer, the core function is to send the control data to the lower computer through the serial port of the computer, and further realize the data exchange between the client and the server.

The method greatly simplifies the development process of the control program of the industrial robot, firstly, a graphical programming interface is used as a client, and the motion program of the industrial robot is compiled on the graphical programming interface; editing program source codes through a source code editing tool, and establishing a C + + program library which is communicated with an industrial robot serving as a server side by a client side; generating a script code, executing and outputting the script code, calling a C + + program library to communicate with the industrial robot, and sending a standard instruction to the industrial robot; the industrial robot executes the instruction analysis program and converts the standard instruction into an appointed instruction name; the server executes the motion instruction, and the practical problems of high use threshold of the industrial robot, difficult programming, low development and deployment efficiency and the like are solved through the graphical programming method. The method is feasible, reduces the learning cost of industrial robot control program development, improves code readability, enables a development engineer to be liberated from complicated work, optimizes the overall process flow by focusing on a higher level, and has certain reference significance for the scheme design of related problems.

The embodiments of the present invention have been described in detail, but the description is only for the preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. All equivalent changes and modifications made within the scope of the present invention should be covered by the present patent.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:奇数边正多边形柱腔适应性螺旋铣削数控加工控制方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类