modelling & control of a 3dof helicopter

60
Modelling & Control of a 3DOF Helicopter Erik Bodin Fanny Stenholm Division of Fluid and Mechatronic Systems Bachelor thesis Department of Management and Engineering LIU-IEI-TEK-G–15/00803—SE

Upload: others

Post on 28-Nov-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modelling & Control of a 3DOF Helicopter

Modelling & Control of a 3DOF Helicopter

Erik BodinFanny Stenholm

Division of Fluid and Mechatronic Systems

Bachelor thesisDepartment of Management and Engineering

LIU-IEI-TEK-G–15/00803—SE

Page 2: Modelling & Control of a 3DOF Helicopter
Page 3: Modelling & Control of a 3DOF Helicopter

Modelling & Control of a 3DOF Helicopter

Bachelor thesis in Mechanical EngineeringDepartment of Management and EngineeringDivision of Fluid and Mechatronic Systems

Linköping Universityby

Erik BodinFanny Stenholm

LIU-IEI-TEK-G–15/00803—SE

Supervisors: Martin HochwallnerIEI, Linköping University

Examiner: Magnus SethsonIEI, Linköping University

Linköping, 1 June, 2015

Page 4: Modelling & Control of a 3DOF Helicopter
Page 5: Modelling & Control of a 3DOF Helicopter

UpphovsrättDetta dokument hålls tillgängligt på Internet — eller dess framtida ersättare —under 25 år från publiceringsdatum under förutsättning att inga extraordinäraomständigheter uppstår.

Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner,skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för icke-kommersiell forskning och för undervisning. Överföring av upphovsrätten vid ensenare tidpunkt kan inte upphäva detta tillstånd. All annan användning av doku-mentet kräver upphovsmannens medgivande. För att garantera äktheten, säkerhe-ten och tillgängligheten finns det lösningar av teknisk och administrativ art.

Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsmani den omfattning som god sed kräver vid användning av dokumentet på ovan be-skrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan formeller i sådant sammanhang som är kränkande för upphovsmannens litterära ellerkonstnärliga anseende eller egenart.

För ytterligare information om Linköping University Electronic Press se förla-gets hemsida http://www.ep.liu.se/

CopyrightThe publishers will keep this document online on the Internet — or its possi-ble replacement — for a period of 25 years from the date of publication barringexceptional circumstances.

The online availability of the document implies a permanent permission foranyone to read, to download, to print out single copies for his/her own use andto use it unchanged for any non-commercial research and educational purpose.Subsequent transfers of copyright cannot revoke this permission. All other uses ofthe document are conditional on the consent of the copyright owner. The publisherhas taken technical and administrative measures to assure authenticity, securityand accessibility.

According to intellectual property law the author has the right to be mentionedwhen his/her work is accessed as described above and to be protected againstinfringement.

For additional information about the Linköping University Electronic Pressand its procedures for publication and for assurance of document integrity, pleaserefer to its www home page: http://www.ep.liu.se/

c© Erik BodinFanny Stenholm

Page 6: Modelling & Control of a 3DOF Helicopter
Page 7: Modelling & Control of a 3DOF Helicopter

AbstractThe scope of this report is the development of a mathematical model and a controlsystem for a three degrees of freedom (3DOF) helicopter rig. This 3DOF-systemoffers a good simplification of a real world tandem helicopter for evaluating per-formance of different automatic control principles.

A mathematical model of the system is developed using free-body diagrams.This mathematical model is then linearized and a controller is developed by decou-pling the system. Due to model imperfections external disturbances and similareffects integral action is added as well as feed-forward compensation to reducenonlinear effects.

After the controller has been decoupled the two different controllers are tuned.The Linear-Quadratic Regulator, described in section 3.6, is used for selectingstate-feedback gains. Due to the highly nonlinear nature of the system an Ex-tended Kalman Filter is developed to estimate unmeasurable states.

The model and controller is then implemented on the actual rig and evaluated.The results displayed that the elevation controller had good performance. Thetravel controller also showed good performance but not as good as the elevationcontroller.

The main goal of this thesis was to develop a controller for the 3DOF helicoptersystem. The results clearly show that an LQR-controller is able to successfully con-trol a system like this with decent performance characteristics despite the highlynonlinear system.

v

Page 8: Modelling & Control of a 3DOF Helicopter
Page 9: Modelling & Control of a 3DOF Helicopter

Acknowledgments

A very special thanks to our co-workers in the ”Helicopter Group”. Also thanksto our supervisor Martin Hochwallner for guidance and help during the project.Thanks to Mr. Markus Ruf for great inspiration from his master thesis [7]. A lastthanks to Johan Löfberg for great guidance in the beginning of the thought process.

Linköping, June, 2015

Erik BodinFanny Stenholm

vii

Page 10: Modelling & Control of a 3DOF Helicopter
Page 11: Modelling & Control of a 3DOF Helicopter

Contents

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 Delimitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 Safety . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.5 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.6 Ethics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.7 Environment and Economy . . . . . . . . . . . . . . . . . . . . . . 31.8 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Model Derivation 52.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Equations of Motion . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.2.1 Pitch axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2.2 Elevation axis . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2.3 Travel axis . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.2.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.3 Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3.1 Masses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3.2 Lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3.3 Inertias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.3.4 Gravitational momentum . . . . . . . . . . . . . . . . . . . 122.3.5 Friction and air resistance . . . . . . . . . . . . . . . . . . . 132.3.6 Parameter optimization . . . . . . . . . . . . . . . . . . . . 14

2.4 State-Space Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.5 Propulsion Unit Model . . . . . . . . . . . . . . . . . . . . . . . . . 182.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3 Controller Design 213.1 Initial Considerations . . . . . . . . . . . . . . . . . . . . . . . . . 213.2 Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.2.1 Equilibrium points . . . . . . . . . . . . . . . . . . . . . . . 213.2.2 Linearized state-space model . . . . . . . . . . . . . . . . . 23

3.3 Decoupling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

ix

Page 12: Modelling & Control of a 3DOF Helicopter

x Contents

3.4 Integral Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.5 Feed-Forward Compensation . . . . . . . . . . . . . . . . . . . . . 25

3.5.1 Pitch controller . . . . . . . . . . . . . . . . . . . . . . . . . 263.5.2 Elevation controller . . . . . . . . . . . . . . . . . . . . . . 26

3.6 Controller Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.6.1 Elevation controller . . . . . . . . . . . . . . . . . . . . . . 273.6.2 Travel controller . . . . . . . . . . . . . . . . . . . . . . . . 27

3.7 State Estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283.7.1 Extended Kalman filter equations . . . . . . . . . . . . . . 283.7.2 Model discretization . . . . . . . . . . . . . . . . . . . . . . 293.7.3 Noise covariance matrices . . . . . . . . . . . . . . . . . . . 30

3.8 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.8.1 Input limitations . . . . . . . . . . . . . . . . . . . . . . . . 30

4 Evaluation 334.1 Model Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

4.1.1 Pitch axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.1.2 Elevation axis . . . . . . . . . . . . . . . . . . . . . . . . . . 354.1.3 Travel axis . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.2 Controller Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . 364.2.1 Elevation controller . . . . . . . . . . . . . . . . . . . . . . 364.2.2 Travel controller . . . . . . . . . . . . . . . . . . . . . . . . 394.2.3 Simultaneous operation . . . . . . . . . . . . . . . . . . . . 39

4.3 State Estimator Evaluation . . . . . . . . . . . . . . . . . . . . . . 41

5 Summary and Conclusion 435.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435.2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

Bibliography 45

Page 13: Modelling & Control of a 3DOF Helicopter

Acronyms3DOF 3 degrees of freedomBLDC Brushless Direct CurrentCAD Computer-Aided DesignDC Direct CurrentEKF Extended Kalman FilterFBD Free-Body DiagramFlumes Fluid and Mechatronic SystemsLQR Linear-Quadratic Regulator/RegulationLQG Linear-Quadratic-Gaussian Regulator/RegulationMIMO Multiple Input Multiple OutputMPC Model Predictive ControlPID Proportional-Integral-DerivativeRPM Revolutions Per MinuteSISO Single Input Single Output

Page 14: Modelling & Control of a 3DOF Helicopter

List of Figures2.1 Helicopter Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Pitch axis FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.3 Elevation axis FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.4 Local (red) and global (black) coordinate system. . . . . . . . . . . 92.5 Travel axis FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.6 Gravitational momentum as a function of elevation angle. . . . . . 132.7 Pitch axis. Parameter optimization. . . . . . . . . . . . . . . . . . 142.8 Elevation axis. Parameter optimization. . . . . . . . . . . . . . . . 152.9 Travel axis. Parameter optimization. . . . . . . . . . . . . . . . . . 17

