Intelligent Control of Welding Gun Pose for Pipeline Welding Robot Based on Improved Radial Basis Function Network and Expert System

Since the control system of the welding gun pose in whole-position welding is complicated and nonlinear, an intelligent control system of welding gun pose for a pipeline welding robot based on an improved radial basis function neural network (IRBFNN) and expert system (ES) is presented in this paper. The structure of the IRBFNN is constructed and the improved genetic algorithm is adopted to optimize the network structure. This control system makes full use of the characteristics of the IRBFNN and the ES. The ADXRS300 micro-mechanical gyro is used as the welding gun position sensor in this system. When the welding gun position is obtained, an appropriate pitch angle can be obtained through expert knowledge and the numeric reasoning capacity of the IRBFNN. ARM is used as the controller to drive the welding gun pitch angle step motor in order to adjust the pitch angle of the welding gun in real-time. The experiment results show that the intelligent control system of the welding gun pose using the IRBFNN and expert system is feasible and it enhances the welding quality. This system has wide prospects for application.


Introduction
At present, welding robots are used in shipping, chemistry, the automobile industry and the mechanism producing industry.Most of these industries need only flat welding or spot welding, which can be easily finished by a robot [1].In the petrochemical, boiler and other industries, pipe insertion is generally used in pipeline connection.The welding seam for pipe insertion is a typical and complicated space welding seam.For the welding of a rotundity pipe in a level position, the gravity endured by the welding drop will form a different angle with the pipe in a different position and so will affect the contiguity degree of the weld slot which directly influences production efficiency and quality.Production practice shows that when the welding seam is in a flat or boat-shaped welding position, excellent welding quality can be guaranteed.The more deviation of weld seam from the flat position, the more difficult it is to guarantee the quality of the welding.The welding gun pose relative to the weld also affects the quality of welding.Many scholars have studied weld models and obtained certain achievements [2][3][4][5].
Many scholars have studied intelligent control methods for seam tracking applications.D.Lakov proposed using the fuzzy model to describe the uncertainty of the arc welding process according to the teaching content for weld seam tracking [5].S. Murakami developed the weld seam tracking system based on fuzzy control and the control effect is good [5].Y. Suga studied neural networks applied to seam tracking and the experimental results show that the system can be effectively used in seam tracking [6].At present, a domestic study of the programming of the welding gun pose is far less required, thus, the study of intelligent control of the welding gun pose contains a lot of academic worth and much application value [5,7,8].
The artificial neural network is a new technique in recent years.Its ability to approach nonlinear functions and its strong self-adaptation has been proved in theory and has also been validated in actual applications [9].Artificial neural network solves some problems that expert systems possess, such as knowledge representation, knowledge acquisition, paralleled inference etc [10].The RBFNN adopted a local approaching network.It has a superior fast learning speed and is capable of a strong functional approach.It can effectively overcome the weakness of the BP network, such as slow convergence and its frequently being trapped in local minima [9,11].With the aim of shortening the traditional genetic algorithm, an improved genetic algorithm which is adaptive is used to optimize the RBFNN structure which can enhance the accuracy and global search efficiency.At the same time, the development of neural network theory which features in the nonlinear parallel distribution process provides an effective method to solve the problems of the traditional expert system.
As we all know, classic control theories are very effective in solving control problems in a linear constant system, however, the control of the welding gun pose is a complex nonlinear controlling target that cannot be captured in a mathematical model [7].With the aim of solving the control problem of the welding gun pose in the case of whole-position welding, an intelligent control system based on the IRBFNN and expert system is presented in this paper.ADXRS300 micro-mechanical gyro is used as the welding gun pose sensor in this system.When the welding gun position is obtained, an appropriate pitch angle can be obtained through expert knowledge and the numeric reasoning capacity of the IRBFNN.ARM is used as the controller to drive the welding gun pitch angle step motor in order to adjust the pitch angle of the welding gun in real-time.

