Research on displacement compensation method of inspection robot based on CS-BP neural network

2022-11-21 13:16WangXingchenPanWeiZhouLichunHouYingyongPetrBartosXiaoMaohua

Wang Xingchen,Pan Wei,Zhou Lichun,Hou Yingyong,Petr Bartos,Xiao Maohua*

(1.College of Engineering,Nanjing Agricultural University,Nanjing 210031,China;2.Jiangsu Huali Intelligent Technology Co.,Ltd.,Changzhou 213000,China;3.Faculty of Agriculture,University of South Bohemia,Ceske Budejovice 370 05,Czech)

Abstract: The displacement error of intelligent patrol robot will continuously increase when it conducts patrol inspection along a fixed trajectory,thus deviating from the established inspection route.This paper presents a displacement compensation method based on CS-BP neural network.The Cuckoo search algorithm is used to optimize the weight and threshold of BP neural network in order to obtain the most excellent neural network structure.The experimental results show that the compensated displacement curve is closer to the actual displacement curve,and the displacement error is much smaller than the uncompensated theoretical displacement curve.At 58.8 s in the experiment,the deviation between the output displacement and the actual displacement after compensation by CS-BP neural network can be maintained at about 3 cm.The displacement compensation method is feasible and can effectively alleviate the problem that the motion path of the intelligent inspection robot deviates from the inspection route.

Keywords: intelligent inspection robot;BP neural network;Cuckoo search algorithm;displacement compensation

0 Introduction

An intelligent inspection robot,featured with automation and intelligence,is a tool for on-site real-time monitoring in a specific environment.It has been widely popularized and applied in many fields such as national defense,substation,and industry[1].However,under the long-term continuous inspection work,the displacement error of the robot will continue to accumulate and increase,which reduces the inspection efficiency,wastes the power storage of the robot,and increases the risk of damage to the robot due to collision.Therefore,it is necessary to compensate for its displacement in order to regulate the path of the inspection robot and improve the inspection efficiency by improving the displacement accuracy of the robot.

There are many reasons for the displacement error of the inspection robot,such as the error caused by the assembly of each part of the robot,the error caused by the friction between the robot and the bottom,the error of the moving speed measured by the sensor and the error caused by the heat loss of parts and components.The displacement error generated by the inspection robot in the working process will lead to a certain deviation between its actual position and the calculated theoretical position.The errors produced by the inspection robot in the moving process can be divided into three categories:geometric error,non-geometry error,and random error.Among them,the error generated in the manufacturing and installation process of inspection robots is a geometric error,a deterministic error that can establish the corresponding error model.In most cases,non-geometry and random errors are unpredictable,so it is impossible to establish an effective error analysis model[2].

The commonly used error compensation technology can be divided into two categories:predicting the displacement calculation deviation by establishing the simulation model and calculating the deviation using sensor measurement feedback information[3].The basic principle of the former is to establish the kinematics model of the robot to obtain the position error,and identify the kinematics parameter deviation of the robot and modify the corresponding parameters[4].Some foreign researchers use fuzzy interpolation and Fourier polynomial algorithms to predict and compensate for the displacement error under different conditions[5].These algorithms need complex polynomial transformation,and the compensation accuracy is relatively low.Other researchers used Spatial Interpolation[6],Kriging[7],and Co-Kriging[8]methods for robot displacement compensation.These error compensation methods are mainly used when there are only individual error variables and it is easy to obtain the mapping relationship of the error function.However,the factors that lead to displacement error in the working process of inspection robots are very complex.Except that geometric error can establish an error analysis model,it is difficult to directly model and analyzes nongeometric error and random error.Therefore,some existing displacement compensation methods are difficult to be directly applied[9-10].Although the displacement compensation method based on sensors can provide the robot with higher position accuracy,it is more vulnerable to the influence of the environment.It is difficult to accurately identify the road features on a wide road,which reduces the stability of the motion process of the inspection robot[11].There is relatively little research on the compensation of displacement error of inspection robots in China[12-13].

To solve the problems that has been discussed,this paper proposes a displacement compensation method of inspection robot based on CS-BP neural network.BP neural network is used to compensate the displacement of four-wheel Ackerman steering inspection robot under the condition of S-type speed curve.Since BP neural network is easy to fall into local optimization,Cuckoo search algorithm is used to improve the motion accuracy of intelligent inspection robot[14-17].

1 Kinematic analysis of inspection robot

1.1 Analysis of Ackerman steering principle