3.1 Controller Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . 253.2 Input Limitations. . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

4.1 Pitch evaluation. Step to udiff = 2.00N . . . . . . . . . . . . . . . 344.2 Pitch evaluation. Step to udiff = −2.67N . . . . . . . . . . . . . . 344.3 Elevation evaluation. . . . . . . . . . . . . . . . . . . . . . . . . . . 354.4 Travel evaluation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.5 Elevation step from -30 to 0 degrees. . . . . . . . . . . . . . . . . . 374.6 Elevation step from 0 to 30 degrees. . . . . . . . . . . . . . . . . . 374.7 Elevation step from 30 to -20 degrees. . . . . . . . . . . . . . . . . 384.8 Travel step from 0 to 90 degrees. . . . . . . . . . . . . . . . . . . . 394.9 Figure of Eight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404.10 Travel and Elevation closed loop systems . . . . . . . . . . . . . . . 41

List of Tables2.1 Helicopter masses . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2 Helicopter lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3 Pitch and Elevation inertia . . . . . . . . . . . . . . . . . . . . . . 122.4 Optimal pitch parameters . . . . . . . . . . . . . . . . . . . . . . . 152.5 Optimal elevation parameters . . . . . . . . . . . . . . . . . . . . . 162.6 Optimal travel parameters . . . . . . . . . . . . . . . . . . . . . . . 17

Page 15: Modelling & Control of a 3DOF Helicopter

Chapter 1

Introduction

1.1 BackgroundThe principals of flight and construction of aircraft and helicopters have alwaysbeen of great interest to man. With the recent technological advancement of com-puters and the development of modern control theory automatic control systemsare a major factor in the development of almost every new flying vehicle.

A professor at the institution of Fluid and Mechatronic Systems (Flumes) atLinköping Institute of Technology has requested a prototype rig of a three degreeesof freedom (3DOF) helicopter. The intention is to use the rig to investigate thedynamics and control of a tandem rotor helicopter. While being quite simple this3DOF-system still offers a good simplification of a real world tandem helicopterfor evaluating performance of different automatic control principles.

Many have already succeeded to build such a helicopter rig and especiallythe Quanser 3DOF Helicopter [5] is being used in control engineering courses atuniversities all over the world. The Quanser helicopter has also been used in severaltheses where candidates develop different mathematical models and evaluate theperformance of different control strategies.

As their bachelor project eight students were given the task of designing andconstructing a 3DOF helicopter, similar to Quansers, from scratch. Everythingfrom the mechanical design process to design and implementation of control logichad to be addressed. The project was split into four different areas where thisreport focuses on the first one.• Modelling & Control

• Mechanical Design

• Hardware and Electrics

• Propulsion UnitThe other areas have been addressed by (in order), Asklund & Kärnell [3], Almén& Lindsten [2] and Ling & Persson [6]. An overall project report can also be foundin [1].

1

Page 16: Modelling & Control of a 3DOF Helicopter

2 Introduction

1.2 ObjectivesThe scope of this report is the development of a mathematical model and a controlsystem for the helicopter designed by the larger group. The performance of thecontrol system should be good enough to safely control the helicopter in flight.Based on the mathematical model a simulation model will also be developed totest the behavior of the model and control system without testing it on the actualrig. The simulation model is necessary for designing the rig and the control system.

1.3 DelimitationsIn order to not make the project too comprehensive due to time aspects, therehad to be some delimitations. The design of the control system has been limitedto one control strategy only. Performance between different control strategieswill not be addressed. Due to the project being very complex and the limitedknowledge the student possessed some limitations had to be made. For examplethe gyroscopic effect and similar effects have been completely neglected. This dueto the complexity in calculating such effects.

The simulation model of the system was used frequently to aid the mechanicalgroup in the design of the rig (dimensioning etc.). However this thesis have beenwritten from the perspective that the rig is already built and consequently theusage of the model to aid in designing have been left out. A brief discussion of itcan be found in the project report [1].

1.4 SafetyThe performance of the helicopter rig is depending on the robustness of the con-troller developed in this report and the overall performance of the controller isdepending on the model of the helicopter dynamics. If the controller is lackingin robustness the system will be very sensitive to component variations. Thismeans that when first testing the controller extra safety measures must be takento minimize any damage on the rig and even more importantly, personal injuries.

1.5 MethodIn the beginning of writing this report numerous reports on the Quanser 3DOFHelicopter and similar problems have been read and studied to get an understand-ing on how an already established helicopter rig behaves and what problems mightcome up during the project.

Especially literature on automatic control was studied and those have been thebasis for most of the equations written in this report. Many of the equations thathave been used, however, could be considered as commonly known among controlengineers and have therefore not been referenced.

To get an understanding on the extent of the project professors in the areawere consulted and were of great help in the beginning of the thought process.

Page 17: Modelling & Control of a 3DOF Helicopter

1.6 Ethics 3

A lot of work was done in collaboration with the others in the project group.This made it easy to communicate between the groups, which was especially impor-tant when the work of assembling the rig was carried out. The controller developedin this report had to be implemented on the hardware in the system, which wasdone with help of the group working with hardware and electrics. The mechanicalgroup was also often consulted since they provided the parameters values.

Numerous tests on the actual rig were performed to evaluate the model andcontroller developed in this report. How the different tests where carried out isdescribed in chapter 4.

It should be noted that several weeks were dedicated to assembly the rig and im-plement the controller on the actual system. Since the evaluation of the controllerwas depending on the rig functioning it was important to help the mechanicaldesign group assembly the rig. This took time away from writing the report butwas needed in order to finish the report. Overall the time distribution could bedescribed as half the time was spent on assembly the rig and implement the con-troller. The rest of the time was spent on mathematical calculations and writingthe report.

1.6 Ethics

As stated a robust controller is essential for building a safe functioning rig. A ro-bust controller will prevent the helicopter from becoming unstable and potentiallycause personal injuries. This is prevented by keeping a big safety distance andby being careful when testing the control system. It should be noted, however,that the rig is not completely safe and should be handled with caution. This isapplicable to most control systems used in technical products all over the world.The consequences of a ill-designed control system could be fatal. Control systemscan be found in everything from trains to airplanes and computers. This meansthat a considerable ethical responsibility is put on the control engineer.

Men and women equality is not really applicable for this project since bothmen and women have worked on the rig. It could be noted that the project groupcontained seven men and only one woman but this has probably more to do withthe mechanical engineering program having more men than women.

1.7 Environment and Economy

Several of the more technically advanced components used in the rig was providedby Flumes. These had all been used in previous projects at Flumes and could bereused for this project. These components could have been very costly if boughtnew. Since technical components often consists of hundredths of different materialsand many of those are often rare and costly this was good from a environmentalas well as economical point of view.

Page 18: Modelling & Control of a 3DOF Helicopter

4 Introduction

1.8 OutlineThe different chapters in this report well represent how and in which order thework was carried out. Here is an overview of the different chapters:

• Chapter 1 - Introduction

• Chapter 2 - Model Identification

• Chapter 3 - Controller Design

• Chapter 4 - Evaluation

• Chapter 5 - Summary and Conclusion

The first theoretical chapter 2 describes how the mathematical model wasdeveloped. It also describes the Simulink model of the system that was developedin order to be able to simulate the system.

Chapter 3 describes the development of the controller implemented on theactual rig.

In chapter 4 the evaluation of the model and controller is carried out. Itdescribes the different tests and outcomes.

In the last chapter the results from the Evaluation chapter is discussed as wellas the different methods used in the report. A summary of the whole report canalso be found there.

Page 19: Modelling & Control of a 3DOF Helicopter

Chapter 2

Model Derivation

In this chapter the mathematical model used throughout the report will be de-veloped. First lengths, forces, angles and torques acting on the helicopter duringoperation are defined. This is followed by a free-body diagram (FBD) analysis us-ing Euler’s second law of motion. The equations describing the system found arethen transformed into a state-space model used in the controller design in chapter3.

2.1 DefinitionsIn figure 2.1 a basic schematic of the helicopter system is shown.

Coordinate systemA coordinate system have been introduced according to figure 2.4. The systemrotates with the rig around the travel and elevation axes. The rig is fastened inthe mount at point O. When describing the helicopter position three angles areused. These are defined as:

• Pitch angle. The angle which the helicopter is rotated around the axis run-ning through the pitch joint. Defined as zero when the helicopter is horizon-tal.

