Modeling and Control of a VTOL Glider

Similar documents
SIX DEGREE-OF-FREEDOM MODELING OF AN UNINHABITED AERIAL VEHICLE. A thesis presented to. the faculty of

Onboard electronics of UAVs

Active Vibration Isolation of an Unbalanced Machine Spindle

Manufacturing Equipment Modeling

CHAPTER 1 INTRODUCTION

Lecture L29-3D Rigid Body Dynamics

The Design and Implementation of a Quadrotor Flight Controller Using the QUEST Algorithm

An inertial haptic interface for robotic applications

Basic Principles of Inertial Navigation. Seminar on inertial navigation systems Tampere University of Technology

2. Dynamics, Control and Trajectory Following

General aviation & Business System Level Applications and Requirements Electrical Technologies for the Aviation of the Future Europe-Japan Symposium

Lab 8 Notes Basic Aircraft Design Rules 6 Apr 06

FRICTION, WORK, AND THE INCLINED PLANE

Center of Gravity. We touched on this briefly in chapter 7! x 2

Quadcopters. Presented by: Andrew Depriest

Quadcopter Dynamics, Simulation, and Control Introduction

Lecture L5 - Other Coordinate Systems

CONTRIBUTIONS TO THE AUTOMATIC CONTROL OF AERIAL VEHICLES

Mechanics lecture 7 Moment of a force, torque, equilibrium of a body

The purposes of this experiment are to test Faraday's Law qualitatively and to test Lenz's Law.

CHAPTER 6 DESIGN OF SIX DEGREES OF FREEDOM AIRCRAFT MODEL AND LONGITUDINAL AUTOPILOT FOR AUTONOMOUS LANDING

DCMS DC MOTOR SYSTEM User Manual

Hardware In The Loop Simulator in UAV Rapid Development Life Cycle

Light Aircraft Design

dspace DSP DS-1104 based State Observer Design for Position Control of DC Servo Motor

Physics 1A Lecture 10C

Lecture L30-3D Rigid Body Dynamics: Tops and Gyroscopes

0 28 November 2011 N/A First Release of Manual 1 24 February 2012 Page 21 Error in FY31AP connection diagram corrected.

Chapter 18 Static Equilibrium

Rotation: Moment of Inertia and Torque

Lecture L17 - Orbit Transfers and Interplanetary Trajectories

Chapter 6 Lateral static stability and control - 3 Lecture 21 Topics

Force/position control of a robotic system for transcranial magnetic stimulation

EDUMECH Mechatronic Instructional Systems. Ball on Beam System

Aerospace Information Technology Topics for Internships and Bachelor s and Master s Theses

Lecture L3 - Vectors, Matrices and Coordinate Transformations

MODELLING A SATELLITE CONTROL SYSTEM SIMULATOR

EE 402 RECITATION #13 REPORT

Lecture 17. Last time we saw that the rotational analog of Newton s 2nd Law is

How To Control Gimbal

Power Electronics. Prof. K. Gopakumar. Centre for Electronics Design and Technology. Indian Institute of Science, Bangalore.

parts of an airplane Getting on an Airplane BOX Museum Aeronautics Research Mission Directorate in a Series

Chapter 10 Rotational Motion. Copyright 2009 Pearson Education, Inc.

Chapter 11 Equilibrium

System Modeling and Control for Mechanical Engineers

The Technical Archer. Austin Wargo

Lecture L22-2D Rigid Body Dynamics: Work and Energy

Let s first see how precession works in quantitative detail. The system is illustrated below: ...

Lab 7: Rotational Motion

Lecture L2 - Degrees of Freedom and Constraints, Rectilinear Motion

Modeling and Simulation of a Three Degree of Freedom Longitudinal Aero plane System. Figure 1: Boeing 777 and example of a two engine business jet

Research Methodology Part III: Thesis Proposal. Dr. Tarek A. Tutunji Mechatronics Engineering Department Philadelphia University - Jordan

Unit - 6 Vibrations of Two Degree of Freedom Systems

Parachute Jumping, Falling, and Landing David C. Arney, Barbra S. Melendez, Debra Schnelle 1

Author: By Siegfried Krainer and Michael Thomas, Infineon Technologies and Ronald Staerz, MCI Innsbruck

PID, LQR and LQR-PID on a Quadcopter Platform

Development of Knowledge-Based Software for UAV Autopilot Design

Motion Control of 3 Degree-of-Freedom Direct-Drive Robot. Rutchanee Gullayanon

Force on Moving Charges in a Magnetic Field

3 Work, Power and Energy

Figure 1. The Ball and Beam System.

Chapter 6 Work and Energy

Precise Modelling of a Gantry Crane System Including Friction, 3D Angular Swing and Hoisting Cable Flexibility

SIMULATION AND CONTROL OF A QUADROTOR UNMANNED AERIAL VEHICLE

Autonomous Mobile Robot-I

Practice Exam Three Solutions

Mathematical Modeling and Dynamic Simulation of a Class of Drive Systems with Permanent Magnet Synchronous Motors

Performance. 13. Climbing Flight

CALIBRATION OF A ROBUST 2 DOF PATH MONITORING TOOL FOR INDUSTRIAL ROBOTS AND MACHINE TOOLS BASED ON PARALLEL KINEMATICS

The Basics of FEA Procedure

The Effects of Wheelbase and Track on Vehicle Dynamics. Automotive vehicles move by delivering rotational forces from the engine to

ACTUATOR DESIGN FOR ARC WELDING ROBOT

Propeller Efficiency. Rule of Thumb. David F. Rogers, PhD, ATP

When the fluid velocity is zero, called the hydrostatic condition, the pressure variation is due only to the weight of the fluid.

Experiment #1, Analyze Data using Excel, Calculator and Graphs.

Columbia University Department of Physics QUALIFYING EXAMINATION

Quadcopter control using Android based sensing

Dynamics of Rotational Motion

Tips For Selecting DC Motors For Your Mobile Robot

Dipl. Ing. Falk Pätzold Technische Universität Braunschweig, Institut für Flugführung February 21 st 2014

POTENTIAL OF STATE-FEEDBACK CONTROL FOR MACHINE TOOLS DRIVES

Design-Simulation-Optimization Package for a Generic 6-DOF Manipulator with a Spherical Wrist

AE Stability and Control of Aerospace Vehicles

DC motors: dynamic model and control techniques

ANALYTICAL METHODS FOR ENGINEERS

Solving Simultaneous Equations and Matrices

KINETIC ENERGY RECOVERY SYSTEM BY MEANS OF FLYWHEEL ENERGY STORAGE

Lecture L6 - Intrinsic Coordinates

High Alpha 3D Maneuvers

Free Fall: Observing and Analyzing the Free Fall Motion of a Bouncing Ping-Pong Ball and Calculating the Free Fall Acceleration (Teacher s Guide)

Motor Selection and Sizing

APPENDIX 3-B Airplane Upset Recovery Briefing. Briefing. Figure 3-B.1

APPLICATION OF A SIX DEGREES OF FREEDOM ADAPTIVE CONTROLLER TO A GENERAL AVIATION AIRCRAFT. A Thesis by. Kimberly Ann Lemon

2.2 Magic with complex exponentials

Servo Motors (SensorDAQ only) Evaluation copy. Vernier Digital Control Unit (DCU) LabQuest or LabPro power supply

PHY121 #8 Midterm I

AP1 Oscillations. 1. Which of the following statements about a spring-block oscillator in simple harmonic motion about its equilibrium point is false?

Electric Motors and Drives

Section 5.0 : Horn Physics. By Martin J. King, 6/29/08 Copyright 2008 by Martin J. King. All Rights Reserved.

Copyright 2011 Casa Software Ltd. Centre of Mass

Transcription:

Autonomous Systems Lab Prof. Roland Siegwart Bachelor-Thesis Modeling and Control of a VTOL Glider Spring Term 2013 Supervised by: Konrad Rudin Ulrich Schwesinger Konstantinos Alexis Prof. Roland Siegwart Authors: Sebastian Verling Julian Zilly

