Journal ofScience & Technology 100 (2014) 011-015 An Object-Oriented Approach to Analyze and Design Controllers of Autonomous Surface Vessels Nguyen Hoai Nam, Khuong Minh Tuan, Ngo Van Hien*, Hoang Sinh Truong Hanoi University of Science and Technology, No.l Dai Co Viet Str., Ha Not, Received; March 04, 2014; accepted: April 22, 2014 VietNam Abstract This paper presents a novel approach based on the Model-Driven Architecture (MDA) to systematically analyze, design and implement controllers of Autonomous Surface Vessels (ASV) It brings out main steps to entirely specify the requirement analysis, design and deployment phases of these systems In this approach, we adapt the ASV dynamic model for control, and specialize MDA's features such as the Computation Independent Model (CIM) combined with the use-case model and hybrid automata, the Platform Independent Model (PIM) carried out by using the real-time Unified Modeling Language (UML)/System Modeling Language (SysML) and its Platform Specific Mode! (PSM) implemented by object-oriented mechanisms to completely perform the development lifecycle of ASV controller This approach is then applied to implement and deploy a horizontal planar trajectory-tracking controller for a miniature autonomous marine vehicle In this application, the PIM Is converted into the PSM by using the open-source platform in order to quickly simulate and realize the operational functionalities of control system Keywords: Autonomous Surface Vessel, Hybrid Automata, UML, SysML and MDA I Introduction Conttol systems have a significant impact on the performance of surface vessels and marine structures allowing them to perform tasks in severe sea states and during long periods of time Surface vessels are designed to operate with adequate reliability and economy, and in order to achieve this, it is essential to control the motion The problem of designing motion contiollers for ASV is equally challenging because they are tightly cotmected with the dynamic models In addition, the immersion in an mdustrial conttol context makes that the designers and programmers must take into account costs and existing standards for analyzing, designing and implementing effectively these systems Starting from the above considerations, we have developed an object-oriented model to effectively carry out the conttoller of Autonomous Surface Vessels (ASV), which have the dynamic behaviors modeled by using hybrid automata [I], [2] This system permits an ASV to reach and follow a reference ttajectory in the Cartesian space In this model, we specify the dynamic model of surface vessels, MDA's feahires such as the CIM with usecase model including hybrid automata and industrial constraints, the PIM earned out by using real-time UML/SysML, and its PSM implemented by object- ' Conesponding autiior; Tel: (+84) 904.255.855 Email: hien.ngovan(ahust.edu.vn oriented mechanisms to cover the whole of development hfecycle of ASV contiollers Based on this approach, a ttajectory-ttacking conttoller of a miniature ASV is completely retto-designed and simulated Modelling asv dynamics for control 2.1 Dynamic model of surface vessels According to SNAME [3], the six motion components of a surface vessel defined as surge, sway, heave, roll, pilch, and_vavv From the large field of guidance, navigation and conttol of marine vehicles [4], the Degrees of Freedom (DoF) dynamic model of surface vessels in body frame can be written in (1): { M-v + C(v)v -f- Div)v Where: r] position (NED: (x, North, -1- giri) = T -|- 5^ + cu *^' y, ^ 9, East and 1//)^ is the Down) and orientation (Euler: RPY -Roll, Pilch and Yaw angles); V = (u, V w, p, q, r)'"\% the velocity and angular velocity; M = M^^ + M^ is a mass mattix, which denotes the 6x6 system inertia matrix containing both: MKB - the generalized constant inertia matrix, and MA the added mass inertia mattix; C(v)=C^(v)-\-C/v) is the 6x6 Conolis and centripetal forces matrix including added mass; linear and Journal ofScience & Technology 100 (2014) 011-015 nonlinear hydrodjmamic damping are contained within the 6x6 matrix D(v)=D+DJv), D contains the linear damping terms, and DJv) contains the nonlinear damping terms; g(ri) is the 6x1 vector of gravitational and buoyancy effects; r is the 6x1 conttol input force and torque; gg is the ballast force and torque; and finally (o is the 6x1 vector extemal disturbances caused by wind, waves and ocean current 2.2 Using controllers the 3D dynamic model for ASV The horizontal motion of a surface vessel is often described by the motion in surge, s-way, and yaw Therefore, we choose tj= (x, y, y/)''', v = (u, V, r)'^ and the Jacobian matrix typed 3x3 for obtaining the dynamic model of this case from the genera! modeL as m (1) More details of this 3D dynamic model can be found in [4] In this paper, we are interested in the ttajectory-ttacking conttol of ASV, so we must concenttate on this dynamic model to gather the conttol algorithms with a concrete guidance, e.g the Line-of-Sight (LOS) [4], [5], MDA specialization to develop an asv controller 3.1 Overview of MDA The MDA [6] is an approach to system development, which increases the power of models in that work, MDA contains three models to separate the specification of the operation of a system from the details of the way that system uses the capabilities of its platform: • Computation-Independent Model (CIM) is refened to as a domain or business model, the CIM presents the system at the highest level of absttaction, • Platform-Independent Model (PIM) is used by conttol system architects and designers to describe the conttol solution at a high level, independent of the solution's deployment platform • Platform-Specific Model (PSM) specifies a combination between the details found m the PIM with the details representing how a solution can be implemented on a platform Furthermore, this approach supports also for model transformation The model ttansformation is the process of converting one model to another model of the same system Transformations can use different mixtures of manual and automatic transformation [6] 3.2 MDA process for an ASV controller Starting fi-om MDA specifications and characteristics of dynamic model of ASV, we define here an executable process, which permits us to cany out the development of an ASV having behavion modeled by Hybrid Automata (HA) [I], [2], and to re-use it in different ASV conttol applications This process includes the following main points: • Object collaborations with UML/SysML and HA present the CIM, which allow analyzing structure and behaviors of an ASV conttoller - To describe a conttol system such as the ASV with the H A ' s formalism and carry out its evolution, we have inttoduced consttaints and mies, which can be found in [2], [5] In CIM, HA are used to describe mathematical behaviors (i.e, the dynamic model of ASV: Situations, Slate Variables, Transition, etc, of its HA) of this system - Object collaborations with UML [7] permit the identified HA model to be exacfly converted into business objects, which present control elements of the ASV being developed, • Real-Time UML models indicate the PIM, which permit us to cover the design phase of the developed system These models are described by using the 'capsules, ports, protocols' concept [7] in order to specify a set of conttol modules in precise behaviors, • Object-Oriented ( 0 ) implementation models are used to introduce the PSM of this system m order to validate and deploy the identified conttol design.' model into the OO software platforms That permits us to evaluate the conttol performance and functionalities, and to easily build control design elements before they can be realized and deployed This process will be gone into detail in the next section for describing the development phases of an ASV Whole of MDA process for an ASV controller 4.1 CIM for an ASV controller Main stages to build the CIM of an ASV are the followings: • Identifying complex behaviors of the ASV being developed by using the use case model [7] In this step, tt is necessary to provide industrial consttaint conditions, e.g the maximum swing angle of mdder, the maximum vehicle velocity, etc in order to make sure the precise operation of this system Fig shows the mam use case model of an ASV conttoller, Here, MDS is the Measurement and Display System; MES is the Marine Environment System including Journal ofScience & Technology 100 (2014) 011-015 disturbances such as the wind, waves, ocean cunents etc We find that the "Drive'" use case is oriented towards conttol modes; its complex behaviors must be specified by using sequence diagrams and local state machines In our model, we use the 3D dynamic model of ASV and LOS guidance [4], [5] because we are interested in the trajectory-tracking conttol Behavior (IGCB's capsule) Fig shows out the general inter-communication pattern of these conttol capsules by using the RT U M L ' s collaboration diagram It can be noted that if we use the SysML notations to model these features, then each capsules and its protocols respectively correspond to a block and its flow ports and item flows ASV Intecronnecbon pattern of ma'n control capsEiles Fig Main use case model of an ASV controller • Defining the extended fimctional diagram [5], which permits us to model ttansformational activities of an ASV conttoller with events coming from outside • Building a global state machine in order to bring out the global dynamic behavior of the ASV being developed from all local identified state machines The specific rules which permit us to discover this global state machine can be found in [5] • Specifying the hybrid automaton of an ASV; this includes situations, invariants, continuous state spaces, events, initial situation, mitial continuous stale, and continuous fluids [2] We have defined the steps and realization hypotheses, which can be found in the author's report [5] to determine HA of the ASV being developed 4.2 PIM for an ASV controller We find that the direct ttansformation of CIM to the implementation environment must be supplemented to carry out an ASV and its re-use in the new application development phase For example, the above identified CIM are not well adapted to visualize, model interconnection types between control objects or sub-systems In the detailed design phase of this system, we transform the identified CIM into PIM, which is based on the use case approach, and uses the Real-Time UML/SysML notations [7] From the approach described in [8], we have developed the main conttol capsules of PIM, which take part in the HA realization of the ASV being developed: the continuous part's capsule, discrete part's capsule, intemal interface's capsule, extemal interface's capsule and Instantaneous Global Continuous Fig Interconnection pattern of main capsules conttol • The discrete part's capsule contains a set of situations and ttansitions in HA of the ASV being developed (i e , the macro-motion in surge, sway, and yaw) • The continuous part's capsule is associated in ttansformational activities of the identified extended functional diagram, • The IGCB's capsule contains concrete continuous fluids of the ASV being developed at time given in its HA Each conttnuous fluid conesponds with a sittiation in this HA • The internal interface's capsule generates intemal events of the ASV bemg developed, so that the discrete part's capsule can make its own evolution by these events • The external interface's capsule is an intermediary, which receives or sends episodic events and penodic signals between the ASV being developed and their interacted systems such as MES and MDS m our case study 4.3 PSM for an ASV controller The 'sub-system' paradigms, which are supported by software tools such as MatLabSimulink, OpenModelica, etc are used to perform the conttol simulation model of ASV; because they are easily adapted from the object-oriented analysis elements of this system Then, the 0 realization models are developed in the PSM in order to carry out its implementation phase with specific platforms Journal of Science & Technology 100 (2014) 011-015 which can support object-oriented programming languages such as C++, Java, Ada, etc., and upload the implemented conttol program to compatible microconttoUers Within limit of the paper, we not show out here all the components of CIM, PIM and PSM for the ASV conttoUer, so detailed results can be seen in [5] Application Based on the above described approach, we have successfiilly analyzed, designed and implemented the horizontal planar ttajectory-ttacking conttoller for a miniature autonomous marine vehicle This is a part of the potential research project (code: KC03.TN05/I I-I5), which has been led by the author fi-om Hanoi University of Science and Technology [5] In this application, we have used OpenModelica software tool [9] for simulate the conttol performance of ASV, because it is tightly based on object-oriented mechanisms and properties oi Modelica language [10] Arduino platform [I I] has been used to quickly deploy the realization model of the conttoller Ariduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software It can sense the environment by receiving inputs from a variety of sensors such as the pressure, Inertial Measurement Unit (IMU), magnetometer Global Positioning System (GPS), etc., and can affect its surroundings by conttolled actuators Arduino Mega2560 microconttoUer [II] on the board has been programmed by using the Arduino programming language based on C++ AH of PIM and PSM artifacts of this conttoller have been created by using the above approach to completely deploy and take on trial trip for this marine vehicle [5] new PSMs by using different object-oriented specific platforms in order to completely realize this conttoller with compatible microconttoUers Following this approach, a ttajectory-ttacking conttoller of a miniature autonomous marine vehicle has been completely developed with the simulation model in OpenModelica, and realization model by using Arduino Mega2560 microconttoUer In the nexl time, we will develop this approach combined with various conttol formalisms and architectures in order to perfectly design, implement and deploy conttollers for balancing search and target response in cooperative ASV teams Acknowledgment The authors would like to thank the supports fi-om the scientific research project, code; KC03.TN05/H-I5, Hanoi University of Science and Technology References Carloni, L.P., Passerone R., Pinto, A., Sangiovanni-VincenteUi L.A.; Languages and Tools for Hybrid Systems Design; now Publishers Inc., Boston, 2006.Hien, N.V., Soriano, T.; Implementing hybrid automata for developmg industrial control systems; Proc of 8'" lEEE-ETFA, ISBN 0-7803-7241-7, (2001) 129-137 SNAME; Nomenclature for Treating the Motion of a Submerged Body Through a Fluid; SNAME Technical and Research Bulletin No 1-5, N.Y., U.S.A., 1950 Fossen T I.; Handbook of Marine Crafl Hydrodynamics and Motion Conttol; John Wiley & Sons, 2011 Hien, N.V., et al.; Research, design and manufacture control systems with the integration of object-oriented technology (MDA & RealTime UML) and navigation units (INS/GPS) for autonomous marine vehicles; Final report of potential research project, code: KC03.TN05/1115, Hanoi University of Science and Technology, 2013 OMG; Model-Driven Architecture (MDA) guide; hflp://wTvw.omg.org/mda/, 2003 OMG; UML Profile for MARTE, Real-Time Unified Modeling Language, System Modeling Language; http://www.omg.org/spec/, 2011 Soriano, T., Sghaier, A., Hien N.V.; Mechattonics Design fi-om an Object-Oriented Point of View; WSEAS Transactions on Communications, ISSN 1109-2742, (2004) 282-287 Conclusion In this paper, we have inttoduced an objectoriented approach to develop conttollers of ASV This approach is based on the specialization of MDA's features with real-time UML/SysML and HA in order to quickly analyze, design and implement the conttol parts of system No single formalism or language of an engineering process can possible capture all the knowledge and information needed to solve complex conttol systems such as the ASV conttoller The ASV dynamic model is adapted to gather the conttol requuement analysis The MDA's features are specified to obtain a general MDA process model including the CIM, PIM and PSM to entirely develop this system The CIM of an ASV conttoller is defined to carry out its object-oriented analysis phase by specializing use case model and HA The PIM is defined for obtaining the detailed design model by specifymg real-time UML/SysML notations in the precise behaviors and stmctures of the ASV conttoller Then, the PIM is converted into Joumal of Science & Technology 100 (2014) 011-015 OpenModelica; OpenModelica software https://openmodelica.org/, 2012 tool; Fritzson P.; Introduction to Modeling and Simulation of Techiucal and Physical with Modetica; John Wiley & Sons, 2011 10 Arduino, Open-source electtonics prototyping platform for hardware and software; http://www.arduino.cc/, 2012