• Elevation angle. The angle between the global XY-plane and the arm. De-fined as zero when the arm is horizontal.

• Travel angle. The angle which the rig is rotated around the global T-axis.Defined as zero at the sensor initialization angle.

5

Page 20: Modelling & Control of a 3DOF Helicopter

6 Model Derivation

Figure 2.1: The helicopter.

DistancesThe distances in figure 2.1 are defined as:

• LW : The distance between the elevation axis and the center of gravity ofthe counter-weight.

• LM : The distance between the elevation axis and the helicopter.

• LH : The distance between the pitch axis and the center of the propellers.

• Lρ: The distance between the pitch axis and the helicopter center of gravity.

MassesThe masses are defined as:

• mW : The mass of the counter-weight.

• mH : The mass of the helicopter (including motors etc).

InertiasThe inertias are defined as:

Page 21: Modelling & Control of a 3DOF Helicopter

2.2 Equations of Motion 7

• Iρ: The rotational inertia around the pitch axis.

• Iε: The rotational inertia around the elevation axis.

• Iτ : The rotational inertia around the travel axis.

Furthermore the forces FF and FB represent the thrust generated by the frontand the back motor respectively.

2.2 Equations of MotionIn order to identify the governing equations of the helicopter system a free-bodydiagram analysis has to be carried out on each of the axes.

2.2.1 Pitch axisIn figure 2.2 the forces acting on the pitch axis are shown. From the figure one can

Figure 2.2: Pitch axis FBD. Pitch axis going into the page.

easily see that main torque around the pitch axis comes from the thrust generatedby the motors. When ρ 6= 0 the gravitational force from the assembly will alsoproduce a torque around the pitch axis. The joint friction and air resistance arecombined into a single torque component MF . Euler’s second law yields:

Iρρ = (FB − FF )LH −mHgLρ sin ρ cos ε−MFρ (2.1)

In equation 2.1 the Coriolis force has been neglected.

2.2.2 Elevation axisIn figure 2.3 the forces acting on the elevation axis are shown. The pitch axishas been rotated an angle of ρ. MG denotes the gravitational momentum. Jointfriction and air resistance are combined into a single torque component MF .

However due to the fact that the rig could be rotating around the travel andelevation axes at the same time the elevation axis cannot be analysed in isolation.

Page 22: Modelling & Control of a 3DOF Helicopter

8 Model Derivation

Figure 2.3: Elevation axis FBD. Elevation axis pointing out of the page.

A new coordinate system is introduced that is fixed in the helicopter accordingto figure 2.4. The local ε, ρ, τ ′ coordinate system (red) is fixed in the rig. TheglobalX,Y, T system (black) is the inertial frame of reference. The local coordinatesystem is sharing origin O with the global (inertial) reference frame and is rotatingwith the rig around the travel and elevation axes.

Euler’s second law about point O yields (h0 denoting angular momentum aboutpoint O): ∑

~M0 = d ~h0

dt

Since the coordinate system fixed in the helicopter is rotating compared to theglobal inertial system the derivative of the angular momentum is given by:

d ~h0

dt=(d ~h0

dt

)ερτ ′

+ ~Ω× ~h0

Where the derivative is evaluated in the local coordinate system and ~Ω is theangular velocity vector describing how the local system rotates compared to theglobal. Furthermore ~h0 is given by:

~h0 = I0~Ω =

Iε 0 00 Iρ 00 0 Iτ

ετ sin ετ cos ε

=

IεεIρτ sin εIτ τ cos ε

This gives: (

d ~h0

dt

)ερτ ′

=

IεεIρ(τ sin ε+ τ ε cos ε)Iτ (τ cos ε− τ ε sin ε)

Page 23: Modelling & Control of a 3DOF Helicopter

2.2 Equations of Motion 9

Figure 2.4: Local (red) and global (black) coordinate system.

Followed by the cross product:

~Ω× ~h0 =

(Iτ − Iρ)τ cos ετ sin ε(Iε − Iτ )ετ cos ε(Iρ − Iε)ετ sin ε

Which gives the change in angular momentum as:

d ~h0

dt=

Iεε+ (Iτ − Iρ)τ2 cos ε sin εIρτ sin ε+ (Iε + Iρ − Iτ )ετ cos εIτ τ cos ε− (Iτ + Iε − Iρ)ετ sin ε

The change in angular momentum about the elevation axis is now identified as:

dh0,ε

dt= Iεε+ (Iτ − Iρ)τ2 cos ε sin ε (2.2)

Where the additional term (Iτ − Iρ)τ2 cos ε sin ε represents the centrifugal torque.Using equation 2.2 together with Euler’s second law gives:

Iεε+ (Iτ − Iρ)τ2 cos ε sin ε = (FF + FB)LM cos ρ−MG −MF,ε (2.3)

In equation 2.3 the torques generated by the motors are neglected. They areproportional to rotational speed squared and can possibly be quite significant.However the motors in our case are rotating in opposite directions hence coun-teracting each other. Clearly they will still generate a net torque when rotating

Page 24: Modelling & Control of a 3DOF Helicopter

10 Model Derivation

with different speeds (when changing pitch) but for simplification this effect isneglected.

Furthermore the inertias around the travel and pitch axis used in equation2.3 are the inertias around each axis as defined in section 2.1. When analysingthe elevation axis the inertia around the travel axis should be compensated forthe fact that the arm has been detached from the mount while the pitch inertiashould be compensated for the inertia of the arm plus counter-weight and thedistance between the pitch axis and the axis running through the arm. Howeverthe difference is small so in order to avoid having to introduce new variables theerror is neglected.

2.2.3 Travel axis

Figure 2.5: Travel axis FBD. Travel axis going out of the page.

The main forces acting on the travel axis are the thrust generated by the twomotors. When the pitch angle is nonzero the thrust forces will have a componentgenerating a torque around the travel axis. The component will increase withincreasing ρ as well as decrease with increased elevation angle ε.

Contrary to the pitch and elevation inertias the travel inertia will vary quitesignificantly as the helicopter moves around. Approximating the helicopter andthe counter-weight as point masses and ignoring the arm the travel inertia can beexpressed according to equation 2.4:

Iτ = cos2 (ε)(mWL2W +mHL

2M ) (2.4)

The factor cos2 ε will cause a quite significant reduction (compared to ε = 0) of theinertia even for relatively small angles. To highlight the fact that the travel inertiais not constant but rather a function of the elevation angle it will be expressed asIτ = Iτ (ε). Figure 2.5 and Euler’s second law yields:

Iτ (ε)τ = −(FF + FB)LM cos ε sin ρ−MF,τ (2.5)

Similarly to the elevation axis the motor torques have been neglected.

Page 25: Modelling & Control of a 3DOF Helicopter

2.3 Model Parameters 11

2.2.4 SummaryApplying Euler’s second law on the different axes provides a model of the helicopterdynamics:

Iρρ = (FB − FF )LH −mHgLρ sin ρ cos ε−MF,ρ

Iεε+ (Iτ − Iρ)τ2 cos ε sin ε = (FF + FB)LM cos ρ−MG −MF,ε

Iτ (ε)τ = −(FF + FB)LM cos ε sin ρ−MF,τ

(2.6)

2.3 Model ParametersAn important part in the development of the controller is getting accurate numer-ical values of all model parameters used in this chapter. Some parameters suchas lengths or masses are quite easy to measure accurately while, for example, theinertias and friction coefficients are much harder.

All measurements are, to some extent, inaccurate. Every provided value inthe tables below is given a tolerance. The tolerances given are simply a bestguess of the amount of uncertainty each value has. MATLAB/Simulink provides aconvenient way to handle parameter uncertainty. It has functions to automaticallyoptimize the model parameters so the model behavior matches given experimentaldata as good as possible. This will be utilized in section 2.3.6.

2.3.1 MassesThe masses given in table 2.1 have been found by weighing the actual helicoptercomponents.

Table 2.1: Helicopter masses

Parameter Value TolerancemH 3.15 kg ±0.05 kgmW 4.533 kg ±0 kg

2.3.2 LengthsAll lengths given in table 2.2 have been found by making measurements on theactual helicopter.

Table 2.2: Helicopter lengths

Parameter Value ToleranceLW 0.74 m ±0.01 mLM 1.19 m ±0.02 mLH 0.20 m ±0.01 mLρ 0.078 m ±0.01 m

Page 26: Modelling & Control of a 3DOF Helicopter

12 Model Derivation

2.3.3 InertiasBecause inertias are a lot harder to measure accurately on the actual rig thanmasses or lengths the inertias given in table 2.3 have been extracted from theCAD-model of the helicopter made by Asklund and Kärnell [3]. As discussed