Declaration of Originality We hereby declare that the written work we have submitted entitled Modeling and Control of a VTOL Glider is original work which we alone have authored and which is written in our own words. 1 Authors Sebastian Julian Verling Zilly Supervising lecturer Konrad Ulrich Konstantinos Prof. Roland Rudin Schwesinger Alexis Siegwart With the signature we declare that we have been informed regarding normal academic citation rules and that we have read and understood the information on Citation etiquette (http: //www.ethz.ch/students/exams/plagiarism_s_en.pdf). The citation conventions usual to the discipline in question here have been respected. The above written work may be tested electronically for plagiarism. Place and date Signature Place and date Signature 1 Co-authored work: The signatures of all authors are required. Each signature attests to the originality of the entire piece of written work in its final form.

Abstract In this bachelor thesis the modeling and control of the aircraft PacFlyer which was built within the scope of a one-year student project at the Autonomous Systems Laboratory at ETH Zurich is studied. The PacFlyer is a hybrid aircraft that can both take off and land vertically like a helicopter as well as fly in cruise like a regular airplane. The goal of this thesis is to enable the aircraft to perform a fully controlled flight envelope with the aid of a pilot. This flight envelope consists of a vertical take off in hover flight, a transition into cruise flight, a transition back to hover flight and vertical landing. The flight envelope of the aircraft is divided into three flight modes, namely hover, cruise and transition. For all three modes a nonlinear grey box system model has been derived via a system identification step of the actuator characteristics. A 6 degree of freedom rigid body model was used to model the dynamics of the aircraft. For hover a transformation to decouple the system has been developed. For both hover and cruise mode cascaded PID controllers were used. To address the transition, strategies have been developed to change from hover to cruise mode and vice versa by thoughtfully combining both the hover and cruise model and controller. The control strategy of all controllers was tested in simulation and partially experimentally validated on the prototype. ii

Acknowledgements We want to thank our supervisors Konrad Rudin, Ulrich Schwesinger and Konstantinos Alexis for their generous support during these last couple of months. We are also very thankful for the effort of Prof. Roland Siegwart who has made the project possible in the first place that this thesis is based on. Furthermore, we want to express our gratitude towards our PacFlyer team that has given us the fuel to work this motivated on the project and this thesis. We are happy to have had the opportunity to work on a thesis with this kind of practical relevance. iii

Contents Symbols vii 1 Introduction 1 1.1 Formulation of the problem.............................. 1 1.2 Related work...................................... 2 1.3 Thesis outline...................................... 3 2 System Description 5 2.1 General description................................... 5 2.2 Flight modes...................................... 6 2.2.1 Hover mode................................... 6 2.2.2 Cruise mode.................................. 7 2.2.3 Transition mode................................ 8 2.3 Coordinate system................................... 8 2.4 Electronics....................................... 11 3 Hover Modeling and Control 13 3.1 Modeling........................................ 13 3.1.1 Modeling of actuator characteristics..................... 14 3.1.2 System dynamics................................ 17 3.2 Control......................................... 19 3.2.1 Attitude controller............................... 19 3.2.2 Position controller............................... 24 3.3 Simulation results................................... 26 4 Cruise Modeling and Control 29 4.1 Modeling........................................ 29 4.1.1 Control surface characteristics........................ 30 4.1.2 Aerodynamics calculations tool........................ 30 4.1.3 Rigid body dynamics.............................. 31 4.2 Control......................................... 32 4.2.1 Control modes................................. 32 4.2.2 Control scheme................................. 32 4.3 Simulation results................................... 34 iv

5 Transition Modeling and Control 37 5.1 Modeling........................................ 37 5.2 Control......................................... 38 5.3 Simulation results................................... 40 6 Implementation and Testing 43 6.1 Implementation..................................... 43 6.2 Testing......................................... 43 7 Conclusion and Outlook 47 A Software structure 49 B Motor selection 54 B.1 Front motors...................................... 54 B.2 Rear motor....................................... 55 References 57

Symbols Symbols φ, θ, ψ Roll, pitch and yaw angle φ d, θ d Desired roll and pitch angle, respectively τ x, τ y, τ z Respective torques around roll, pitch and yaw axis Ω Angular speed of a propeller/rotor b i Thrust coefficient d i Drag torque coefficient L... Length of... (front, back, side) β Rear tilt angle for yaw control in hover ɛ... Efficiency of... τ... Absolute value of torque of... F z Force in z - direction τ x,y,z Abbreviation for torques in x, y and z direction T x Thrust in x - direction T y Thrust in y - direction T z Thrust in z - direction T Total thrust A 4x4 Placeholder for a 4 by 4 matrix R T (z, ψ) Rotational matrix to account for yaw orientation α Angle of attack of air inflow towards the wing d Chord length k V Motor speed constat k τ Motor torque constant R i Inner resistance of the motor I 0 No-load current Indices x y z x axis y axis z axis vii

Acronyms and Abbreviations ASL C/C++ CAD CoG DMAVT DoF EKF ETH GCS IMU LQR MIMO PID PWM RC RPM RSSI RTL SISO UAV UKF VTOL Autonomous Systems Laboratory Computer programming languages Computer Aided Design Center of Gravity Department of Mechanical and Process Engineering Degree of Freedom Extended Kalman Filter Eidgenössische Technische Hochschule (Swiss Federal Institute of Technology) Ground Control Station Inertial Measurement Unit Linear Quadratic Regulator Multiple Input Multiple Output Abbreviation for proportional, integral and derivate gains for control Pulse Width Modulation Radio Control or Remote Control Revolutions per Minute Received Signal Strength Indication Return to Launch Single Input Single Output Unmanned Aerial Vehicle Unscented Kalman Filter Vertical Takeoff and Landing

Chapter 1 Introduction In the last couple of years science has made an unprecedented advance in sensing capabilities as well as provided an almost ubiquitous presence of computing technology. Simultaneously, knowledge in unmanned aerial vehicles (UAVs) has progressed considerably. With these means available, a one-year-long focus project at the Autonomous Systems Laboratory at ETH Zurich of which the authors of this thesis were a part of set out to build an UAV with vertical take off and landing (VTOL) capability. This aircraft is called PacFlyer. The developed prototype was designed to combine the VTOL capability of a helicopter with the forward flight efficiency of an airplane. For take off and landing it employs a multicopter setup that hovers and can transition into regular airplane flight. The multicopter setup of the PacFlyer used for VTOL capability is a tricopter which has three rotors. Applications of UAV aircraft are very diverse and could potentially range from tasks as diverse as small parcel delivery to surveillance as well as general sensing applications. UAVs could be used in hazardous environments to protect rescuers and gather critical information. Some applications that are already in use are domestic policing, natural resource exploration, wildlife conservation and fire detection. The project set out with the idea of small parcel delivery even to remote places or villages where little or no infrastructure for transportation such as roads or flight runways exists. To enable an aircraft to have good access to these places a VTOL capable prototype was needed. A sample flight mission would therefore consist of vertical take off, transition to cruise flight, traveling to the destination in cruise flight, transitioning back to hover flight, landing vertically and vice versa. This would not only allow transporting goods to remote places but also sending them from there, potentially allowing for trade. Developing such an adaptable aircraft could potentially yield great benefits by transporting parcels with e.g. medicinal drug delivery to mentioned remote places. 1.1 Formulation of the problem The bachelor thesis is written at the Autonomous Systems Laboratory of the Mechanical and Process Engineering Department (DMAVT) at ETH Zurich and is based on the focus project PacFlyer within the same institute. The goal of the work is to mathematically model, control and stabilize the aircraft during its whole flight envelope. Specifically the model should capture the most relevant effects of the system, e.g. taking into account the characteristics of the actuators such as saturations and actuator dynamics. Furthermore when suitable to the accompanying 1

Chapter 1. Introduction 2 project, the controllers should be implemented and tested in the different flight modes of the flight envelope. The flight envelope described before in the general introduction is divided into three flight modes, namely hover, cruise and transition mode. The PacFlyer has to be modeled and controlled in hover mode during take off and landing. In a next step the cruise mode should be modeled and controlled. With a working controller and knowledge of both hover and cruise mode the transition should be addressed. The transition of the two previous modes is achieved through a simple intermediate controller or control strategy. Methods such as cascaded PID control, a decoupling transformation and a position control technique in hover are investigated as described by Astrom et al. [1], Guzzella [2] and Rudin [3] and are used to control the aircraft in its flight modes. 1.2 Related work The PacFlyer is a hybrid aircraft meaning it can be regarded as a different aircraft depending on whether it is hovering or in cruise flight. Similar designs to the PacFlyer can be divided into either multicopter setups, regular airplanes or similar hybrid aircraft that combine the first two designs. Multicopter designs On a more conceptual level, Barsk [4] deals with modeling and control of a tricopter with a model predictive control approach. A tricopter is a multicopter with three rotors where one rotor is able to tilt sideways. Similarly but more applied, Salazar-Cruz [5] shows the building, simulating and physical testing of a tricopter design with real-time control. Regular airplane designs The concept of a regular airplane with standard control surfaces is widely and well understood in the airplane community. Lectures such as Unmanned Aircraft Design, Modeling and Control [3] at ETH Zurich explain the general modeling and control approaches for airplanes such as cascaded PID control or optimal control approaches like LQR while the lecture Aircraft Stability and Control at MIT [6] focuses more closely on airplane modeling and control concepts such as PID or root locus control. Albaker and Rahim [7] deal with PID control of a fixed-wing UAV.Additionally, there are also books such as by Bryson [8] that deal with LQR control of aircraft. Hybrid designs Carlson [9] demonstrated in the Orange Hawk Project a system that also has a tricopter mode in hover and can change into cruise flight of a regular airplane in flight. This aircraft utilizes a one wing design with three short arms outward on which the rotors are located. Similar to the PacFlyer design, the Orange Hawk has front rotors that can tilt forward. Likewise, Fan, Wand and Cai [10] describe a tricopter design with two attached wings that can perform high speed flight. A very similar design to the focus project PacFlyer was developed by Ta, Fantoni and Lozano [11]. It is a small airplane with three rotors, the two in the front being able to tilt forward. This design was simulated but not experimentally validated.

3 1.3. Thesis outline 1.3 Thesis outline The organization of the thesis is shown in the following. Chapter 2 gives with a general description of the properties of the PacFlyer in its flight modes. Here relevant actuators or control surfaces are already assigned to their respective flight modes in which they are used. A general flight envelope overview is given. Chapter 3, 4 and 5 deal with the individual flight modes hover, cruise and transition respectively. These chapters deal with the modeling, the controller and the simulation for the individual modes. Chapter 6 presents the implementation and testing of the controllers and the results are discussed. Chapter 7 finally gives a conclusion and outlook to the thesis.

Chapter 1. Introduction 4

Chapter 2 System Description The system PacFlyer regarded in this thesis is a hybrid between a regular plane and a tricopterlike aircraft as explained in the introduction. This chapter focuses on the description of the system with regard to aspects relevant to modeling and control and later implementation of the different flight modes. The motors and servos and their placement will be discussed. Additionally, the control surfaces for cruise flight will be mentioned. Another focus will be on the electrical parts relevant for controlling the system i.e. the microprocessor and the sensors. 2.1 General description Figure 2.1: Illustration of the PacFlyer with its most important system components 5

Chapter 2. System Description 6 The PacFlyer will be regarded within the context of its different flight modes. In that context the necessary parts to fly in the different modes will be shown. Correspondingly, in figure 2.1 the most relevant parts of the aircraft are shown. In figure 2.2 the schematics of the three flight modes hover, transition and cruise are illustrated. The most important functional parts and main properties of the modes will be presented in individual subsection for each mode. Cruise Transition Hover Figure 2.2: Illustration of the PacFlyer in its different flight modes - hover, transition and cruise from bottom left to top right 2.2 Flight modes The main properties of the three flight modes displayed in figure 2.2 will be explained in the following. 2.2.1 Hover mode In hover the PacFlyer is essentially a tricopter as displayed in figure 2.3. The two front propellers and the rear propeller are pointing upwards while the rear propeller also has the ability to tilt sideways with angle β with a servo. In contrast to an airplane, manually steering a tricopter or more generally a multicopter is a challenging task without electronic stabilization due to cross-coupled system dynamics. A tricopter has strong cross-coupling within the system, e.g. one motor thrust has an effect on multiple states such as attitude angles. Roughly however a

7 2.2. Flight modes tricopter is controlled using differential thrust of the front propellers to roll, differential thrust of the rear and the two front propellers to pitch and tilting of the rear propeller sideways to yaw. Using geometric calculations the thrust distribution of the three propeller for this system is shown in table 2.1 to hover at an equilibrium. Given this distribution stronger motors for the front than the rear are required. For more detailed information about the motors see appendix B. Figure 2.3: PacFlyer in hover mode. Thrusts in orange, tilt angle β to tilt the rear thrust around x-axis. Table 2.1: Thrust distribution of the front and rear propeller-motor-assemblies Rotors Total thrust in percent % Each main front rotor 37.9 % Rear rotor 24.0 % 2.2.2 Cruise mode In picture 2.4 the PacFlyer is illustrated in cruise flight mode. The aircraft in this mode works like a regular airplane. The front propellers are tilted by 90 in the front in comparison to the hover mode so they point in forward flight direction. The control surfaces are highlighted in orange. The ailerons are deflected antisymmetrically to control the roll motion, the elevator is used to control the pitch motion and the rudder for the yaw motion. The two front propellers are used to produce thrust and rotate with the same speed. The rear propeller is deactivated during this mode. The dimensions of the flaps were estimated as proposed by Raymer [12].

Chapter 2. System Description 8 Figure 2.4: PacFlyer configured for cruise flight. Control surfaces highlighted in orange, thrusts in forward flight direction in red 2.2.3 Transition mode During the transition mode displayed in figure 2.6 both the actuators and control surfaces of the hover and the cruise mode are used. Additionally the tilting mechanism of the front propellers shown in figure 2.5 is used to steer the angle of the front propeller in order to regulate the ratio between the thrust in forward flight and upward direction. This angle has a range of 90. All elements such as forces and torques that are influencing the system are illustrated in figure 2.6. The mentioned tilting mechanism is one of the most essential hardware parts of the system, as it provides the possibility of changing from the flexible hover mode to the efficient cruise mode. Due to complex mechanics and the importance of this part it was developed and is discussed more thoroughly in another thesis by Lehmann [13]. 2.3 Coordinate system To make things more tangible and concrete for modeling a body coordinate system is set on the aircraft and an earth-fixed coordinate system is introduced. The coordinate systems explained in the following are closely based on descriptions by Wendel [14]. The body coordinate system is presented in the upcoming figure 2.7 and as the earth-fixed system will be used in the further discussion and chapters. Using different coordinate systems allows the introduction of various forces and torques acting on the aircraft in a simpler way. Specifically, some forces are easier to model in the body-fixed frame shown in the figure 2.7 above. Whereas, some forces and torques are more easily modeled using an earth-fixed coordinate frame.

9 2.3. Coordinate system Actuation Axis Figure 2.5: Tilting mechanism Figure 2.6: Illustration of the PacFlyer in transition mode with tilting of front rotors (angle displayed) and both hover and cruise forces

Chapter 2. System Description 10 Figure 2.7: Illustration of the PacFlyer with its body-fixed coordinate system and respective rotation angles as introduced by Leutenegger [3] Body-fixed frame The body-fixed coordinate system is fixed to the aircraft. It has the x-axis along the forward axis of the fuselage. The y-axis is alongside the right wing side (from back to front view). Finally, the z-axis points downwards from the aircraft as illustrated in figure 2.7. The center of the body frame is set to the quarter chord of the wing in forward direction of the fuselage, in the center of the wing in the direction along the wing and at the height of the wing in up or down direction. The body-fixed frame is mainly used to compute aerodynamic forces that depend on the attitude of the PacFlyer. As the IMU measures accelerations in this coordinate system the equations get simpler than in a fixed frame. The thrust forces and resulting drag torques are introduced in the body-fixed coordinate system as well. A vector in the body frame is denoted with a superscript b. Earth-fixed frame The earth-fixed frame is as the name says earth fixed and meant to show where the aircraft is relative to this fixed observer point. For simulation purposes the frame can be regarded as being placed a plane with z-direction downwards in the direction of the ground or gravity and the x and y direction arbitrarily set. This is done because the simulations are not conducted on a specific point on earth but rather in a virtual environment. While the earth-fixed frame remains immobile, the body-fixed frame can move relative to the earthfixed frame.the earth-fixed frame can be used e.g. for the translational movement of the body as well as for the gravity force acting in earth-fixed frame z-direction on the center of gravity. Furthermore, one often wants to follow a reference trajectory in the earth-fixed coordinate system. This frame also introduces the attitude of the system, which is defined as the angle state of the body-fixed frame relative to the earth-fixed frame as shown with the angles φ, θ and ψ in figure 2.7. A vector in the earth-fixed frame is denoted with a

11 2.4. Electronics superscript e. Due to the resolution of the IMU the rotation of the earth is not taken into account when measuring and the earth-fixed frame is used. While the IMU delivers data in the body-fixed frame, data such as position are needed in the inertial frame. Therefore a transformation between these two frames is used in the work presented in this thesis. Overall Tait-Bryan angles are used to describe the attitude of the aircraft. For a more detailed understanding of both Tait-Bryan angles and the transformation between the presented coordinate frames refer to Leutenegger [3] and Wendel [14]. 2.4 Electronics With all physical parts discussed needed for the flight envelope, the essential electronic parts that power and control the system still need to be addressed. In the following the microprocessor controller and sensors will be described. ArduPilot Mega 2.5 The circuit board used in the described system is an ArduPilot Mega 2.5. It consists of the components described in table 2.2 For control purposes the most important part of this board Table 2.2: ArduPilot Mega 2.5 components Processor On-board sensors Atmega 2560 by Atmel Barometer MS5611-01BA03 Magnetometer HMC5883L Inertial Measurement Unit (IMU) MPU-6000 Ports USB-Port GPS-sensor connection 8 input-ports 8+3 PWM output-ports Input-port for optical flow sensor ADNS-3080 Input-port for airspeed sensor MPXV7002DP Input-port for telemetry kit Additional features 16Mbit data flash AT45DB161D-MU

Chapter 2. System Description 12 is the IMU which contains a gyroscope and an accelerometer to measure angular velocity and accelerations of the system respectively. To obtain the attitude angles shown in figure 2.7 the IMU is first calibrated around a manually set zero attitude. The attitude angles are then obtained by integrating the angular velocities. Merging the data of the IMU with the measurements of the GPS-Sensor, the barometer and the magnetometer one can also estimate velocity and position of the system. To implement control algorithms and in the end calculate control signals using the state data of the system the Atmega 2560 processor is used. The control signals are then written to the PWM port of the actuators.

Chapter 3 Hover Modeling and Control This chapter describes the PacFlyer in hover mode. The hover mode will be presented with a first overview about the mode s modeling and control scheme. Then the modeling of the mode itself will be discussed. Afterwards the controller will be presented in more detail. Finally, a discussion of simulation and test results is made. 3.1 Modeling Creating a control model of PacFlyer system makes it possible to test preliminary controller designs before implementing them and also gives an understanding for the dynamics of the aircraft. For the PacFlyer a grey-box modeling approach is chosen. The model is based on physical considerations yet some parameters of the model will have to be determined experimentally. Figure 3.1: Illustration of the complete model for hover with controller, system dynamics and non-linearities of the actuators and mappings In a first step, a brief overview over the entire modeling is given in figure 3.1. Given the overall structure of the system model the actuators with their dynamics and saturations, the system dynamics and parameters will be explained. Figure 3.1 shows the hover simulation model 13

Chapter 3. Hover Modeling and Control 14 with actuator and system dynamics, saturations and mappings. The way the signals from the controller travel through the model can be followed. Here the output signals of the controller are the control signals that are inputs to the system to the left of figure 3.1. The system model for the system dynamics is colored orange, the controller blue, the non-linearities grey and mappings green. In the following the individual blocks and parameters of the model will be explained in more detail. Here is a short list of the most relevant criteria as well as assumptions for the system model in hover that were taken into account as presented by Rudin [3]. The system model is based on a rigid body assumption Interaction with the ground or other surfaces is neglected Interaction with the environment is neglected (e.g. wind) Friction and damping are neglected (Viscous Friction, Induced Drag, Turbulences) Actuator/motor dynamics and saturation effects are taken into account based on measurements The propellers are assumed to be rigid Hub forces and torques are neglected Gyroscopic forces are neglected The interaction between the accelerated air of the front propellers with the wings is not considered 3.1.1 Modeling of actuator characteristics This subsection illustrates the signal - output relationship of the actuators, their saturations and dynamics. This essentially covers the first 4 system blocks in figure 3.1 beginning on the left. In order to make the system model as realistic as possible, actual physical tests of certain parts were relied on for modeling. The tilt angle of the rear servo as well as the forces of the front and rear propeller-assemblies are therefore mapped to the respective electrical signals that were shown to result in these forces or tilt angle. These are the actuators needed for control of the hover mode. The dynamics of the actuators as well as their saturations will be evaluated. Actuator signal characteristics When testing, all actuators (propeller-motor-assemblies and servos) exhibited a linear relationship between either thrust force, drag torque or angle and the respective electrical signal. The electrical signal used is a PWM (Pulse-Width Modulation) signal as described in more detail by Andersson [15]. One of these linear relationships is shown in figure 3.2 as an example. To find the thrust to the corresponding PWM signal of the propeller-assemblies a setup with a scale to measure thrust was used. Likewise, the angle of servos was measured with a digital angle gauge. The received data was then interpolated with a linear function of the form y = a x + b and the parameters a and b were determined.

15 3.1. Modeling Figure 3.2: PWM signal to front thrust The drag torque could not be directly measured with the material available and was thus calculated from the measured data. The calculated relationship for the drag is displayed in equations 3.1.1 and 3.1.2. The mechanical power is calculated to be the used electrical power multiplied by the efficiency of the motor and the gearbox as described in the equation P mech = ɛ motor ɛ gearbox P electric. (3.1.1) Having calculated the mechanical power one can now utilize the upcoming relationship 3.1.2 that the drag torque is the same as the mechanical power divided by the angular speed Ω τ drag = P mech Ω. (3.1.2) The resulting relationship between the drag torque τ drag and the PWM signal is as mentioned also found to be linear and hence modeled as such. Actuator dynamics In order to get a more realistic system model the actuator dynamics have also been looked at and were included in the model. The measurements of step-like changes of the motors signals were not significant enough for modeling due to too much noise. Therefore the actuator dynamics have been modeled with a mathematical model of the motors based on the motor specifications given in table B.1 and B.2 in the appendix B. This motor model is shown in figure 3.3 as it was simulated in MATLAB/Simulink. The Simulink model is an adapted file provided by Prof. Roland Büchi (Prof. R. Büchi 2013, pers. comm., unreferenced). The constants required for this model are presented in table 3.1. The main motor dynamics equation is given by d dt ω motor = 1 J ( ( U a ω motor k V ) kτ ( I 0 k τ + τ load (ω motor )) ). (3.1.3) R i

Chapter 3. Hover Modeling and Control 16 Table 3.1: Constants needed for actuator model Symbol Name Unit k V Speed constant rpm/v R i Internal resistance Ω k τ Torque constant N/mA J propeller inertia kg m 2 I 0 no-load current A The inertia J is calculated based on the weight and the dimensions of the propeller which is approximated with a disc. The speed constant, internal resistance and the no-load current is taken from the motor specification sheet. The torque constant can be calculated with the following formula. k τ = 1 30 k V π The voltage affecting the motor is then computed by U res = U a U induced with U induced = n /k V the induced voltage, n as the revolutions per minute and U a the applied voltage. The resulting current is then I = U res R i The therefore resulting torque is computed with τ res = Ik τ τ drag I 0 k τ Dividing the resulting torque with the inertia results in the angular acceleration. Integrating this result then provides the angular velocity in rad/s. Figure 3.3: Simulink model of the actuator dynamics

17 3.1. Modeling Actuator saturations To more accurately model the real prototype saturations were taken into account. The identification of the actuators saturation limits is based on measurements. The saturation of the servos are mechanical limits of the range. The brushless motor s saturations are mainly due to overheating at very high rpm. The motors could drive at higher angular speeds but these high angular speeds would require a high current which would heat the motor up too much and damage it. In table 3.2 the saturations of the various actuators are shown quantitatively. Some of these saturations have been set manually within the controller even though the actuators would have a broader range as described in the case of the motor. Otherwise the actuators could damage the system. Table 3.2: Actuator saturations Front motors Rear motor Rear tilt servo Front tilt servo Ailerons Elevator Rudder 27N/6500rpm 17N/8700rpm ±15 0 to 90 ±25 10 to 6.5 ±20 Sensor noise The sensor noise disturbing the measurements of the gyroscope and the accelerometer described in section 2.4 was modeled based on information of the sensor data sheet of the IMU. According to these information the total root mean square (RMS) noise of the gyroscope has a value of 0.05 /s and the noise of the accelerometer has a power spectral density of were considered during the modeling of the whole system. 3.1.2 System dynamics With all necessary subsystems modeled, the overall system dynamics can be looked at. The parameters for the system dynamics will be dealt with afterwards. The body dynamics are displayed by the two blocks to the very right of the overview figure 3.1. The system dynamics modeling is closely based on the MATLAB/Simulink model of the Skysailor airplane of the ASL at ETH Zurich [16] that is part of a lecture by Leutenegger [3]. Even though this is an airplane model, the 6 DoF rigid body dynamics remain the same for any body with 6 DoF. A few adaptations of the parameters were made to more realistically model the specific PacFlyer aircraft. The modeling for the dynamics works as follows. The input to the system dynamics part of the model, namely the green block to the right in figure 3.1 are the forces of the propeller-assemblies and the rear tilt angle. From these the resulting forces and torques on the system are calculated by taking into account the geometry of the aircraft and gravity. The forces and torques in the body frame that result from the propellers and the tilting of the rear propeller with angle β in the body frame are

Chapter 3. Hover Modeling and Control 18 F x F y F z τ x τ y τ z b = 0 F back sin(β) F fr F fl F rear cos(β) F fr L s + F fl L s F fr L f + F fl L f F rear cos(β) L b τ drag rear sin(β) τ drag right + τ drag left + τ drag rear cos(β) F rear β L b b. (3.1.4) The forces F fr and F fl are the abbreviated form for the forces F front right and F front left that are generated by the front propeller-motor-assemblies displayed in figure 2.3. Once arrived at the forces and torques the model describes the dynamics equations of the rigid body and is thus essentially a double integrator as shown in the following dynamics equations. Gravity is now also taken into account. This part is illustrated by the orange 6 DoF rigid body model block in figure 3.1. The following equation u v ẇ b = r v q w + 1 M F x g sin(θ) p w r u + 1 M F y + g sin(φ) cos(θ) q u p v + 1 M F z + g cos(φ) cos(θ) (3.1.5) describes the rate of change over time of the body s translational velocities. As the velocity is the time derivative of the position this equation 3.1.4 displays the translational body dynamics in the body coordinate frame. These dynamics have an Euler dynamics part as described by Leutenegger [3] that incorporates the effect of the body angular rate p, q and r into translational body dynamics. The total mass of the aircraft is denoted with M, the gravitational earth acceleration with g. Once these body accelerations are integrated the actual body velocities can be obtained. From this the translational velocities in the earth-fixed frame can be calculated by transforming from the body to earth-fixed frame with the relationship ẋ ẏ ż e = R e b u v w b. (3.1.6) Similar to the translational case, the rate of change of the body angles is shown in equation 3.1.7 ṗ q ṙ b = 1 I xx (τ x q r (I zz I yy )) 1 I yy (τ y p r (I xx I zz )) 1 I zz (τ z p q (I yy I xx )). (3.1.7) As in the translational case in equation 3.1.6 the body angular rates can be multiplied by a transformation matrix to obtain the inertial angular rates. The notation Rb e means that a transformation from subscript body frame to the superscript earth-fixed frame is conducted. Rudin and Leuteneggger [3] as well as Wendel [14] deal with this transformation in more detail. Obtaining a variable from its time derivative as the ones above requires integration. This way the model simulates the dynamics of the aircraft as a double integrator and has the attitude, angular rates, position and velocity as output.

19 3.2. Control Estimating model parameters To be able to accurately model the system dynamics a few parameters such as inertias, total mass and the center of gravity have to be found. The actuators parameters have been regarded in the respective subsection 4.1.1. The center of gravity CoG, total mass M and inertias in matrix Θ were first predicted with a function that modeled the different masses and inertias of the individual parts of the PacFlyer. As a more sophisticated CAD model became available, the parameters were determined with it. Once the prototype was built the center of gravity and total mass were measured. The total mass presented below does however not consider the landing gear that was added for testing as described in chapter 6. Given the small value for the non-diagonal entries of Θ which are about a factor of 200 smaller than the other entries their effect was neglected in the dynamics equations. The parameters are M total = 5.035 kg, CoG = 3.2 Control 0.024 0 0.013 2.15 0 0.006 m, Θ = 0 1.32 0 kg m 2. (3.1.8) 0.006 0 1.53 In the following the control in hover mode will be explained further. An overview over the control scheme is given. Subsequently, the individual controllers will be explained in more detail. Figure 3.4 gives a general insight into the control scheme. As illustrated a cascaded control approach is adopted. The inner control loop contains an attitude and the outer loop a position controller. The position controller sets the reference for the attitude controller. The detailed description of both the attitude and the position controller and their respective reference signals will be dealt with in the upcoming subsection 3.2.1 and 3.2.2. Finally, all control signals are passed as an input signal into the system as described in the previous section 3.1. Figure 3.4: Illustration of the structure of the general control approach 3.2.1 Attitude controller Having figure 3.4 in mind, first the inner attitude controller loop of the controller will be regarded more closely. A more detailed illustration of this attitude controller is shown in figure 3.5. For this inner controller a cascaded control approach was also adopted. In the inner loop of the cascaded controller the angular rates are controlled with a PD controller. In the outer loop the angles are controlled with a P controller. The input to the inner or outer loop is the difference between reference and actual rate or angle respectively. The output of the cascaded controller

Chapter 3. Hover Modeling and Control 20 after the angular rates controller block in figure 3.5 are the torques (torque signals) that the system should achieve to stabilize its attitude angles φ, θ, ψ. For this controller design all angles are treated as separate SISO systems in the earth-fixed frame. This is possible because of a decoupling transformation that was developed and will be explained in detail further below. This transformation maps the torques just mentioned and the thrust in negative z-direction (pointing upward) to the forces of the propeller-assemblies and the rear tilt angle. The transformation is therefore called Mapping to Actuators in figure 3.5. The desired thrust in negative z-direction (pointing upward) that controls the altitude of the aircraft can be either set manually by the pilot or is set by the position controller to stabilize the height of the PacFlyer. With the necessary forces and tilt angle in the rear obtained from the decoupling transformation or mapping to actuators, the rear tilt angle and the propeller forces are mapped to their respective electrical signals that are needed to generate them. This is illustrated by the green block to the right in figure 3.5. The idea is to generate exactly the signals needed that will generate the mapped forces of the propellers and the rear tilt angle in the system. This mapping is again based on the tests discussed in subsection 4.1.1 and represents the exact inverse mapping to the one found in the modeling subsection 4.1.1 about signal mapping. Therefore the two mappings should cancel each other out. These signals are then finally the overall output of the controller and serve as control signals to the aircraft system as displayed on the very right of figure 3.5. Figure 3.5: Illustration of the structure of the attitude controller Decoupling transformation for hover controller As mentioned in the previous subsection 3.2.1 the attitude is controlled by treating the attitude angles as three separate SISO systems. This is possible because of the decoupling transformation or mapping that will be described in detail in the following. The tricopter configuration in hover as described in section 2.2 is a MIMO system with strong cross couplings of the inputs to the outputs and states of the system. To counteract this effect a transformation was developed to decouple the system. This allows one to treat the system as several separate SISO systems. For quadcopters this has already been achieved as shown by Rudin [3]. Yet for the tricopter design one first had to consider all the dynamics equations in detail and then had to evaluate them. A walkthrough into the making of the transformation is given below. Later an error analysis is given for the transformation.

21 3.2. Control Figure 3.6: Illustration of the PacFlyer in hover mode with most important lengths. Thrusts in orange, corresponding torques in black, tilt angle β to tilt the rear thrust around the x-axis, important lengths in red and labeled. Given the system in figure 3.6 above, the dynamics equations are F z τ x τ y = τ z F fr F fl F rear cos(β) F fr L s + F fl L s F fr L f + F fl L f F rear cos(β) L b τ drag rear sin(β) τ drag right + τ drag left + τ drag rear cos(β) F rear β L b. (3.2.1) To make the drag torque a function of the corresponding force the following relationship 3.2.1 was used. This is necessary to have a working mapping between the forces F z and the torques τ x,y,z and the forces of the motors and the rear tilt angle β. Ω is the angular speed of the individual propeller. b i is the thrust, d i the drag coefficient that corresponds to the angular speed. The mentioned relationship 3.2.1 between drag torque and thrust is described as T i = b i Ω 2, τ dragi = d i Ω 2 τ dragi = T i di b i. (3.2.2) Therefore the drag torque divided by the corresponding thrust was plotted for the PWM range in which the regular flight takes place. The relationship was found to be almost constant as predicted and the constant di /b i could be determined as shown in k front = d front b front, k rear = d rear b rear. Therefore the torques can be formed in the following way while taking into account the direction of rotation of the propellers. When looking at the aircraft from above, the right rotor rotates clock-

Chapter 3. Hover Modeling and Control 22 wise while the left and the rear rotor rotate counterclockwise. The following torque relationships are formed τ front right = F front right k front τ front left = +F front left k front τ rear = +F rear k rear. With small angle approximation for the rear tilt angle β << 1 the relationship sin(β) = β, cos(β) = 1 is assumed. The tilt angle β has been shown to generally operate in a region of ± 15. This has been validated in simulation. Likewise, since the main use of tilting with angle β is controlling the yaw movement one can regard the created torque more closely. Under hovering condition of the aircraft the torque in z-direction is around 3.3 N m at ± 15. This has been shown to be quite enough to stabilize the aircraft s yaw movement. Therefore the small angle approximation is a valid simplification. With all these relationships put together the final matrix relationship is F z τ x τ y τ z = 1 1 1 0 L s L s 0 0 L f L f L b k rear k front k front k rear L b F right front F left front F rear F rear β. (3.2.3) With this matrix relationship at hand, one only needs to invert it to obtain the desired decoupling transformation. The decoupling relationship F right front F z F left front F rear = A 1 4x4 τ x τ y (3.2.4) F rear β τ z allows a mapping between the different torques and the force in z direction and the actuators of the PacFlyer. This in effect, decouples the system and allows one to treat the attitude angles and the height as separate systems to be controlled. Error estimation An error assessment of the transformation was conducted to verify how well it is actually working. For this a predefined set of vectors of desired force F z and torques τ x,y,z were compared to the result of what happens when this vector is first mapped to the respective forces of the motors and rear tilt angle β and then used as an input to the system model. In theory with an ideal and perfect transformation the result should be exactly what has been used as an input. With the made assumptions in deriving the transformation this is not the case. The absolute error is given by ɛ error abs = F z τ x τ y τ z 2 F z τ x τ y τ z 1. (3.2.5)

23 3.2. Control Where the first vector denoted with subscript 2 is generated by transforming the reference vector with subscript 1 as in F z F right front A 1 4x4 τ x τ y = F left front F rear (3.2.6) τ z F rear β 1 and using the result in the system. The vector with subscript 2 that is compared to the reference vector 1 is found to be F z F fr F fl F rear cos(β) τ x τ y = F fr L s + F fl L s F fr L f + F fl L f F rear cos(β) L b τ drag rear sin(β). (3.2.7) τ z τ drag right + τ drag left + τ drag rear cos(β) F rear β L b 2 Figure 3.7: Graphical display of the relative error of the decoupling transformation of the torque in z-direction Most error evaluations show the same pattern. Relative errors are in the worst case around 20% in general but often exhibit sharp rises close to 0 N m input torque. At the same time the absolute error is small around the points of sharp rises. A sample graph of the relative error

Chapter 3. Hover Modeling and Control 24 and absolute error is given in figure 3.7 and 3.8 respectively. The decoupling transformation works well and has errors within reasonable limits which is ultimately proven by the robust flight behavior experienced in hover mode testing described in chapter 6. Figure 3.8: Graphical display of the absolute error in Nm of the decoupling transformation of the torque in z-direction 3.2.2 Position controller In a next step a position controller was developed. This controller sets the reference angle of the attitude controller for the roll and pitch movement (angle φ and θ) and the thrust in negative z-direction and in this way controls the position. The yaw movement is not controlled by the position controller. The figure 3.9 illustrates the general idea of the position controller. The general body coordinates are hereby specified in figure 2.7. The general idea for the hover controller is already in use for quadcopters as Rudin [3] states. The same approach can be implemented for a tricopter setup as well. The concept of the position controller is to have a total thrust pointing upward in the body system. The idea now is to tilt the total thrust with certain body angles θ, φ so as to have the specified forces T x, T y in the

25 3.2. Control forward and sideway direction. These forces in effect control the position of the aircraft. The concept is illustrated in figure 3.9. A nose down movement with a negative angle θ would tilt the total thrust forward and thus accelerate the aircraft forward in x-direction. Likewise, a positive angle θ with which the aircraft could be tilted around the forward x-axis would tilt the total thrust in positive y-direction along the right wing and accelerate the PacFlyer in this direction. In this way the x and y position is controlled. The z-height control is done by simply increasing or decreasing thrust in z-direction. The total thrust is calculated with T = Tx 2 + Ty 2 + Tz 2. All thrusts T x, T y, T z are determined with a PID control design for the position. The necessary angles φ, θ are then computed by evaluating the following transformation 1 T RT (z, ψ) T x T y = sin(θ d)cos(φ d ) sin(φ d ). (3.2.8) T z cos(θ d )cos(φ d ) The rotational matrix R T (z, ψ) is used to account for the rotation around the yaw axis with angle ψ. This ensures that the position is controlled in the earth-fixed frame. Figure 3.9: General idea of the position controller Having calculated all thrusts the rotational transformation is evaluated with the desired angles θ, φ as output. Finally, the outputs of the position controller are the two angles just mentioned and the desired thrust in negative z-direction to stabilize the altitude. The angles control the position in x and y direction and the thrust in negative z-direction controls the height of the aircraft.

Chapter 3. Hover Modeling and Control 26 3.3 Simulation results In the following subsections first the attitude controller and then the position controller in simulation will be discussed. This should give a clearer picture on the kind of control authority the user has over the system. Attitude controller In the figure 3.11a one can see the attitude controller for hover react to the disturbances displayed on the right of the same figure. The attitude itself is shown on the left. Evidently, the controller works well and is able to stabilize the attitude even though a strong disturbance torque of either 3 N m for pitch or 5 N m for roll is applied for two seconds each. The pilot of the PacFlyer requested to only have yaw angular rate control instead of angle control. Therefore only the rate of change of the angle ψ around the yaw axis is controlled. All other angles are treated with the described cascaded control loop approach mentioned in subsection 3.2.1. Roll[ ] 50 0 Attitude Roll 50 0 5 10 15 20 time[s] Attitude Pitch 40 Pitch[ ] Yaw[ ] 20 0 0 5 10 15 20 time[s] Attitude Yaw 180 178 176 0 5 10 15 20 time[s] Torque [Nm] Torque [Nm] Torque [Nm] Disturbance X direction 5 0 0 5 10 15 20 time[s] Disturbance Y direction 4 2 0 0 5 10 15 20 time[s] Disturbance Z direction 1 0 1 0 5 10 15 20 time[s] (a) Attitude of the PacFlyer (b) Disturbance torques of the PacFlyer Angular rate [ /s] Angular rate [ /s] Angular rate [ /s] Angular rate body X direction 50 0 50 0 5 10 15 20 time[s] Angular rate body Y direction 50 0 50 0 5 10 15 20 time[s] Angular rate body Z direction 5 0 5 0 5 10 15 20 time[s] (c) Angular Rates (Body frame) Figure 3.10: Attitude angles, angular rates and respective disturbances of the PacFlyer in hover with attitude controller

27 3.3. Simulation results Position controller Roll[ ] Pitch[ ] Yaw[ ] 50 0 Attitude Roll 50 0 5 10 15 20 25 30 time[s] Attitude Pitch 50 0 50 0 5 10 15 20 25 30 time[s] Attitude Yaw 185 180 175 0 5 10 15 20 25 30 time[s] Torque [Nm] Torque [Nm] Torque [Nm] Disturbance X direction 5 0 0 5 10 15 20 25 30 time[s] Disturbance Y direction 4 2 0 0 5 10 15 20 25 30 time[s] Disturbance Z direction 1 0 1 0 5 10 15 20 25 30 time[s] (a) Attidude (b) Disturbances Position [m] Position [m] Position [m] Position X direction 10 20 30 0 5 10 15 20 25 30 time[s] Position Y direction 5 0 5 0 5 10 15 20 25 30 time[s] Position Z direction 198 199 200 0 5 10 15 20 25 30 time[s] (c) Position Figure 3.11: Positon controller simulation results In figure 3.11 a simulation of the hover controller with combined position/attitude controller is illustrated. It is shown to work properly. The disturbances to the right are rejected but have to be counteracted more than with just the attitude controller since the original position has to be reached again. For this simulation both the attitude and the position controller were active. Otherwise the attitude would have been stable immediately after the disturbances as displayed in figure 3.11a. The reference position was set to ( 200, 0, 200) T m. Again strong disturbances are applied as in the attitude controller simulation.

Chapter 3. Hover Modeling and Control 28

Chapter 4 Cruise Modeling and Control This chapter deals with the aircraft in cruise mode. Cruise flight is the mode which represents the regular airplane flight. The cruise mode will be regarded in a brief overview, followed by the modeling and control of the aircraft in cruise mode. Finally the performance of the cruise controller will be evaluated in simulation. 4.1 Modeling To test the characteristics of the aircraft in cruise flight a mathematical model has to be derived first. This then enables the user to test control designs and simulate them before physically testing them. This introductory part of the section gives an overview over the system model in cruise mode with the effects taken into account for modeling. Given the overall structure the individual parts of the model will be dealt with in more detail. Figure 4.1: Illustration of the complete model for cruise with controller, system model and non-linearities Figure 4.1 shows the system dynamics model, computational aerodynamics tool, speed scaler, propeller input and saturations. To show the whole model with a closed control loop the attitude 29

Chapter 4. Cruise Modeling and Control 30 controller is also displayed. The system dynamics block is colored orange, the controller blue, the speed scaler is grey and the aerodynamics tool is shown in green. The following modeling subsections describe the individual modeling blocks of the overview figure 4.1. To model the cruise mode of the PacFlyer system the following effects were considered respectively neglected based on material by Rudin and Leutenegger [3]. System dynamics based on rigid body model Interaction with ground and other solid objects are neglected Aerodynamic forces (lift, drag) and torques of the main wing, the elevator and the rudder respected Drag of the fuselage is neglected Drag of the extension booms and servo arms are neglected Actuator limitations are considered Propellers are assumed to be rigid Gyroscopic forces and hub forces and torques are neglected Influence of the accelerated air of the propellers (alongside the wings) are neglected. Similar to the hover mode model in 3.1 many of the system model assumptions remain the same or similar, e.g. the system dynamics are also based on a rigid body model. The main and crucial difference is that the aerodynamic forces such as lift and drag of the main wing are now considered as opposed to the hover model where these forces are neglected. 4.1.1 Control surface characteristics The mapping of the control surface deflections to PWM signals are based on measurements with a digital angle gauge. Since the dependency of the control surface deflection on the PWM signals are almost linear this correlation was approximated by a linear function as was illustrated similarly earlier in the hover mode in figure 3.2. From these measurements the limitations or saturations of the servo s range were found out as well. The saturations are displayed as a grey block in the center of figure 4.1. The angle mapping itself was implemented on the microcontroller but was not used in the model. 4.1.2 Aerodynamics calculations tool With the control surfaces and various other variables such as the aircraft s velocity and attitude one can calculate the aerodynamic forces and torques on the system. The aerodynamic forces and torques could not be measured within the framework of the project, but were calculated with a computational tool that was provided by Rudin and Leutenegger (K. Rudin 2013, pers. comm., unreferenced). This aerodynamical force and torque calculation tool is illustrated as the green block in figure 4.1. Effectively, the tool calculates the aerodynamic forces and torques as a function of the following variables. Inflow velocity Inflow vortices

31 4.1. Modeling Control surface deflection Propeller angular speed More specifically, the tool calculates the drag- lift-, and moment coefficient for individual angle of attacks, Reynolds numbers and flap deflection based on Xfoil 1 to calculate a lookup table. For Figure 4.2: Aerodynamics of a wing profile simulation purposes this aerodynamic part then interpolates the current state of the system and integrates the resulting forces and torques alongside the wing and estimates the propeller thrust using blade element momentum theory. To estimate the downwash the vortex sheet theory has been used. The aerodynamics tool fails however when the aircraft enters stall and generates incorrect forces and torques. 4.1.3 Rigid body dynamics The last system modeling block in figure 4.1 is the 6 DoF rigid body block shown in orange. It describes the rigid body system dynamics as previously described for the hover mode in subsection 3.1.2. The figure 4.3 shows the rigid body model more closely together with aerodynamics tool describes in subsection 4.1.2. Again as described for hover the forces and torques are input to the system dynamics block. The system dynamics essentially represent a double integrator with angular velocity, linear velocity, angles and position as output. Figure 4.3: Cruise model As described in the hover subsection 3.1.2 the parameters of the rigid body model, that is the inertia and the weight, were estimated from the CAD model of the PacFlyer and measurements of the prototype. For a more detailed treatment of the dynamics see the mentioned subsection 3.1.2. 1 A free computational program developed at MIT to evaluate the aerodynamic characteristics of airfoils

Chapter 4. Cruise Modeling and Control 32 4.2 Control A controller is needed to stabilize and steer the system in general. In the case of cruise flight a pilot can by himself also be able to stabilize the aircraft. When designing a controller it can be tested on the system model before implementing and testing it on the physical prototype. The different control modes that can be chosen for the cruise controller as well as different control schemes will be discussed in the following. The whole model with controller can be regarded in more detail in the figure 4.1. As the cruise flight mode is essentially the one of a regular airplane, the controller is taken from the already implemented ArduPilot [17] for regular airplanes. 4.2.1 Control modes For cruise flight there are four different control modes with which the aircraft can be steered all of which are implemented and are taken from the ArduPilot [17]. Here is a brief description of each one. Manual: Directly passes the RC inputs to the actuators without feedback control. Used for safety reasons and tests. The human pilot is the controller. Stabilize: Tries to regulate the roll and the pitch angle automatically to zero; required for autopilot mode Auto: Flies to predefined waypoints RTL (return to launch): Return to launch coordinate; automatically activated when RC loses control to system 4.2.2 Control scheme Figure 4.4: Control Scheme for cruise flight Figure 4.4 shows the basic idea of the control scheme for the cruise mode. As for the hover controller, a cascaded control approach is used to realize the position controller. The inner loop is an attitude controller for stable flight. At the outer loop an ArduPilot [17] bearing controller sets a reference angle for roll and pitch to the attitude controller in order to reach specific waypoints. It additionally contains a speed scaler that scales the calculated control surface deflection, since for higher inflow velocities the deflections have much more effect. Therefore the system is more

33 4.2. Control robust and will not begin to oscillate at higher speeds. The structure of this speed controller has been adopted from the existing Arduplane [17] controller. The scaling factor is given by λ = γ v x. Where λ is the speed scaler, γ a tuning parameter and v x the estimated speed in body x-direction. The scaler λ gets limited with an upper and a lower bound. It then is multiplied with the control input of the P and the D part of the controller and in this way scales some of variables of the controller. The I is not scaled, as it could lead to a static error. Attitude controller The control strategy for the attitude in cruise flight is the same as for regular airplanes. In this mode the PacFlyer has 4 control inputs to control the system. Front propellers angular speed to regulate thrust in flight direction Aileron deflection to control the roll movements Elevator deflection to control the pitch movements Rudder deflection to control the yaw movements As displayed in figure 2.4 the control surfaces ailerons, elevator and rudder control the attitude. For reference the attitude angles are displayed in figure 2.7. The ailerons control the roll movement with angle φ around the x-axis with an anti-symmetrical deflection of both surfaces. The pitch movement with angle θ is controlled by deflecting the elevator. Finally, by deflecting the rudder the yaw movement with angle ψ is controlled. The inner attitude control loop is a simple PID controller that calculates the control surface deflection as a function of the angle error. As the system in the cruise mode is already almost decoupled there is no need for a special decoupling as shown in the hover mode 3.2.1. Therefore it is possible to control the system along one axis by only using one control surface configuration as shown in the brief description in the previous paragraph. If there is for example an error along the roll axis the controller deflects the ailerons in a way to produce a torque to steer against this error. With the current controller errors along the yaw axis are not regulated with the rudder. The yaw can however be controlled manually by the pilot. For more detail to regulate the yaw error see the upcoming part of the section 4.2.2. Bearing controller In order to fly to a defined waypoint it is important to be able to fly with a specific altitude and a specific bearing or attitude. To achieve this, the outer control loop, i.e. the position controller or bearing controller is used. In figure 4.5 the functionality of the bearing controller is illustrated. Having a bearing error a PID controller computes the reference angle. As the system is almost decoupled, these errors can be looked at seperately as follows: Given an altitude error the controller calculates a pitch angle reference to climb to the defined altitude and Given the bearing error the controller calculates a roll angle reference to correct the orientation ofthe system. These references are given an upper and lower saturation so as to not destabilize the aircraft. Furthermore these angle references are then the input to the inner attitude control loop.

Chapter 4. Cruise Modeling and Control 34 4.3 Simulation results Figure 4.5: Position controller In the following the cruise mode will be evaluated in simulation. First a simulation without a controller will be conducted to assess the aerodynamic properties of the aircraft. Then the PacFlyer is tested with the attitude controller for cruise under disturbances. Later the bearing controller is evaluated. Without controller In figure 4.6 both the attitude and the position of the aircraft are displayed for a simulation with all controllers turned off. One can see from the pitch attitude that the aircraft is aerodynamically stable. When the system pitches downwards, the aerodynamic forces lead to a pitch upward torque and vice versa. These movements have enough damping so that the oscillations around the pitch axis decrease in amplitude with each oscillation. Small changes of the pitch angle of ± 5 are only achieved after a relatively long period of time of around 50 s. Roll[ ] Pitch[ ] Yaw[ ] 0 20 Attitude Roll 40 0 10 20 30 40 50 60 time[s] Attitude Pitch 0 20 40 0 10 20 30 40 50 60 time[s] Attitude Yaw 0 20 40 0 10 20 30 40 50 60 time[s] Distance [m] Distance [m] Distance [m] 4000 2000 Position X direction 0 0 10 20 30 40 50 60 time[s] Position Y direction 10 0 10 0 10 20 30 40 50 60 time[s] Position Z direction 500 0 500 0 10 20 30 40 50 60 time[s] (a) Simulation results of the attitude during cruise without controller (b) Simulation results of the position during cruise without controller Figure 4.6: Simulation of the PacFlyer in cruise without controller

35 4.3. Simulation results Attitude controller Figure 4.7: Simulation results for the attitude during hover with disturbances In a next step the PacFlyer in cruise flight with attitude controller is simulated. In figure 4.7 the attitude along the three main axis directions is plotted against the time under influence of disturbances. As one can see the system has no problem handling this disturbances. The controller achieves to regulate the roll and the pitch angles within about 2 to 3 s without causing overshoot or miscellaneous unwanted effects. Bearing controller Figure 4.8 shows the results of the simulation of the bearing controller. When flying to a specific waypoint one can calculate the needed bearing and altitude the system needs to fly to the defined waypoint. During this simulation the system tries to fly with an altitude of 200 m and a yaw bearing of 0 with initial conditions at altitude 180 m and 60 yaw bearing. The system can reach the desired bearing within an acceptable range of time of around 10 s, without overshoots.

Chapter 4. Cruise Modeling and Control 36 Roll[ ] Yaw[ ] 50 0 Attitude Roll 50 0 5 10 15 20 25 30 time[s] Attitude Pitch 20 Pitch[ ] 10 0 0 5 10 15 20 25 30 time[s] Attitude Yaw 100 0 100 0 5 10 15 20 25 30 time[s] Distance [m] Distance [m] Distance [m] 1000 500 Position X direction 0 0 5 10 15 20 25 30 time[s] Position Y direction 100 50 0 0 5 10 15 20 25 30 time[s] Position Z direction 180 200 220 0 5 10 15 20 25 30 time[s] (a) Attitude (b) Position Figure 4.8: Simulation result of bearing controller

Chapter 5 Transition Modeling and Control In order to change from cruise mode to hover mode and vice versa a third flight mode i.e. the transition is needed. This mode has to cope with the problem of integrating components of both the hover and the cruise flight and is therefore more complicated. In the following sections the general properties, the strategy to fly during the transition phase as well as the modeling and control during that time will be discussed. Concluding, simulation results for the transition from hover to cruise and back will be presented and discussed. 5.1 Modeling The transition mode combines both elements of the hover mode and the cruise mode and ideally their interaction. Since the aerodynamic calculations get very complex during the transition period, this has been worked on in much more detail in the context of another bachelor thesis by Kober [18]. However, with the model used within this more control oriented thesis, it should be possible to make some rough conclusions about the general feasibility of the transition. A detailed graphic with both system model and controller is presented in figure 5.1. Within the scope of this thesis the following simplifications and restrictions for the system model in transition mode were made or taken into account in addition to the ones made for the hover model in section 3.1 and the cruise model in section 4.1. Drag of additional features such as landing gear is neglected. Downwash of the airflow of the propeller on the wing is neglected. Same assumptions as for cruise model (see section 4.1) At stall the aerodynamics calculations described in subsection 4.1.2 are not accurate. The transition model as presented in figure 5.1 can be considered as both the hover and the cruise model next to each other. All blocks that are present in the individual modes are now present as well. In a final step the forces and torques that the two models generate are combined and serve as input to the 6 DoF rigid body model block shown in orange. To not account for the propeller thrusts twice they are only considered for the hover model part as long as the hover controller is active. Once deactivated the thrusts are introduced into the transition model from the cruise mode part of the model in the block Propeller. 37

Chapter 5. Transition Modeling and Control 38 Figure 5.1: Illustration of the complete model for transition with controller, system model, saturations and mappings Due to the simplifications presented above, mainly that the downwash of the propeller on the wing is neglected, it is possible, that the real system will not act as expected. Therefore simulation results should be taken as qualitative arguments for general feasibility of the transition while having the risk of the made simplifications in mind. 5.2 Control Two control strategies were developed to handle the transition mode, one to transition from hover to cruise and one from cruise to hover mode. Hover to cruise transition strategy In figure 5.2 the strategy to change from hover to cruise flight is presented. One slightly tilts the front rotors to gain speed, until the wings carry most of its weight. This will be with a speed of around 13 m/s, the stall speed of the system. During this phase both controllers the hover and the cruise are activated. Afterwards the front propellers are tilted entirely to the front and the hover controller will be deactivated. Cruise to hover transition strategy For the purpose of changing from cruise to hover flight, the idea is to slow down the front rotors, tilt them upwards and carry on gliding. Then the hover controller gets activated and pitches

39 5.2. Control Figure 5.2: Transition strategy, hover to cruise the prototype backwards to reduce the speed, until it is in normal hover mode with little or no forward speed. This process is illustrated in figure 5.3. Figure 5.3: Transition strategy, cruise to hover For the following simulations of the transition phase both the hover and the cruise flight controller are active. Since the hover controller has to cope with increasing cross-coupling with increasing tilt angles forward in flight direction of the front rotors, it is not advisable to have it fully active at high tilt angles. The control authority of the hover controller gets lower with increasing tilt angles. Roughly speaking e.g. the roll movement is stabilized in hover by having a differential thrust of the two front rotors. After tilting the rotors to the front the same differential thrust would also introduce a torque in z-direction and influence the yaw movement. This is highly undesirable as control authority is lost. Therefore for the simulation the front propellers were tilted by only 20 with an active hover controller. Subsequently, the controller gets deactivated and the propellers immediately tilt entirely to the front. The real system would not be able to tilt the propeller as fast to the front or upwards. Some adaptations of the controller would be required. Therefore a weigthing of the hover controller was implemented on the physical prototype as 1 if β front < 20 w = 1 β front 20 20 0 if 20 < β front < 40 if β front > 40 with β front as the tilt angle (0 equates to propeller pointing upwards) and w as the weighting factor that scales the desired angular rates by multiplying them with factor w. As the cruise controller has almost no control authority at low speeds there is no need for a weighting of the cruise controller.

Chapter 5. Transition Modeling and Control 40 5.3 Simulation results To test the mentioned control strategies simulations were of these were made. simplifications only general feasibility can be inferred from the results. Again due to Hover to cruise transition The simulation with this model to change from hover to cruise flight can be seen in figure 5.4. At the beginning, the front rotors are tilted by 20 to the front until the system has a speed of 15 m/s. Then the rotors are tilted completely to the front and the hover controller gets deactivated. The result of the simulation shows, that the system accelerates to the desired velocity without getting unstable. Figure 5.4: Simulation of the transition from hover to cruise flight with attitude and velocity displayed Cruise to hover transition To get a rough estimation of how perturbing the influence of the aerodynamic forces and torques are for the hover controller the following simulation was made. Here the initial speed is set to 20 m/s and the hover controller that regulates the speed to zero is activated (cruise controller deactivated). The results are shown in figure 5.5. As seen in the plots, the controller succeeds to slow down the system while stabilizing it. This data is therefore a good indicator that the hover controller should not have too great difficulties in stabilizing the system, while flying with forward speed.

41 5.3. Simulation results Figure 5.5: Simulation of transition from cruise flight to hover with attitude and velocity displayed

Chapter 5. Transition Modeling and Control 42

Chapter 6 Implementation and Testing With designed controllers for the different flight modes with satisfying simulation results, implementing the controllers on a microprocessor and later prototype testing is an important next step. 6.1 Implementation As explained in chapter 2 an ArduPilot mega 2.5 microcontroller has been used as a platform to implement the control algorithms. As explained in previous sections the controller has a cascaded structure. Since there were problem with the computation time of the processor the controller needed adaptations as with the whole control algorithm at 100 Hz the processor was not able to meet all the task deadlines resulting in deactivation of the motors. Therefore now, the inner control loop operates with 100 Hz and the outer loop mainly at 50 Hz. The subsequently done tests proved that this is still fast enough to stabilize the system. For a more detailed insight in the software structure refer to appendix A. 6.2 Testing Due to time constraints in the accompanying student project only the hover controller was experimentally validated. The testing of the PacFlyer in hover mode will therefore be described in the following with a focus on the control aspects of testing. After implementing the simulation based controller for the hover mode it could subsequently be tested. The full testing of the hover mode includes the tuning of the hover attitude controller from subsection 3.2.1, a brief discussion about the existing predefined controllers namely the standard Ardupilot controller [17] and a general assessment of the then used controller in hover flight. To tune the controller further in experiment for hover mode, it is recommended to test the system one degree of freedom at a time, as otherwise cross-coupling effects would complicate the process. In figure 6.1 this test setup is shown. With this setting the hover controller gains for the pitch and roll attitude could be tuned on the real system under influence of manual disturbances and target angles given with the RC. In the process of tuning, the self-made hover attitude controller discussed in subsection 3.2.1 was compared to the predefined tricopter controller of the ArduPilot. As anticipated the performance of this predefined controller was not satisfying, since it was designed for a simple symmetric tricopter with three identical rotors. In fact because the controller was tailored specifically to a symmetric tricopter design it was not able to stabilize 43

Chapter 6. Implementation and Testing 44 the aircraft at all. This strongly supported the decision made before of designing a new hover controller from scratch with a proper decoupling. Fixed Fixed (a) Tuning of pitch (b) Tuning of roll Figure 6.1: Tuning 1 degree of freedom With a controller that works at least for the individual degrees of freedom of the real system, the full free system hover flight could be tested, as is shown in figure 6.2. For both indoor and outdoor tests flight gears were used as displayed in figure 6.2 and 6.3. These were used for robust testing purposes but were not included in the modeling since the aircraft is designed to eventually fly without the landing gear. The roll and pitch controller gains did not need any further tuning, since the result of the single axis attitude controller were already satisfying. The yaw controller gain needed little adaptions to make it more aggressive, which was to be expected, as it was not tuned on the real system before. All in all the simulation based gains were already able to control the aircraft. A great change was done for the derivative part of the inner angular rate loop. Due to too much noise this part was given less weight and now has a value around 1 /10 of the simulation based value. All other gains were also tuned but remain within the same order of magnitude. After tuning the free system, one could observe irregular small oscillations of the prototype during this indoor test. The higher the aircraft flew the less oscillations it had. The reason for these oscillations are the propeller induced turbulences of the air in combination of the small volume of air in the room. During the outdoor tests as shown in figure 6.3 with logged flight data in figure 6.4 these oscillations disappeared, which supports the theory above. The performance of the hover controller outdoors was better than expected, allowed a well controlled hover flight and was fully satisfying. In figure 6.4 a plot of the logged attitude data during one test flight is shown. The roll and pitch axes are very stable and never above an angle of 15. The low frequency oscillations are due to the navigation inputs of the pilot to fly the system. During this test the pilot performed an S-curve flight which can be seen in the yaw angle in the plot.

45 6.2. Testing Figure 6.2: Tuning of the free system Figure 6.3: Outdoor hover test