Research on Robot Control Technology Based on Vision Localization

: Based on the understanding of machine vision localization technology at home and abroad, this paper outlines the overall design of the system, and analyses the working principle and workflow of the robot with vision system in workpiece grinding. The hardware design of the system is introduced. The process of image processing is analyzed in detail, and the results of image processing are given. The basic parameters of camera imaging are taken as internal parameters. The camera calibration is obtained by rotation matrix R and translation parameter T. The coordinate transformation of camera coordinate system and world coordinate system is analyzed. Finally, the positions and postures of the actual workpiece and the end-effector in the world coordinate system are given respectively, and the robot with the vision system is used to grasp the actual workpiece. The difficulties of this project are visual calibration, image processing and coordinate transformation. Robot vision technology can directly grasp the location. Compared with the manual mechanical positioning, the robot that realizes autonomous vision localization has more flexibility, better quality and higher efficiency.


Introduction
With the advancement of science and technology and the improvement of productivity, industrial robots are applied to various fields, and are developing in the direction of high precision, high speed and stable safety. Human beings are susceptible to emotions, which affect the quality and efficiency of work. Robots can avoid subjective emotions, and the efficiency and quality of work are far more than human beings. According to the actual workpiece structure, through the manipulator technology, a fixture which can replace manual grasping is designed and installed in the flange of the robot to meet the requirements of automation production. However, the simple industrial robot can not adapt to the flexible manufacturing system [Li and Savkin (2018); Robla-Gómez, Becerra, Llata et al. (2017)]. The machine vision system can save time, reduce production costs, reduce the number of unqualified products and improve the utilization rate of the machine. In order to make robots more intelligent, the field of robotic vision has been greatly developed and widely used in measurement, detection, positioning and recognition [Probst, Maninis, Chhatkuli et al. (2018); Wang (2018)]. The purpose of this project is to achieve visual calibration, image processing and coordinate transformation through the visual system of the loading and unloading robot, so that it can autonomously locate the position of the object to be polished, so as to achieve grabbing. Compared with the manual picking, the loading and unloading robot of the system independently realizes the grasping of the target object, which has better quality and higher efficiency.

System design and workflow 2.1 System design
The entire robotic workpiece grinding system includes vision localization, pick and place paths and grinding paths. First, the workpiece is identified by a robot with a vision system, then the workpiece is grasped, and finally the captured workpiece is polished. The following is the detailed introduction to the system: The system consists of four robots and two worktables. Robot A has vision system [Fang, Zhang, Victor et al. (2018)], while robot B, C and D do not have vision system, so this topic focuses on Robot A. Robot A can identify the workpiece to be grasped through the vision system, including image smoothing, image segmentation, image center point positioning, etc. Then the identified object is captured and placed on the worktable No.1. Robot B or C removes the workpiece from worktable No.1 and grinds it. After grinding, the workpiece is placed on worktable No. 2. Robot D removes the grinded workpiece from worktable No. 2. The overall design of the system is shown in Fig. 1. The overall workflow of the system is shown in Fig. 2

Workpiece identification and crawling workflow
Firstly, the focal length and light source of the vision system are adjusted to achieve the best shooting effect. Secondly, the standard template is placed in the standard position. Thirdly, the coordinates of the origin are determined by cross-alignment. Fourthly, the workpiece is placed under the camera. Fifthly, the coordinates of the workpiece to the standard position are calculated by the system. Sixthly, the coordinate signal of the vision system is completed. In the seventh step, the PLC (Programmable Logic Controller) transmits the signal to the action of the robot. Finally, the robot picks up the workpiece and places it in the designated position. Working flow chart is like Fig. 3. 3 System software and hardware composition and system implementation

System hardware circuit design
Robot work needs real-time information exchange with each module. This system takes PLC as the center to exchange information. Compared with previous direct information interaction, the observability is stronger. For example, the information exchange between the robot and the camera, the robot sends the information to the PLC first, and then to the robot by the PLC [Axinte (2018); Rodrigues, McGordon, Gest et al. (2018)]. This design can make all the fault information appear on the PLC with the alarm signal, and can be maintained directly, avoiding a lot of maintenance time. Communication system is an important guarantee for maintaining efficient and stable operation of the whole system.