Table 2.3: Pitch and Elevation inertia

Parameter Value ToleranceIρ 0.11 kgm2 ±0.06 kgm2

Iε 7.78 kgm2 ±1 kgm2

in section 2.2.3 the travel inertia is a function of the elevation angle. Throughmeasurements of the inertia (in the CAD model) for different elevation anglesfollowed by curve-fitting Asklund and Kärnell found that the travel inertia can beexpressed according to equation 2.7.

Iτ (ε) = −6.373ε2 + 1.032ε+ 7.196 (2.7)

2.3.4 Gravitational momentumThe gravitational momentum around the elevation axis has been determined bymeasuring what combined thrust the motors need to produce (both motors pro-ducing equal thrust) in order to maintain a specific elevation angle. The requiredthrust is then multiplied with the lever arm LM to get the momentum.

However the actual thrust the motors produce cannot be controlled directly.Rather the inverse of the force/rpm-equation 2.15 is used to control the force.Hence, if the relation describing the force/rpm-relation is inaccurate the measuredgravitational momentum will also be inaccurate. Therefore the moment is alsomeasured by a simple baggage-scale to verify the thrust measurements. The re-sult is given in figure 2.6. The thrust and scale measurements show very similarcharacteristics.

Analytically (refer to figures 2.3 and 2.1) the gravitational momentum wouldbe given according to equation 2.8 (mALA denoting momentum from the arm).

MG = (mWLW −mALA −mHLM )g cos ε−mHLρg sin ε cos ρ (2.8)

As one can see in figure 2.6 (with ρ = 0) this analytical model differs quite a lotfrom the measurements. The reason for this is mostly due to inaccurate parametersand neglected geometry such as the distance between the elevation joint and thearm. If the neglected geometry would be added to equation 2.8 the equation wouldstill just consist of cosine and sine terms. Series expansion of a general sum ofcosine and sine terms would result in a general polynomial. Consequently it isnatural to approximate the measured momentum by a general polynomial.

Fitting a second order polynomial (i.e. neglecting higher order terms) againstthe measurements gives the gravitational momentum function as:

MG = M(ε) = −2.8834ε2 + 5.2111ε+ 7.1683 (2.9)

Page 27: Modelling & Control of a 3DOF Helicopter

2.3 Model Parameters 13

y = -2,8834x2 + 5,2111x + 7,1683

0

1

2

3

4

5

6

7

8

9

10

-0,6 -0,4 -0,2 0 0,2 0,4 0,6

Mo

me

ntu

m (

Nm

)

Elevation angle (rad)

Gravitational momentum

Thrust

Scale

Model

Figure 2.6: Gravitational momentum as a function of elevation angle.

The reason for using the thrust measurements instead of simply using the scalemeasurements directly is that the thrust corresponds to an actual control signalwhich will be utilized when designing the controller.

Theoretically the MG is also a function of the pitch angle but this has beenneglected in equation 2.9.

2.3.5 Friction and air resistanceJoint friction and air resistance have been modelled as Coulomb and viscous fric-tion according to equation 2.10 for all axes (ω denoting arbitrary angle).

MF = kdω + sign(ω)ks (2.10)

Air resistance is theoretically proportional to velocity squared (assuming otherwiseconstant parameters) but for simplicity and the fact that it is very hard to measurefriction and air resistance in isolation from one other the relation is approximatedas linear.

When determining the friction coefficients different methods can be used. Forthe travel and elevation axes one could solve the governing equations assuming zerocontrol input. Then it is just a matter of curve-fitting the solution to experimentaldata to determine the friction coefficients.

However the method used in this case is simply to conduct a test on each axisindividually and then use Simulink to find the friction parameters that makes themodel response correspond as good as possible to measured response in the realsystem. A drawback to this approach is the fact that one cannot be sure it isactually the friction and/or air resistance that is being measured. This is more amethod of compensating for model simplifications, parameter errors as well as true

Page 28: Modelling & Control of a 3DOF Helicopter

14 Model Derivation

friction and air resistance of course. Though from a controller design perspectiveit does not really matter whether it is actual friction or something else.

2.3.6 Parameter optimizationAs mentioned above MATLAB/Simulink provides very powerful tools to aid inparameter identification. Based on measurements gathered from an experimenton the real system one can let Simulink automatically find the parameters thatmakes the simulated system response as close to the experiment as possible.

Pitch axis

With the elevation and travel axes physically locked to the zero position and themotors turned off the pitch axis is held against its stop. The helicopter is thenreleased and the response is observed. Figure 2.7 is showing the system response

-50

-40

-30

-20

-10

0

10

20

30

40

0 1 2 3 4 5 6

An

gle

(d

eg

ree

s)

Time (s)

Pitch parameter identification

System

Simulation

Figure 2.7: Pitch axis. Parameter optimization.

as well as the simulation response with model parameters optimized. Optimalparameters found are given in table 2.4. As one can see in figure 2.7 the simulationand the system shows very similar characteristics with almost perfect matching.It can also be noted that the optimal parameters in table 2.4 does not differ muchfrom the original values in tables 2.1, 2.2 and 2.3.

Page 29: Modelling & Control of a 3DOF Helicopter

2.3 Model Parameters 15

Table 2.4: Optimal pitch parameters

Parameter ValuemH 3.153 kgLH 0.201 mLρ 0.073 mIρ 0.094 kgm2

kd,ρ 0.053 Nmsrad

ks,ρ 0.04 Nm

Elevation axis

The test setup for the elevation consists of locking the pitch and travel axes. Thecombined motor thrust is then adjusted until the helicopter is steady at an angleof ε = −20. At this point a step is given to the thrust sum to 5.91 N (eachmotor running at 6800 RPM) while the system response is observed. Figure 2.8 isshowing the system and simulation response. Optimal parameters found are givenin table 2.5.

-25

-20

-15

-10

-5

0

5

10

15

0 1 2 3 4 5 6 7 8 9 10

An

gle

(d

eg

ree

s)

Time (s)

Elevation parameter matching

System

Simulation

Figure 2.8: Elevation axis. Parameter optimization.

Compared to the pitch system the elevation system and simulation differs quitea lot from from each other. This is possibly due to the fact that the rpm-to-forcerelation has been determined experimentally (see equation 2.15) which means itmost certainly comes with uncertainty affecting the simulation. One can alsonote that in table 2.5 the optimal parameters found differs as much as possiblefrom the original values in tables 2.2 and 2.3. Furthermore the static (Coulomb)

Page 30: Modelling & Control of a 3DOF Helicopter

16 Model Derivation

Table 2.5: Optimal elevation parameters

Parameter ValueLM 1.17 mIε 6.78 kgm2

kd,ε 1.78 Nmsrad

ks,ε 0 Nm

friction parameter was found to be zero meaning the elevation friction model canbe reduced to viscous friction only.

Page 31: Modelling & Control of a 3DOF Helicopter

2.4 State-Space Model 17

Travel axis

The test setup for the travel axis consists of locking the elevation and travel axes.The force motors are then set to a speed of 1500 and 8500 RPM respectively. Thisgives usum = 4.82N and udiff = 4.67N and a steady-state pitch angle of −26.2.At this point the travel axis is released while the system response is observed. As

0

100

200

300

400

500

600

700

800

900

1000

0 1 2 3 4 5 6 7 8 9 10

An

gle

(d

eg

ree

s)

Time (s)

Travel parameter optimization

System

Simulation

Figure 2.9: Travel axis. Parameter optimization.

one can see in figure 2.9 the system and simulation show similar characteristics.However the simulation accelerates slower than the system. Furthermore the opti-mal static friction coefficient has been found to be zero meaning the friction modelcan be reduced to viscous friction only.

Table 2.6: Optimal travel parameters

Parameter ValueIτ (0) 6.78 kgm2

kd,τ 0.5 Nmsrad

ks,τ 0 Nm

2.4 State-Space Model

Following the identification of the governing equations found in 2.6 and the modelparameters in section 2.3 one can go ahead and develop a state-space model. Sincethe system in its current form is highly nonlinear the state-space model will be on

Page 32: Modelling & Control of a 3DOF Helicopter

18 Model Derivation

the form:

x = f(x, u)y = g(x)

Where x denotes the state vector, u the input vector and y the output vector.The obvious choice of state variables is to select the states as the angles and

their corresponding angular velocities as:

x1 = ρ

x2 = ρ

x3 = ε

x4 = ε

x5 = τ

x6 = τ

(2.11)

Choosing the state variables according to 2.11 yields the following state-spacemodel:

