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

Authors: Ngo Van Hien; Van-Thuan Truong; Ngoc-Tam Bui
Journal: Journal of Advanced Transportation
 (2020)

---

## Abstract

This paper introduces a model-driven control realization, which is based on the systems engineering concepts of the model-driven architecture (MDA)/model-based systems engineering (MBSE) approach combined with the real-time UML/SysML, extended/unscented Kalman filter (EKF/UKF) algorithms, and hybrid automata, in order to conveniently deploy controllers of autonomous underwater vehicles (AUVs). This model also creates a real-time communication pattern, which can permit the designed components to be customizable and reusable in new application developments of different AUV types. The paper brings out stepwise adapted AUV dynamics for control that are then combined with the specialization of MDA/MBSE features as follows: the computation independent model (CIM) is defined by the specification of the use-case model together with hybrid automata to gather the requirement analysis for control; the platform-independent model (PIM) is then designed by specializing the real-time UML/SysML’s features including main control capsules that depict structures and behaviors of controllers in detail; and the detailed PIM is subsequently converted into the platform-specific model (PSM) by object-oriented platforms to rapidly implement the AUV controller. Based on this proposed model, a horizontal planar trajectory-tracking controller was deployed and tested that permits a miniature AUV possessing a torpedo shape to reach and follow the desired horizontal planar trajectory.


---

## Body

## 1. 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–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–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. This 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. The 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). The 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. Thus, 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–25] to support the modeling of system requirements, design, analysis, verification, and validation of artifacts in the development lifecycle of complex systems. Thus, 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. The 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. This provides a means to develop an understanding of the complex relationships that exist between organizations, systems, and systems-of-systems and can permit the analysis of these systems to ensure that they meet the expectations of the user community. The applications of real-time UML/SysML and model-driven techniques for the implementation of industrial control systems can be found in [27–34].The above considered points have inspired us to find a specialization of the MDA/MBSE features together with the real-time UML/SysML [21, 35–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. The 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 trajectory-tracking 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. The main contributions of this paper can be summarized as follows:(1)
The 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)
The 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 testedThe paper is structured as follows: the AUV dynamics and control structure are introduced in the second section. The 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.


## 2. AUV Dynamics and Control Structure

### 2.1. Modeling the AUV Dynamics for Control

The six motions of an underwater vehicle defined as surge, sway, heave, roll, pitch, and yaw [40] are shown in Table 1.Table 1
SNAME notations for underwater vehicles.
Degree of freedomMotionsForce and momentLinear and angular velocityPosition and Euler angles1SurgeXUx2SwayYVy3HeaveZWz4RollKPϕ5PitchMQθ6YawNRψFrom the large field of guidance, navigation, and control of underwater vehicles [4, 31, 41–45], the 6-degree-of-freedom (DoF) models in the body frame considered in this study use the following representation:(1)η˙=Jη,Mv˙+Cvv+Dvv+gη=τv,u,where η=η1T,η2TT and v=v1T,v2TT are vectors of position/Euler RPY angles and linear/angular velocities, respectively: η1 = [x, y, z]T, η2 = [ϕ, θ, ψ]T, v1 = [u, v, w]T, and v2 = [p, q, r]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:(2)xk=fk−1xk−1,uk−1+wk−1,yk=hkxk+vk.Here,x=ηv; xk is the vector of state variables at the kth instant of x; uk and yk are, respectively, the inputs and outputs of the system; hk, wk, and vk 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:(3)x˙=η˙v˙=η˙=Jη2vM−1τv,u−Cvv−Dvv−gη+w.


### 2.2. Specifying the Control Structure of an AUV

There 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. These 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. Figure1 shows a general block definition diagram in SysML, which captures how these subsystems interact.Figure 1
Block definition diagram of autonomy architecture for an AUV.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–51].


## 2.1. Modeling the AUV Dynamics for Control

