# Novel Online Optimized Control for Underwater Pipe-Cleaning Robots
## 1 Introduction  
Offshore platforms play an important role in marine resource exploitation, and jackets made of steel pipes are essential structural supports for oil rigs. As barnacles, algae, and other forms of marine life always adhere to their surface, these pipes need periodical cleaning to prevent load increase and corrosion [1; 2]. Until now, most of these cleaning tasks have been accomplished manually, which is of low efficiency and high cost, and presenting potential safety threats to the divers. Therefore, it is essential to replace manual labor by underwater robots. In recent years, climbing robots have been developed for industrial applications, especially in the area of cleaning underwater structures [3; 4]. These robots utilize propulsion force adhesion [5; 6; 7; 8], magnetic force adhesion [9; 10], and clamping [11] to achieve stable locomotion and withstand the counterforce brought on by cleaning operations. All of them, however, focused only on locomotion, adaptation, or the cleaning method, which are the basic functions of climbing robots used for cleaning. As these underwater robots may work several to over twenty hours a day and operators can only concentrate effectively for 30-60 min before their driving ability declines [12], automation is urgently required not only to relieve the stress of operators but also to improve the operational efficiency. Many researches have paid attention to localization, navigation, and motion control of climbing robots to achieve automation [13]. MagneBike, also moving on the pipe, uses a localization strategy based on 3D scan registration and 3D odometry, and transforms the path from 3D space into 2 Dspace by projecting movements into local surface planes, allowing for 2D trajectory tracking [14; 15]. In addition, multiple methods and devices have been utilized to achieve stable motion and autonomous control of climbing robots, including computer vision [12; 16; 17] or structural light-based computer vision [18; 19; 20], 3D perception sources [21], dead reckoning [22], and external guidance [23]. As the methods above were commonly developed considering the constraints of a particular working environment, their performance may decrease if applied to other fields, especially under water. Meanwhile, there have been few effective localization and control methods for underwater cleaning robots due to the complexity of the marine environment. 3D localization is an indispensable step towards the implementation of a semiautonomous or autonomous control. However, according to underwater environment specifications [9], an accurate global localization is either hard to achieve or inadequate for cleaning tasks. Thus, we propose a compromised method composed of rough global localization and accurate local localization, which, respectively, helps operators locate approximately the underwater pipe-cleaning robot (UPCR) and provides reference paths and movement errors for the control method. The global localization of a UPCR was demonstrated in our previous work [24]. Based on the transfer matrix between the global coordinate and the UPCR coordinate, the orientation error between the axis of the pipe and the UPCR, accelerometer measurements, and the inclination of the pipe were fused to calculate the relative orientation between the pipe and the UPCR. Then, combined with the liquid level transmitter, the global localization of the UPCR was obtained. This paper focuses on the local localization and autonomous control of the UPCR. As the boundary of the area covered by biofouling is always irregular, the \"highest\" point on the boundary along the direction of the pipe's axis was chosen as the feature point, and the line on the pipe across the point that was vertical to the axis of the pipe was defined as the reference path, as shown in Figure 1. During local localization, therefore, the pipe edge and the biofouling boundary in the image are first recognized. The orientation error of the UPCR is calculated based on the inclination of the pipe's edge.