A Model-Driven Realization of AUV Controllers Based on the MDA/MBSE Approach

,


Introduction
Autonomous underwater vehicles (AUVs) are increasingly developed and used for the study of oceans to enhance the effectiveness of civil society in economic as well as in other naval facilities, e.g., the biological discovery of ocean resources, disaster and tsunami warnings, and self-operated underwater military means [1][2][3][4][5][6].
Up to date, many control applications of AUVs have been implemented by the traditional guidance, navigation, and control approach combined with soft-computing methods [7][8][9][10][11][12][13][14] to closely deal with their dynamic models for control. For example, Rodriguez et al. [15] introduced a design model of adaptive sliding mode control (SMC) for a micro-AUV to reject bounded perturbations, where the finite-time convergence using the control Lyapunov function (CLF) was performed.
is proposed control allowed achieving low-level tasks such as velocity control and regulation, as well as high-level tasks such as autonomous path-following using waypoints (WP). A robust adaptive integral SMC technique has also been developed by Yan et al. [16] for the trajectory tracking control of underactuated AUVs in the 5 degrees of freedom (DoF), where the vehicle dynamics were unknown and also subjected to environmental disturbances. e dual closed-loop control design in this study ensures that the vehicle's dynamics are all consistent with the reference "state-space" trajectory including the time evolutions of position and attitude, as well as velocities. A hierarchical robust nonlinear (HRN) controller was designed by Karkoub et al. [17] for the horizontal planar trajectory tracking of an AUV subject to uncertainties (e.g., current disturbances, unmodeled dynamics, and parameter variations); in this study, the proposed HRN controller was used with the integral backstepping (IB) and SMC techniques enclosed with the control Lyapunov function (CLF). e robustness of the proposed HRN controller was then verified through injection of random uncertainties into the system model, and the closed-loop stability of the proposed individual subsystems was, respectively, guaranteed to have uniformly ultimately bounded performance. Furthermore, both extended Kalman filter (EKF) and unscented Kalman filter (UKF) algorithms have been experimentally evaluated offline by means of sea navigation tests performed by [18,19] for estimating the dynamic behavior of the AUV and improving the performance of the navigation system for the vehicle.
Besides, the low development costs must be taken into account in the application construction. us, the reusability is also needed to be considered in the new development lifecycle of various AUV applications. According to the Object Management Group (OMG) [20], the Unified Modeling Language (UML) has been standardized for analyzing and designing system components visually in the software industry. In addition, the System Modeling Language (SysML) [21] is a UML profile for systems engineering that has also been standardized by the OMG. SysML is used for the analysis, design, verification, and validation of industrial systems in various domains. Nevertheless, both UML and SysML lack the constructs for modeling precisely timing and communication evolutions between the control objects for real-time and embedded systems, e.g., the AUV controller. Furthermore, OMG has also standardized the model-driven architecture (MDA) [22] whose main idea is to separate the specification of system operations from the details of the way that system uses the capabilities of its platform. MDA supports a framework for and enables tools to be provided for specifying a system independently of the platform that supports it; specifying platforms; choosing a particular platform for the system; and transforming the system specification into one for a particular platform. On the contrary, the model-based systems engineering (MBSE) has been formalized by INCOSE [23][24][25] to support the modeling of system requirements, design, analysis, verification, and validation of artifacts in the development lifecycle of complex systems.
us, MDA defines a general system approach, which focuses on the use of rigorous visual modeling techniques throughout the whole of development lifecycle and provides a skeletal solution, whose details can be the MBSE specialization to systems engineering applications. e foundation of MDA actually enables the Unified Architecture Framework (UAF) [26], which can evolve to meet future needs as the leverage cross-industry and standards-based approaches (e.g., UML/SysML), to enhance tool and architecture data interoperability. is provides a means to develop an understanding of the complex relationships that exist between organizations, systems, and systems-ofsystems and can permit the analysis of these systems to ensure that they meet the expectations of the user community. e applications of real-time UML/SysML and model-driven techniques for the implementation of industrial control systems can be found in [27][28][29][30][31][32][33][34]. e above considered points have inspired us to find a specialization of the MDA/MBSE features together with the real-time UML/SysML [21,[35][36][37], which can be used to systematically model the analysis, design, and implementation of artifacts for developing an AUV controller. In this study, the AUV dynamics for control are specified for the requirement inputs that are then implemented with the specialization of MDA/MBSE features composed of the computation independent model (CIM), platform-independent model (PIM), and platform-specific model (PSM). Here, the CIM consists of the use-case model defined closely with an implemented function block diagram, the supplemented EKF/UKF algorithms, and the hybrid automata (HA) features to depict in detail the analysis phase for an AUV controller; the PIM is designed from the defined CIM by specifying the real-time UML/SysML to capture the real-time control capsules with their ports, protocols, and their intercommunication evolutions in detail for AUV controllers. e designed PIM elements are then transformed into PSMs by open-source platforms such as Arduino [38] in order to rapidly implement the AUV controller. Finally, a horizontal planar trajectorytracking controller of an application of a miniature AUV possessing a torpedo shape was completely deployed and tested. In this work, we followed the method of Hien et al. [39], presenting an object-oriented systems engineering viewpoint for controllers of micro-unmanned aerial vehicles. e main contributions of this paper can be summarized as follows: (1) e MDA/MBSE approach, in combination with the real-time UML/SysML, implemented functional block diagram, EKF/UKF algorithms, and hybrid automata, is specialized to intensively develop the AUV controller (2) e rule specializations permit the main designed control capsules to be customized and reused for various AUV types (3) A planar trajectory-tracking controller of a low-cost torpedo-shaped AUV is developed and tested e paper is structured as follows: the AUV dynamics and control structure are introduced in the second section. e third section presents the details of MDA/MBSE-driven development to intensively realize AUV controllers, including the CIM, PIM, and PSM components. Following this proposed model, in the fourth section, it is applied to a case study of a miniature AUV possessing a torpedo shape. Conclusion and future work are reported in the final section.

Modeling the AUV Dynamics for Control.
e six motions of an underwater vehicle defined as surge, sway, heave, roll, pitch, and yaw [40] are shown in Table 1.
From the large field of guidance, navigation, and control of underwater vehicles [4,31,[41][42][43][44][45], the 6-degree-offreedom (DoF) models in the body frame considered in this study use the following representation: T are vectors of position/Euler RPY angles and linear/angular velocities, respectively: T ; the model matrices M, C(ν), and D(ν) denote inertia, Coriolis, and damping, respectively, while g(η) is a vector of generalized gravitational and buoyancy forces. Similarly, τ(v, u) is the vector of resultant force and moment acting on the underwater vehicle, and u is the control input.
A model of state-space discreteness is needed to model the control evolution of the AUV that is used to estimate the motion states of the vehicle by using digital filters, e.g., the EKF and UKF; the control evolution of the system can then be written by the following equation: Here, x � η v ; x k is the vector of state variables at the k th instant of x; u k and y k are, respectively, the inputs and outputs of the system; h k , w k , and v k are, respectively, the measurement function, additive process, and measurement noise.
According to AUV dynamic model (1) together with the following assumptions, the lateral and the vertical motions are ignored because we are only interested in developing the AUV possessing a torpedo shape in this study, the AUV dynamics can only be considered on the longitudinal direction; the timing evolution of control is then rewritten by the following equation:

Specifying the Control Structure of an AUV.
ere are three main systems within the physical structure of AUVs as follows: the guidance system is used for providing the desired path for the AUV to track; the navigation system is responsible for executing an estimation of the current state of the AUV; and the control system is used for calculating and applying the control forces and moments to conduct this AUV.
ese subsystems have themselves missions to be accomplished yet must also have to cooperatively operate for allowing an AUV to fulfill its tasks even in the presence of unknown environmental disturbances. Figure 1 shows a general block definition diagram in SysML, which captures how these subsystems interact.
In addition, the problem of control design for AUVs is equally challenging because the controllers are tightly linked with the AUV dynamics. Hence, these control systems of AUVs must take into account evolution models combined with discrete events and continuous behaviors that can be called hybrid dynamic systems (HDS) [46,47]. Besides, controlled systems do not always have the same behavior because they are associated with validity hypotheses to check at any moment; the security requirement forces to envisage events and behaviors different from nominal behaviors. Hence, the behaviors of such systems are complex and can be modeled by HA [48]. In this study, we are interested in implementing the horizontal planar trajectory-tracking controller of AUVs, so this hybrid dynamic model can be used to find out the control algorithms combined with a specific guidance law such as the line-of-sight (LOS) guidance implemented in [49][50][51].

MDA/MBSE-Driven Development for AUV Controllers
As previously stated, the CIM, PIM, and PSM components of MDA/MBSE combined with the real-time UML/SysML [21,[35][36][37] are specialized for analyzing and designing in detail control components of complex control systems, e.g., the AUV controller. Following the above described AUV dynamics and general control structures and real-time UML/SysML specifications, we specialize in detail the MDA/ MBSE approach for deploying the AUV controller that consists of the 3 models as follows, CIM, PIM, and PSM, to separate the specification of the operation of the system from the details of the way that system uses the capabilities of its platform. All artifacts and activities in the CIM, PIM, and PSM for an AUV controller will be given in detail in the next sections.

Defining the Computation Independent Model (CIM) for an AUV Controller.
Following the AUV dynamics and control structure adapted in the second section together with LOS guidance [49][50][51], we present here the main use-case model ( Figure 2) of AUV controllers combined with an example of trajectory-tracking scenarios and local state machine of the "track a desired trajectory" use case, which Surge are, respectively, shown in Figures 3(a) and 3(b). In the usecase model, it is necessary to set up industrial maneuvering constraints, e.g., the maximum swing angles of rudders, velocity, and submersing depth of the AUV in order to closely ensure the system safety. In Figure 2, (i) MDS is the measurement-cum-display system consisting of the guidance and navigation systems because both of them essentially act as a signal supplier for the controllers of the AUV (ii) MES is the marine environment system including disturbances such as the wind, waves, and ocean currents (iii) e "track a desired trajectory" use case is performed for tracking the desired trajectory for the vehicle to follow (iv) e "ensure safety" use case is realized for maintaining system safety when one of its component fails or supplied power is low or when the weather is bad (v) e "configure" use case permits users or maintainers to configure and update control parameters for starting up the controllers (vi) e "maintain" use case is performed for maintaining the whole system that includes activities, e.g., the error identifications and corrections of the whole of physical AUV or periodical maintenance In addition, an implementing functional block diagram must be built for modeling continuous dynamics of the AUV controller because the real-time UML/SysML lacks the constructs for depicting internal continuous models for each state on the state machine diagram. us, we propose an  implemented functional block diagram to gather the internal continuous behaviors of the AUV controller as shown in Figure 4.
In Figure 4, (i) Desired trajectory and depth are events, which are used for providing, respectively, the desired position and depth to the control blocks of positions and depths (ii) Ω di , i � 1, n, are desired rotational speeds, which are applied to the n actuators installed on the AUV, e.g., the blocks of motor control for the propellers and rudders (iii) ΣT and τ ϕ, θ, Ψ are the overall output forces and moments acting on the actuators of the AUV In this study, the integral backstepping (IB) methods of control enclosed with the CLF [42,45,52] are also applied to the control blocks of depth, position, and attitude for the AUV. e discrete state-space models in equations (2)  AUV controller x, y  e standard navigation filters are based on the EKF or UKF [19,53,54] algorithms. e application details of EKF/UKF algorithms for an AUV controller will be presented in the fourth section.
In the CIM, hybrid automata (HA) are specified to present the mathematical implementation model of the AUV controller consisting of terms such as the situations, continuous state variables, event, transition, global continuous behavior, and invariants. A HA of the AUV controller (H AUV ) is established by data as follows: Here, Q is a set of operation modes called the situations of H AUV , e.g., the modes of idle, transferring, submerging, and rising; q o ∈ Q is the initial situation; X is the continuous state space of continuous elements of the AUV, e.g., the control blocks of motor, position, and depth; xco is the initial value of this space; is a set of external interacting events for triggering from the current situation to the reached situation, which is issued from the guidance and navigation systems and environmental disturbances for the AUV controller; A is a set of transitions between the situations that are linked to the appropriate events σ ∈ ; Inv is called the invariant term of the situation for verifying when the situation is q, the continuous state must then be x c ∈ inv(q); and F is the global continuous models issued from by 6-DoF dynamic model (1) and the implemented functional block diagram ( Figure 4); the global evolution of continuous state is performed when a new situation is reached in the operation modes of the AUV. e detail of HA specialization and its realization hypotheses for the AUV controller can be seen in the authors' report [55].

3.2.
Designing the Platform-Independent Model (PIM) for an AUV Controller. From the above defined CIM, the 5 main control capsules have been specialized to participate in the HA evolution of the AUV controller: the continuous part's capsule, discrete part's capsule, internal interface's capsule, external interface's capsule, and instantaneous global continuous behavior (IGCB's capsule). Figures 5 and 6 show the capsules' collaboration of the real-time communication pattern for the AUV controller by using the real-time UML collaboration and sequence diagrams.
Here, the discrete part's capsule consists of the situations Q and transitions A in HA of the AUV controller; the continuous part's capsule contains the continuous statespace X; the IGCB's capsule builds up concrete global continuous behaviors as f ∈ F, f is derived from equations (1) and (2) and the implemented functional block diagram (Figure 4), and the EKF/UKF algorithm can be implemented in f for estimating the values of position, depth, attitude, and velocity of the AUV; the internal interface's capsule permits the Inv tool to generate internal events in the HA evolution; and the external interface's capsule is an intermediary, which receives or sends episodic events and periodic signals between the AUV controller and its interacting systems such as MES and MDS. e timing concurrency of evolutions for the above capsules' collaboration of the real-time communication pattern has been described in detail in the authors' reports [31,55]. In addition, the reusability is very important to implement controllers for various AUV types because it allows reducing the cost of application deployments. e specializations, which permit the capsule collaboration of a developed AUV to be customizable and reusable in the new control application for various AUV types, can be summarized in Table 2.

Implementing the Platform-Specific Model (PSM) for an AUV Controller.
To carry out the AUV controller, the PIM is implemented to the PSM that is transformed from the above built PIM by using tools such as IBM Rational Rose  RealTime or IBM Rational Software Architect RealTime [56] or Papyrus for Real Time (Papyrus-RT) [57]. Here, IBM Rational's leading role in defining the real-time UML is widely acknowledged as it is the preeminence of the IBM Rational Rose RealTime or IBM Rational Software Architect RealTime products for supporting the real-time UML design of industrial software systems. It combines a rich modeling environment with a code-oriented tool set to make up a comprehensive practitioner desktop for creating solutions in a variety of architectural styles and targeted at specific runtime infrastructures. Besides, Papyrus-RT is an industrial-grade, complete open-source modeling environment for the development of complex, software-intensive, realtime, embedded, cyber-physical systems; it provides an implementation of the real-time UML together with editors, code generator for C++, and a supporting runtime system. Many other important lifecycle artifacts also benefit from these tools (e.g., requirement lists, test cases, and build scripts) to entirely cover development phases for the AUV controller. Hence, the above designed PIM can be subsequently transformed into the PSM (i.e., the realization model) by using various object-oriented implementation development environments (IDEs) in order to entirely deploy the AUV controller with compatible embedded microcontrollers. In fact, this transformation model is quickly performed through the round-trip engineering (i.e., the forward and reverse engineering) of intermediate programming codes, e.g., the C++ codes, which are issued from the design models depicted in IBM Rational Rose RealTime or IBM Rational Software Architect RealTime or Papyrus-RT tools. Furthermore, the above defined HA can be automatically implemented by using the state pattern described in [58,59]. e state pattern is in either of the following cases: (i) an object's behavior depends on its state, and it must change its behavior at runtime depending on that state. (ii) Operations have large, multipart conditional statements that depend on the object's state.
is state is usually represented by one or more enumerated constants. Often, several operations will contain this same conditional structure. e state pattern puts each branch of the conditional in a separate class. is lets us treat the object's state as an object in its own right that can vary independently from other objects. Following this pattern, an implementation structure of HA is specified as shown in Figure 7 to improve the evolution of the AUV controller.

Journal of Advanced Transportation
Here, software tools such as IBM Rational Rose RealTime or IBM Rational Software Architect RealTime or Papyrus-RT can support multiple transformations between design models and various object-oriented programming languages.

An Application
Based on the above proposed hybrid control model, we deployed a horizontal planar trajectory-tracking controller, which permits a miniature AUV (M-AUV) possessing a Continuous part e ports and protocols of this capsule are not changed in the overall design for the new AUV controller e continuous part's capsule is specialized by supplementing or cutting down continuous components (x c ∈ X) that depend on the physical actuators installed on the new AUV. e states and their behaviors, which correspond to the supplemented/ cut down continuous elements, are supplemented/cut down in/from the state machine of this capsule. e behavior of the new set of continuous elements will be used to redefine the concrete IGCBs (f ∈ F). External interface e state machine, ports, and protocols of this capsule are not changed in the overall design for the new AUV controller e external interface's capsule is specialized by supplementing or cutting down input or output events, which are issued from outside (i.e., supplementing/cutting down these events in/from its protocols) e communication pattern shown in Figures 5 and 6 is not changed in the overall design for new controllers of various AUV types.

HA_Q_AUV
-itsState or -situation State  torpedo shape with the small navigation bridge (Figure 8) to reach and follow a desired horizontal planar trajectory. e main operational parameters of the M-AUV are summarized in Table 3.
In the case study, the M-AUV dynamic model described in equation (1) is used with the following assumptions: the damping matrix is assumed as a diagonal matrix, which permits the coupling between dissipative effects to be neglected because the velocities of the M-AUV are not too high; the mass matrix is considered as diagonal that is derived from the body reference frame aligning with the vehicle principal axes of inertia for the M-AUV. e state-space models described in equations (2) and (3) are implemented for estimating the position, depth, attitude, and velocity corresponding to the sensors installed on the M-AUV, such as the inertial measurement unit (IMU): MPU6000 with working frequency 100 Hz [60] and GPS: Ublox Neo 6M with working frequency 10 Hz [61]. ese state estimations and predictions are implemented in the two cases by the navigation filters based on the EKF (Algorithm 1) and the UKF (Algorithm 2). In Algorithms 1 and 2,. denotes an estimate; P is the state covariance; Q and R are, respectively, the covariance matrices of process and measurement noise, assumed as zero-mean stationary white noises with zero cross-correlation; the state is recursively estimated starting from the assumed initial conditions as follows: x 0/0 � x 0 and P 0/0 � 0 12×12 . e unscented transform (UT) is a deterministic sampling technique, which allows us to compute the mean and the covariance matrix of a random variable; it undergoes a generic nonlinear transformation by propagating a minimum set of its samples and exploiting the knowledge of the mean and the covariance of the starting variable.
In this case study, ATMEGA32-U2 and STM32-Cortex-M4 microcontrollers [38] have been used on the main board, and the control program is installed based on C++ language. An example of instantiation and use of the generic HA classes based on the above-specified state pattern (Figure 7) is implemented as Figure 9 for the idle/transferring state pair of the M-AUV controller. e experimental scenarios of the M-AUV controller were based on various desired course angles and shapebased planar trajectories and mean transferring speeds that were performed on Ho Tien basin at Hanoi University of Science and Technology, Hanoi, Vietnam (Figure 8). Table 4 illustrates the main obtained test results for the course tracking of the M-AUV. Figures 10(a) and 10(b), respectively, indicate the horizontal planar trajectory-tracking controller with the EKF and UKF algorithms that permits the M-AUV to reach and follow the desired rectangleshaped trajectory. Table 5 is the comparison of root mean square (RMS) and peak values for the path tracking error between the two cases using the EKF and UKF algorithms.  ese values are carried out for the five paths generated by waypoints (WPs) as follows: WP0-WP1, WP1-WP2, WP2-WP3, WP3-WP4, and WP4-WP0. By comparing the RMS and peak values of the path tracking error, it is shown that the trajectory error is lower if the UKF algorithm is applied.
Based on the comparison between the above obtained experimental data and the experimental data of the existing results in [62] (the thesis has been supervised by the author) in which PID was only implemented as the control law for the same physical AUV model, the horizontal planar trajectory-tracking controller of this M-AUV was improved on the stabilized course duration and trajectory error. Following these obtained trial test results (Tables 4 and 5), we can find that the UKF could provide considered improvement over the EKF in the control implementation for AUV controllers. In fact, the EKF has been widely accepted as a standard tool in the control and machine learning communities. In this work, we used the UKF, which addresses many of the approximation issues of the EKF. e UKF consistently performs equally to or better than the EKF at comparable levels of complexity. e performance benefits of UKF-based algorithms have been shown in a number of application domains, including state estimation, dual estimation, and parameter estimation. e UKF can facilitate the accurate implementation of the optimal recursive estimation equations, although equations specifying the UKF may appear more complicated than those for the EKF algorithm.

Function EKF algorithm
Step EKF predict Data: ALGORITHM 1: Navigation filter based on EKF.

Function UKF algorithm
Step UKF predict Data: Step UKF update Data: x k|k−1 , P k|k−1 , h k (·) Result: x k|k , P k|k (y k|k−1 , S k , P xy k ) � UT(x k|k−1 , P k|k−1 , h k−1 (·)); S k � R k + S k ; L k � P xy k S −1 k ; e k � y k − y k|k−1 ; x k|k � x k|k−1 + L k e k ; P k|k � P k|k−1 − L k S k L T k ; end ALGORITHM 2: Navigation filter based on UKF.  The current state is also suppressed.

Conclusion and Future Work
e paper introduced a systems engineering-based implementation model to conveniently realize controllers for AUVs. is model is mainly based on the specializations of the MDA/MBSE approach combined with the real-time UML/SysML, EKF/UKF algorithms, and HA for analyzing, designing, and deploying closely AUV controllers. No single formalism or language of an engineering process can possibly capture all the knowledge and information needed to solve complex control systems such as the AUV controller. Hence, the AUV dynamics and control structure are adapted for the requirement analysis of control that are implemented by the specializations of MDA/MBSE features including the CIM, PIM, and PSM elements. In the CIM, the use-case model is clearly defined and is enclosed with the continuous behaviors, EKF/UKF algorithms, and HA in order to gather the control requirements for an AUV. e PIM is designed by specifying the real-time control capsules, ports, and protocols to obtain a real-time communication pattern for AUV controllers. is pattern can permit the designed PIM elements to be customizable and reusable in new application developments of various AUV types (Table 2). e PIM is then converted into the PSM through the round-trip engineering in order to entirely implement the AUV controller with compatible embedded microcontrollers. Following this proposed control model, a horizontal planar trajectorytracking controller of a low-cost AUV was developed and tested out ATMEGA U2 and STM32-Cortex-M4 microcontrollers.
Using the above-specified MDA/MBSE approach, engineering developers will be more capable to manage the system complexity through the visual component models and their model transformations, e.g., the model transformations were performed through the round-trip engineering of the intermediate C++ codes in the case study.
However, the real-time UML/SysML versions lack the constructs for modeling internal continuous behaviors for each state on the state machine diagram, and implemented functional block diagram must then be defined in the CIM to model continuous behaviors for the AUV controller with events issued from outside.
Finally, we applied the above specialized model just in the low-cost AUV controller and intended to implement it in the new control applications for the autonomous coordinated AUV. Eventually, if we get positive feedbacks, we will investigate in the application strategy to extend it more effectively in order to create cooperative controllers for balancing the search and target response in the coordinated team of an autonomous unmanned ship and various AUVs for ocean exploration.  Proportional-integral-derivative PIM: Platform-independent model PSM: Platform-specific model RPY: Roll, pitch, and yaw SMC: Sliding mode control SNAME: Society of Naval Architects and Marine Engineers UKF: Unscented Kalman filter UML: Unified Modeling Language WP: Waypoint.

Data Availability
No data were used to support this study.

Conflicts of Interest
e authors declare that they have no conflicts of interest.