An Object-Oriented Systems Engineering Point of View to Develop Controllers of Quadrotor Unmanned Aerial Vehicles

,


Introduction
Unmanned Aerial Vehicles (UAVs) have been used in many military applications for a long time. Currently, UAVs, especially quadrotor UAVs (Q-UAVs), are also being developed rapidly in civilian applications to enhance economic effectiveness, e.g., online shipping in e-commerce, precision agriculture, environmental monitoring, mapping, and surveillance. The Q-UAV is one of the micro-UAV types of which operating modes are capable of Vertical Take-Off and Landing (VTOL) and hovering and horizontal flight, so they can handle turbulence due to, for example, wind more easily and are easier to design and realize by using a compact airframe [1][2][3].
Systems engineering is an approach that has been widely accepted in the aerospace and defense industry to provide system solutions to technologically challenging and mission-critical problems. The solutions often include the use of hardware and equipment, software, data, people, and facilities [4]. In addition, the low development costs must be taken into account in the construction of applications. Thus, reusability must also be considered in the new development lifecycle of various applications for UAVs, such as the VTOL. According to the Object Management Group (OMG) [5], Unified Modeling Language (UML) has been standardized for analyzing and designing visual system components in the software industry. In addition, System Modeling Language (SysML) [6] is a UML profile for systems engineering that has been also standardized by OMG. SysML is used for analyzing, designing, verifying, and validating the development artifacts of industrial systems in various domains. Nevertheless, both UML and SysML lack the constructs for precise modeling of timing and communication evolutions between the control objects for real-time and embedded systems, e.g., the Q-UAV controller. Furthermore, the OMG has also standardized the Model-Driven Architecture (MDA) [7,8] whose main idea is to separate the specifications of system operations from the details of the way that a system uses the capabilities of its platform. On the other hand, Model-Based Systems Engineering (MBSE) has been formalized by INCOSE [9,10] to support the modeling of system requirements, design, analysis, verification, and validation artifacts in the development life cycle of complex systems.
In addition, the problem of designing autonomous flight controllers for Q-UAVs is equally challenging because these controllers are closely connected with the dynamic models [11][12][13]. Hence, the Q-UAV controller can be considered to be a model that combines discrete and continuous behaviors named the Hybrid Dynamic System (HDS), and it can be modeled by hybrid automata (HA) [14][15][16].
Following on from the above points, the MDA/MBSE's features can be specialized by combining them with the real-time UML [17][18][19][20] together with the SysML (i.e., realtime UML/SysML) to depict the analysis and design components of control systems in detail. This study focuses on the development of a hybrid control model that integrates the Q-UAV dynamics specialized for the MDA/MBSE together with real-time object paradigms and the HA, which permits us to conveniently implement the Q-UAV controller. This model also allows the designed control components to be closely customized and reused for deploying new control applications of various UAV types capable of VTOL. In this work, the Q-UAV dynamics and control architecture are combined with the specialization of MDA/MBSE features, composed of the Computation Independent Model (CIM), Platform Independent Model (PIM), and Platform Specific Model (PSM). The control system permits a Q-UAV to track the desired trajectories. In detail, the CIM consists of the usecase model defined closely with an implemented function block diagram, the supplemented Unscented Kalman Filter (UKF) algorithm, and HA to accurately meet the control requirements for a Q-UAV controller. Based on the defined CIM, the PIM is designed by specifying the real-time UML/-SysML that allows a real-time capsule pattern to be created to model the real-time control elements with their timing evolutions in detail. The detailed PIM components are then trans-formed into PSMs by using open-source platforms such as OpenModelica [21] and Arduino [22] in order to rapidly implement and deploy the Q-UAV controller. Finally, a trajectory-tracking controller of an application of Q-UAV is deployed and used to test the ATMEGA U2 and STM32-Cortex-M4 microcontrollers, which are linked with the Inertial Measurement Unit (IMU) MPU6000 with a working frequency of 100 Hz [23] and GPS Ublox Neo 6M with a working frequency of 10 Hz [24]. This controller is trialed through different experimental scenarios and is compared to existing solutions.
In this study, we followed the method of our author introduced in Van Hien et al. [25]. The main contributions of this paper are summarized as follows: (1) The MDA/MBSE approach combined with the realtime UML/SysML, UKF algorithm, and hybrid automata is specialized to conveniently analyze, design, implement, and deploy the Q-UAV controller (2) The main designed control capsules can be customized and reused for various UAV types capable of VTOL (3) The open-source platforms are used to rapidly implement and deploy the controller (4) A trajectory-tracking controller of a low-cost Q-UAV is developed and tested The rest of this paper is organized as follows: The second section introduces the related works that inspired us to build an MDA/MBSE-oriented development life cycle for Q-UAV controllers. The Q-UAV dynamic model and control architecture are introduced in the third section. The fourth section presents the details of MDA/MBSE-based development to conveniently realize and deploy Q-UAV controllers, including the CIM, PIM, and PSM components. In the fifth section, this specialized model is applied to a case study. Conclusions and future work are shown in the final section.