x1 = ρ = x2

x2 = ρ = udiffLH −mHgLρ sin x1 cosx3 − (kd,ρx2 + sign(x2)ks,ρ)Iρ

x3 = ε = x4

x4 = ε = usumLM cosx1 −M(x3)− (Iτ − Iρ)x26 cosx3 sin x3 − kd,εx4

Iεx5 = τ = x6

x6 = τ = −usumLM cosx3 sin x1 − kd,τx6

Iτ (x3)

(2.12)

Where:

usum = FF + FB (2.13)udiff = FB − FF (2.14)

2.5 Propulsion Unit ModelThe motors used in the helicopter rig are of Brushless Direct Current (BLDC) typemanufactured and sold by Swiss company Maxon Motor. Contrary to a brushedtype DC-motor that only requires a voltage to run a BLDC motor requires a quiteadvanced separate controller board.

However the controller board makes it possible to operate the motor in a closedloop fashion. The motor operation mode used in our case is a closed loop maximum10000 RPM meaning the analog input signal will be used to set a speed between0-10000 RPM.

Page 33: Modelling & Control of a 3DOF Helicopter

2.6 Summary 19

A detailed analysis of the behaviour of the propulsion unit has been madeby Ling and Persson [6]. They have found that the relationship between speedmeasured as revolutions per minute (ω) and thrust in Newton (F ) can be describedby:

F = 7.26 · 10−8ω2 − 5.93 · 10−5ω (2.15)

Furthermore they have found that the transient behaviour of the propulsion unitis very fast compared to the helicopter and hence the motor dynamics will notbe modelled. Instead the inverse of equation 2.15 will be used to determine whatspeed each motor should run to produce thrust as commanded by the controller.

2.6 SummaryIn this chapter a mathematical model of the helicopter system has been devel-oped using free-body diagrams together with Euler’s second law of motion. Modelparameters have been estimated using Simulink parameter estimation. Some sim-plifications have been made in the model that together with regular parameteruncertainty will require a robust controller.

Page 34: Modelling & Control of a 3DOF Helicopter
Page 35: Modelling & Control of a 3DOF Helicopter

Chapter 3

Controller Design

3.1 Initial Considerations

In the previous chapter a mathematical model of the helicopter system was de-veloped. Simplifications were made in the modelling that combined with a largenumber of system parameters which contain error will require the synthesis of arobust controller.

A fundamental limitation of the system is the fact that there are three degrees offreedom but only two inputs (underactuated system). This makes it impossible todesign a controller capable of keeping all three angles at arbitrary reference values.Therefore the elevation angle ε and the travel angle τ are chosen as referencevariables and the pitch angle ρ will be indirectly controlled.

When choosing control strategy there are many different methods to choosefrom. Many successful attempts at implementing control strategies on similarsystems have been made with everything from simple PID-controllers to very so-phisticated MPC [7]. In this chapter focus will be on the synthesis of a Linear-Quadratic Regulator (LQR). A PID-controller would probably have been simplerbut the LQR offered a great learning opportunity and it seemed more interestingthan a simple PID-controller.

3.2 Linearization

3.2.1 Equilibrium points

In order to be able to go ahead with the control synthesis the state-space modelfound in equation 2.12 must be linearized around an equilibrium point. An equi-librium point is a point which fulfils f(x0, u0) = 0. It is quite obvious that thesystem has an infinite amount of equilibrium points. To prove this set x = 0 and

21

Page 36: Modelling & Control of a 3DOF Helicopter

22 Controller Design

solve for state- and input variables (superscript 0 denotes steady-state values):

0 = x02

0 =u0diffLH −mHgLρ sin x0

1 cosx03 − sign(x0

2)(kd,ρx02 + ks,ρ)

0 = x04

0 = u0sumLM cosx0

1 −M(x03)− kd,εx0

4 − (Iτ − Iρ)(x06)2 cosx0

3 sin x03

0 = x06

0 = −u0sumLM cosx0

3 sin x01 − kd,τx0

6Iτ (x0

3)

Equation 1, 3 and 5 gives x02 = x0

4 = x06 = 0 which leaves the following system left

to solve: 0 = u0

diffLH−mHgLρ sin x01 cos x0

3Iρ

0 = u0sumLM cos x0

1−M(x03)

0 = −u0sumLM cos x0

3 sin x01

Iτ (x03)

(3.1)

This is a system with three equations and four unknowns which, as suspected,implies that there exist an infinite amount of equilibrium points. In order to solvethis system one of the unknowns must be fixed.

Analyzing the third equation in the system 3.1 it can be seen that there arethree possibilities to fulfill the equation. One can choose u0

sum = 0, x01 = 0 or

x03 = ±π2 . The only choice of interest here is to choose x0

1 = 0. Inserted into thefirst and second equation in system 3.1 gives:

0 =u0diffLH

Iρ(3.2a)

0 = u0sumLM −M(x0

3)Iε

(3.2b)

Similarly to system 3.1 this system has two equations with three unknowns withan infinite amount of solutions. Looking at equation 3.2a it gives u0

diff = 0.Equation 3.2b is furthermore of much importance. It basically answers the

question: “What thrust is required to maintain a specific elevation angle?”. Solvingfor u0

sum gives:

u0sum = M(x0

3)LM

(3.3)

From equation 3.3 it is just a matter of choosing an elevation angle for linearization.Choosing x0

3 = 0 gives:

u0sum = M(0)

LM

Finally it is worth noting that state x5 (travel angle) does not show up anywherein the equations above meaning its actual value has no affect whatsoever.

Page 37: Modelling & Control of a 3DOF Helicopter

3.2 Linearization 23

3.2.2 Linearized state-space modelFollowing the identification and selection of an equilibrium point it is possible togo ahead and linearize the state-space model 2.12 to the form:

x = Ax+Bu

y = Cx

Linearized around the equilibrium point chosen in section 3.2.1 gives the matricesA,B,C as:

A = df

dx(x0, u0) =

0 1 0 0 0 0−mHgLρIρ

−kd,ρIρ 0 0 0 00 0 0 1 0 00 0 −M

′(0)Iε

−kd,εIε 0 00 0 0 0 0 1

−M(0)Iτ (0) 0 0 0 0 − kd,τ

Iτ (0)

B = df

du(x0, u0) =

0 00 LH

0 0LMIε

00 00 0

C = dg

dx(x0, u0) =

[0 0 1 0 0 00 0 0 0 1 0

]

The derivative sign function used in the pitch friction model is not defined atzero and hence the friction model derivative is not defined at the linearizationpoint. However the derivative very close to zero is one which has been used in thelinearization. The linearized state-space model now reads:x1x2x3x4x5x6

=

0 1 0 0 0 0−mHgLρIρ

−kd,ρIρ 0 0 0 00 0 0 1 0 00 0 −M

′(0)Iε

−kd,εIε 0 00 0 0 0 0 1

−M(0)Iτ (0) 0 0 0 0 − kd,τ

Iτ (0)

x1x2x3x4x5x6

+

0 00 LH

0 0LMIε

00 00 0

[usumudiff

]

(3.4a)

y =[0 0 1 0 0 00 0 0 0 1 0

]x1x2x3x4x5x6

(3.4b)

Page 38: Modelling & Control of a 3DOF Helicopter

24 Controller Design

3.3 DecouplingThe most straight-forward method of designing a controller for a Multiple InputMultiple Output (MIMO) system is to decouple the system by pairing inputs andoutputs to obtain two separate systems with a Single Input Single Output (SISO)acting independently of each other.

Decoupling the system is only suitable if the interactions between the chosenpairs are negligible. Analyzing the transfer matrix of the system 3.4 the transfermatrix in equation 3.5 is found.

G(s) = C(sI −A)−1B =[

LMIεs2+kd,εs+M ′(0) 0

0 − LHM(0)s(Iτ (0)s+kd,τ )(Iρs2+kd,ρs+mHLρg)

](3.5)

From the transfer matrix found above it is shown that the elevation angle is onlyaffected by usum and the travel angle is only affected by udiff . This means thatthere are no interactions between the pairs if usum is chosen to control the elevationangle and udiff to control the travel angle.

Pairing the input and outputs as so gives two separate systems. Equation 3.6is the elevation angle system.[

x3x4

]=[

0 1−M

′(0)Iε

−kd,εIε

] [x3x4

]+[

0LMIε

]usum (3.6a)

y =[1 0

] [x3x4

](3.6b)

Equation 3.7, the travel angle system.x1x2x5x6

=

0 1 0 0

−mHgLρIρ−kd,ρIρ 0 0

