ON INFORMATICS VISUALIZATION

A bstract — Maritime simulation systems provide opportunities to acquire technical, procedural, and operational skills without the risks and expenses associated with on-the-job training. Maritime simulation systems are tools used to simulate real-world scenarios for training and research purposes, in which they are used to train seafarers in a safe and controlled environment. These systems are used to simulate different scenarios, such as navigation, maneuvering, and ship handling. The simulation systems allow users to learn and practice different scenarios without exposing themselves to real-life risks. However, at the moment, Vietnam's maritime simulators are dependent on other nations, which results in a lack of technological autonomy, a lengthy transfer of technology, high expenses, and a reduction in national security. Therefore, there is a lot of interest in developing a domestic maritime simulation system. With a rotation angle of α = [α1 α2 α3]T from the PLC controlling the DC/Servo system, the motion platform of the marine simulation system is built on the Stewart platform design principle. Due to the use of conventional control methods, this system suffers from a time delay of up to 1200ms, which prevents it from reacting to real-time control. In this paper, we investigate a novel technique for controlling the dynamic model with three degrees of freedom (3 DOF) of a cockpit cabin deck using artificial neural networks. The findings demonstrate that the reaction to real-time control, rotation error, and drive/servo system movement are all greatly improved.


I. INTRODUCTION
Maritime simulation systems are tools used to simulate real-world scenarios for training and research purposes [1] [2]. These systems are used to simulate different scenarios, such as navigation, maneuvering, and ship handling. They are essential in training seafarers, ship pilots, and other personnel who work in the maritime industry [3]. The simulation systems allow users to learn and practice different scenarios without exposing themselves to real-life risks [4]. The use of maritime simulation systems has increased over the years due to advances in technology [5]. These systems have evolved from basic 2D simulators to complex 3D simulators that simulate various environments such as the cockpit cabin deck, engine room, and bridge. Traditional maritime simulation systems have limitations that make it difficult to simulate complex scenarios accurately [6]. These systems rely on predefined rules and data, which may not be accurate in real-life situations [7]. Another limitation of traditional maritime simulation systems is that they are not adaptive [8]. They cannot adjust to changes in the simulation environment, which may affect the accuracy of the simulation. The findings from the works are carried over into the article [9]- [11]. Based on the Stewart platform principle, the work developed a signal model for the Drive/Servo system to control the cockpit cabin deck with three degrees of freedom [9]. To operate the Drive/Servo combination with significant tracking errors, the host computer sends shake control signals (Roll , Pitch , and Heave z) over the Modbus TCP protocol to the PLC. Dang et al. [10] propose a fuzzy adaptive controller design for a class of networked control systems (NCS) with the presence of network induced delay, data packet dropout and unknown time-delay controlled plant. The mathematical model of Smith predictor, which is combined with fuzzy adaptive controller and fuzzy compensator time-delay, is designed to adjust online its parameters according to the changing of the system's output [12]. The results based on TrueTime Beta2.0 simulation platform demonstrate that our design significantly improves the response of system over unknown time-delay. Åström et al. [13] shows a closed-loopthree-loop control structure that is typical of modern simulation systems and employs a controller to address the issue of significant latency brought on by the use of CAN networks. PLC control in conjunction with control algorithms and forecasting techniques like load noise compensation and error prediction [14] [15]; however, the data from still contain some lags and inaccuracies [9], [10], [13]. In order to increase the system's response time, we directly concatenate the signal from the PLC controlling the Drive/Servo combination in this study and employ an artificial neural network of the MLP type. The organization of this paper is presented as follows: Section 2 describes the dynamic equations of the ship with 3 degrees of freedom (DOF). Section 3 will provide the AI algorithms for cockpit cabin deck control. The simulated results are stated in Section 4. Finally, a conclusion is given in Section 5.