The six motions of an underwater vehicle defined as surge, sway, heave, roll, pitch, and yaw [40] are shown in Table 1.Table 1
SNAME notations for underwater vehicles.
Degree of freedomMotionsForce and momentLinear and angular velocityPosition and Euler angles1SurgeXUx2SwayYVy3HeaveZWz4RollKPϕ5PitchMQθ6YawNRψFrom the large field of guidance, navigation, and control of underwater vehicles [4, 31, 41–45], the 6-degree-of-freedom (DoF) models in the body frame considered in this study use the following representation:(1)η˙=Jη,Mv˙+Cvv+Dvv+gη=τv,u,where η=η1T,η2TT and v=v1T,v2TT are vectors of position/Euler RPY angles and linear/angular velocities, respectively: η1 = [x, y, z]T, η2 = [ϕ, θ, ψ]T, v1 = [u, v, w]T, and v2 = [p, q, r]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:(2)xk=fk−1xk−1,uk−1+wk−1,yk=hkxk+vk.Here,x=ηv; xk is the vector of state variables at the kth instant of x; uk and yk are, respectively, the inputs and outputs of the system; hk, wk, and vk 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:(3)x˙=η˙v˙=η˙=Jη2vM−1τv,u−Cvv−Dvv−gη+w.


## 2.2. Specifying the Control Structure of an AUV

There 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. These 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. Figure1 shows a general block definition diagram in SysML, which captures how these subsystems interact.Figure 1
Block definition diagram of autonomy architecture for an AUV.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–51].


## 3. 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–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.


### 3.1. 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–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 are, respectively, shown in Figures 3(a) and 3(b). In the use-case 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.Figure 2
Use-case diagram for capturing the main control requirements of the AUV.Figure 3
A desired trajectory-tracking scenario (a) and local state machine for performing the “track a desired trajectory” use case (b).
(a)(b)In Figure2,(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)
The “track a desired trajectory” use case is performed for tracking the desired trajectory for the vehicle to follow(iv)
The “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)
The “configure” use case permits users or maintainers to configure and update control parameters for starting up the controllers(vi)
The “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 maintenanceIn 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. Thus, we propose an implemented functional block diagram to gather the internal continuous behaviors of the AUV controller as shown in Figure4.Figure 4
Proposal of a functional block diagram for implementing the continuous behaviors of the AUV controller.In Figure4,(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 AUVIn 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. The discrete state-space models in equations (2) and (3) are implemented in the navigation system block for estimating the position, depth, attitude, and velocity corresponding to the sensors installed on the AUV. The standard navigation filters are based on the EKF or UKF [19, 53, 54] algorithms. The 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 (HAUV) is established by data as follows:(4)HAUV=Q,X,∑,A,Inv,F,q0,xc0.Here,Q is a set of operation modes called the situations of HAUV, e.g., the modes of idle, transferring, submerging, and rising; qo∈ 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 xc∈ 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. The 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). Figures5 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.Figure 5
Capsules’ collaboration of the real-time communication pattern for the AUV controller.Figure 6
Sequence diagram of the real-time communication pattern for the AUV controller.Here, the discrete part’s capsule consists of the situationsQ and transitions A in HA of the AUV controller; the continuous part’s capsule contains the continuous state-space 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.The 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. The 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.Table 2
Main control capsules of the PIM can be customized and reused in the new control application for various AUV types.
Designed control capsulesSpecialization rulesGeneric artifactsSpecialized artifactsDiscrete capsuleThe discrete part’s capsule is not changed in the overall design for the new AUV controllerNone.Continuous partThe ports and protocols of this capsule are not changed in the overall design for the new AUV controllerThe continuous part’s capsule is specialized by supplementing or cutting down continuous components (xc∈ X) that depend on the physical actuators installed on the new AUV. The 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. The behavior of the new set of continuous elements will be used to redefine the concrete IGCBs (f ∈ F).IGCBThe state machine, ports, and protocols of this capsule are not changed in the overall design for the new AUV controllerThe specification of the IGCB’s capsule captures new IGCB model, which is formed by restructuring the new set of continuous elements according to the implemented functional block diagram.Internal interfaceThe state machine and ports of this capsule are not changed in the overall design for the new AUV controllerThe specialization of the internal interface’s capsule is performed by supplementing/cutting down in/from the new IGCB in the IGCB’s capsule if necessary newInv term that corresponds to new supplemented/cut down situations in/from the discrete part’s capsule of application.External interfaceThe state machine, ports, and protocols of this capsule are not changed in the overall design for the new AUV controllerThe 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)The communication pattern shown in Figures5 and 6 is not changed in the overall design for new controllers of various AUV types.


