SimTwo as a simulation environment for flight robot dynamics evaluation

Aerial Robots has become very popular in robotics groups. This ongoing interest is driven by a significant number of potential end-user applications where it is necessary to reduce human intervention. The validation of control/cooperation algorithms not always is an easy task and requires a large number of humans to keep tests safety. Is present in this paper the simulation of a quadrotor model in SimTwo simulation environment and evaluated the flight dynamic of the robot. To do that was developed a control layer responsible to the hovering maneuver and “go to” position function. The results prove that the objectives were achieved successfully and the simulation was validated. The navigation simulation is left as future work. Subject Headings. Robotics, simulation model, digital control. Author


Introduction
The human interview complexity in the natural environment has originated a growing need for performance risk tasks, i.e., inspection actions of infra-structures either environment itself.Robots are many times called to replace human interview in actions that requires precision or are dangerous.Some complex tasks require the necessity to obtain wide visual information (or other sensory information) through multiple observations points.In this context, mobile autonomous aerial robots arise as an important and valuable tool.Thinking about a scenario with a team of aerial robots, for a safety reasons, it is necessary to have at least one human operator for each robot, which is not feasible for some research groups (Echeverria et al. 2012;Folgado et al. 2007;Dewan et al. 2013b;Lächele et al. 2012;Michael and Kumar 2008;Mira 2007;Costa et al. 2011).A reasonable solution is the utilization of Simulation Software's.An example of this is the work from Johannes (Meyer et al. 2012) with a simulation environment developed in Gazebo and integrated with Robotic Operating System (ROS) that was very useful to evaluate the aerial robot behavior such as flight dynamic.Also developed in Gazebo was the Nathan (Koenig et al. 2004) work that simulates a distributed formation of a swarm team of ground robots with the ability to adapt the shape of the formation based on the environment constrains.The work from Dewan (Dewan et al. 2013a) to evaluate the proposed optimization method to perform cooperative exploration between heterogeneous vehicles was also implemented in a simulation environment.
In this article is present the simulation of a quadrotor using the realistic simulator SimTwo (Costa et al. 2011).The real vehicle, modeled in simulator, is illustrated in the Figure 1.The hovering maneuver was achieved successfully as well as the implementation of a "go to" point controller.The outline of the paper follows.In section 2 is approached the State of the Art as regard quadrotor simulators.Section 3 presents some assumptions used in the system modeling.Section 4 is related to evolved referentials in this application.Section 5 is dedicated to control architecture presentation.The implementation in SimTwo simulator is addressed in section 6.For final, the conclusions are presented in section 7.

State of the Art
Due the difficult to evaluate algorithms in aerial robots without damage itself, the use of simulators is a path rather sought by researches.External environment conditions as wind and dynamics effects are features that giving realism to the simulator.A simulator should be as realistic as possible to minimize the difference between the simulation and the practice.There are many commercials and open-source simulators.Even though 2D simulators, such as Enki (Magnenat 2013), Stage (Hedges 2005) and BugWorks (Thornton 2006), we will focus in 3D simulators.All of them, listed below, already offer quadrotor models that can be used for simulations.

Gazebo
Gazebo is a simulator very popular under Robotic Community and has evolved a lot since it was integrated in Robotic Operating System (ROS) platform (Koenig et al. 2004).The lack of documentation is a negative point for this software that requires a big effort to sensors integration into the vehicles and to develop realistic outdoor scenarios.However, the Gazebo 4.0 version (released in July 2014), provides a graphical user interface that could overcome the limitations mentioned.

USARSim
Initially developed as a simulator for search and rescue operations, Unified System for Automation and Robot Simulation is widely used in RoboCup competitions (Carpin et al. 2007).It follows a modular component approach and uses the Unreal Engine gaming platform.The disadvantage of this software is the external communication layer that doesn't support some of the most common robotics middleware without additional programming.

Webots
Webots is a commercial simulator that even though provides a full programming environment to create robots and environments, has an unintuitive and complex interface to construct new robots and components (Michel et al. 2004).

MORSE
The Modular Open Robots Simulation Engine is a powerful simulator that runs on the Blender Game Engine to interface 3D environment with external robotics software.Developed in Python, it has a lot of sensors that are fully supported by the middleware and can provide data as their real world counterparts allowing also the choice of different levels of realism and abstraction.MORSE proved to be very versatile, modular, flexible and reusable (Echeverria et al. 2012).

SimTwo
SimTwo is a realistic simulator system that can support several types of robots (Costa et al. 2011).With this complete tool is possible to design robots and environments as well as define objects characteristics imperials to a realistic behavior.Devoted to an educational and research approach this simulator being a versatile robot simulation environment that allows rapid test and design of differential, omnidirectional, industrial, humanoid robots, etc., developed in Object Pascal.The dynamics realism in SimTwo is obtained by decomposing a robot in parts such as rigid bodies and electric motors (Costa et al. 2011).

System Modeling
A quadrotor is described as a vehicle with 4 thrusters in a cross configuration.The two pairs of thrusters (1,3) and (2,4), as shown in the Figure 2, spins in opposite directions.Through the speed variation, there is a variation in lifting force thereby producing movement.In this way, increasing/decreasing the speed of four thrusters simultaneously, create vertical movement.To actuate in pitch moment is necessary to decrease/increase the speed rotation of motor 1 and increase/decrease the speed rotation of motor 3 from the same number of magnitude.
In the same way, to actuate on roll moment, is necessary to decrease/increase the speed rotation of motor 2 and increase/decrease the speed rotation of motor 4. The yaw moment is achieved ranging the speed rotation difference between thrusters pairs 1/3 and 2/4.