0 0 0 1−M(0)Iτ (0) 0 0 −kd,τ (0)

x1x2x5x6

+

0LHIρ

00

udiff (3.7a)

y =[0 0 1 0

] x1x2x5x6

(3.7b)

The discussion above leads to the controller schematic outlined in figure 3.1.

Page 39: Modelling & Control of a 3DOF Helicopter

3.4 Integral Action 25

Figure 3.1: Controller schematic showing decoupling.

3.4 Integral ActionDue to model imperfections, external disturbances and similar effects the controllerin its current form will not be able to reach a steady-state tracking error of zero.In order to mitigate this integral action has to be added to the feedback loop.This is achieved by augmenting system 3.6 and 3.7 by adding a new state variablecorresponding to the integral of the tracking error defined as:

e = r(t)− y(t) (3.8)

Augmenting the elevation system 3.6 with the new state gives the following state-space model:x3

x4e

=

0 1 0−mHLρg

Iε−kd,εIε 0

−1 0 0

x3x4e

+

0LMIε0

usum +

001

r(t) (3.9)

Similarly augmenting the travel system 3.7 gives the following system:x1x2x5x6e

=

0 1 0 0 0

−mHLρgIρ−kd,ρIρ 0 0 0

0 0 0 1 0−M(0)

Iτ0 0 −kd,τ (0)

Iτ (0) 00 0 −1 0 0

x1x2x5x6e

+

0LHIρ

000

udiff +

00001

r(t)(3.10)

3.5 Feed-Forward CompensationAn LQR-controller must be calculated from a linear model hence all nonlinearitiesfound in the nonlinear state-space model 2.12 will be unaccounted for by the stan-dard controller. However all nonlinear effects in the model 2.12 are measureableand it is possible to use feed-forward compensation to (theoretically) eliminate thenonlinear effects.

Page 40: Modelling & Control of a 3DOF Helicopter

26 Controller Design

3.5.1 Pitch controllerAnalyzing the equation for x2 in the nonlinear state-space model one can identifytwo nonlinearities that can be compensated for. Selecting the control signal udiffaccording to 3.11 will effectively compensate for the nonlinearities.

udiff,ffc = udiff + mHLρg(sin x1 cosx3 − x1)LH

(3.11)

3.5.2 Elevation controllerAnalyzing the equation for x4 in the nonlinear state-space model one can identifythree nonlinearities that can be compensated for. Selecting the control signal usumaccording to 3.12 (usum denoting the LQR-feedback) will effectively compensatefor all the nonlinearities:

usum,ffc = 1cosx1

(usum + M(x3)−M ′(0)x3 + (Iτ − Iρ)x2

6 cosx3 sin x3

LM

)(3.12)

3.6 Controller TuningIn section 3.3 the helicopter controller has been decoupled into two different con-trollers that need to be tuned. As stated earlier the LQR-theory will be used forselecting state-feedback gains.

An infinite horizon LQR is a regulator that minimizes a cost-function definedas:

∞∫0

x(t)TQx(t) + u(t)TRu(t) dt (3.13)

For given positive-definite weight matrices Q and R. While not going into thedetails or proofs the controller that minimizes 3.13 is a linear state-feedback con-troller:

u = −Lx(t) + l0r(t) (3.14)Where L is given as:

L = R−1BTP

Where P is given as the solution to the Algebraic Riccati Equation (details omit-ted). For calculating the feedback-gain matrix L the well known softwareMATLABfrom Mathworks Inc. will be used.

The forward gain l0 should, in the absence of integral action, be chosen so theclosed loop system gets static gain one in order to eliminate static error (assumingperfect model and no disturbances). Because of the added integral action theclosed loop system will have static gain one for any l0. However in order to reducethe ”stress” on the integral part of the controller l0 is chosen as if no integral actionhad been added. The l0 which gives Gc(0) = 1 (for the unaugmented system) iscalculated as:

l0 = (C(BL−A)−1B)−1 (3.15)

Page 41: Modelling & Control of a 3DOF Helicopter

3.6 Controller Tuning 27

Where the matrices are the state-space matrices for the unaugmented system givenin equations 3.6 and 3.7. For further details or theoretical background of theLinear-Quadratic Regulator please consult Glad and Ljung [4] or any other liter-ature on the subject.

When designing an LQR-controller it is simply a matter of trying differentweight-matrices Q and R until a controller with satisfactory performance is found.

3.6.1 Elevation controllerFor the elevation controller the following weight matrices turned out to give a fastrise time with little to no overshoot (see section 4.2.1 for actual performance).

Q =

1000 0 00 500 00 0 10

R = 3

This yielded the feedback gain matrix L:

L =[16.0890 17.3320 −1.8257

]Followed by reference gain:

l0 = 18.7928

3.6.2 Travel controllerThe travel controller is essentially using the pitch angle to rotate the helicopteraround the travel axis. The pitch axis is physically limited to angles −π2 ≤ ρ ≤

π2

which means it is vital to tune the controller to avoid hitting the physical pitch stopwhen operating the helicopter. A design decision was made to tune the controllerto be able to handle a 90 degree step on the travel angle without hitting the stop.The following matrices were chosen:

Q =

500 0 0 0 00 100 0 0 00 0 1000 0 00 0 0 10 00 0 0 0 50

R = 100

Yielding feedback gain matrix:

L =[1.4209 1.2565 −5.0541 −10.1076 0.7071

]Reference gain:

l0 = −3.1623

Page 42: Modelling & Control of a 3DOF Helicopter

28 Controller Design

3.7 State Estimator

Three quadrature encoders will be used to measure the angles of each axis. How-ever the angular velocities are not directly measurable. Instead they have to beestimated programmatically in the control unit with for example the Euler-forwardmethod or estimated by the use of a state estimator/observer.

Using a Kalman filter in conjunction with the previously developed LQR-regulator is called a Linear-Quadratic-Gaussian Regulator. However due to thehighly nonlinear nature of the helicopter system a standard Kalman filter gives un-satisfactory performance. In order to get better performance an Extended KalmanFilter (EKF) operating in discrete time is developed.

3.7.1 Extended Kalman filter equations

The basic operating principle of the EKF consists of a prediction step (equation3.16) where the state vector and the covariance matrix is predicted using themodel. The equations used to implement the Kalman filter are given below. Forreference see for example the Wikipedia article [8] on the subject.

The prediction step is given by:

xk|k−1 = f(xk−1|k−1, uk−1)Pk|k−1 = Fk−1Pk−1|k−1F

Tk−1 +Qk−1

(3.16)

The correction step is given by:

Kk = Pk|k−1HTk (HkPk|k−1H

Tk +Rk)−1

xk|k = xk|k−1 +Kk(zk − h(xk|k−1))Pk|k = (I −KkHk)Pk|k−1

Where Pk is the estimate of the covariance, K is the Kalman gain and zk is thevector of measurements.

However, f and h can not be used directly due to nonlinear nature of theprocess. To get around this the Jacobians of f and h are used.

Fk−1 = ∂f

∂x

∣∣∣∣xk−1|k−1,uk−1

Hk−1 = ∂h

∂x

∣∣∣∣xk|k−1

Page 43: Modelling & Control of a 3DOF Helicopter

3.7 State Estimator 29

3.7.2 Model discretizationIn order to implement the EKF the governing state equations 2.12 must be dis-cretized. Using the Euler forward method gives the discrete model:

xt+11 = xt1 + xt2∆T

xt+12 = xt2 + ∆T

Iρ(utdiffLH −mHgLρ sin xt1 cosxt3 − sign(x2)(kd,ρx2 + ks,ρ))

xt+13 = xt3 + xt4∆T

xt+14 = xt4 + ∆T

Iε(utsumLM cosxt1 −M(xt3)− (Iτ − Iρ)(xt6)2 cosxt3 sin xt3 − kd,εxt4)

xt+15 = xt5 + xt6∆T

xt+16 = xt6 −

∆TIτ (xt3) (LMutsum cosxt3 sin xt1 − kd,τxt6)

(3.17)

Where ∆T denotes the sample time. The Jacobian matrix of the function f isnow calculated as:

F t =

1 ∆T 0 0 0 0∂xt+1

2∂xt1

1− ∆TIρkd,ρ

∂xt+12∂xt3

0 0 00 0 1 ∆T 0 0

∂xt+14∂xt1

0 ∂xt+14∂xt3

1− ∆TIεkd,ε 0 ∂xt+1

4∂xt6

0 0 0 0 1 ∆T∂xt+1

6∂xt1

0 ∂xt+16∂xt3

