Title page Combination Strategy of Dynamic Obstacle-avoidance and Autonomous Tracking for Hazardous Gases Inspection Robot in Man-Machine environment

A variety of toxic and hazardous gases exist in many working or storage environments, and once a leak occurs, it will cause a wide range of casualties and immeasurable economic losses. To improve the timeliness and flexibility of the inspection equipment in a man-machine hybrid environment, this research provides an effective and practical method to improving the autonomous behavior strategy of robots in complex environments. The team designs a mobile inspection robot used to inspect hazardous gas which can be controlled remotely or inspect dangerous gas independently first, the robot is controlled by a host computer through a hybrid architecture control system mainly composed by Micro Controller Unit (MCU), Raspberry Pi based on Wi-Fi formed by a wireless router. The robot uses the hub motors as the driving wheels, equipped with multiple sensors and cameras to complete forward and backward, turning, possesses target tracking, obstacle avoidance and real-time image transmission functions softly. Based on the robot kinematic model built, this paper studies the interfering objects four typical behavior patterns, establishes a social force model to guide the robot behavioral decision-making under dynamic obstacles. To verify the effectiveness of the combination motion strategy, Matlab is used to establish a shared environment space, trajectory simulation of the state of human crossing behavior and encounter behavior, and the speed change trend of the mobile robot is recorded. Combines the dynamic obstacle avoidance strategy presented based on fuzzy thinking, an autonomous tracking strategy by adopting Fuzzy-PID controller is proposed, the experiments under fixed trajectory indoors verifies that when the robot deviates from the predetermined trajectory during inspection operations, the FuzzyPID control system can effectively help the robot return to the target trajectory, which the PTZ is stable and the video image is clear and the frame rate is more than 10 frames per second shows the good inspection performance. The results of simulation and test are similar, and the robot position error up to 10mm, the angle error up  Xue-Shan Gao xueshan.gao@bit.edu.cn 1 Beijing Institute of Technology, Beijing 100081, China to 0.1 rad, which draws the reliability and accuracy of the inspection method,. And the robot can fast responsive, the smallscale time delay of the speed change does not affect the obstacle avoidance effectiveness, the robot and human will always maintain a sufficient safety distance to reduce the "sense of crisis" that humans towards to the robot.


Introduction
Hazardous gas leakage often causes a series of hazards to human's and equipment's safety, especially in natural gas factories, mines and chemical plants. Common hazardous gases are toxic and harmful (such as sulfur dioxide, carbon monoxide, etc.), also can be flammable and explosive (such as methane, etc.). Therefore, the detection of hazardous gases has become one of the most important problems which need to be solved urgently in the field of safety emergency and industrial production. With the development of robots, in factories, buildings and even homes more and more robots can be seen in the court. Among them, mobile robot has become the focus of scholars at home and abroad [1][2][3].
Dynamic obstacle avoidance technology is one of the important technologies for the mobile robot to realize the autonomous inspection function [4][5]. As an important manifestation of the degree of robot intelligence, it is always a difficult point in robotics research filed. Obstacle status information collection and obstacle avoidance strategies are key issues in the realization of obstacle avoidance technology.
The common algorithms of traditional obstacle avoidance algorithms include Artificial Potential Field (APF) [6],

·3·
Essential Visibility Graph (EVG) [7], Vector Field Histogram (VFH) [8] and fuzzy logic control et al. [9][10][11]. In the 1980s, Khatib O [12] proposed an artificial potential field method based on a virtual force field. The planned path generated by it is relatively smooth and the obstacle avoidance effect is good. However, when the gravitation and repulsion are equal, it will fall into a local optimal solution and produce concussion route [13]. The vector field histogram proposed by Janet J et al. [14] in the 1990s has high requirements for data storage, which requires the use of sensors to collect data in advance, and the reliability of obstacle avoidance is strictly affected by sensor performance [15]. In order to avoid the original defects of the artificial potential field method, Borenstein et al. [16] proposed the VFH vector field histogram method, which verified that the specific candidate direction can successfully guide the robot to deal with the local optimal solution problem of the pure local obstacle avoidance algorithm, but the application occasions are restricted [17]. Fuzzy logic can realize dynamic obstacle avoidance in unstructured environment [18][19]. This algorithm avoids the construction of complex motion models and environmental data models, converts accurate data into fuzzy language and formulates fuzzy rules, which can effectively reduce the pressure of data calculation and improve the efficiency of obstacle avoidance [20]. In order to improve the autonomous obstacle avoidance accuracy and tracking robustness of hazardous gas inspection mobile robots in complex man-machine indoor environments, this paper proposes an combination strategy of dynamic obstacle avoidance and autonomous tracking for hazardous gases inspection robot under a fixed trajectory to realize autonomous inspection, studies the main behavior patterns of interfering objects and establishes the social force model to guide the robot makes decisions about behaviors under dynamic obstacles. The study inputs the fuzzy variables such as man-machine distance, moving linear velocity, behavior mode, and robot speed increments into fuzzy language, makes the decision-making rules through fuzzy inference, and finally designs and implements a motion controller based on fuzzy logic.
In this research, a mobile inspection robot used to inspect hazardous gas which can be controlled remotely or inspect dangerous gas independently is designed and an autonomous tracking strategy combined with dynamic obstacle avoidance strategy and is presented. The research includes four main aspects: 1) introduce robot mechanical structure and composition; 2) build the robot kinematics model; 3) design the robot control system; 4) explain the robot motion strategies. In section 5, based on fuzzy thinking, the team studies the interfering objects main behavior patterns, establishes a social force model and designs fuzzy control rules to help the robot realize dynamic obstacle avoidance. Consequently, the simulations and experiment results analysis are presented in Section 6.