In the process of turning,if all four wheels are in the pure rolling state,the turning radius of the inner tire of the vehicle needs to be smaller than that of the outer tire,which is Ackerman’s steering principle.As shown in Figure 1,it is a schematic diagram of the motion steering of the inspection robot[18].In order to ensure that the vehicle does not slip laterally when turning,and the wheels on both sides only have pure rolling movement,there must be an instantaneous center between the wheels,and each wheel rotates around the instantaneous center to minimize the resistance.Therefore,the relationship between the wheel angles on the inner and outer sides should meet the relationship shown in equation(1).

According to the geometric relationship

In equation (1)and equation (2),α1andα2respectively represent the rotation angle of the inner and outer wheels of the front wheel,andαis the rotation angle of the virtual wheel equivalent to the midpoint of the front axle;bis half of the distance between the two wheels of the rear wheel drive wheel;lis the distance between the front and rear wheels.According to equation (2),the equivalent virtual steering angleαcan be used to represent the real rotation angle of the inspection robot.In addition,in this definition,all angles are positive counterclockwise and negative clockwise.

In order to ensure that the curve drives well,the speed of the left and right tires of the rear wheel is generally not equal,but there is an active differential according to the steering angle.Therefore,when the left and right motors of the rear wheel are responsible for the speed of the trolley,they also need to cooperate with the steering gear to control the steering of the trolley,that is,the actual heading of the inspection robot is determined by the steering gear and the two motors,which affect each other.

In order to simplify the kinematic model,the following assumptions are adopted for the model.

(1)The two steering wheels of the front wheel can be equivalent to a virtual wheel,which is located in the middle of the front wheel shaft.

(2)The inspection robot can be regarded as a rigid body as a whole,and its four wheels are regarded as rigid wheels.

(3)It is assumed that the inspection robot always moves on the two-dimensional plane,ignoring the influence of pitch and roll.

(4)Only the forward and steering behavior of the inspection robot is considered.

As shown in Figure 1,it is assumed that the included angle between the forward direction of the robot and the X-axis isθ;According to Ackerman’s steering principle,the normal of the four wheels of the robot gather at the same point,that is,O2in the figure;Ris the distance from the driving reference point of the robot to the revolution center of four wheels;vis the overall linear velocity of the robot[19].

During the movement of the robot,the angular velocities of the four wheels at any time are the same,as shown in equation(3),taking the midpointO1of the connecting line between the center points of the two rear wheel drive wheels as the reference point and the robot steering angle asα,the speed relationship between the two rear drive wheels is

Among them,ωlandωrare the angular velocities of the left and right wheels respectively;vlandvrare the linear speeds of the left and right wheels respectively;then the angular velocityωcof the robot body is

During the movement,the left and right wheels and the reference point are moving coaxially,and their angular speeds are the same.It can be deduced that the linear speed of the reference point is half of the linear speed of the left and right wheels,that is,the linear speed of the robot body is

Where,ris the wheel radius.

Due to the consistency of angular velocity,the relationship between the left and right driving wheels and the linear velocity of the robot body can be further calculated.

It can be seen from the above that the speed control of the inspection robot is mainly determined by the linear speed of the two rear wheels,and then by the speed of the rear wheel motor.The steering angle is determined by the steering angle of the front wheel.In other words,the displacement determination of the position information of the inspection robot mainly depends on three quantities,the left and right wheel speed and the steering angle of the steering gear.That is,as long as the speed of the two driving wheels of the rear wheel and the steering angle of the front wheel steering gear are taken as inputs,the position information of the inspection robot can be obtained at any time[20].

Under the motion mode of front steering gear steering and rear wheel dual motor drive,the steering angle range of front steering gear is[-π/2,π/2].According to the different steering angle and rotation direction of the steering gear,the designed intelligent inspection robot has two different motion behaviors,as shown in Figure 2.

Figure 1 Schematic diagram of motion steering of inspection robot

Figure 2 Two motion behaviors of inspection robot

(1)Whenα=0,v=vl=vr,R=+∞,ω=0,The inspection robot moves in a straight line.

(2)Whenα≠±π/2or0,v=,ω>0,The inspection robot makes a turning movement,and the turning angle is determined by the speed of the two driving wheels and the steering angle of the steering gear.

The motion trajectory generated by the designed intelligent inspection robot during operation is composed of continuous position information of multiple points at multiple times.When it completes linear motion and steering motion by using Ackerman steering principle,the motion state of the inspection robot will change constantly,as shown in Figure 3.

Figure 3 Schematic of position information change of inspection robot steering

According to the above analysis,when the angleαof the front wheel steering gear and the linear speedvof the inspection robot are the control inputs,the following kinematics model of the inspection robot can be constructed.