Radial basis function neural network (RBFNN)
The radial basis function neural network is composed of three layers.Those are the input layer, hidden layer and output layer.The input layer nodes transmit input signals to reach hidden layers, hidden layer nodes are described by the gauss kernel function and output layer nodes are described by the linear function.The structure of the radial basis function neural network is shown in Figure 1.
In this paper, the basic function is defined as follows: where i (x)  is the output of number i node of the hidden layer; T 1 2 n X (x ,x , ,x )   is the input samples; i C is the centre of the Gauss kernel function, and it has the same dimensions as X ; i  is the variable of the number i of hidden layers, it is called the standardized constant; m is the total number of hidden layer nodes.
The output of the radial basis function neural network is given by the following formula: where ik  is the weight value of the network; p is the number of the output layer nodes.2.2 Improved genetic algorithm [12][13][14][15][16] The genetic algorithm (GA) is a kind of self-adapting heuristic global search algorithm which is derived from an imitation of how natural biological evolution is thought to occur.In nature, it is a cyclical process made up of reproduction-crossover-mutation operators.An adaptive genetic algorithm is a kind of GA that has toscale reproduction and self-adaptive crossover and mutation operations.
where c P is the exchanging probability, m P is mutation probability, max f is the biggest fitness of the colony, avg f is the average fitness of the colony, f is the bigger fitness of two strings used for an exchange, f is the fitness of the individual to mutate.

Code
A key problem is completing the mapping from the solution space of the optimization problem to the coding space.There are two main encoding modes of the genetic algorithm: binary-coding and decimal-coding.The improved genetic algorithm denotes the parameters directly with binary-coding.
Concerning hidden random nodes of RBFNN, the control vector (individual) of hidden nodes is expressed in the binary coded form, where the i l value is 1 or 0, which separately correspond to the existence or not of the i hidden node.The selection of hidden nodes and the gene of the chromosome is one to one correspondence.

Initial solution and adaptation function
A large number of individuals will be generated in the initialization phase, which is called the colony.The adaptation function is given as follows: where the max C can be the maximum value E of the evolutionary process, E is the object function.p is the number of training samples, k is the node number of the network output layer, pk t is the RBF network output and pk o is the real output.

Operation operator
The operation operator of the genetic algorithm is composed of three operators, namely the reproduction operator, crossover operator and mutation operator.
The reproduction operator reproduces the individuals in the new colony according to the probability of their success in proportion to their adaptive value.After reproduction, preponderant individuals are preserved and the inferior individuals are weeded out, and the average fitness degree of the colony is increased, but the variety of the colony is lost at the same time.The role of the reproducing operator is to realize the principle of winner priority for preserving the predominance and natural selection, and making the colony converge on the optimum solution.
The crossover operator first selects two individuals stochastically according to a certain adaptive exchanging probability c P , then it can produce two new individuals by exchanging parts of the chromogene stochastically.The two-point crossover is adopted in this paper, which randomly generates two crossover points; this is shown in Figure 2. The genetic algorithm can generate a filial generation colony which has a higher average fitness and better individuals due to the reproduction and crossover operators, and makes the evolutionary process proceed to the optimum solution.
The mutation operator changes several bits of the chromosome string stochastically with a small probability m P , namely turn 0 to 1 and 1 to 0. The mutation operator is very important in recouping the loss of colony diversity.

RBFNN structure optimization with an improved genetic algorithm
Network optimization and parameter learning are divided into two phases, which are training and evolution.Firstly, N individuals are randomly generated and are regarded as the initial colony.Then the centre parameter i c is trained as is the width parameter i  of the basis function and network weights i w using the gradient descent method (GDM) and the least squares method (LSM).Secondly, the number of hidden layer nodes is optimised as are the other parameters using an improved genetic algorithm.We can obtain the least number of hidden layer nodes that satisfy the accuracy requirement through alternate training and evolution.

Introduce Boolean vector
 represents the existence of the hidden, i u 0  represents the non-existence of the hidden node.
Every Boolean vector T U can generate two chromosomes with binary-coding, one is the central parameter chromosome T c U , another is the width parameter chromosome T U  .
The algorithm flow is shown in Figure 3.

Total framework of the control system based on the IRBFNN and the expert system
The intelligent control system of the welding gun pose for a pipeline welding robot based on an IRBFNN and expert system is shown in Figure 4.This system is mainly composed of an expert controller, an IRBFNN controller, a position sensor and a controlling target.The expert controller and the IRBFNN controller compose a knowledge sharing and parallel control compound controller.The operating principle of the expert controller and the IRBFNN controller is described as follows: establish a knowledge base and the expert experience is formed with learning samples and stored in every node of the neural network in nonlinear mapping form.Start the expert controller to control the system, the inference mechanism implements the inference according to the knowledge of the knowledge base and the control information that the user provided, at the same time the IRBFNN controller is trained using the learning samples.When the IRBFNN controller is stable, the IRBFNN controller is used to control the system instead of the expert controller.Using the forward computation of the IRBFNN, we can obtain the output quantity of the control signal.When the performance of the IRBFNN controller does not meet the system requirements, the expert controller is restarted and the IRBFNN controller is trained again.
When the system runs, the position sensor will detect the space position of the welding gun of the welding robot, and the IRBFNN controller will educe an appropriate pitch angle control signal for each sampling time, based on the measured real space position and the forward computation of IRBFNN.ARM is used as the controller to drive the welding gun pitch angle step motor in order to adjust the pitch angle of the welding gun in real-time, which realizes the real-time conditioning of the pitch angle of the welding gun.The compound controller composed of the expert controller and the IRBFNN controller and the welding gun on the pipe-welding robot composes a closed loop which completes a real-time control.

