Virtual simulation of communication between KUKA robot and PLC

Virtual simulation can effectively provide the training environment for the robot. It can solve many problems in robot practice, such as complex equipment, high price and so on. Virtual simulation and communication of KUKA robot can increase more possibilities. Based on the study of its trajectory planning and kinematics, this paper further increases the research content of virtual policy. This paper takes uniy3d virtual reality engine as the development platform, and studies the virtual motion simulation and control of industrial robot from the perspective of interaction between virtual robot and real robot,


Introduction
In this era of rapid development of Internet technology, virtual reality has made a lot of achievements, it has been widely applied to the actual production. With the development of intelligent manufacturing industry in the world and the improvement of virtual reality technology, the combination of virtual reality and industrial field has begun. The robot simulation platform based on virtual reality technology is a good practice [1][2][3].
This design takes unit3d as the virtual development platform, and studies the virtual motion simulation of industrial robot and the communication control of real robot with Siemens PLC from the perspective of virtual simulation and real robot interaction. The simulation software can let users complete the motion control and operation of virtual robot in the whole virtual environment, which has a positive significance for robot teaching and application. At the same time, the virtual reality simulation system and the industrial robot arm are interconnected through the bus communication to realize the organic combination of the two advantages, which makes the simulation system more convenient to be applied to the actual production and can achieve the combination of real virtual and reality, which will have important practical significance for the visual control and real-time monitoring of industrial production[4-6].

System overall design
Unity3D is an engine developed by unity technologies for game development and virtual reality development. After the development of software package, it can be published to most commonly used operating systems such as windows system, MAC system, webgl system, Android system, IOS system and so on. The function of this software is modularized and packaged, with high development efficiency and good visualization effect. It is very easy to learn. The visual editing mode is adopted. Moreover, the developers can easily simulate the same environment as the display environment with the help of the physical engine, which is closer to the real environment. Due to its efficient and As shown in Fig. 1, the Unity3D development environment includes five views: game, scene, inspection, hierarchy and project. In Unity3D software, there are three kinds of programming systems that can be used: C ා , unityscript and boo. Boo programming is rarely used, so we basically choose one from the other. Unityscript is a variant of JavaScript, which is usually used in Web script. Its programming flexibility makes it tedious to use in script writing. It is also unable to make full use of some powerful and interesting features of modern programming language. The domestic insiders who use Unity3D almost all adopt the C ා programming system, because it has the modern programming features and syntax structure in Java and C + +, so C ා has all the functions of modern programming language.

Construction of virtual reality system
The virtual motion simulation system of KUKA robot designed in this paper is a complex software system, so it can improve the development efficiency to make clear the object design idea based on components before developing virtual simulation system based on Unity3D engine. Only in this way can we achieve better design of script components, improve the independence and reusability of script components, reduce the coupling relationship between components, add new functions to the system, and realize the scalability of complex system.The display and management of industrial robot model in Unity3D is realized by model tree, and then the model building task is completed by setting the DH parameter relationship of parent-child relationship among all joints of the robot, so that the movement of the parent joint driven by the self joint can be realized. imported into 3dsmax, and then the coordinate system of the joint to be adjusted in 3dsmax is adjusted to the last joint connection to ensure the alignment center. Here, the coordinate system direction is not changed and then imported into Unity3D for correction The adjusted model in 3dsmax is shown in Fig.  2. The model format of Unity3D engine has good compatibility with the model of 3dsmax software. The robot model can be imported to Unity3D engine only after 3dsmax is exported as FBX file and copied directly to the project view.
According to the D-H parameters, this paper modifies the transform value of the industrial robot model and establishes the correct parent-child relationship of the model. The obtained model of industrial robot is shown in

Research and implementation of communication between KUKA robot and PLC
We have completed the virtual reality system of KUKA robot in unity, and then realized the communication between virtual reality system and KUKA robot. This is the key to our design specification. The control command sent by the virtual simulation system is transmitted to the real KUKA robot through PLC, which can respond and move. So we need to establish communication with Siemens PLC first, because communication between PLC and KUKA robot is easy to achieve. As shown in Fig. 4.

Fig.4 PLC and robot communication control
PROFINET protocol communication is a communication protocol applicable to many industrial robots, and KUKA robots can also be applied. Because problems will inevitably occur when robots work, PLC can diagnose and send information in time when problems occur. PROFINET transmission can reduce transmission restrictions and protect transmission process, which is very important.
Siemens S7-200 PLC is suitable for automatic detection, monitoring and control. It is a super small PLC developed by Siemens. There are many types of communication interfaces for S7-300 PLC. Because of the equipment, this design can not test whether PLC and virtual simulation system can communicate correctly, so the theoretical research and design are made. Virtual system is the same as traditional PC communication protocol in theory, which is TCP / IP protocol. We use TCP to transmit The code for developing communication process takes into account this theory. We use the HslCommunication, the open source industrial framework. The open source project is also the latest Internet plus framework system in China. At the same time, we can also receive and send the data received by hslcommunication in the virtual simulation system by socket program.
This design also needs to design a virtual simulation system how to communicate with PLC and send correct instructions without the actual KUKA robot. Whether it is virtual simulation system or socket program, their communication files are of string type. In the process of data transmission, the first step is to establish the correct communication channel, transmit the string to Siemens PLC, PLC receives and analyzes the data, and converts the data into the corresponding control instructions through the specified protocol. The communication protocol is TCP / IP. As this communication does not need to consider other situations, it only needs to be accurate, and the TCP protocol is still used . We use the software workvisual, as shown in Figure 3-4, through the intervention of plug-ins, we can simulate the PLC to control the real robot, and then convert the data of PLC into data segments recognized by workvisual, and verify the correctness of the program by executing or diagnosing the I / O information of PLC in workvisual.

Conclusion
This design specification aims to provide a relatively simple research method to solve the communication between KUKA robot and PLC in computer or workstation. Based on the research object of KUKA robot motion simulation control system, through the preliminary trajectory planning and virtual simulation of robot based on untiy3d, the communication control with PLC is carried out, and finally the robot is combined in virtual reality. The final conclusions are as follows: (1) Using the most classical D-H parameter method, the motion equations of each joint of KUKA robot are solved. The kinematics algorithm and trajectory algorithm of the robot are designed to simulate the trajectory of the KUKA robot in three ways: arc interpolation, line interpolation and joint interpolation.
(2) The motion simulation system of industrial robot based on virtual reality engine is developed in Unity3D. The operation mode and control mode of virtual simulation system are designed. The core algorithm function is separated from the virtual system. It improves the expansibility of virtual system and realizes virtual roaming.
(3) It is planned to build online and offline simulation and test platform for KUKA robot and virtual reality. Due to the limitation of equipment, no effective conclusion can be drawn. But the ultimate goal is to verify the effectiveness of virtual reality system for the control of KUKA robot. It has important practical significance for the control and development of robot.