Overall Design of Mobile Inspection Robot
Taking the functionality and applicability of the robot as the starting point, the robot is mainly composed by chassis, shell, gimbal support, gimbal, two driving wheels, two driven wheels and other electronic components. The robot overall structure schematic diagram is shown in Figure 1 and Figure 2 is the robot prototype.
The driving wheels use a hub motor, are fixed on the chassis through mounting seat, bolts and nuts. The two driven wheels form a driven universal wheel through the wheel shaft and other parts, and then installed on the chassis. A group of short support columns and a group of long support columns are installed above the chassis respectively for mounting the robot outer shell. The hub motor driver, control board, battery and other components are installed in the middle of the shell and the chassis.  Besides, the original components such as the power indicator, switch, emergency stop switch and charging port are installed behind the casing. Also, a grayscale sensor is installed below the chassis, four ultrasonic sensors are installed in the robot, two of them and two headlight are installed in the front of the shell, the other are installed on each side of the shell. Four supporting columns are installed in the rear of the robot where the battery is placed, and a supporting plate is installed above the supporting columns ·4· for mounting the gimbal support, pan-tilt-zoom (PTZ) double head camera is fixed on the robot by the gimbal support and gimbal shell.
The robot can realize moving forward and backward, turning left and right through differential drive. The two driving wheels are arranged in front of the chassis and the driven wheels are arranged behind the mobile robot with gears, beam, etc. as follower are shown in Figure 3. When the two driving wheels rotate at the same speed, the robot walks straight. Turning, the two driving wheels rotate at different speeds can achieve different steering.

Figure 3
Moving mechanism of the robot

Kinematics Analysis of the Robot
In order to establish a robot motion model to analyze the robot kinematics, according to the robot actual application environment and the robot mechanical structure, the following assumptions are made for the robot system: 1) Assume that the robot chassis is a rigid structure, and the planes of the four wheels are perpendicular to the ground, the center of mass and centroid of each wheel overlap and are in the same plane; 2) Between the two driving wheels and the driven wheel shaft and the chassis only exist relative rotation , and the same is true between two driven wheels and the driven wheel shaft. Along the robot forward direction, the two driving wheels are the front wheels and the two driven wheels are the rear wheels; 3) Only one contact point between the four wheels and the ground, and the slight deformation of the wheels and tires is ignored; 4)The four wheels and the ground are pure rolling motion, skidding is ignored.
Set the plane global reference coordinate system {XOY}.
M is the robot centroid, as the robot position reference point in the global coordinate system. The robot pose is represented by a vector . M is at the midpoint of the two wheels，the displacement of the robot on the X and Y axes are x and y, respectively. θ is the angle difference between the global reference system and the robot reference system. The rotation speed of the left driving wheels is ω1, the rotation speed of the right driving wheels is ω2 and the radius of the driving wheels is r. The wheelbase of the front and rear wheels is L. The distance from the center of two front wheels to the center of mass is L1. The distance between the rear wheel axis and the center of mass is L2, L3 is the distance from the rear axle to the rotating shaft. The rotation angle of the rear wheel is β. The speed at the midpoint of the two front wheels is v. Figure 4 is the robot kinematics model.

