Retrofit an 11-meter yacht for autonomous navigation

Intelligent/autonomous ships form a rising field that brings beneficial changes to waterborne transportation such as relieving labour shortages, avoiding collisions, and providing assistance to humans. Many autonomous navigation attempts have been carried out on ship models rather than real ships. The results of these studies have certain gaps with the results of full-scale ships. Cost and risk of intelligent ships for autonomous navigation are yet unclear, which makes retrofitting existing ships for tests and development appealing. This paper introduces the process of retrofitting a full-scale 11-meter yacht, including mechanical retrofit, hardware redesign, software deployment, and functional testing. The process is proposed as a solution of ship retrofit for autonomous navigation functions like heading control, path following, and collision avoidance. In the end, this paper concludes a plan of hardware and software that could help find more retrofit solutions, providing a reference for academic research and practical applications.


Introduction
The development of unmanned transport has caused many interests in recent years by the influence of hightech. Because of the considerable expenditure in single ship construction and its retrofit, the development of intelligent ships including the unmanned surface vehicle (USV) falls behind the development of unmanned ground vehicle (UGV) and unmanned aerial vehicle (UAV), both of which have been already tested in broad scale and the real environment. Thus, most researchers turn to use small USVs to verify the performance of intelligent ships on a small scale and deduce the performance to a large scale. Most of the test ships are built with a particular design, which leads to less referable for generalships.
The pressure of the environment protection and finance expectations on real ships make the intelligent ship a trend and accelerate its realization process. Ships, especially cargo ships, need to reduce crew numbers to cut operating expenditure to gain more profits. Energy conservation and environmental-friendly policy put much pressure on traditional ships (Blanco-Davis, Castillo Comas, & Zhou, 2014;Hekkenberg & Thill, 2014). Intelligent ship technology is considered to be a possible solution to these problems (Xu, Feng, Suli, Jialun, & Xinping, 2020). Several institutions and companies have made strategic plans and constructed testbed. In June 2017, the International Maritime Organization's (IMO) Maritime Safety Committee put forward the concept of Maritime Autonomous Surface Ships (MASS). Later in December 2018, the IMO defined the four degrees of MASS (IMO, 2018). In December 2018, Rolls-Royce and Finnish state-owned ferry operator Finferries had successfully demonstrated the world's first fully autonomous ferry in the archipelago south of the city of Turku (Jallal, 2018). In May 2017, Finland. Kongsberg and Yara plan to build YARA Birkeland as an autonomous zero-emission container vessel, which is to be launched in 2020 (Maritime, 2017).
The tasks of motion control have received significant attention for intelligent ships in the literature. According to Wang et al. 2019, ship motion control can be classified as speed control, course control, stabilization control, path following, and trajectory tracking. Primary functions for intelligent ships are course control and path following. PID and LOS are the fundamental algorithms that can be used in these procedures (Hinostroza, Soares, & Xu, 2018;Peimin, Huajun, & Xinchi, 2019;Yu et al., 2020). Moreover, algorithms like fuzzy logic control (Xiang, Yu, Lapierre, Zhang, & Zhang, 2018), predictive control (Li & Sun, 2011;C. Liu, Zheng, Negenborn, Chu, & Xie, 2019), sliding mode control (Z. Liu, Gu, & Gao, 2016;Zhou, Zhao, Feng, & Wu, 2020), artificial intelligence algorithms (Tuyen, Layek, Vien, & Chung, 2017), and their combinations (Cui, Osaki, & Matsubara, 2019;Fossen, Breivik, & Skjetne, 2003), etc. also improves the adaptability and achieves good results. Due to the difficulty in the implementation of intelligent ships with limited finance, this paper aims to introduce how to retrofit a traditional ship into an intelligent ship. The content is divided into six sections. Following this introduction of the research background. Section 2 shows the target 11-meter yacht to be retrofit and the test environment. Section 3 gives information about mechanical retrofit and hardware design. Section 4 presents the deployment of software and its functions. Section 5 introduces the functional testing of hardware and software after the retrofit. Section 6 concludes the existing problems in the retrofit process and discusses future work.

Particulars of the 11-meter yacht and the test area
The target vessel for retrofit is presented in Fig. 1. This vessel is an 11-meter full-scale yacht and is built of fibreglass. Its design speed is 28 knots. The main particularities are given in Table 1. The original vessel is equipped with 2 waterjet, 2 engines, and assorted structures. The control system is designed for crews to operate in ship bridge, where they can get surrounding information from sensors and vision. The existing sensors, show two engine rotation speed, mainly designed for engine monitoring in this ship. Other sensors, like RADAR, GNSS, and AIS, should be replaced to suit intelligent ships. The test area is shown in Fig 2, located in Tangxun Lake, Wuhan, Hubei province. The area for tests is more than 4 km^2, as shown in the red zone. In this zone, the water depth is deep enough to neglect the shallow-water effects. Furthermore, the wind and current influences during the test are marginal and could be neglected.