II. MATERIALS AND METHOD
Ship dynamics is obtained by applying Newton's laws. The marine vehicle has 6 DOF since six independent coordinates are necessary to determine the spatial position and orientation of a rigid body. The six different motion components are called: surge, sway, heave, roll, pitch, and yaw. Accordingly, the most generally used notation for these quantities is x; y; z; ϕ; θ; and ψ: Figure 1 shows all six-coordinate definitions and the most generally adopted reference frame. The position and orientation of the ship are described relative to the inertial reference frame OE xEyEzE (Earth-fixed reference frame).
Excluding Surge (x), Sway (y), and Yaw (Ψ) motions, the 3-degrees-of-freedom model of motion is derived from the 6degrees-of-freedom model of motion [16] [17]. Figure 1 shows a ship's motion in the horizontal plane based on the Stewart platform's structure [18]. Drive/Servo controls three model directions: Roll ( ), Pitch ( ), and Heave (z). Thus, the position vector = [ z]T describes 3 states of the cockpit cabin deck. The equation describes the mathematical model that models the motion of a ship with three degrees of freedom as Equation (1).
Where: C( ) is the Coriolis matrix, D( ) is the oscillation matrix, and M is the matrix of moments. In details: Multi-Layer Perceptron (MLP) technology is a type of neural network that is used in machine learning [19]. An MLP normally consists of at least three layers of nodes, these being the input layer, a hidden layer, and an output layer. MLPs are composed of multiple layers of nodes, each of which performs a specific function [20]. The nodes in the input layer represent the input vector [21]. Each node in the hidden layer is connected to every node in the input layer and has an associated weight and bias [22]. The output layer produces the output vector. The nodes are connected by weights, which are adjusted during training to improve the accuracy of the network [23]. This is a completely black box model that accepts inputs and produces the desired output for the processing dataset. MLP technology has been used in various applications, such as image recognition, speech recognition, and natural language processing [24]. MLP is an effective method for condition prediction, prospective failure detection, and nonlinear identification [25]. The MLP structure is shown in Figure 2, where: P: input vector; Wi: weight matrix of i-th layer; S: number of rows, R: number of columns; bi: bias, ni: net input, ai: net output, fi: activation function.
While single-layer networks cannot be used to approximate mathematical functions, two-layer networks that use the identity function for the second layer and the sigmoid function for the first layer may [26]. In order to estimate the reference value for the Drive/Servo motor combination in this article, MLP is used. The neural network's output is in the form of Equation (5): With the input number chosen for network training The mean squared error vector is roughly represented by Equation (6): The three-layer M = 3 with 12x10x3 MLP network that has been chosen will produce accurate prediction results because it has 12 inputs, 10 hidden nodes, and 3 outputs. The rotation angle signal, position, angular speed, and length values are the six inputs that make up the input layer. Choose an additional 6 input layers going back in time (t-1) and forward (t-1). The output layer consists of three buttons that represent the three expected values of the rotation angle of the three servo motors: α = [α1 α2 α3]T to receive the floor's previous values for sliding in the horizontal, vertical, and vertical directions. The hidden layer will be chosen to have 12 nodes based on the network training procedure and results. According to this implementation, predictions and future forecasts are made in the range of 50 milliseconds to 1500 milliseconds using data from the present and the past. This relationship will be taught to the MPL neural network, and the outcomes after learning can be verified using another sample dataset (test file Backpropagation is used in the MLP network training technique. The back-propagation algorithm provides an effective and straightforward method for calculating the objective function's derivative with respect to weight and bias Equation 11 at various stages. As in the forward propagation Equation 9 and backpropagation formulae, the weights and biases are computed and modified at the k + 1st step (Equation 10). The error produced by the network, based on the percentage absolute error (APE) and the average percentage absolute error, is the condition for ending learning for the training process (MAPE) [27]. Following training, we move on to evaluate the network's error in order to select the most effective network for forecasting.

B. Building A Neural Network Using Matlab/Nntool
MLP technology has several advantages over traditional maritime simulation systems. One of the main advantages is that MLPs can learn from data and adjust to changes in the environment. This means that the simulation systems can adapt to changes in the environment, which can improve the accuracy of the simulation [28]. Another advantage of MLP technology is that it can simulate complex scenarios accurately. MLPs are capable of processing large amounts of data, which can be useful in simulating complex scenarios such as ship handling in adverse weather conditions [29]. Neural networks are computational models that are designed to simulate the behavior of the human brain [30]. These networks are composed of multiple layers of nodes, each of which performs a specific function [31] [32].
Network training process: The system configuration during network training includes input data from the roll, pitch, and height sensors of the suspended floor collected at the PLC [33]. These signals are transmitted to the PC/Matlab computer via the OPC tool module. In addition, the data of servo motor rotation angles are also collected by PLC and transferred to Matlab software as output data.
Execution process: The configuration of the system during operation includes input data which are signals from roll, pitch, and heave inclination calculated from the PC/Unity 3D simulation model provided by the PC/Unity computer. supplied to a PC/Matlab computer with the learned ANN/MLP module will provide as output the predicted servo motor rotational angle values [34]. The proposed structure to integrate the ANN module into the Platform control system is shown in Figure 3.
Data acquisition and direct control of the suspended floor is done through PLC; The supervisory control computer will communicate with the PLC through the OPC server module, this module provides data for the 3D simulation software and communicates with the Matlab software through the OPC toolbox [35]. The computer installs the Matlab/NN tool software, installs the ANN/MLP algorithm, performs network training and will receive input data from the platform, then executes the learned algorithm, and makes predictive decisions for the machine. computer so that the PLC controller makes handling situations earlier [36].
Time delay is a significant challenge in maritime simulation systems. Time delay refers to the delay between the input and output of the system, which can result in inaccurate simulations [37]. In maritime simulation systems, time delays can be caused by factors such as the ship's response time, communication delays, and processing delays. MLP technology can be used to mitigate the effects of time delay in maritime simulation systems [38]. By using MLP technology, maritime simulation systems can provide more accurate and realistic simulations, even in scenarios with significant time delays. KEPServerEX 5 is an OPC tool/OPC server that transfers network training data from a PLC into Matlab software. Excel processes the test data from the cockpit simulation (20,000 records). Signal samples from this data are chosen to reference times between 50 ms and 1500 ms. Figure 4 shows the developed neural network structure, which has 12 inputs, 10 hidden layers, and 3 output layers. Figures 5 and 6 display the network training outcomes. According to the results, the training error is less than 0.007 after 60,000 training cycles, which is better than the parameter of a trustworthy MLP network (0.01). The network model ( Figure 6) can be used to find fresh data after training.

C. Simulation
The model ship is a TT400 type, measuring 55 meters in length, 9.2 meters in width, 2.6 meters in the draft, and 429 tons in the payload. The data used for network training is fed from the PLC into the Matlab software using the OPC tool/OPC Server: KEPServerEX 5. there are 1207 records in the database of the cockpit simulation system of the tests. This data is selected to produce samples with reference signals at times of 50ms -1500ms. These 1207 records include the special motion states of the platform that occurred with 03 wave levels that are level 3, level 7, and level 9 according to the Beaufort scale within 03 wind directions and 03 movements (roll, pitch, heave) as shown in Figure 7 Figure 10 shows the simulation scenario of the ANN predictor. Accordingly, this simulation is performed in the following sequence: firstly, each movement is predicted; then for a mixed motion of all 3 movements when the ship is under the impact of waves. Figure 11 illustrates the actual tracking response characteristics without a neural network for the cockpit cabin deck rotation angles. Figure 12 shows the measured value from the 3D host computer, which includes the Roll ("phi from Sim") and the Pitch ("Beta from Sim"), and the heave ("Z from Sim"). The corresponding curves represent the value of the angles of the cockpit cabin deck. The motion response of the cockpit cabin deck always has a 500-1500 ms delay, according to the data above, along with numerous surveys and measurements, and the floor's maximum tracking margin has an error of roughly 12%. The difficulty of doing correct Feedforward stages leads to all of them approximating them as differentials, which explains why there is always a delay in the signal transmission from the host computer to the PLC. The MLP neural network's prediction of the signals, and z reduces error and reaction time dramatically. The real inaccuracy is less than 2%, and the reaction time is around 50ms late as Figure 12. However, the phase always exceeded the control signal of the dynamic model by up to 1200ms and the Drive/Servo control signal α = [α1 α2 α3]T was shown in Figure 13. Fig. 11 The actual tracking response characteristics without a neural network for the cockpit cabin deck rotation angles. However, the amplitudes of the output signals (horizontal shake, , vertical shake, , and heave, z) measured directly from the suspended platform do not fully capture the signals from the simulation system. There is a time when the noise pulse of the measured signal exceeds 5%.

IV. CONCLUSION
The use of multi-layer perceptron technology in maritime simulation systems has revolutionized the industry. MLPs are capable of simulating complex scenarios accurately and can adapt to changes in the environment. The use of MLP technology in maritime simulation systems has led to increased safety, efficiency, and cost savings in the industry. The cockpit cabin deck served as the target of this study's application of modern control algorithms (AI) in ship motion control. This study designed modern prediction in the form of an MLP artificial neural network using NNtool in Matlab/Simulink environment and OPC real-time tool. The MLP artificial neural network is built to predict the rotation angle of 03 suspended floor motion servomotors with a structure of 12 input layers, 10 hidden layers, and 3 output layers. The predictive controller has overcome the disadvantages of latency and improved the control quality to track in real-time the simulated signal to only about 50ms. This study has built a controller that tracks the motion signal ϕ, θ, z of the ship in 3D simulation by an accurate inverse kinematic model. The forward kinematics model applied to the Newton-Raphson algorithm was used to test the signal tracking response. The authors have also proposed the connection options between PLC and Drive, the method of designing control algorithms on PLC and Drive to improve the quality of control with simulated signals such as using methods such as Feedforward input, load noise compensation, and digital prediction. For detail, The MLP neural network's prediction of the signals, and z reduces error and reaction time dramatically. The study's results show how well the system responds to most training simulation settings, which highlights its early success.
ACKNOWLEDGMENT This research is funded by Vietnam Maritime University.