### 3.3. 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, real-time, 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]. The 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. This state is usually represented by one or more enumerated constants. Often, several operations will contain this same conditional structure. The state pattern puts each branch of the conditional in a separate class. This 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. 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.Figure 7
State pattern structure of HA for the AUV controller.


## 3.1. 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–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 are, respectively, shown in Figures 3(a) and 3(b). In the use-case 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.Figure 2
Use-case diagram for capturing the main control requirements of the AUV.Figure 3
A desired trajectory-tracking scenario (a) and local state machine for performing the “track a desired trajectory” use case (b).
(a)(b)In Figure2,(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)
The “track a desired trajectory” use case is performed for tracking the desired trajectory for the vehicle to follow(iv)
The “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)
The “configure” use case permits users or maintainers to configure and update control parameters for starting up the controllers(vi)
The “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 maintenanceIn 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. Thus, we propose an implemented functional block diagram to gather the internal continuous behaviors of the AUV controller as shown in Figure4.Figure 4
Proposal of a functional block diagram for implementing the continuous behaviors of the AUV controller.In Figure4,(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 AUVIn 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. The discrete state-space models in equations (2) and (3) are implemented in the navigation system block for estimating the position, depth, attitude, and velocity corresponding to the sensors installed on the AUV. The standard navigation filters are based on the EKF or UKF [19, 53, 54] algorithms. The 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 (HAUV) is established by data as follows:(4)HAUV=Q,X,∑,A,Inv,F,q0,xc0.Here,Q is a set of operation modes called the situations of HAUV, e.g., the modes of idle, transferring, submerging, and rising; qo∈ 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 xc∈ 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. The 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). Figures5 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.Figure 5
Capsules’ collaboration of the real-time communication pattern for the AUV controller.Figure 6
Sequence diagram of the real-time communication pattern for the AUV controller.Here, the discrete part’s capsule consists of the situationsQ and transitions A in HA of the AUV controller; the continuous part’s capsule contains the continuous state-space 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.The 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. The 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.Table 2
Main control capsules of the PIM can be customized and reused in the new control application for various AUV types.
Designed control capsulesSpecialization rulesGeneric artifactsSpecialized artifactsDiscrete capsuleThe discrete part’s capsule is not changed in the overall design for the new AUV controllerNone.Continuous partThe ports and protocols of this capsule are not changed in the overall design for the new AUV controllerThe continuous part’s capsule is specialized by supplementing or cutting down continuous components (xc∈ X) that depend on the physical actuators installed on the new AUV. The 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. The behavior of the new set of continuous elements will be used to redefine the concrete IGCBs (f ∈ F).IGCBThe state machine, ports, and protocols of this capsule are not changed in the overall design for the new AUV controllerThe specification of the IGCB’s capsule captures new IGCB model, which is formed by restructuring the new set of continuous elements according to the implemented functional block diagram.Internal interfaceThe state machine and ports of this capsule are not changed in the overall design for the new AUV controllerThe specialization of the internal interface’s capsule is performed by supplementing/cutting down in/from the new IGCB in the IGCB’s capsule if necessary newInv term that corresponds to new supplemented/cut down situations in/from the discrete part’s capsule of application.External interfaceThe state machine, ports, and protocols of this capsule are not changed in the overall design for the new AUV controllerThe 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)The communication pattern shown in Figures5 and 6 is not changed in the overall design for new controllers of various AUV types.


## 3.3. 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, real-time, 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]. The 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. This state is usually represented by one or more enumerated constants. Often, several operations will contain this same conditional structure. The state pattern puts each branch of the conditional in a separate class. This 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. 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.Figure 7
State pattern structure of HA for the AUV controller.