Referentials
The referential concept identifies a coordinator system, as always necessary the utilization of, at least, two referentials: one for vehicle representation and another for navigation referential representation.
The utilization of multiple sensors that provides data in different referentials, create the need of coordinates transformation for one unique referential in order to do the sensory fusion.Below are presented the used referentials.

ECEF (Earth-Centered, Earth-Fixed)
The ECEF referential (Xu et al. 2007), used by GPS, is a Cartesian coordinates system (x,y,z) presented in Figure 3.Some characteristics of this referential are: − The referential origin is coincident with the Earth's center of mass; − The Z axis is coincident with the Earth rotation axis; − The X axis is coincident with the interception of planes defined by the Greenwich Meridian and Ecuador; − The plane defined by X and Y axis coincides with the Ecuador plane.

Vehicle Referential
The body referential, represented in Figure 4, has its axis coincident with the vehicle referential.The xx' axis points to the front of aircraft (roll axis), the yy' points to the aircraft left (pitch axis) and the zz' points to up (yaw axis), completing an orthogonal coordinates system.The origin of this referential is considered in the cross of coincident symmetry, in this case, with the vehicle's center of mass.

Relationship between vehicle referential and ECEF referential
Through Figure 4 we can observe the vehicle referential.We should assume that the body center of mass is coincident with the origin of the referential.In order to list both referentials is necessary the introduction of a rotation matrix R.This matrix is constituted through successive rotations of three Euler angles (Grewal et al. 2007) known as roll, pitch and yaw (φ, θ, ψ, respectively).In this way obtain E through successive rotations multiplied by system coordinates B that is mathematical described as: Considers up for the Earth referential E = {X,Y,Z} and the body referential B = {x,y,z}.For a real-time control, at each moment is needed the position knowledge and orientation of B related to E. The rotation of a rigid body could be parameterized using some methods (Euler angle, quaternion, etc.).The Tait-Bryan angles, also known as "Cardan angles", are used in aeronautic engineering.Those angles correspond to a specific set of Euler angles, that is, consists in a three Euler angles (Grewal et al. 2007) with a pre-defined rotation convention.
In this article will be used the same nomenclature used in the aeronautic engineering.The Euler angles, represented in Figure 5 will be designated in the following way: According to the axis convention adopted, the rotation matrices will be the following, respectively to roll, pitch and yaw (Perez et al. 2007;Bouabdallah et al. 2007): The complete rotation matrix, as well known as Direct Cosine Matrix, is:

Control
In the control and basic stabilization of the vehicle will be used a decoupled approach assuming that the system is little disturbed relatively his balanced point from what can be conjugate effects from four separately controllers: height, pitch, yaw and roll.In this way, the stabilization problem consists in the project of 4 controllers each of one responsible to stabilize one variable (height, roll, pitch and yaw).This controllers generates a reference (U1,...,U4) correspondent a generalized control force that after is combined in order to obtain the reference speeds for each motor (Amaral et al. 2009).The control architecture is represented in the figure below.The difference between the desired and actual speed is injected in the speed controller that try to generate a reference in order to minimize or, in the best case, cancel the error (Figure 7).This simulator can combine a high level of reality with a reduced computational power and with good graphical representation instead another simulators.

Simulator
The main robot is constituted by a central sphere and four arms arranged in such a manner that confines a cross disposal.In the exterior arms' extremity are present motors with propellers joined through "Hinge" joints.Objects parameters as well as weights, drag coefficients, thrust coefficients, position, etc., are defined in a XML dedicated file.
The controller code was developed in Pascal.A particularity of this simulator is that at program beginning is called an initializing function where some variables are loaded and then control loop start to run at 25 Hz (by default).The function calculates control actions using actual and desired position in order vehicle's position converge to given points.We can observe an overshoot near references changes that can be perfectly accepted taking into account the vehicle dynamic.From the origin, was defined the set point (1,0) and then (1,1).After the vehicle has reached the position, was defined, at same time, a variation in both axes: (2,2).Finally, was defined the origin position (0,0).All tests were done with height reference of 1 meter.

Conclusions
In this paper we propose the simulation of a quadrotor vehicle like using the SimTwo Simulator software.We present the relationship between different two referentials and use it to implement the control layer, responsible to keep the robot in the air.A "go to" point function was also implemented and validated successfully.The vehicle dynamics influence is notorious in the quadrotor behavior denouncing the power of the simulator and the right values assigned to objects parameters.For future work is the application of a claw in the quadrotor structure confining the capacity to transport objects from one side to another and simulation of navigation layer.

Figure 2 :
Figure 2: Quadrotor movements' description -Arrows dimensions are proportional to propeller spin speed

Figure 6 :
Figure 6: Quadrotor control architecture Each speed controller was hand tuned to obtain a satisfactory step response.

Figure 7 :
Figure 7: Block diagram of a generic speed controller

Figure 9 :
Figure 9: Evolution of vehicle's height for different set points For the height controller evaluation was defined different values for the desired height, namely the sequence {1, 2, 1, 0}.The behavior of the vehicle's height is shown in the Figure 9.

Figure 10 :
Figure 10: Evolution of vehicle's position for different set pointsFigure10illustrates the position controller behavior.Taking advantage of the "go to" developed function, were given different points in the Earth referential.The function calculates control actions using actual and desired position in order vehicle's position converge to given points.We can observe an overshoot near references changes that can be perfectly accepted taking into account the vehicle dynamic.From the origin, was defined the set point (1,0) and then (1,1).After the vehicle has reached the position, was defined, at same time, a variation in both axes: (2,2).Finally, was defined the origin position (0,0).All tests were done with height reference of 1 meter.