Figure 4
Kinematics model of the robot In order to describe the robot motion state in the plane global reference system and the robot local reference system, the mapping relationship is as shown in Eq. (1).
Where, R  is the robot motion vector in the local coordinate system, R(θ) is the orthogonal rotation matrix which describes the mapping relationship between the global coordinate system and the local coordinate system.
When the mobile inspection robot turns, the linear speeds v1 and v2 of the two driving wheels can be obtained according to the different rotation speeds of the left and right front wheels, then the midpoint linear velocity v, the angular Novel 6-DOF Wearable Exoskeleton Arm with Pneumatic Force-Feedback for Bilateral Teleoperation

·5·
velocity ω of the body at this time can be got [21][22]. 1 1 Combining Eq. (5) with Eq. (3) and Eq. (4), the kinematic model of the robot walking mechanism can be established as shown in Eq. (6). 1 2 And the robot turning radius is: Based on the kinematics model of the robot above can design the robot control system. For this robot, the rotation angle β of the rear wheel is related to the rotation speed ratio of the left and right driving wheels.
According to the Eq. (3)-(8), the indicators including the turning radius of the robot, the rotation angle β of the rear wheel and the rotation speed ratio of the left and right driving wheels can be calculated as shown in Eq. (9), (10) and (11), respectively. 1 1 The wheelbase L of this robot in Figure 4 is 438mm, L1 is 214.25mm, L2 is 171.75mm and L3 is 46mm. According to the formulas above, the greater the turning angle of the rear wheel is when the robot turns, the smaller the turning radius will be.
Taking into account that the driven wheel of the robot is not a direct universal wheel but is used as a whole through the combination of two universal wheels, in order to prevent the rear wheel from colliding with other parts of the robot, two gears with gear ratio of 1: 5 are installed by meshing method to control the rotation of the rear wheel. The rotation range of the pinion is controlled between -90-90 degrees by installing a limiter. Due to factors such as gear gap and installation error, when the robot turns 90 degrees, the rotation angle of the rear wheel is approximately 20 degrees, as shown in Figure 5. Taking the data to the formulas above can calculate that the rotation speed ratio of the left and right wheels of the robot is about 1.44 and the minimum turning radius is about 1.17m.

Figure 5
Schematic diagram of the robot turning motion

Control System Structure of the Robot
The overall structure and kinematic model of the robot has been established. This part will introduce the design of the robot corresponding control system.

·6·
Hierarchical architecture is one of the common mobile robot system structures. This structure divides the robot control system into logical and physical levels according to electrical standards. In 1970s, Scholar Saridis [23] divides the control system into organization layer, coordination layer and execution layer based on the principle of decreasing control accuracy [24]. With the rapid development of sensor systems and widespread application in robots, a classic three-tier structure of Sense-Panning-Action (SPA) layered architecture emerged [25][26]. However, the completion of each task action requires hierarchical calculation and transmission, resulting in inevitable control delay, lacking of flexibility and real-time. The behavior-based inclusive architecture can avoid long-link information transmission and improve the robot rapid response functions. The independent packaging of functions improves the robustness, stability and scalability of the system. However, due to the lack of task guidance and coordinator plan, the shortcomings such as insensitivity to information accuracy, high error rate, and lack of initiative in target tasks exposed. In order to improve the rapid responsiveness of the system and get the overall coordination and decision-making abilities, finally adopts a hybrid architecture in the overall design of the control system, a hierarchical architecture as the basic framework, and sub-systems with inclusive characteristics forms an organic fusion. The application of hybrid architecture can not only fully reflect the advantages of the above two classic architectures, but can also effectively solve the single structure control limitations.
As shown in Figure 6, the control system of the robot is mainly composed by perception layer, decision-making layer and executive layer.

Figure 6
Structure of the robot control system The entire robot power supply is provided by a lithium battery and a corresponding voltage conversion circuit. The perception layer is composed of sensors and cameras on the robot, which are mainly used to collect environmental information around the robot to detect hazardous gases and implement dynamic obstacle avoidance. In the perception layer, the visible light camera DS-2ZMN3007 and the infrared gas camera FLIR G200a are connected to the Raspberry Pi which is at the decision layer through network communication to detect gas leakage. Ultrasonic sensor and grayscale sensor are connected to STM32F103 through I/O port, the signal is processed through STM32F103 and then transmitted to the decision-making Raspberry Pi through the serial port.
The decision-making layer of the robot is composed by Raspberry Pi and Raspberry 4B, which are client and server, respectively. The Raspberry Pi can send and receive control commands and display these commands on terminal interface through Wi-Fi established by router. When the camera image data is collected, the image data needs to be hard coded in H.264, and compressed into H.264 format video image. In order to ensure the smoothness of the video, the frame rate of the output video image should be more than 10 frames per second. Therefore, UDP protocol is selected in the transport layer to improve the efficiency of video transmission and improve the problem of video delay. After receiving the information, the decision-making layer will process the information and send these commands to executive layer.
The executive layer mainly includes STM32F103 controller, motion control software, hub motor driver, hub motor, PTZ and other related communication modules. The microcontroller unit (MCU) STM32F103 runs the embedded system, sends the motion information of the rotation speed and displacement and uploads the sensing layer information to the upper computer through the serial communication. After receiving the corresponding instruction, the hub motor and PTZ will be droved to complete the established action.Additionally, the MCU can obtain and analyze the distance information of the ultrasonic sensor to prevent collision accidents in an emergency by internal obstacle avoidance strategy.