Knowledge acquisition
Based on the experience of an expert, in the control system, the circle of the pipeline is divided into 360 entries, for each space position, the welding gun has a corresponding experience value of the pitch angle.The information is formed using learning samples in a certain code form.This system adopted the semi-automatic method to obtain knowledge.For the IRBFNN controller, the knowledge is gained automatically through continuous learning from samples in the IRBFNN.The expert experience is stored in every node of the neural network in a nonlinear mapping form.By this means, the expert knowledge database is formed and the bottleneck problem of knowledge acquisition of the traditional expert system is overcome.

Inference mechanism
The inference mechanism of the expert system based on the neural network and the traditional inference mechanism has essential differences.The traditional inference mechanism is an inference based on the logic symbol and the inference mechanism of the expert system based on the neural network is a numerical calculation process.This system adopts a forward reasoning strategy driven by data.For the IRBFNN controller, firstly, the space position of the welding gun and the width and depth of the welding seam are inputted to every input node of the IRBFNN.Then the hidden layer output is computed through the formula (1) and acts as the input to the output layer, the output of the output layer neuron is computed by the formula (2).The output of the output layer neuron is the final inference result.Compared with the forward inference of the traditional expert system, the neural network forward inference is a paralleled inference and is implemented through numerical calculation, so the inference speed based on the neural network is enhanced greatly.

Position sensor
The effect of the position sensor in the intelligent control system of welding gun pose is to detect the space position of the welding gun.ADXRS300 micro machine gyro is used as the welding gun position sensor.In reality, to use the micro machine gyro it has to be fixed to the welding gun and, along with the welding robotʹs circle turning around the pipe, the micro machine gyro will run at the same time.
The type ADXRS300 micro machine gyro is a kind of micro gyro on-chip [17].Its important indexes are as follows: Measuring range is ±300º/s.Supplied output current is 6mA.Supplied voltage is 4.75V to 5.25V.The marked factor is 5mV/º/s.Bandwidth is 0.04 kHz, nonlinearity is 0.1% of FS.Examining the micro machine gyro, we find that its circumvolution is around the centre axis and its positive going voltage related to the circumvolution angle speed will be outputted, the two have a linear relationship, as shown in Figure 5.By carrying out the integral operation for voltage, we can get the real space position of the welding gun.

Control for step motor of welding gun pitch angle
After the space position of the welding gun is ascertained, we take the normal plane of the welding seam tangent vector through the welding spot as the default plane.In real welding, the welding technique usually needs a certain forward pitching angle between the welding gun and the default plane.So the real plane of the welding gun is ascertained after the default plan is pitched at a certain angle.Based on the forward inference of the expert system and the IRBFNN controller, we can get an appropriate pitching angle.Meanwhile, the step motor will adjust the pitching angle of the welding gun.
This design scheme is adopted by the ARM processor as the control kernel.ARM technology is the mainstream of the embedded system [18].At present, ARM chips available in the market can even reach a speed of several trillion and systems which use these chips as their main controller can build up a system of data collection, data process and communication with a high speed and high precision.The system in this paper adopted the Samsung Company's S3C2410 processor , combined with the μC Linux operating system to realize the control of the welding gun pose of the welding robot.S3C2410 is a type of low price, low power loss and high performance microprocessor of 16/32 bits, which performs quite well in the application field of the embedded system.
The aim of the control system is to realize the control of the welding gun pose of the welding robot.The kernel question consists in the start, stop and control of the speed and direction.Aimed at the working principle of the step motor, we adopted the frequency conversion timing control method, let the electricity level signal control the inside convert circuit of the driver to change the pulse list.In this way, the direction exchange of the motor is realized.The control pulse is supplied by the outside V/F circuit.After power magnification, the welding gun pitch angle step motor transforms the signal outputted by ARM into angular displacement.This project adopted the step motor SANYO 103H7123 and adopted the Parker Company OEM750 as the driver, which accomplishes the digital fractionalization of the motor.The fractionized steps of the motor can be as many as 4000~20000 steps/circle and this fractionized motor is used as the motor to control the pitch of the welding gun.