Structural Approaches for Q-UAV Controllers.
In the present design of complex systems, many applications use standard control methods together with soft-computing approaches to make them more effective for controllers of such systems [26][27][28][29][30]. These have also been applied to the construction of Q-UAV controllers; for example, some of the main control methods and assessments for Q-UAV applications are summarized in Table 1.
The assessment results of the above control approaches suggest the use of a combination of PID and backstepping, the so-called Integral Backstepping (IB) technique. This is used to implement the continuous evolution of the Q-UAV controller by a functional block diagram in the fourth section.
In addition, the above traditional control models are based on structural approaches that focus on databasedriven architecture. Hence, the designed control components 2 International Journal of Aerospace Engineering could be difficult to customize and reuse for realizing new controllers of different UAVs of the VTOL type and for deploying them appropriately into various software and hardware platforms. To achieve this goal, model-driven approaches can be specialized to conveniently perform the whole development lifecycle focused on control systems such as the Q-UAV controller.
2.2. Model-Driven Approaches and Applications. As previously stated, the MDA has been standardized by OMG for system design, development, and implementation. The three main goals of the MDA are portability, interoperability, and reusability through an architectural separation of concerns. Furthermore, Model-Based Systems Engineering (MBSE) is the formalized application of modeling that is used to support system requirements and for design, analysis, verification, and validation activities beginning in the conceptual design phase and continuing throughout development and later life cycle phases [9,10]. MDA is a system development paradigm that emphasizes the use of rigorous visual modeling techniques throughout the system development life cycle (SDLC), and MBSE is a specialization of MDA that applies MDA principles and best practices to systems engineering applications [25,50]. Following the above model-based approaches, Ragavan et al. [51] proposed the Bond Graphbased Unified Meta-Modeling Framework (BG-UMF) to lead the complexity in model transformation, analysis, validation, verification, and automatic code generation, which are focused on the conceptual design and development of executable models for large engineering systems. Herrera et al. [52] introduced the complex UML/MARTE (Modeling and Analysis of Real-Time and Embedded Systems) methodology to design embedded systems, which brought out a new integration of Model-Driven Engineering (MDE), electronic systems, and space exploration technologies. This platform could capture the set of possible design solutions by using the UML and the standard MARTE profile. Many industrial applications based on the real-time UML/SysML and model-driven approaches for complex control systems can be found in [8,25,50,[53][54][55][56].
In particular, the demands of system complexity and design productivity for embedded control systems must be managed by simplifying and reusing the design. Thus, these systems need to be verified as early as possible in the development process to reduce the cost and effort in the context of MBSE [57]. To achieve these goals, the UML profile for SystemVerilog (UMLSV) [58,59] and a novel Natural Language Processing (NLP) framework [60] were developed to completely model the design and verification requirements of systems.
In this section, we cited the structural realizations for Q-UAV controllers and the model-based approaches for industrial control systems that could be used to create a hybrid control model based on the MDA/MBSE approach and real-time UML/SysML to conveniently deploy the Q-UAV controller.

Q-UAV Dynamics and Control Architecture
3.1. Q-UAV Dynamic Model for Control. The aim of modeling the dynamics of Q-UAV is to find differential equations that relate a system's outputs (position and orientation) to its inputs (force and torque vectors). As determined from a large field of guidance, the navigation and control of aerial vehicles presented in [61][62][63][64], the 6 DoF dynamic model of a Q-UAV in the body coordinate frame can be written as equation system (1). Here, I xx , I yy , and I zz are inertia moments; ϕ, θ, and ψ are, respectively, Roll, Pitch, and Yaw (RPY) angles; J r presents the rotor inertia; H is a set of hub forces; R m is a set of rolling moments; T i presents the thrust force (i = 1, 4); Ω r is the overall residual propeller angular speed; A c is the fuselage area; C is the propulsion group cost factor; ρ is the air density; Q i presents the drag moment; h and l are, respectively, the vertical distance and horizontal distance of the propeller center to the Center of Gravity (CoG); and x, y, and z define the position in the body coordinate frame. Table 1: Some of the used control methods and assessments for Quadrotor Unmanned Aerial Vehicle (Q-UAV) applications.

Used control methods Assessment of Q-UAV control applications
Lyapunov theory [31,32] This is proved to be very reactive, especially for the yaw angle control of a Q-UAV. However, stabilization in the direct neighborhood of the equilibrium point was not rigid enough to permit hover flight.
Proportional-Integral-Derivative (PID) controller [33][34][35] It is proved to be well adapted to the Q-UAV when flying near hover. It was possible using this technique to successfully perform the first autonomous flight. But the PID controller was only able to control the Q-UAV in near hover and absence of large disturbances.
Linear Quadratic (LQ) regulator [36][37][38] This displayed average stabilization results. However, it was shown to be less dynamic than the PID controller.
Backstepping technique [39][40][41][42] The ability of this technique to control the orientation angles in the presence of relatively high perturbations is very interesting.
Sliding-mode technique [42][43][44][45][46][47][48][49] This did not provide excellent results when used alone. The switching nature of the controller seems to be ill adapted to the dynamics of Q-UAVs. Thus, it could be combined with other control techniques, such as the backstepping or radical basis function neural networks, to improve the control performance for Q-UAVs.

International Journal of Aerospace Engineering
In this study, we proposed the following assumptions: the hub forces and rolling moments were ignored, and thrust and drag coefficients were considered constants in order to comply with the real-time constraints of the embedded control loop. The evolution of the control system can be rewritten in state-space form _ x = fðx, uÞ with the u input vector and x state vector as equations (2)-(4).
Here, u i is the control input (i = 1, 4) that is described by a set of equations (3), ω i is the propeller angular rate, and b and d are, respectively, the thrust and drag factors.
x is a 12-dimensional state vector that is used to describe the motion of Q-UAV and is written as shown in A discrete state-space representation is required to model the Q-UAV controller in order to use a recursive estimation filter of motion states, e.g., the Extended Kalman Filter (EKF) or UKF; the developed system can be then described by a set of equations (5): Here, 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.
In fact, the EKF has been widely accepted as a standard tool in the control and machine-learning communities. In this study, we used the UKF to estimate the altitude, position, attitude, and velocity control of the Q-UAV. This addresses many of the approximation issues of the EKF and consistently achieves an equal or better level of performance at a comparable level of complexity. The performance benefits of UKFbased algorithms have been demonstrated in a number of application domains, including state estimation, dual estimation, and parameter estimation [65,66]. There are a number of clear advantages to the UKF, e.g., the mean and covariance of the state estimate are calculated to second-order or better, as opposed to first-order in the EKF. This allows more accurate implementation of the optimal recursive estimation equations, which is the basis for both the EKF and the UKF. While equations specifying the UKF may appear more complicated than the EKF, the actual computational complexity is equivalent. More detail about the use of the UKF algorithm for the Q-UAV controller will be provided in the fourth section.

General Control
Architecture for a Q-UAV. There are three main systems within the physical structure of a Q-UAV as follows: the guidance system is used to provide the desired path for the Q-UAV to track, the navigation system is responsible for estimating the current state of the Q-UAV, and the control system is used to calculate and apply the control forces and moments to conduct this Q-UAV. These subsystems have missions to be accomplished, yet they must also cooperatively operate to allow  International Journal of Aerospace Engineering the Q-UAV 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.
As previously stated, control systems and their actuators can be considered models including discrete events and continuous behaviors that can be named HDSs. Furthermore, controlled systems do not always have the same behavior because they are associated with validity hypotheses that need to be checked at any moment, as well as security forces to envisage events and behaviors different from nominal behaviors. In this paper, we are also interested in analyzing and designing an industrial HDS (IHDS). This IHDS contains two parts, which are the HDS controller and controlled HDS. These parts mutually exchange periodic signals and episodic events. The episodic event is either external or internal. Figure 2 shows the block diagram of an IHDS. Here, E o and E i are, respectively, output and input events; S o and S i are, respectively, output and input signals; ΔT is a sampling period of the evolution model for control; and Actor 1 , Actor 2 , and Actor m are descriptions of a coherent set of roles that users (i.e., persons or involved external systems) play when they interact with the developed IHDS.
As shown by the above Q-UAV dynamic and general control architecture together with the described characteristics of the IHDS, controllers of Q-UAVs are then considered as IHDSs whose dynamic behaviors can be modeled by HA. These control systems have continuous/discrete parts and they have interactions, such as those with motional components, e.g., horizontal transferring, VTOL, and rotation, external interacting events from the guidance and navigation system, and environmental disturbances. In this study, we are interested in developing a trajectory-tracking controller of Q-UAVs, so this hybrid dynamic model can be used to form control algorithms combined with a specific guidance law such as the Line-Of-Sight (LOS) guidance implemented in [67][68][69][70].

Model-Driven Development for a Q-UAV Controller
As previously stated, the CIM, PIM, and PSM components of MDA/MBSE combined with the real-time UML/SysML are  International Journal of Aerospace Engineering specialized for analyzing and designing control components of complex control systems, e.g., the Q-UAV controller, in detail. Following the above-described Q-UAV dynamics and general control architecture for the real-time UML/-SysML specifications, we specialize the MDA/MBSE approach in detail for deploying the Q-UAV controller that consists of the following three models: CIM, PIM, and PSM. This separates the operation specifications of the system from the details of the way that the system uses the capabilities of its platform. All of the artefacts and activities in CIM, PIM, and PSM for a Q-UAV controller will be detailed in the next subsections.

CIM for a Q-UAV Controller.
In the CIM, object collaborations with the real-time UML/SysML are based on the use case model, together with the specifications of continuous behaviors including the implemented functional block diagram, the IB, and UKF algorithms, and HA in order to closely depict the control requirements for a Q-UAV controller.
The main use case model of a Q-UAV controller is defined as shown in Figure 3. It encompasses an example of trajectory-tracking scenarios and the local state machine of the "Track a desired trajectory" use case, which are, respectively, shown in Figures 4(a) and 4(b)). In Figure 4(a), the "loop(5)" fragment is a value typically seen in the practice of LOS guidance, as shown in [71], where (i) MDS is the Measurement-cum-Display System, consisting of the guidance and navigation systems,    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 used to maintain system safety when one of its components fails or its supplied power is low or there is bad weather (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 which includes activities, e.g., error identification and correction of the whole physical Q-UAV or periodical maintenance In the use case model, industrial maneuvering constraints, e.g., the maximum tilted angle, velocity, altitude, and other safety modes of the Q-UAV, need to be set up. In this study, a functional block diagram must be built to model the continuous dynamics of the Q-UAV controller, because the real-time UML/SysML lacks the constructs for depicting internal continuous models for each state situated in the state machine diagram. Thus, we propose an implemented functional block diagram to gather the internal continuous behaviors of the Q-UAV controller, as shown in Figure 5, where (i) Desired trajectory and take-off/landing are events that are used for providing, respectively, the desired   As previously mentioned, the UKF algorithm is used to estimate the altitude, position, attitude, and velocity control. Following the Q-UAV dynamics in equation systems (1)-(5), the application details of the UKF algorithm for a Q-UAV controller are shown in Algorithm 1.
In Algorithm 1,: denotes an estimate; P is the state covariance; Q and R are, respectively, the covariance matrices of process and measurement noise, assumed to be zero mean stationary white noise with zero cross-correlation; the state is recursively estimated starting from the assumed initial conditions asx 0|0 = x 0 and P 0|0 = 0 12×12 ; and the Unscented Transform (UT) is a deterministic sampling technique that 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 addition, the IB expansion combined with the CLF for Q-UAV controllers is well used in many Q-UAV control applications, for instance [72,73]. PID regulators can be applied to the functional block of motor control to reduce the inertial and delay time caused by the physical Q-UAV actuators in the whole system's evolution.
In the CIM, hybrid automata (HA) are specified to present the mathematical implementation model of the Q-UAV controller consisting of terms such as the situations, continuous state variables, event, transition, global continuous behavior, and invariants. An HA of the Q-UAV controller (H Q−UAV ) is established by data as follows:    International Here, Q is a set of operation modes called the situations of H Q−UAV , e.g., the modes of hovering, transferring, taking off, and landing; q o ∈ Q is the initial situation; X is the continuous state-space of continuous elements of the Q-UAV, e.g., the control blocks of a motor, position, altitude; x co is the initial value of this space; ∑ is a set of external interacting events for triggering movement from the current situation to the reached situation, which is issued from the guidance and navigation systems as well as environmental disturbances for the Q-UAV controller; A is a set of transitions between the situations that are linked via appropriate events σ ∈ ∑; Inv is called the invariant term of the situation and is used for verifying when the situation is q; the continuous state must be then x c ∈ invðqÞ; and F is the global continuous model issued from the 6 DoF dynamic model in equations (1)-(5) and the implemented functional block diagram ( Figure 5). The global evolution of the continuous state is performed when a new situation is reached in the operation modes of the Q-UAV. The details of HA spe-cialization and its hypotheses for the evolution of a control system can be seen in previous reports [74,75].

PIM for a Q-UAV Controller.
The above-defined CIM is transformed into a PIM that is based on the use case approach [5,6], real-time UML profile [17][18][19][20], and IBM Rational Rose RealTime or IBM Rational Software Architect RealTime tools [76]. The goal of the PIM is to closely build up the real-time control capsules, ports, protocols, and their timing evolutions, which allow the precise behaviors and structures of the Q-UAV controller to be designed. From the above-defined CIM components, the five main control capsules have been specialized to participate in the HA evolution of the Q-UAV controller: the continuous part's capsule, the discrete part's capsule, the internal interface's capsule, the external interface's capsule, and the Instantaneous Global Continuous Behavior (IGCB's capsule). Figures 6-8 indicate the real-time capsule pattern for the Q-UAV controller by using the real-time UML's collaboration, class, and sequence diagrams.
End of period of the IGCB's capsule is realized by the "timeout" message. In Figure 6, the discrete part's capsule consists of the situations Q and transitions A in the HA of the Q-UAV 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, where f is derived from equations (1)-(4) and the implemented functional block diagram ( Figure 5) can be implemented in f for estimating the values of the position, altitude, attitude, and velocity of the Q-UAV; 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 that receives or sends episodic events and periodic signals between the Q-UAV controller and their interacting systems, such as the AES and MDS.
In Figure 8, the messages exchanged between the main control capsules, which are defined by the protocols (Figure 7), are synchronous, and the interval between two adjacent timeout messages indicates the sampling period (ΔT) of the IGCB's capsule. The external interface's capsule receives periodic signals coming from external continuous components. It then gives the ContinuousElement message to the IGCB's capsule so that the IGCB's capsule can call all of the continuous elements corresponding to the concrete "IGCB:IGCB1." During the call of the IGCB's capsule, the external interface's capsule can receive an event named "3: InputEvent" issued from the MDS or AES, and this event, named "ee1: DetectedEvent", is given to the discrete part's capsule. The discrete part's capsule then memorizes and later processes this event. If the IGCB's capsule receives the LastContinuousTerminal message coming from the continuous part's capsule, it gives the ContinuousEvolution message to the continuous part's capsule so that the internal interface's capsule can receive all updated variables. The internal interface's capsule then verifies the invariant (x c ∈ invðqÞ) of the situation q 2 . In this case, there is a generated internal event. The internal interface's capsule gives this event to the discrete part's capsule, which permits the IGCB's capsule to identify the concrete "IGCB:IGCB2" and give output signals to the external interface's capsule. At the end of this sampling period, the external interface's capsule gives the output event and control signals to the external environment of the Q-UAV operating with its concrete"IGCB:IGCB2." Tools such as HyTech, CheckMate, PHAver, and HSolver [77] can be used to test a hybrid automaton to verify the generally dynamic behaviors of the Q-UAV controller. At this The discrete part's capsule is not changed in the overall design of the new controller of VTOL-type UAVs.

Continuous part
The ports and protocols of this capsule are not changed in the overall design of the new controller of VTOL type UAVs.
The 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 VTOL-type UAV. 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 is used to redefine the concrete Instantaneous Global Continuous Behaviors (IGCBs) (f ∈ F).

IGCB
The state machine, ports, and protocols of this capsule are not changed in the overall design for the new controller of the VTOL-type UAV The specifications of the IGCB's capsule make up the new IGCB model and are formed by restructuring the new set of continuous elements according to the implemented functional block diagram.

Internal interface
The state machine and ports of this capsule are not changed in the overall design for the new controller of the VTOL-type UAV.
The 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. A new Inv term corresponds to new supplemented/cut down situations in/from the discrete part's capsule of application.

External interface
The state machine, ports, and protocols of this capsule are not changed in the overall design for the new controller of the VTOL-type UAV.
The 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 real-time capsule patterns shown in Figures 6-8 are not changed in the overall design for new controllers of VTOL-type UAVs.

10
International Journal of Aerospace Engineering moment, formal tools, such as IBM Rational Test RealTime [76], also exist to directly test a capsule collaboration. This tool permits us to validate a set of input sequences and defined objects in order to make sure the behaviors of the system are well modeled. Moreover, we can find software tools such as IBM Rational Rose RealTime and IBM Rational Software Architect RealTime [76], which can be used to support the formal reuse of designed control components. They permit us to undergo reverse engineering of applications to track the requirements of the developed systems. In particular, we can also use the SystemVerilog tool [58,59] and a novel NLP framework [60] to completely validate the control requirements and design models of the developed system. In addition, the reusability is very important when implementing controllers for different applications of UAVs of the VTOL type because it can reduce the development time and cost. The specializations, which permit the capsule collaboration of a developed Q-UAV to be customizable and reusable in the new control application for various UAVs of the VTOL type, are summarized in Table 2.

PSM for a Q-UAV Controller.
To realize and deploy the Q-UAV controller, the PIM is first implemented in the PSM (i.e., the simulation model) that is transformed from the above-built PIM by using tools such as the IBM Rational Rose RealTime or IBM Rational Software Architect RealTime [76] or Papyrus for Real-Time (Papyrus-RT) [78] and Modelica/OpenModelica [21,79]. Here, the IBM Rational provides a rich set of capabilities delivered as part of a collaborative and integrated range of products to support the real-time UML design of industrial software systems. Papyrus-RT is an industrial-grade, complete open-source modeling environment that is used for the development of complex, software-intensive, real-time, embedded, and cyber-physical systems. It acts as an implementation of the real-time UML together with editors, a code generator for C++, and a supporting runtime system. In addition, OpenModelica is an open-source modeling and simulation environment intended for industrial and academic usage. It is an object-oriented declarative multidomain modeling language that is used for complex dynamic systems. The OpenModelica environment allows most of the expression, algorithm, and function parts of Modelica to be executed interactively, as well as equation  Horizontal distance: propeller center to CoG l 0.515 m 11 International Journal of Aerospace Engineering models and Modelica functions to be compiled into efficient C/C++ codes. The simulation results in OpenModelica allow us to theoretically assess the control performance and to choose the properties of control elements before they are deployed.
In this study, the PIM with optimized control elements in the simulation model was updated to obtain a new PIM for the deployment model of Q-UAV called PIM + . Finally, this PIM + was transformed into the new PSM + (i.e., the realization model) by using various specific platforms based on Step.z Altitude. Step.
x Position.x x-position (m) the object-oriented Implementation Development Environment (IDE), e.g., the Arduino's IDE [22], to construct a Q-UAV controller with compatible microcontrollers, e.g., the ATMEGA32-U2 and STM32 Cortex-M4 microcontrollers [22].  [50,74,75]. In addition, the above-defined HA can be automatically implemented by using the State pattern described in [80,81]. The State pattern represents either of the following cases: (i) an object's behavior depends on its state, and the object must change its behavior at run-time depending on that state, and (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 contain this same conditional structure. The State pattern puts each branch of the conditional struc-ture 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, the detailed implementation structure and codes of HA have been found in the author's report [74] to enhance the significant programming effectiveness of the control program of Q-UAV.

Physical System
Configurations. Based on the aboveproposed hybrid model, a trajectory-tracking controller that permits a low-cost Q-UAV to reach and follow the predetermined trajectory was developed. Figure 9 shows the Computer-Aided Design (CAD) model of this Q-UAV used for the case study. The main operational parameters of the Q-UAV are summarized in Table 3.

5.2.
Results of Control Implementation. All elements of the analysis and design models were created to allow the implementation of the trajectory-tracking controller of this Q-UAV. Here, we present some of the control simulation results that were obtained through the following simulation cases: the guidance system addressed a desired event of taking-off to the Q-UAV with an altitude of 15 m; the transient control response in the z-direction is illustrated in Figure 10(a); Figure 10(b) shows the transient control response in the x-direction when the Q-UAV received the desired event of transferring with a desired distance of 15 m in the x-direction from the current position. All of the obtained simulation results allow the control performance of the system to be assessed theoretically within the control criteria such as the admissible timing response, the transition, and static errors. The assessed simulation results permitted us to choose the designed control elements and their properties that were used to perform the deployment phase.
In this case study, the defined state-space models presented in equation systems (4) and (5) were implemented by the UKF algorithm (Algorithm 1) to predict the motion

13
International Journal of Aerospace Engineering states corresponding to the sensors installed on this Q-UAV, such as the IMU MPU6000 with a working frequency of 100 Hz [23] and the GPS Ublox Neo 6M with a working frequency of 10 Hz [24]. The ATMEGA32-U2 and STM32 Cortex-M4 microcontrollers [22] were used on the main board, and the control program was installed with Arduino's IDE [22] based on C++ language. The Q-UAV installation for trial flights is shown in Figure 11.
The main test cases and obtained results for the Q-UAV are illustrated and were used to assess the control performance of this Q-UAV as follows: (i) First test scenario: the Q-UAV autonomously reached and followed a desired polygon-shaped trajectory with heading angles of about 90°and 110°a nd an average velocity of 2.5 m/s ( Figure 12). The maximum trajectory error was about 1.40 m against each Way-Point (WP) position at these heading angles.
(ii) Second test case: the Q-UAV was capable of Vertical Take-Off and Landing (VTOL) with a maximum altitude of 480 m ( Figure 13); the landed position error was 0.30 m against the initial take-off position (iii) Third test scenario: the Q-UAV autonomously reached and followed a desired zigzag-lined trajectory with various heading angles and an average velocity of 2.5 m/s ( Figure 14). The maximum trajectory error was about 1.20 m against each WP position at these heading angles Following the comparison between the above-obtained experimental data and the existing experimental results presented in [74], in which the EKF algorithm was used to implement the same physical Q-UAV model, the trajectory-tracking controller of this Q-UAV had an improved stabilized trajectory error, which decreased by about 0.2-0.4 m. From this case, we also found that the UKF can provide considerable improvement over the EKF in the control implementation for VTOL-type UAVs.

Conclusions and Future Work
This paper presented a hybrid control that can be used to conveniently realize controllers for Q-UAVs whose global behaviors mean that they can be considered industrial HDSs (IHDSs). This model is mainly based on the specialization of MDA/MBSE features combined with the real-time UML/-SysML, UKF algorithm, and HA to closely implement and realize the control parts of the system. The Q-UAV dynamics and control architecture were firstly adapted for the control and combined with the specialization of MDA/MBSE features including the CIM, PIM, and PSM components. In the CIM, the use case model was specialized with continuous behaviors, the UKF algorithm, and HA to closely capture the requirements of the analysis for a Q-UAV controller. The PIM was built to obtain a detailed design model by specifying the control capsules, ports, and protocols enclosed with their timing evolutions in order to model the behaviors and structures of the Q-UAV controllers in detail. The designed PIM components were also used to create a real-time capsule pattern that can be customized and reused in new UAV applications, of which operating modes are capable of VTOL, hovering, and horizontal flight. The updated PIM with the optimized control elements of the simulation model (PIM + ) was then transformed into PSM + through the round-trip engineering of the intermediate C++ codes in order to form a Q-UAV controller with compatible microcontrollers. Based on this proposed hybrid control model, a trajectory-tracking controller of a low-cost quadrotor UAV was deployed and tested out on the Arduino ATMEGA U2 and STM32-Cortex-M4 microcontrollers.
Furthermore, the above-developed control application confirms that the MDA/MBSE approach combined with the real-time UML/SysML provides a framework for, and enables, tools to be provided to specify a system independently of the 14 International Journal of Aerospace Engineering platform that supports it, specify platforms, choose a particular platform for the system, and transform the system's specifications into one for a particular platform. However, the real-time UML/SysML versions lack the constructs required for modeling internal continuous behaviors for each state on the state machine diagram, so an implemented functional block diagram must then be defined in the CIM to model continuous behaviors for industrial HDSs such as the Q-UAV controller with events issued from outside. We only applied the above-proposed control model in the low-cost Q-UAV controller and intend to implement it in new control applications for autonomous coordinated vehicles. Eventually, if we get positive feedback, we will investigate our application strategy to make it more effective. This will permit us to create controllers to effectively balance the search and target response in cooperative teams of a VTOL-type UAV with an unmanned ship and multiple autonomous underwater vehicles for ocean exploration. This will be specialized with design and verification models of safety-critical systems, as indicated by [58][59][60]. International Journal of Aerospace Engineering