0 0 1− ∆TIτ (xt3)kd,τ

Where:

∂xt+12

∂xt1= −∆T

IρmHLρg cosxt1 cosxt3

∂xt+12

∂xt3= ∆T

IρmHgLρ sin xt1 sin xt3

∂xt+14

∂xt1= −∆T

IεutsumLM sin xt1

∂xt+14

∂xt3= −∆T

Iε(M ′(xt3) + (Iτ − Iρ)(xt6)2 cos 2xt3)

∂xt+14

∂xt6= −∆T

Iε(Iτ − Iρ)2xt6 cosxt3 sin xt3

∂xt+16

∂xt1= − ∆T

Iτ (xt3)LMutsum cosxt3 cosxt1

∂xt+16

∂xt3= ∆TIτ (xt3)2 (I ′τ (xt3)(LMutsum cosxt3 sin xt1 − kd,τxt6) + LMu

tsumIτ (xt3) sin xt3 sin xt1)

Page 44: Modelling & Control of a 3DOF Helicopter

30 Controller Design

Furthermore the Jacobian matrix of the function h is given as:

H =

1 0 0 0 0 00 0 1 0 0 00 0 0 0 1 0

3.7.3 Noise covariance matricesThe noise covariance matrices below were chosen by trial and error.

Q =

0.005 0 0 0 0 0

0 0.5 0 0 0 00 0 0.005 0 0 00 0 0 0.5 0 00 0 0 0 0.005 00 0 0 0 0 0.5

R =

1 0 00 1 00 0 1

3.8 ImplementationAll of the controller design have been made in continuous time. However likealmost all controllers it will be implemented on a microprocessor operating in dis-crete time. If the sampling time of the implemented controller is fast enough thediscrete controller will behave almost identical to the continuous time one. Differ-ent ”rules of thumb” for when the sample time can be considered ”fast enough”exist. Glad and Ljung [4] state that if the sample frequency is at least 10 timesthe bandwidth of the closed loop system the effects of using a discrete controllerin place of a continuous can be neglected.

The bandwidth of the elevation and travel system is approximately 0.22 and0.09 Hz respectively which gives a minimum sample frequency of 2.2 Hz. Theimplemented control loop is operating at a frequency of 200 Hz which is wellabove the minimum of 2.2 Hz. Consequently the fact that the controller is actuallydiscrete can be neglected.

3.8.1 Input limitationsThe motors are able to operate in the range of 0-10000 RPM which given relation2.15 gives a thrust range of around 0-6.7 N for each motor. The controller is usingthe force sum and the force difference as input signals when controller the system.The relations between input signals and thrust for each motor is given in equation3.18.

FF = 12(usum − udiff ) (3.18a)

FB = 12(usum + udiff ) (3.18b)

Page 45: Modelling & Control of a 3DOF Helicopter

3.8 Implementation 31

As the motors cannot produce negative thrust equation 3.18 gives the followinginequalities:

0 ≤ 12(usum − udiff ) ≤ 6.7N (3.19a)

0 ≤ 12(usum + udiff ) ≤ 6.7N (3.19b)

Figure 3.2 shows these inequalities plotted with the set of feasible combinationsof usum and udiff marked in grey. As one can see from figure 3.2 the range of

-8

-6

-4

-2

0

2

4

6

8

0 2 4 6 8 10 12 14

Fo

rce

Dif

fere

nce

(N

)

Force Sum (N)

Input Limitations

Figure 3.2: Input Limitations.

available values for udiff is depending on the current value of usum or vice versa.The most straightforward way to handle this would be to select one of the inputsas ”master” and limit the other one depending on the current value of ”master”.Selecting usum as the master would potentially cause problems when usum = 0or usum = 13.4 N as the range of available values for udiff then shrinks to zero.One could possible mitigate this by not allowing usum to vary over its full range.However usum will only be at its limits for short periods of time so this will notbe implemented.

Page 46: Modelling & Control of a 3DOF Helicopter
Page 47: Modelling & Control of a 3DOF Helicopter

Chapter 4

Evaluation

4.1 Model EvaluationA good model of the helicopter dynamics plays a key role in the overall performanceof the controller. Therefore it is of great interest to evaluate how well the modeldeveloped in chapter 2 corresponds to the real world helicopter rig.

Each axis will be evaluated separately by physically locking the other two andthen manually controlling the input signals (i.e. no control system active).

When running the helicopter without an active control system the system iscontrolled by setting the RPM of each motor individually which through equation2.15 translates to a force. Because of this the forces given below might seem likestrange choices but they correspond to an even RPM.

4.1.1 Pitch axisFor the pitch test the travel and elevation axes are physically locked while udiff = 0and usum is held steady at 3.04N . A step is then given to udiff while the systemresponse is observed. Figure 4.1 shows the responses for udiff = 2.00 N . Figure4.2 shows the result for udiff = −2.67N .

As one can see in figures 4.1 and 4.2 the simulated step response shows sim-ilar characteristics to the real system response. The steady state angle differsapproximately 0.15 and 0.36 degrees respectively.

33

Page 48: Modelling & Control of a 3DOF Helicopter

34 Evaluation

0

2

4

6

8

10

12

14

16

18

0 0,5 1 1,5 2 2,5 3 3,5 4 4,5 5

An

gle

(d

eg

ree

s)

Time (s)

Pitch axis - Step to udiff 2,00N

System

Simulation

Figure 4.1: Pitch evaluation. Step to udiff = 2.00N .

-25

-20

-15

-10

-5

0

0 0,5 1 1,5 2 2,5 3 3,5 4 4,5 5

An

gle

(d

eg

ree

s)

Time (s)

Pitch axis - Step to udiff -2,67

System

Simulation

Figure 4.2: Pitch evaluation. Step to udiff = −2.67N .

Page 49: Modelling & Control of a 3DOF Helicopter

4.1 Model Evaluation 35

4.1.2 Elevation axisThe evaluation scenario of the elevation axis starts by having the pitch and travelaxes physically locked. With udiff = 0 usum is adjusted until the elevation angleis steady at -20 degrees. A step is then given so usum = 7.28N . The result of thetest is given by figure 4.3. As one can see the simulation and system show similarresponse characteristics. The simulation however is slightly slower than the realsystem.

-30

-20

-10

0

10

20

30

40

50

60

0 0,5 1 1,5 2

An

gle

(d

eg

ree

s)

Time (s)

Elevation angle - Step to usum 7.28N

System

Simulation

Figure 4.3: Elevation evaluation.

4.1.3 Travel axisThe evaluation setup for the travel axis consists of locking the elevation and travelaxes. The force motors are then set to a speed of 2500 and 7500 RPM respectively.This gives usum = 3.94 N and udiff = 3.33 N and a steady-state pitch angle of−17.6. At this point the travel axis is released while the system response isobserved. The result of the travel test can be seen in figure 4.4. Clearly theresponses of the simulation and the system are very similar.

Page 50: Modelling & Control of a 3DOF Helicopter

36 Evaluation

-100

0

100

200

300

400

500

0 1 2 3 4 5 6 7 8 9 10

An

gle

(d

eg

ree

s)

Time (s)

Travel evaluation

System

Simulation

Figure 4.4: Travel evaluation.

4.2 Controller EvaluationThe performance of the helicopter rig is depending on the robustness of the con-troller developed in chapter 3. If the controller is lacking in robustness the systemwill be very sensitive to component variations. The evaluation of the controllerimplemented on the helicopter rig is therefore extremely interesting.

When evaluating the controller developed in chapter 3 a step is given and thestep responses from each axis in the simulation is compared to the real worldhelicopter rig.

For each step response test three performance characteristics will be used.

• Rise time: Time from 10 % to 90 % of the target angle.

• Settling time: Time until the angle is within 5 % of target angle.

• Overshoot: Percentage overshoot of target angle.

4.2.1 Elevation controllerIn figure 4.5, 4.6 and 4.7 three different step responses on the elevation axis areshown. Performance characteristics are given below (average of the three tests):

• Rise time: 1.22 s.

• Settling time: 2.17 s.

• Overshoot: 0.0 %.

Clearly the elevation controller has good performance with fast rise- and settlingtimes without any overshoot.

Page 51: Modelling & Control of a 3DOF Helicopter

4.2 Controller Evaluation 37

-35

-30

-25

-20

-15

-10

-5

0

5

0 1 2 3 4 5 6 7 8 9 10

An

gle

(d

eg

ree

s)

Time (s)

Elevation evaluation - Step from -30 to 0

Reference

System

Simuation

Figure 4.5: Elevation step from -30 to 0 degrees.

-5

0

5