Image acquisition and center location determination 3.2.1 Figure format
Usually, the original image is subject to objective restrictions and random interference of the scene environment. It needs to binarize [Chen, Lu, Yeunget al. (2018); Hong and Yuan (2018)], filter, extract edges and determine the center of the image. The system uses filtering algorithm to realize image processing [Li, Bai, Zhao et al. (2018); Tu, Lin, Wang et al. (2018)]. It needs original image S (x, y), processed image D (x, y), 2D template K (x, y), filtering algorithm such as formula 1.
In the formula 1, M, N is the size of the 2D template K. Gauss filter is used to enhance the contrast and find the center point. The binarized image has a lot of noise, and this phenomenon is solved by morphological processing. Then the edge of the image is extracted by Laplace operator [Lee and Na (2017); Mahmmod, Ramli, Abdulhussian et al. (2017)], and the outline of the workpiece is found. According to the outline of the workpiece, the minimum outline rectangle is calculated, and the center of the rectangle is calculated as the center of the workpiece. After filtering, edge extraction, the workpiece image after center point positioning is shown in the Fig. 4.

Pose calculation
The mathematical model of camera describes the relationship between arbitrary point P (Xw, Yw, Zw) in three-dimensional space and corresponding point P (u, v) in twodimensional image coordinate system. The relationship between the world coordinate system and the image coordinate system, such as formula 2.
Where = , = ,f is the focal length of the camera. M2 is the camera's external parameter matrix, which can be obtained from the world coordinate system. It is the basis for subsequent coordinate system transformation and determination of any target workpiece [Tan and Sun (2018)]. The camera coordinates [Xc, Yc, Zc] can be obtained from any point [Xw, Yw, Zw] in the world coordinate system space by the transformation of the camera's external parameter matrix [Basso, Menegatti and Pretto (2018)]. Therefore, M2 can be changed to , and the transformation process is like formula 3. (3) If the world coordinate system is consistent with the target coordinate system of the object itself, then any point in the target coordinate system is transformed into the camera coordinate system by formula 3. According to , the transformation from the target coordinate system to the robot base coordinate system can be obtained as = .

Experiment and analysis
The robot A is mainly subjected to visual capture experiments, and the robot A is placed on the experimental platform. Because the robot A comes with a vision system, the workpiece is photographed by its own camera and the image processing described in Chapter 3 is performed. After recognizing the workpiece, the position and pose of the actual workpiece and the end-effector in the world coordinate system are calculated by camera calibration and coordinate transformation of the world coordinate system and the camera coordinate system. The workpiece can be grasped accurately by controlling the robot A manipulator. The actual coordinate diagram captured is shown in Fig. 5, where crs0 is the set reference attitude. cp0, cp1, cp2, cp3 represent the pose of the end effector of the robot A in the world coordinate system. ap0 and ap1 represent the mapping relationship between the original coordinate system and the converted coordinate system. The actual coordinate map laid down is shown in Fig. 6. ap0 is the mapping relationship between the coordinate system of the workpiece and the grabbing coordinate system. cp0, cp1 and cp2 represent the position and posture of the actual workpiece placed in the world coordinate system. The difference between the two positions is the vector between the workpiece and the robot. , vol.1, no.1, pp.37-44, 2019 Figure 5: Grasp the actual coordinate map converted After the debugging is successful, the "time" instruction is used to test the beat time, and the test speed is set at 80% for some speed tempo. In order to simplify the program, we can read the rhythm directly with "time. Read" at the end of the program, because the program loop runs until initialization and automatically sets the rhythm data to "0" without waiting for the "time. Stop" instruction to stop. The test results show that the visual scanning time is 2-3 seconds, the grabbing time is 5 seconds, the grabbing time is 0.5 seconds and the placing time is 0.5 seconds. The rhythm of the whole process is 8-10 seconds, which meets the needs of processing and production. Artificial grabbing takes about 20 seconds to place the work piece. The vision localization based grabbing and placing is twice as fast as manual grabbing and placing. It is impossible to keep this speed all the time, but the robot can work at the same speed for 24 hours. The efficiency of comprehensive calculation of visual positioning and placing the work piece is far more than twice that of manual operation.

Conclusion
In this paper, the visual servo control system of industrial robot is established. The robot with vision localization function is used to grasp the workpiece, the camera calibration and image processing, and the system is debugged and verified.
(1) Motion analysis of robots: analysis of robot speed, torque and current based on actual data. To determine the stability of the robot through analysis is not only to ensure the accuracy of positioning, but also to consider the personal safety, which is the necessary guarantee before the whole system works.
(2) Camera calibration: the result of calibration directly affects the transformation of camera coordinates and space coordinates and the position accuracy of space coordinate points. (3) Image processing: laplace operator is used to extract edges, and find the center of the workpiece. Experiments show that the design of the robot control system based on visual positioning is feasible, and it can achieve automatic positioning while ensuring accuracy in the grasping process.