## 4. 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 torpedo shape with the small navigation bridge (Figure8) to reach and follow a desired horizontal planar trajectory. The main operational parameters of the M-AUV are summarized in Table 3.Figure 8
Installation and trial trips for the M-AUV controller.
(a)(b)(c)(d)(e)Table 3
Main operational parameters of the M-AUV.
ParametersValuesSize (L × H × W)(1.54 × 0.27 × 0.25) mNet dry weight12.30 kgAutonomous duration20 min2 × Li-Po battery22.2 V; 20,000 mAhUltimate capacity314 WMaximum submerging/rising speed0.65 m/sMaximum horizontal transferring speed1.82 m/sMaximum diving depth1.15 mMaximum radius of action390 mIn 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.The 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]. These 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=x0 and P0/0=012×12. The 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.Algorithm 1:Navigation filter based on EKF.
Function EKF algorithmStep EKF predictData: x^k−1|k−1,Pk−1|k−1,fk−1⋅Result: x^k|k−1,Pk|k−1Fk−1=∂fk−1/∂x|x^k−1|k−1uk−1;x^k|k−1=fk−1x^k−1|k−1;Pk|k−1=Fk−1,Pk−1|k−1Fk−1T+Qk−1;endStep EKF updateData: x^k|k−1,Pk|k−1,hk⋅Result: x^k|k,Pk|kHk=∂hk/∂x|x^k|k−1;Sk=Rk+HkPk|k−1HkT;Lk=Pk|k−1HkTSk−1;ek=yk−hkx^k|k−1;x^k|k=x^k|k−1+Lkek;Pk|k=Pk|k−1−LkSkLk−1T;endAlgorithm 2:Navigation filter based on UKF.
Function UKF algorithmStep UKF predictData: x^k−1|k−1,Pk−1|k−1,fk−1⋅Result: x^k|k−1,Pk|k−1x^k|k−1,P¯k|k−1=UTx^k−1|k−1,P¯k−1|k−1,fk−1⋅;Pk|k−1=P¯k|k−1+Qk−1;endStep UKF updateData: x^k|k−1,Pk|k−1,hk⋅Result: x^k|k,Pk|kyk|k−1,S¯k,Pkxy=UTx^k|k−1,Pk|k−1,hk−1⋅;Sk=Rk+S¯k;Lk=PkxySk−1;ek=yk−y^k|k−1;x^k|k=x^k|k−1+Lkek;Pk|k=Pk|k−1−LkSkLkT;endIn 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.Figure 9
An example of instantiation and use of state pattern of HA for the M-AUV controller.The experimental scenarios of the M-AUV controller were based on various desired course angles and shape-based planar trajectories and mean transferring speeds that were performed on Ho Tien basin at Hanoi University of Science and Technology, Hanoi, Vietnam (Figure8). 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 rectangle-shaped 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. These 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.Table 4
Experimental scenarios and obtained test data for the course tracking of the M-AUV.
NoDesired course angle (deg)Mean transferring speed (m/s)Duration for the stabilized course (s) (with the EKF)Duration for the stabilized course (s) (with the UKF)10101.06.46.220101.55.75.630201.06.76.540201.56.06.050301.07.77.660301.56.66.4Figure 10
M-AUV reaches and follows the rectangle-shaped planar trajectory (a) with the EKF algorithm and (b) with the UKF algorithm.
(a)(b)Table 5
Comparison of the path tracking error between the two cases using the EKF and UKF algorithms.
Paths generated by WPsUsing the EKF algorithmUsing the EKF algorithmRMS position error (m)Peak value (m)RMS position error (m)Peak value (m)East directionNorth directionEast directionNorth directionEast directionNorth directionEast directionNorth directionWP0-WP12.92963.18503.09823.53672.70363.08762.92073.4398WP1-WP21.95994.17742.32795.39461.74652.19352.32792.8723WP3-WP42.16862.78482.38643.18952.07542.65272.26752.0894WP3-WP42.25973.84062.60735.07812.05322.09212.27932.7260WP4-WP01.76501.58921.99341.78921.72701.55731.98741.7674Based 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. The UKF consistently performs equally to or better than the EKF at comparable levels of complexity. The performance benefits of UKF-based algorithms have been shown in a number of application domains, including state estimation, dual estimation, and parameter estimation. The 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.


## 5. Conclusion and Future Work

The paper introduced a systems engineering-based implementation model to conveniently realize controllers for AUVs. This 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. The PIM is designed by specifying the real-time control capsules, ports, and protocols to obtain a real-time communication pattern for AUV controllers. This pattern can permit the designed PIM elements to be customizable and reusable in new application developments of various AUV types (Table2). The 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 trajectory-tracking 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.



---

*Source: 8848776-2020-10-26.xml*