10

15

20

25

30

35

0 1 2 3 4 5 6 7 8 9 10

An

gle

(d

eg

ree

s)

Time (s)

Elevation evaluation - Step from 0 to 30

Reference

System

Simulation

Figure 4.6: Elevation step from 0 to 30 degrees.

Page 52: Modelling & Control of a 3DOF Helicopter

38 Evaluation

-30

-20

-10

0

10

20

30

40

0 1 2 3 4 5 6 7 8 9An

gle

(d

eg

ree

s)

Time (s)

Elevation evaluation - Step from 30 to -20

Reference

System

Simulation

Figure 4.7: Elevation step from 30 to -20 degrees.

Page 53: Modelling & Control of a 3DOF Helicopter

4.2 Controller Evaluation 39

4.2.2 Travel controllerFigure 4.8 is showing the system response of a step from 0 to 90 degrees. Perfor-mance characteristics are given below:

• Rise time: 3.68 s.

• Settling time: 5.82 s.

• Overshoot: 0.0 %.

-20

0

20

40

60

80

100

120

-1 1 3 5 7 9 11 13 15

An

gle

(d

eg

ree

s)

Time (s)

Travel evaluation - Step from 0 to 90

Reference

System

Simulation

Figure 4.8: Travel step from 0 to 90 degrees.

The travel controller shows good performance. The rise and settling times are notas fast as for the elevation controller (which is natural) but still relatively fast.Also there is no overshoot which is very good.

4.2.3 Simultaneous operationIn the above sections the elevation and travel controllers have been evaluated inisolation from one other. However due to the cross-couplings between the twosystems that exists when they are operated simultaneous it is of great interest toevaluate them together.

Using two out-of-phase sine-waves as reference angles for the elevation andtravel it is possible to make the helicopter fly a ”figure of eight”. In figure 4.9 theresult of such a test using 20 sin (0.2t) as elevation reference and 45 sin (0.1t+ 90)as travel reference is shown. As one can see the reference and angle curves areout-of-phase for both the elevation and travel system. This is natural consequenceof the fact that the controllers in their current form are not designed to follow atrajectory but rather maintain a constant set-point. The phase-lag is around −98for the elevation and around −114 for the travel system. Comparing this with

Page 54: Modelling & Control of a 3DOF Helicopter

40 Evaluation

-50

-40

-30

-20

-10

0

10

20

30

40

50

0 2 4 6 8 10 12 14 16 18 20

An

gle

(d

eg

ree

s)

Time (s)

Controller Evaluation - Figure of Eight

Travel Reference

Travel Angle

Elevation Reference

Elevation Angle

Figure 4.9: Figure of Eight

the closed loop bode plots of the elevation and travel system in figure 4.10 onecan see that the phase-lag for the elevation system is −68 and −106 for travelsystem. Furthermore ratio between the amplitudes are 0.93 for the elevation and0.74 for the travel system. This can be compared to the gains in the bode plotwhich are 0.75 and 0.61 respectively.

However the angles being out-of-phase with the references does not affect theperceived trajectory and indeed the helicopter is visually performing an almostperfect figure of eight.

Page 55: Modelling & Control of a 3DOF Helicopter

4.3 State Estimator Evaluation 41

Mag

nitu

de

(a

bs)

10-10

10-5

100

Elevation

Travel

10-3 10-2 10-1 100 101

Pha

se

(d

eg

)

-360

-270

-180

-90

0

Bode Diagram

Frequency (Hz)

Figure 4.10: Travel and Elevation closed loop systems

4.3 State Estimator EvaluationThe Extended Kalman Filter developed in section 3.7.1 was not used during theelevation and travel controller evaluations above. The reason for this was that themuch simpler and easier to implement Euler forwards method of approximating aderivative turned out to work sufficiently well. Because project time was limiteda decision was taken to stick with the Euler forwards method to estimate angularvelocities and, if there were time left, implement and evaluate the EKF.

With little project time left the EKF was implemented and a few tests werecarried out. The results can be summarized as:

• The EKF was able to estimate the state vector successfully and using esti-mated states in the feedback loop worked very well.

• The EKF was quite computationally heavy. The loop timing had to beincreased from 5ms to 25ms.

• Compared to the Euler forwards method the angular velocities estimated bythe EKF were much ”smoother”.

The evaluation in section 4.2.3 was carried out using angular velocities estimatedby the EKF. As discussed in the section the controller performs very well whichalso shows that the EKF is working well.

Page 56: Modelling & Control of a 3DOF Helicopter
Page 57: Modelling & Control of a 3DOF Helicopter

Chapter 5

Summary and Conclusion

5.1 SummaryThe scope of this report was to develop a mathematical model and a controlsystem for a 3DOF helicopter. Using Euler’s second law of motion the equationsof motion for the helicopter system were found. A Simulink model of the systemwas developed in order to be able to simulate the system. The simulation modelwas then evaluated against the real world system, which showed a good match,especially for the pitch and travel axes.

In order to develop an LQR for the helicopter system the highly nonlinear state-space model was linearized around an operating point were all angles are equalto zero. Because the system is underactuated and therefore all angles cannot beindependently controlled a decision was made to control the travel and elevationangles and let the pitch be indirectly controlled. The linearized system was thendecoupled into two different systems, one for the elevation system and one for thetravel system, each one with a separate controller. In order to mitigate constantdisturbances and model uncertainty integral action was added to both controllers.Furthermore feed-forward compensation links were added in order to mitigate themeasurable nonlinear effects neglected by the linear model used by the controller.Suitable weight-matrices were then found by trial and error.

An EKF was developed due to the problem of the angular velocities not beingdirectly measurable. The filter showed promising results in the simulation envi-ronment. However, in the real system the much simpler Euler forward method ofapproximating derivatives was implemented first and showed decent performanceso it was decided to use that method instead of the more complicated Kalman fil-ter. Though very late in the project the EKF was implemented on the real systemand a few tests were carried out. These showed that the EKF could successfullyreconstruct the states for use in the feedback loop.

The controllers were then evaluated on the real system. The elevation controllershowed exceptionally good performance with short rise- and settling time withoutany overshoot. The travel controller did not show the same exceptionally goodperformance. It had a little bit longer rise- and settling time but without any

43

Page 58: Modelling & Control of a 3DOF Helicopter

44 Summary and Conclusion

overshoot.

5.2 ConclusionThe main goal of this thesis was to develop a mathematical model and controllerfor the 3DOF helicopter system. The results clearly show that an LQR-controlleris able to successfully control a system like this with decent performance charac-teristics despite the highly nonlinear system.

Further work on the subject could include additional tuning of the model andcontroller which would most likely provide even better performance. Especiallythe mathematical model over the elevation axis could need further improvementssince the simulation and the real system differed a considerable amount. With aneven better model the controller performance can be further enhanced.

Additional work could also include testing other control systems. Developmentof a simpler PID-controller could provide an interesting comparison to the moreadvanced LQR developed in this report since the linkage between the adjustedparameters and resulting changes are much clearer with such a controller.

Page 59: Modelling & Control of a 3DOF Helicopter

Bibliography

[1] Marcus Almén, Rasmus Asklund, Erik Bodin, Klas Lindsten, Gustav Ling,Jesper Persson, and Fanny Stenholm. Design & Implementation of a 3DOFHelicopter. Technical report, Linköping Institute of Technology, 2015.

[2] Marcus Almén and Klas Lindsten. Design and Implementation of a Softwareand Electronic system for a 3DOF Helicopter. Bachelor thesis, Linköping In-stitute of Technology, 2015.

[3] Rasmus Asklund and Samuel Kärnell. Mechanical Design of a 3DOF Heli-copter. Bachelor thesis, Linköping Institute of Technology, 2015.

[4] Torkel Glad and Lennart Ljung. Reglerteori : flervariabla och olinjära metoder.Studentlitteratur, Lund, 2003.

[5] Quanser Inc. http://www.quanser.com/products/3dof_helicopter, 2015.Accessed: 2015-03-07.

[6] Gustav Ling and Jesper Persson. Propulsion unit of a 3DOF Helicopter. Bach-elor thesis, Linköping Institute of Technology, 2015.

[7] Markus Ruf. Model Predictive Control of a Quanser 3DOF Helicopter. Master’sthesis, Chalmers University of Technology/University of Stuttgart, 2014.

[8] Wikipedia, the free encyclopedia. Extended Kalman Filter. http://en.wikipedia.org/wiki/Extended_Kalman_filter, 2015. Accessed: 2015-04-23.

45

Page 60: Modelling & Control of a 3DOF Helicopter