# A Water Tank Level Control System with Time Lag Using CGSA and Nonlinear Switch Decoration
## 1 Introduction  
Level control is commonly applied in large industrial automation production. In the shipping industry, the level control of various ship compartments plays a vital role in coordinating the safe navigation of ships, such as oil tanks, ballast tanks, and freshwater tanks. However, tank-level control systems are often subject to uncertainties such as time-varying state, non-linearity, and time lag. So many scholars have conducted a lot of research on this problem. [PERSON] et al. [1] and [PERSON] et al. [2] designed the water tank level controller based on the PID method, the simulation experiments showed that the PID controller has a better control performance. However, there is still the problem of complex parameter rectification to some extent. Thus, the idea of fuzzy logic and PID control worked together to solve the problem of parameter tuning [3, 4]. [PERSON] et al. [5] used the ant colony algorithm (ACO) to further optimize the fuzzy controller for the water tank. However, this type of intelligent algorithm is more complex and computationally intensive. [PERSON] et al. [6] proposed a sliding mode control theory. It is widely used in applications due to its robustness and simplicity. The water tank level controller designed based on the sliding mode control theory [7, 8, 9, 10] worked well. However, the discontinuous switching characteristics of the variable structure can cause jitter and vibration in the system. It reduces the service life of the pump and is not conducive to practical engineering applications. Therefore, it is necessary to design a simple tank level control system with the following characteristics. (1) Clear engineering implications and low calculation load. (2) Under the constraints of pump performance constraints, external environmental interference, and time lag, the controller should reduce energy loss and extend the service life of the pump while ensuring high control effects. So, we use a closed-loop gain-shaping algorithm (CGSA) to design the controller. The algorithm is simplified as an engineering application of robust control and has the advantages of a simple design process and obvious physical significance. [PERSON] et al. [11]proposed a new control scheme for industrial multiple-input multiple-output (MIMO) systems with a time lag using the CGSA method. [PERSON] et al. [12] used CGSA to design a robust PID fin control system to achieve ship rocking reduction control. [PERSON] et al. [13] designed a wireless network control system based on CGSA and verified its role in a ship course keeping control through a simulation platform. The non-linear modification technique adds a non-linear function component between the control input and the system model. It is often combined with CGSA algorithms to solve the issue of high energy consumption. The technique is widely used in various fields such as ship heading control [14; 15; 16; 17], track keeping [18; 19; 20], pressure control in insulated spaces [21], parameter identification of ship response models [22], tank level control [23; 24; 25; 26], etc. However, for tank level control, CGSA was modified by different functions, such as the arctan [23], sinusoidal function [24], and S function [25]. The control system was modified by the Gaussian function and applied to the control of liquid tanks of LNG vessels [26]. The above research results were searching for the effect of different nonlinear functions on the modification of the CGSA algorithm and applying them to different fields. In this paper, we propose a nonlinear switching theory to reduce its impact on the dynamic performance of the controller while ensuring the original decoration effect. Moreover, we introduce new evaluation metrics to analyze the effectiveness of the control system. The main contributions are listed by  
(1) We design a concise linear controller using a third-order closed-loop gain-shaping algorithm and modify the linear control law by a nonlinear switching modification technique based on the arcsine function.