If the inspection robot moves fromO1(X t,Y t,θt)toO1′(X t+1,Y t+1,θt+1)within the time intervalΔt,there isΔθ=θt+1-θt.If the position information(X t,Y t,θt)of the inspection robot is known at timet,the position information (X t+1,Y t+1,θt+1)of the inspection robot at timet+1 can be easily obtained according to equation(9).

Through the above analysis,it can be seen that when the inspection robot changes its motion state,it can reach the required turning angle and forward speed by controlling the angle of the steering gear and the speed of the two motors,so as to realize what determines motion position information of the inspection robot.According to the movement speed of the inspection robot,the speed of the two rear wheels required at the current time is calculated in advance,and then converted into the realtime speed of the two drive motors at the current time.Then the steering angle of the steering gear is calculated in advance according to the movement direction of the inspection robot,so as to achieve the continuous change of the movement state of theinspection robot at any time.

1.2 Acceleration and deceleration motion control algorithm of S-curve

In the working process of inspection robot,only when its motion speed is smooth and stable enough can the motion of robot have good stability and coherence[21-22].In this paper,the S-curve acceleration and deceleration motion control algorithm is used to realize the smooth adjustment of the motion speed of the inspection robot.

The S-type algorithm is mainly used to solve the acceleration and deceleration curve in the acceleration and deceleration process of the trapezoidal acceleration and deceleration system.S-curve acceleration and deceleration algorithm is not a fixed algorithm.There are totally seven stages shown as jerk,constant acceleration,descending acceleration,constant velocity,increasing deceleration,constant deceleration,descending deceleration.Its motion law is shown in Figure 4.

Figure 4 S-curve acceleration and deceleration motion control algorithm

The core idea of S-curve acceleration and deceleration algorithm is to make the acceleration not abrupt,so as to ensure that the speed of robot motion can realize smooth transition,which can be flexibly applied to various practical situations[23-24].

2 Research on displacement compensation method of inspection robot based on Neural Network

2.1 BP neural network

BP neural network is a popular machine learning method.It can train a large number of given inputs and outputs for many times and find the mapping relationship between inputs and outputs,so as to realize the prediction or classification from input to output.This offers a suitable solution to the complex nonlinear problem that intelligent inspection robot,which has multiple error variables and is difficult to explore the mathematical relationship between errors.

BP neural network is a multilayer pre-feedback network,which is usually composed of input layer,output layer and hidden layer.A large number of studies show that the three-layer forward network can approach any continuous function.

In BP algorithm,after the network structure is determined,the initial weight and threshold must be given.When the training data enters the input layer of the network,the actual output value is obtained by using the weight and activation function connected between the hidden layer and the input layer,and then the error value in the actual situation is calculated by using the expected output value and the actual output value,and the error value in the actual situation is compared with the expected error value.Thus,the weight and threshold are adjusted to make sure the calculation results meet the accuracy requirements.Although BP neural network can use relevant parameters to predict the output,it is also easy to fall into local minimum,so it needs to use optimization algorithm to overcome this disadvantage[25].Cuckoo search algorithm is a population-based optimization algorithm,which can adjust the weight and deviation of BP neural network by updating the position of nest,so as to improve the performance of BP neural network.

2.2 BP neural network model for optimization of Cuckoo search algorithm

The process of optimizing BP neural network(CSBP)by Cuckoo search algorithm is essential take the training error function of BP neural network as the fitness function of Cuckoo search algorithm,and use the powerful global search ability of Cuckoo search algorithm to optimize and improve the weight and threshold of BP neural network in the initial state,so as to obtain the neural network structure with the best performance and improve the network performance[26-28].The specific flow of the algorithm is as follows.

(1)Determine the topological hierarchy of BP neural network,including the number of nodes in input layer,hidden layer and output layer.

(2)The neural network is input after normalizing the training data and test data.

(3)Determine the weight and threshold in the initial state,and determine the coding length of each cuckoo in CS algorithm according to the total number of them.

(4)The training error of BP network is taken as the fitness function value of CS algorithm.The fitness function is usually expressed by the absolute value of the error between the actual output and the expected output,as shown in equation(10),and the cuckoo is updated according to the Levi flight mechanism.

Where,nis the number of nodes in the output layer;kis the coefficient;y iis the actual output of node;andoiis the expected output of nodei.

(5)In the cuckoo population,the cuckoo individuals in the population are constantly updated according to the Levi flight mechanism.