Dynamic Obstacle Avoidance Strategy of the Robot
When the robot perform inspection tasks, while ensuring that the robot does not collide with interference especially humans, it should also maintain a reasonable safety range with humans to prevent humans from having a "sense of crisis". Therefore, when formulating robot inspection rules, set humans as interfering objects in the shared space.

·7·
Considering the robot target operating environment and the robot autonomous tracking strategy, adjusting the moving direction is not the best way to avoid obstacles. In order to improve safety, finally adopts fixed-point and fixed-track inspection method to obtain appropriate speed control parameters by formulating social force models and fuzzy rules that match the required environment.

Social Power Model
In general, each person and robot will have their own local motion targets, individual motion speeds, and accelerations in the man-machine behavior model. The following three force items should be considered in the modeling process [27]: 1) The acceleration term is the trend to reach the desired speed, F acc ; 2) The force term is that reflects the boundary condition of maintaining a certain distance during the interaction between human and robot, F int ; 3) The attractive force term is that the target to human/robot, F att .
Assuming that the above three components affect pedestrian decision-making at the same time, as shown in Figure 7, quoting the traditional force superposition principle, the total effect force equation can be obtained: R r,avoid ,R θ,avoid are the avoidance distance of the robot and the avoidance distance of the human, respectively. As a result, the relationship between the robot kinematics model and the tendency of the interference individual can be obtained.

Figure 7
Social power model

Behavioral pattern analysis
According to the man-machine relative distance, relative motion direction, relative position and relative speed factors in the shared space environment, adopts empirical method andheuristic method to divide the behavior of human (or interfering body) into four types [28]: crossing, encountering, leading and confronting typical mode. According different typical behavior patterns, the robot follows the corresponding rules to ensure safety and does not invade sensitive areas.

Behavioral pattern analysis
The fuzzy logic control method is used to deal with the behavioral movement rules of the interfering objects and the robot specific strategies. Based on the above analysis of basic human behavior patterns, the robot possess the decision-making capabilities similar to humans through speed adjustment. To realize fuzzy logic control, the following three steps are required: fuzzification of input and output, fuzzy reasoning, and defuzzification of output variables.
(1) Fuzzification of input and output In the robot dynamic obstacle avoidance control system, the input of the selected controller is the distance between man and machine, R r , the mode of interference behavior B i   Table 1 shows part fuzzy control rules formulated. (

3) Defuzzification of output variables
The result obtained by fuzzy control rules is a fuzzy quantity, but in actual fuzzy control, the fuzzy quantity cannot directly control the actuator, and it needs to be converted into a precise quantity. Use Mandani reasoning method to get the mean value, as in Eq. (14).
Among them, ∆V RO is the calculated robot linear velocity increment, and μ(∆V R i ) is the membership function value corresponding to the i element.   As shown in Figure 10, the simulation experiment 1 was considered the common crossing behavior at the intersection.
In this case, the interfering object moved along the set movement route at an initial speed of 0.4 m/s, and the robot Qing-Fang Zhang et al.

·10·
performed a constant-speed inspection work at an initial speed of 0.4 m/s. At t=4.2s, the robot detected that an interfering object entered the maximum avoidance distance area from the right side of the robot moving direction, the robot speed adopted a speed reduction strategy to produce 75% of the initial speed, 0.3 m/s. At t=5.5s, the speed dropped to the lowest, 0.1 m/s. As shown in Figure 11, at t=7.6s, the interfering object left the maximum avoidance area and accelerated to the initial speed, 0.4m/s. The elliptical social distance analysis result of the two sampling points at t=5s shows that when the robot meets with human, exists overlapping phenomenon in sensitive areas.