The structure of the whole retrofit
The original structure of this vessel is designed for crews to fulfil navigation tasks, which is not well adapted to unmanned ships. Thus, the base need for this case is to connect all the information and the control system through a "ship brain". To solve this problem, We designed a series of devices and marched structures for this case based on the structure of Navigation Brain System (NBS) (Yan, Ma, Liu, & Wang, 2019) and Guidance, Navigation, and Control system (GNC) (Fossen, 1995(Fossen, , 2011. All the related devices and structures can be divided into hardware structure with mechanical structure and software architecture. As shown in Fig. 3, the hardware structure consists of all the sensors, processors, and actuators. Nearly all the information is collected and transmitted through the network switch and handled by the processor. Different from the original ship, the structures of steering feedback and speed feedback are created to enhance the accuracy of control. The different sensors, whose protocols are different, can provide data by ethernet cables at the same time to meet the demand of data. These data are analysed with algorithms in the processor unit simultaneously. After that, the processor forms new control orders to actuators. The more detailed information about hardware structure and mechanical structure are presented in Section 4. For software architecture, it mainly programmed by Python in Mini-PC. This part is not only processing data with algorithms but also has the function of data display. The other parts, information collector and actuator, are programmed by C language in PLC. Fig. 4 presents the whole information flow, which consists of three parts: information collector, processor, and actuator. The primary information collector of sensors is made by their manufacturer, which is under the standard protocol for ships. The other data created not from common ship devices, like steering feedback, speed control feedback, and human operation (in Touch-screen), is collected by PLC, which has Modbus as a standard protocol to receive and send data bidirectionally between hardware and software. The algorithms contain data processing algorithms, control algorithms, actuator algorithms, and data display, which are the core of the whole software structure. These algorithms and display parts are programmed by Python mainly with data process programmed by C++ to ensure stability. The actuator part is hardware programming by C, which is designed for eliminating hardware errors. Apart from the steering system and engine system coded by C++, the communication system adds a 4G signal to transmit more information than the traditional system to other intelligent ships or the ground control station. More information about software architecture and functions can be seen in Section 5.

Mechanical retrofit and hardware design
The original yacht is designed for crews to do navigation tasks, the elementary functions of which are generally divided into route making and ship control. To replace the crew functions, some hardware with matched mechanical structures are added to make the yacht to be more automated even more intelligent to achieve autonomous navigation. According to the hardware structure and deployment in Fig.3 and Fig. 5, it consists of all the information collectors, processors, and actuators that are used in real-time navigation. The main units of sensors and processors are widely used in USVs; however, the control and feedback of the steering system and information on human operation are different, as mentioned before. The sensors and devices deployment is presented in Fig.5. The sensors are mainly located at the top and the head of the yacht, which are used to collect surrounding information. In the middle of the yacht, the original control board is newly designed to show data information from the processor in the pilot's cabin, and the operation mode is changed to suit the retrofit of speed control and steering control. The data collector and processor are placed under the main antennas for the convenient line routings and reducing signal loss. In the ship engine room, the retrofit part is designed with mechanical structures to control and get the feedbacks of the engine, steering, and waterjet propellers.
The whole structure can be divided into three parts in a generalship, including the guidance system, navigation system, and control system, according to Fossen's theory (Fossen, 2011). In this yacht, the control system includes a propulsion system and a steering system, the navigation system includes all sensors, the guidance system mainly consists of a computer with the main software on it.

Guidance system
The guidance system is described to generate a reference trajectory for time-varying trajectory tracking or a path for time-invariant path following (Fossen, 2011). Nearly all these functions are achieved mainly by software on a high-performance computer. This computer has I5 8250u CPU, 16G memories, and 256G SSD, which can process large amounts of data simultaneously. And this computer case is designed for a multilingual interface with compact space, as shown in Fig. 3. In this study, the main algorithm is realized by Python 3.6, with part data procession in C++. The detailed information is shown in section 5.

Navigation system
This system consists of all information collectors, as presented in Fig.4. The sensors and human operation collector are discussed in this section. The part of the control feedback is discussed in the next part due to the structural integrity of the control actuator. The main types of sensors in this ship is presented in The RADAR is the most common sensor in environment data collection. For large ships, several wavebands RADAR are installed as required for their different detection ability at different distances. In this case, the original yacht is supposed to equip with RADAR to detect long-distance objects and human vision to detect short-distance objects. After the retrofit, this human function is replaced by lidar, which can even measure the distance (Halterman & Bruch, 2010). The position of these two sensors is critical due to their disadvantages in range and accuracy. For this ship, the consideration of ship length and ship speed play an essential role in the lidar position. It has a 10m long ship body with designed 28kn, and the lidar is only a 100m detection range, which means it has 7 seconds to avoid obstacles in a short distance. To get better detection scope, the lidar is placed on the head of the ship, which can provide more reaction time when detecting an obstacle.
The position of RADAR and lidar is shown in Fig.5 and Fig.6. When the RADAR detects obstacles firstly, obstacle avoidance function begins to work. And lidar is an auxiliary method to judge whether the distance is too close to implementing an emergency strategy. As shown in Fig.7, the limited optical keep out zone make it difficult to detect the ship sides when placing lidar on the top, which is dangerous for collision detection. The head position of lidar helps detect the front hull. Another consideration is docking and undocking, placing the lidar on the head still can have adequate distance information in the docking process.  Different from single GPS, the differential GPS can get more accurate location information. With the help of dual-antenna, it can provide the ground speed and ship course when navigation. The camera device can record the vision information and judge the ship types like a human. The 4G router, from Huawei, is the basic communication part for remote control. In this case, the test water area has a strong 4G signal, which can realize the information exchange with other ships or ground control station.
All these data are high-frequency, and some of the data are even very huge. The sample rate of these sensors is set to 0.1s. They are collected by computer through network cable and switch. Other fewer frequency signals contain control orders and human operation orders, are collected by the programmable logic controller (PLC). PLC is widely used in industrial control due to its stability and applicability. There is an industrial control box with S7-200 placed in the middle of the yacht as shown in Fig.5 and Fig.8. The box consists of a PLC with an expansion module for analogue and digital data input and output, 10 circuit breakers for steering control and engine control, and a transformer for power supply. In this retrofit process, it is not able to realize the unmanned ship for the sake of safety. Crews on the ship need to look out and operate the ship if there is an emergency. As is shown in Fig.9, the control table, which has two modes for manned and unmanned, is considered. By using indicator lights, knobs, and touch-screen, the manned mode and the switching function are realized by press the real button or touch the button on touchscreen. The steering wheel can work in both modes, so the operator can make a quick switch and drive the ship when there is any danger.

Control system
The control system consists of two parts: a propulsion system and a steering system, which is designed for real ships. This is the most challenging point in this retrofit case. Based on the experience before, the main solution is to use electronic signals to control mechanical structures. To improve control accuracy, these mechanical structures are supposed to have feedbacks to form closed-loop control.
In the propulsion system, two diesel engines and a waterjet structure are seen in Fig.3 and Fig.12. This yacht has waterjet propulsion whose power is provided by two diesel engines: each diesel engine has 154kW rated power and 3500r/min in rated power. In this case, speed changing is considered to be controlled by pushrod electrical motor with a potentiometer in the front cabin in Fig.10, which can avoid more structural changes in the main cabin. The solenoid valve provides hydraulic pressure to control the steering angle. The ground speed is measured by the differential GPS to make sure the order of speed is executed. The signals of pushrod electrical motor with a potentiometer and the solenoid valve, which contains analogue data and digital data, are collected by the PLC.
In the steering system, the steering angle is controlled by the waterjet pipe angle through electro-hydraulic pressure and mechanical hydraulic pressure. Another control formation is the structure of the reversing bucket in Fig. 11, which can change the waterjet direction. Similar to the propulsion system, the retrofit of the steering system uses the solenoid valve to control the steering angle with an electronic ruler as a measurement. The status of the reversing bucket is determined by a hydraulic machinery system. With the help of control feedbacks of speed and steering angle, the control accuracy is improved. Furthermore, with the help of the PID and LOS algorithms, this ship can implement more navigation tasks as an intelligent ship.

Software deployment and functions
Besides the added mechanical structures and hardware devices, the software is even more important to realize functions. It is the carrier of all algorithms, which needs as highest performance as possible. In Fig. 3 and Fig.5 show it is deployed in a mini-PC and located in the middle ship. The language of software is mainly Python and some data collection program in C++. Besides the function shown in Fig.4, the software contains human-computer interaction by Qt5 as shown in Fig.13. This interface presents all the collected data and gives information on ship control mode. The designed models are Local Manual, Remote Manual, Local Command, Remote Command, Local Auto, Remote Auto, Fast-time, Real-time, Parallel, and Manoeuvre. Firstly, Local Mode is the most basic model which can help to complete other modes. In this mode, operators can give specific order of speed or steering angle by this display, and all information is updated in real-time. The preliminary tests about manoeuvrability can carry out. Other modes, for example, Remote control, just need to add some modules like communication functions. Figure 13 shows the display of Local Mode, where there is a data display on the left and environment map on the right. Another completed mode is the remote control, and the operator can drive this ship by giving specific orders or targets in a remote computer through the Internet.
All these modes are built based on algorithms. For basic needs, only preliminary algorithms are introduced into this software at the first stage. In this case, the algorithms of control, the proportional-integral-derivative controller (PID) and line-of-sight (LOS) are put into use. Figure 12 presents the structure of the path following in this study. Firstly, the designed route is made by humans according to the map. Then, the LOS algorithm can receive a series of waypoints separated by the real map and give a designed heading angle. For the PID algorithm, it compares the designed and real heading angle and gives a certain steering angle. The environment and uncertainty of the ship model are roughly considered by the stability of structure and algorithms, and the real experiments. The calculation of parameters in PID and LOS are suggested in (Moreira, Fossen, & Guedes Soares, 2007).

Line of sight algorithm
As shown in Fig 14, is the current ship position. The designed waypoints are . is heading angle.
is a lateral tracking error. To follow the path , a LOS circle is designed to find an intersection point . The target ship can change the steering angle to follow to achieve the path following. According to the geometric structure, the LOS formula can be concluded in (1). When target ship is getting close to the waypoint and the distance is less than , the target point is changed to .
After the ship gets into acceptance circle of , LOS angle is supposed to change sharply. To smooth this angle and improve the tracking accuracy, a self-adaption LOS algorithm is put forward in (2). This algorithm can automatically match the best acceptance circle radius according to the . Where and are the minimum radius and maximum radius of the acceptance circle. l is a dimensionless parameter that can be calculated through real experiments.

PID algorithm
Based on designed waypoints and current position, LOS algorithm can give a suitable heading angle for heading control. To overcome the uncertainty and disturbance of heading control, a PID-controller (Fossen et al., 2003) is put into used as: Where is the heading error, is the current heading angle generated by compass. are PID parameters and can be obtained through pole placement in terms of design parameters.

Field experiments
This section introduces some tests of the intelligent ship in basic functions, which is divided into three parts: hardware test, software test, and combined test. The core of the test is to find the shortcomings and test the performance to implement intelligent under security. Like traditional ships, the test of hardware is designed to work without advanced algorithms, which could ensure the stability and safety of the whole ship. The specific test items of all sensors and devices are classified by the function of the propulsion system, steering system, sensors, and other information collectors. Table 3 shows the primary checks off all the hardware and its systems. Besides the regular test like a traditional ship, the added intelligent functions need to be checked carefully. This part is a lack of existing inspecting methods, which may lead to uncertainty for safety. The switch of auto control and human control is considered the most important function to be checked in case of any emergency in this study. Table 3 The test lists of hardware.  Table 3, some of the tests need collaborative work with software. So, the software of the information collector and actuator can be checked in this part. Besides that, other software tests mainly contain algorithms and display functions. Firstly, the existing ship motion model is used to verify the algorithm functionality in a virtual environment with the data transmission process simulated by KEPserver EX6. This procedure can test all the functions on Min-PC without hardware.

Part
Finally, all hardware and software function is combined to test in real navigation environment. Crews and technicians are suggested to keep in watching in the first tests until all structures are in stable use. After that, the basic tests of zigzag and turning-circle, used for testing ship manoeuvrability, are conducted. These performance tests can lead to figuring out the ship model.
As shown in Fig 15, this is a path following test in the real situation, where the red line represents the designed path, and the blue line shows the actual path. This map also shows the GPS coordinates of the start point and detection area of the test vessel. The speed is service speed, and the steering angle order is generated through real-time computing by PID and LOS algorithms. Finally, with the help of hardware and software structure, heading control, course keeping, and path following are realized.

Conclusions
This paper introduces the retrofit of an 11-meter yacht, including hardware and software. Accordingly, test plans and procedures are provided. Conclusions are drawn through this study：The retrofit of an existing ship can be accomplished when only considering the ship's control. With the help of new types of equipment in hardware, it is easy to retrofit the propulsion system and steering system to achieve control functions. After the retrofit, some functions like path following can be achieved. Based on these functions, more complex functions like remote control can realize in preliminary ways.
Work to be solved in the future are summarized as follows: The accuracy of control is hard to improve due to uncertainties such as an analogue of switches, empty stroke caused by mechanical transformation, and imprecision of algorithms. It is hard to get an accuracy motion model for an atypical ship, which makes it more difficult to check its manoeuvrability and design a suitable control strategy. The existing sensors provide a solid foundation for the planned tests. It is concerned that the effective information we get is much less than the raw data, which means how to obtain more effective information is challenging.