Working flow of pose control system
The work of the control system can be divided into two sections: the manual part and the auto part.The working flow of this system is shown in Figure 6.When the system operates, first the manual state is entered.The pitch angle of the welding gun can be adjusted by the operator through the adjustment mechanism.When the control system enters auto state, the welding gun position is detected by the ADXRS300 micro machine gyro and the welding gun position is inputted to the compound controller which is a combination of the expert controller and the IRBFNN controller.Once the IRBFNN controller performance meets requirements, the IRBFNN controller is used to control the system instead of the expert controller.With the IRBFNN forward computation, the output quantity of the control signal can be obtained and the pitch angle of the welding gun is adjusted.Otherwise, the expert controller is restarted to control the system, the inference mechanism implements its inference based on the knowledge of the knowledge base and the control information that the user provided, and the pitch angle of the welding gun is adjusted, at the same time the IRBFNN controller is trained using the learning samples.

Application study
Through correlative analysis between the characteristic parameters and the welding gun pose angle, we find the characteristic parameters which have the maximum correlativity with the welding gun pose angle.Combining expert experience, finally, we select 3 kinds of characteristic parameters to input as neurons of IRBFNN, these parameters are space position of the welding gun (expressed by angle), the width of the welding seam and the depth of the welding seam.The output layer of IRBFNN contains one node, which stands for the value of the pitch angle.
We wrote some programs for the corresponding algorithm using C++.In order to show the advantage and feasibility of IRBFNN, we adopted the expert system based on IRBFNN, RBFNN and BP network to complement the forward inference.The structure of RBFNN and the BP network is the same as the IRBFNN.
According to the actual sample data and the RBFNN structural optimization with the improved genetic algorithm, the number of hidden layer nodes in IRBFNN is 12.The effect of different numbers of hidden nodes on the properties of RBFNN is shown in Figure 7. From Figure 7, we can see that when the number of hidden nodes is 12, the average train accuracy and test accuracy are higher than that of the number accuracy of the other hidden nodes number accuracy.So the topology structure of the IRBFNN network is 3-12-1.
After all the samples are normalized, we randomly separate 500 samples into 5 groups and take out 80 pieces From Table 1, we can see that the mean squared error of training samples of IRBFNN is smaller than that of the RBFNN and BP network.Moreover the mean squared error of testing samples of IRBFNN is also smaller than that of the RBFNN and the BP network.Furthermore, the iteration times of the IRBFNN are obviously smaller than those of the RBFNN and BP network with the same system error.From the Table 2 and Table 3, we can obtain the same result.It shows that the IRBFNN is superior to the RBFNN and BP network with regards to estimation accuracy and convergence rate.So the control system based on an improved radial basis function network and expert system has higher stability and faster real-time controlled speed.

Conclusion
This paper presented an intelligent control system of welding gun pose based on an improved genetic algorithm radial basis function network and an expert system.This system integrated AI, robotics and other technologies, and combined computer science and mechanism science.It supplied a new way and method for the whole position auto-programming of pipeline welding gun pose of the welding robot, it has some use for reference with regards to the intelligent control of robots.Experiments proved that using the expert system based on an improved radial basis function network to control the welding gun pose is feasible.It can enhance the welding quality.This system will have a wide prospect for application.

Figure 1 .
Figure 1.Structure of the radial basis function neural network

Figure 3 .
Figure 3. Flow chart of RBFNN structure optimization with improved genetic algorithm

Figure 4 .
Figure 4. Control system of the welding gun pose structure

Figure 5 .
Figure 5. Relationship of output and circumgyrate angle speed

Figure 6 .
Figure 6.Work flow of the welding gun pose control system

Figure 7 .
Figure 7.The effect of different numbers of hidden nodes on the properties of RBFNN

Table 1 .
of sample data as training samples each time, while the other 20 samples are testing samples.The IRBFNN, RBFNN and BP network are trained 5 times respectively using 5 groups with different training samples; thenceforth we used the corresponding testing samples to test.The results of the training and testing by the IRBFNN, RBFNN and BP network are shown in Table1.Tables2 and 3are the results of training and testing by IRBFNN, RBFNN and BP networks in different training samples and test samples.Training and testing results by IRBFNN, RBFNN and BP network (80 training samples and 20 testing samples)

Table 2 .
Training and testing results by IRBFNN, RBFNN and BP network (70 training samples and 30 testing samples)

Table 3 .
Training and testing results by IRBFNN, RBFNN and BP network (60 training samples and 40 testing samples)