Figure 11 Speed change trend of the robot in crossing behavior mode
In the algorithm experiment under the crossing behavior mode, the initial distance between the human and the robot was kept at the about 5m, and the experimenter crossed from the front left of the robot to the right, and the speed was similar to the robot, as shown in Figure 12(a). At about 5s, the robot started to decelerate and wait. At this time, the distance between human and machine measured by the ultrasonic sensor was equal to the avoidance distance of the robot, as shown in Figure 12(b). When a person passed and left, the distance between the man and the robot detected by the robot increased, its speed accelerated, and finally it detected that it entered the interference area with the front wall until judged that the dangerous distance and stopped.
(a) Approach robot (b) Robot decelerate to avoid (c) Human leave Figure 12 Experiment of crossing behavior The simulation experiment 2 was considered the common encountering behavior mode in the aisle. As shown in Figure   13, when the robot inspection strategy was based on the premise that the inspection route does not change, the walking route of the tester could be set as needed. The obstacle movement speed was 0.4 m/s, and the robot movement speed was 0.4 m/s. As shown in Figure 14, at t=4.2s, the robot detected that an intervener entering the maximum avoidance distance area from the left side of the robot moving direction, and the robot speed adopted a speed reduction strategy. At t=6.8s, the speed dropped to the minimum, 0.1m/s. At t=9.3s, the intervener left and the robot accelerated to the original speed. always maintain a sufficient safe distance to reduce the "sense of crisis" produced by human towards to the robot.

Autonomous Tracking Strategy of the Robot
Robot autonomous tracking strategy is one of the robot most important functions, it relates to the efficiency of the hazardous gas inspection robot. Consider the robot target job requirements, its expected tracking route is drew in advance, combines the obstacle avoidance strategy proposed above, Fuzzy-PID method to control is adopted.

Modeling
In order to make the errors as small as possible, designs the auxiliary kinematics controller based on the robot position error vector: k1, k2, k3 are different auxiliary control parameter respectively, and under these auxiliary control rates, v, ω gradually converges to vr, ωr. After getting the linear velocity and angular velocity of the robot, angular speed of driving wheel ω1，ω2 can be solved through the kinematic equation.
Assume angular speed error of driving wheel ωe = e(t), using PID controller, the controller output u(t) can be got [29].
Since the position error generally exists, the team set a The second step was to utilize the membership function in different ranges to solve Kp, Ki, Kd [30]. The specific control method was presented in the Figure 17.

Simulation and Experiments
In order to verify the effectiveness of the controller, the robot was tested in an indoors man-machine environment. First drew a circular trajectory on the floor as the target trajectory, then placed the robot at a distance from the target trajectory.

Figure 18
Target trajectory of the robot The robot target trajectory as shown in Figure 18. The robot experiment platform also includes a PC host, which installs with control software and camera processing software to track the robot trajectory and generate trajectory map, as Figure 19 shows. The target of the robot starting point is (3.5, 0). The Initial position error is (0.2, -0.5) and the initial angle error is π 6 ⁄ .    Table 2. Analysis the robot motion data, the robot position error (coordinate unit: meter) and rotation angle error can be calculated respectively.

Conclusions
(1) Based on the research of the mobile robot to inspect hazardous gas, this research designs a mobile inspection robot, builds the kinematic model of the robot, establishes a hybrid architecture of the control system to improve the rapid responsiveness of the system and get the overall coordination and decision-making abilities. (2) In the dynamic and time-varying environment which shared space between humans and machines, the team analyzes human movement and behavior and divides them into four typical behavior patterns to describe with fuzzy language, establishes a social force model that matches the environment based on the human mental state. Based on social force model and fuzzy logic, proposes an inspection method for mobile dynamic obstacle avoidance. (3) With sets of the crossing mode and encountering mode simulation and experiments, the obstacle avoidance performance of the robot is taken, the small-scale time delay of the speed change does not affect the obstacle avoidance effect, the robot and the human will always maintain a sufficient safe distance to reduce the "sense of crisis" produced by human towards to the robot. (4) Combine the dynamic obstacle avoidance strategy presents an autonomous tracking strategy controlled by Fuzzy-PID control system. The trajectory experiments results are similar to the simulation, verifies that when the hazardous gas inspection robot deviates from the predetermined trajectory, the robot can return to the original trajectory, and control the position error to 10mm and angle error up to 0.1 rad. Besides, the PTZ can rotate 0-360° horizontally and freely swing -90°-90° vertically. The inspection of the robot is more flexibility since the PTZ is independent with the movement mechanisms of the robot, and the PTZ patrol action group can be set as required. The robot can transmit back the image information timely and efficiently, the image transmission speed can reach 10 frames per second, and the image is clear regardless of the movement state of the robot moving mechanism. In summary, the results show that the combination moving strategy presented in this paper is effective and practical, can more reliably protect the safety of robots and humans and the robot can complete the task of hazardous gas inspection well in complex man-machine environment.