(6)The optimal individual cuckoo found by CS algorithm is recoded to obtain the optimal combination of weight and threshold value,which is used to update the original weight and threshold value of BP neural network.

(7)When the output training error of BP neural network meets the required accuracy or reaches the maximum number of iterations,stop the iteration and output the training results.Otherwise,return to step(4)to start the next iteration until the requirements are met.

The algorithm flow of CS-BP neural network is shown in Figure 5.

Figure 5 CS-BP neural network algorithm flow chart

3 Displacement compensation of inspection robot based on CS-BP neural network

Due to the particularity of the working environment of the intelligent inspection robot,its main movement mode is to walk in a straight line along a fixed track.When the straight line is unable to pass,there will be turning movement,as shown in Figure 6.The designed inspection robot mainly monitors the surrounding environmental conditions along the preset track,and the main error of its displacement mainly exists in theX-axis direction,while in theY-axis direction,the coordinates of the inspection robot walking along the fixed track in theY-axis direction are preset and remain unchanged in the whole robot movement process.Therefore,in order to simplify the model,this paper mainly studies and compensates the displacement error in theX-axis direction during the movement of the inspection robot.

Figure 6 Working track of inspection robot

In this paper,the CS-BP neural network is used to compensate the displacement error of the robot in theX-axis inspection direction.At the same time,the factors affecting the position deviation of the inspection robot are mainly divided into motion parameter variables and structural parameter variables.The errors caused by different structural parameters of the inspection robot are finally reflected by the changes of motion parameters.Therefore,five motion parameters of the inspection robot in the inspection process:theoretical speed,actual speed,theoretical acceleration,actual acceleration,and theoretical displacement are selected as the input feature of the CS-BP neural network.The ratio of actual displacement to theoretical displacement,for example displacement compensation coefficient,is taken as the output feature of CS-BP neural network.

The number of nodes in the input layer and the number of nodes in the output layer of BP neural network are determined by the dimension of the input eigenvector and the dimension of the output eigenvector respectively.As mentioned above,this paper takes the five motion parameters of the inspection robot in the inspection process:theoretical speed,actual speed,theoretical acceleration,actual acceleration and theoretical displacement as the input feature vector,and the size of the displacement compensation coefficient as the output feature.Therefore,the number of input layer nodes of the established neural network is set to 5 and the number of output layer nodes is set to 1.According to the empirical equation (11)and after many neural network training and verification,the number of nodes in the hidden layer of neural network is finally selected as 6.Therefore,a 5-6-1 three-layer BP neural network is finally established,and its network structure is shown in Figure 7.In the Cuckoo search algorithm,only one parameter needs to be set,that is,the discovery probability Pa,which is usually taken as 0.25.

Figure 7 CS-BP neural network model for displacement compensation of inspection robot

Where,Nis the number of nodes in the hidden layer;mis the number of nodes in the input layer;nis the number of nodes in the output layer;andcis a constant from 1 to 10.

As shown in the Figure 7,the BP neural network structure established in this paper is a threelayer neural network structure with an input layer with 5 nodes,an implicit layer with 6 nodes and an output layer with 1 nodes.The transfer function between the input layer and the implicit layer istansigfunction,and the transfer function between the implicit layer and the output layer ispurelinfunction.In the figure above,there are five inputs.V_tis the theoretical speed,V_ris the actual speed,a_trepresents theoretical acceleration,a_rrepresents the actual acceleration,S_trepresents the theoretical displacement of the inspection robot moving in theX-axis direction.Krepresents the displacement compensation coefficient,which is the ratio of actual displacement to theoretical displacement.

In the actual motion process of the inspection robot,the established CS-BP neural network model continuously trains the motion parameters of the inspection robot,so as to continuously obtain the displacement compensation coefficientKat the next time,and then calculate the actual displacement of the inspection robot according to equation (12)to improve the accuracy of the robot motion.

Where,S_rrepresents the actual displacement of the robot moving in theX-axis direction.

4 Simulation verification based on MATLAB

The displacement compensation model of inspection robot based on CS-BP neural network is tested and analyzed through the robot motion simulation experiment in MATLAB.Firstly,the kinematics simulation platform of intelligent inspection robot based on Ackerman steering principle is built in the Simulink module of MATLAB.According to the actual situation of the designed inspection robot,the appropriate motion parameters are selected in Simulink and a certain random disturbance is added to simulate the actual motion process of the inspection robot and generate motion data.

In this paper,the S-shaped curve acceleration and deceleration motion control algorithm is used to adjust the motion speed of the inspection robot,and the motion speed curve of the inspection robot presents seven S-shaped curves in the simulation process of Simulink.Figure 8 (a)shows the comparison between the theoretical speed curve and the actual speed curve of the inspection robot in the working process.Figure 8(b)shows the comparison between the theoretical displacement curve and the actual displacement curve of the inspection robot in the working process,and the sampling period is 1 ms.

Figure 8 Simulation of motion parameters of inspection robot

It can be seen from Figure 8 that when the designed inspection robot uses the acceleration and deceleration motion control algorithm of S-curve,there is a certain deviation between its actual speed and the theoretical speed,so there is also a deviation between the theoretical displacement and the actual displacement of the inspection robot in theX-axis direction before the displacement compensation of the robot,and the accumulation of displacement error increases as the robot runs.

In this paper,the CS-BP neural network is used to compensate the displacement of the intelligent inspection robot.Firstly,the CS-BP neural network model is established according to the steps described above,and then the kinematics simulation platform of the robot based on Simulink is used to generate the input and output characteristic data of the neural network:theoretical speed,actual speed,theoretical acceleration,actual acceleration,theoretical displacement and the actual displacement of the simulation.Since the sampling time is 1 ms and the motion time is set to 61.465 s,the number of sampling points of motion parameters appealed is 61 465.When the ratio of actual displacement is calculated,a total of 61 465 displacement compensation coefficients are obtained.Therefore,a total of 61 465 groups of sample data are used to train the established CS-BP neural network model,and then the relationship between the five motion parameters of theoretical speed,actual speed,theoretical acceleration,actual acceleration and theoretical displacement and the displacement compensation coefficient is obtained from the trained CS-BP neural network.61 465 groups of sample data of the above five motion parameters are input into the trained CS-BP neural network model to obtain the displacement compensation coefficient of the inspection robot predicted by the model,which is multiplied by the corresponding theoretical displacement to obtain the actual displacement after compensation.The displacement compensation results are shown in Figure 9.

Figure 9 Displacement compensation results of inspection robot based on CS-BP neural network

According to the above displacement compensation results by CS-BP neural network model and the local enlarged drawing,it can be seen that as the displacement error between the theoretical displacement and the actual displacement increases,the displacement compensation value also increases,and the displacement error is far smaller than the theoretical displacement curve without compensation.At 58.8 s,the uncompensated theoretical displacement has deviated from the actual displacement by 50 cm,while the deviation between the theoretical displacement curve multiplied by the displacement compensation coefficient output by the neural network and the actual displacement has been maintained at about 3 cm.This shows that it is feasible to use CS-BP neural network model to compensate the displacement of inspection robot.In the practical application of the inspection robot,the actual displacement of the inspection robot can be calculated at the same time according to the known theoretical displacement given by the system.On the contrary,if you want to make the actual displacement of the robot reach a certain position,you only need to calculate the theoretical displacement at the same time according to the displacement compensation coefficient.

5 Conclusion

This paper analyzes the motion control principle of the intelligent inspection robot,and based on the Ackerman steering principle,the kinematics model of the mobile chassis driven by the front wheel steering gear and the rear wheel dual motor is established,so that the position information of the inspection robot can be determined at any time.The S-curve acceleration and deceleration motion control algorithm is selected to realize the smooth adjustment of the motion speed of the inspection robot.By analyzing the source of displacement error during the movement of inspection robot,a displacement compensation model of inspection robot based on CS-BP neural network is established.The training error function of BP neural network is regarded as the fitness function of Cuckoo search algorithm,and the weights and thresholds of BP neural network in the initial state are optimized and improved by using Cuckoo search algorithm.Then the neural network structure with the most excellent performance is obtained,and it is verified by MATLAB software.The experimental results show that with the increase of the displacement error between the theoretical displacement and the actual displacement,the displacement compensation value also increases,and the displacement error is much smaller than the uncompensated theoretical displacement curve.At 58.8 s,the uncompensated theoretical displacement has deviated from the actual displacement by 50 cm,while the deviation between the theoretical displacement curve multiplied by the displacement compensation coefficient output by the neural network and the actual displacement has been maintained at about 3 cm.It shows that the displacement compensation method based on CS-BP neural network can effectively alleviate the problem that the motion path of the intelligent inspection robot deviates from the inspection route.Since there is relatively little research on displacement error compensation of inspection robot in China,this research result provides a scheme for displacement compensation of intelligent inspection robot in the long-time inspection process.As BP neural network is easy to fall into local optimization,the Cuckoo search algorithm is used to optimize it and improve the motion accuracy of intelligent inspection robot.