report

148
Modelling and Control of a Twin-Rotor MIMO System Department of Control Engineering 6th Semester Aalborg University 2006

Upload: vijichit

Post on 21-Nov-2014

258 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: report

Modelling and Control of aTwin-Rotor MIMO System

Department of Control Engineering6th Semester

Aalborg University 2006

Page 2: report
Page 3: report

A A L B O R G U N I V E R S I T Y

6th SemesterDepartment of Control EngineeringInstitute of Electronic SystemsFaculty of Engineering and ScienceFredrik Bajers Vej 7CDK-9220 Aalborg ØstDenmarkTelephone +45 96 35 87 00Fax +45 98 15 17 39http://www.control.aau.dk/

Title:Modelling and Control of a Twin-RotorMIMO System

Theme:Feedback Control

Period:P6, Spring Semester 2006

Project group:06gr632

Group members:Rolf ChristensenNikolaj FoghRico Hjerm HansenMads Schmidt JensenSøren LarsenAchuthan Paramanathan

Supervisor:Henrik Vie Christensen

Copies: 9

Pages: 138

Attachments: 14, CD-ROM

Finished: 29th of May 2006

Synopsis:

This report documents the developing andimplementation of quick and accurate trackingcontrollers for a Twin-Rotor MIMO System.This system has a high degree of non-linearityand cross-coupling between the inputs andoutputs.

The mechanical properties of the systemis modelled rigorously using the method offirst principle while the aerodynamics of therotors are modelled using a black box systemidentification technique. The parametervalues of the models are estimated usingthe Matlab toolbox Senstools. Theresulting non-linear models are linearizedand verified successfully.

Both classical control and modern state-space pole-placement and LQR control areused on the system. The controllers aredesigned using the linearized model andare verified against the non-linear model toensure their performance on the physicalmodel before actual implementation.

By implementing the controllers inSimulink and testing them on thephysical model it is found that all ofthe controllers are able to stabilize thesystem and track a reference signal. Thestate-space controllers are superior to theclassical controller in both tracking andstabilization of the system and complywith the requirement specification exceptin one test each.

Page 4: report
Page 5: report

A A L B O R G U N I V E R S I T Y

6. SemesterAfdeling for ProceskontrolInstitut for Elektroniske SystemerDet Teknisk-Naturvidenskabelige FakultetFredrik Bajers Vej 7CDK-9220 Aalborg ØstDanmarkTelefon +45 96 35 87 00Fax +45 98 15 17 39http://www.control.aau.dk/

Titel:Modelling and Control of a Twin-RotorMIMO System

Tema:Reguleringsteknik

Periode:P6, Forårssemester 2006

Projektgruppe:06gr632

Gruppemedlemmer:Rolf ChristensenNikolaj FoghRico Hjerm HansenMads Schmidt JensenSøren LarsenAchuthan Paramanathan

Vejleder:Henrik Vie Christensen

Kopier: 9

Sider: 138

Bilag: 14, CD-ROM

Færdiggjort: 29. Maj 2006

Synopsis:

Denne rapport beskriver udviklingen af hur-tige og præcise regulatorer til et Twin-RotorMIMO System, et system som indeholdermegen ulinearitet og har krydskoblingermellem inputs og outputs.

Mekanikken i systemet er modelleret vedhjælp af de grundlæggende fysiske love,hvorimod aerodynamikken i rotorerne ermodelleret ved hjælp af en black-box test ogsystemidentifikation. Modellernes parametreer estimeret ved brug af Matlab toolboxenSenstools. De resulterende ikke-lineæremodeller er lineariseret og verificeret.

Reguleringsteknik indenfor klassiskregulering og moderne state-space pol-placering og LQR er brugt i systemet.Regulatorerne er designet ud fra delineære modeller og er verificeret på denulineære systemmodel, for at sikre deresperformance på den fysiske model indenden egentlige implementation.

Regulatorerne er implementerede iSimulink og ved tests er det verificeret atalle regulatorer er i stand til at stabiliseresystemet og følge en given reference. State-space regulatorerne er væsentligt bedreend den klassiske regulator til at følge enreference og stabilisere systemet, og deoverholder begge kravsspecifikationen pånær ved een test hver.

Page 6: report
Page 7: report

PrefaceThis report is written by group 06gr632 at the Department of Process Control under theInstitute of Electronic Systems at Aalborg University. The report is composed duringthe period from the 1st of February to the 29th of May 2006 under the theme “FeedbackControl”.

For a complete understanding of the report a technical and scientific level correspondingto that of 6th semester students at the Department of Process Control is required.

Literature references are written according to the Harvard-method: [Last name of au-thor, year of publication]. If a literary work has more than two authors the first author’slast name is written followed by “et al.”: [Last name of author et al., year of publication].

The verbatim environment is used whenever referring to Matlab functions and whenlisting code or Matlab scripts.

The version of Matlab and Simulink used in this report is 7.0.0.19920 (R14) and6.0 (R14). The version of Matlab and Simulink used on the laboratory-computerconnected to the system is 6.5.0.180913a (R13) and 5.0 (R13).

References to appendices are enumerated as: App. A, B, etc., while attachments arereferred to with a number [1], [2], [3], etc. A list of the attachments can be found inthe section “Appended Documents”. The enclosed CD-ROM contains the attachmentsof this report.

The last pages of the report contains a nomenclature for easy reference of used symbols.

A video clip of the system with the designed controllers implemented can be foundin appended document [1].

Permission has been granted by Prof. Jakob Stoustrup to attach his course-material forthe course “State-Space Methods” on the enclosed CD-ROM.

The report is copyrighted by the members of the group and Aalborg University. Itmay be used freely provided that a distinct reference is made.

Aalborg University, 29th of May, 2006

Rolf Christensen Nikolaj Fogh

Rico Hjerm Hansen Mads Schmidt Jensen

Søren Larsen Achuthan Paramanathan

Page 8: report

Contents

I Introduction 1

1 Project Scope 2

2 System Description 3

3 Requirement Specification 5

II Modelling 7

4 Modelling Strategy 8

5 Modelling the DC Motors with Rotors 105.1 Non-linear Model of DC Motor with Rotor . . . . . . . . . . . . . . . 105.2 Linear Model of DC Motor with Rotor . . . . . . . . . . . . . . . . . 145.3 DC Motor Models for Main and Tail Rotor . . . . . . . . . . . . . . 16

6 Modelling the Aerodynamic Torques 206.1 Rotor Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206.2 Rotor Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

7 Modelling the TRMS Mechanics 247.1 Reference Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247.2 Torques in the Vertical Plane . . . . . . . . . . . . . . . . . . . . . . 247.3 Torques in the Horizontal Plane . . . . . . . . . . . . . . . . . . . . . 297.4 Moment of Inertia of the TRMS . . . . . . . . . . . . . . . . . . . . . 307.5 Transfer Function in the Vertical Plane . . . . . . . . . . . . . . . . 327.6 Transfer Function in the Horizontal Plane . . . . . . . . . . . . . . . 347.7 Verifying the Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

Summary 42

Page 9: report

III Controller Design 45

8 Classic Controller 468.1 Classic Controller Design . . . . . . . . . . . . . . . . . . . . . . . . 468.2 Verification of the Classic Controllers . . . . . . . . . . . . . . . . . . 518.3 Classic Controller Implementation . . . . . . . . . . . . . . . . . . . 54

9 State-Space Controller 569.1 State-Space Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569.2 State-Space Controller Architecture . . . . . . . . . . . . . . . . . . . 609.3 State-Space Controller Design . . . . . . . . . . . . . . . . . . . . . . 67

Summary 81

IV System Testing and Summary 83

10 Acceptance Test 84

11 Conclusion 98

12 Closing Statement 99

References 100

Appended Documents 101

V Appendix 103

A System Performance Test 104

B Parameter Estimation of the DC Motors 106

C Parameter Estimation of the Vertical Mechanics 120

D Parameter Estimation of the Horizontal Mechanics 123

E Determination of the Aerodynamic Torques 126

F Senstools 129

G The TRMS Software 133

H Nomenclature 135

Page 10: report
Page 11: report

Part I

Introduction

This part defines the scope of the project and explains important concepts and termi-nology surrounding the Twin Rotor Multiple Input Multiple Output System (TRMS).

Having described the system, a preliminary test is made where the dynamic perfor-mance of the system without controllers is measured. This test makes it possible toset up a well-considered requirement specification, including requirements for rise time,overshoot and settling time.

Page 12: report

Chapter 1Project Scope

The main goal of the 6th semester in Control Engineering at Aalborg University isto enable students to analyze and control a physical process. To do this, the controllaboratory in Aalborg University is in possession of a simple helicopter model in form ofthe TRMS. The TRMS has a high degree of non-linearity and cross-coupling betweeninputs and outputs. Control of the TRMS provides a challenging task in the areas ofmodelling and control of dynamic systems.

The scope of the project is given in the project proposal, in which the tasks which mustbe accomplished are specified:

The task of the project is to design an autopilot, ie. a controller for direc-tion control so the helicopter is hovering or tracking a predefined trajectory.Furthermore the auto pilot must be implemented in real-time.

The autopilot is created by developing a linear model of the system which is usedto design both classic and state-space controllers. The controllers are implemented inWindows 98 using Simulink and a proprietary real-time kernel included with the TRMSsystem.

Figure 1.1: The Twin Rotor MIMO System.

2

Page 13: report

Chapter 2System Description

To visualize the parts and motions of the TRMS together with the forces generatedby the actuators, a model of the TRMS is seen in Fig. 2.1. The TRMS consists of atower with a beam attached by two bearings. These bearings allow the beam to movefreely in the horizontal and vertical plane within some limits. At the two ends of thebeam, rotors are attached which are rotated 90 degrees from each other allowing themto generate horizontal and vertical thrusts. A beam with a counterweight is attachedto the housing of the bearings. This is used to change the settling point of the TRMS,and also dampens the dynamics of the system. The model is fastened to a stand by thetower, and hence cannot have translatory movements. Also, the main beam is locked,so that the model cannot roll.

Vertical Y-axisHorizontalX-axis

Verticalplane

Tail rotor

Horizontal thrust

Main rotor

Pitch motionYaw motion

Counter weight

TRMS stand

Beam

Yaw motion

Vertical plane

Horizontal plane

HorizontalZ-axis

Pitch motion

Vertical thrust

Tower

Bearings

Figure 2.1: The TRMS. The beam is connected to the tower using two bearings,which enables pitch and yaw motion. The main and tail rotor generates the verticaland horizontal thrust which pitches and yaws the model. The counterweight is usedto change the settling point and dynamics of the TRMS.

The rotor generating vertical thrust is called the main rotor. This enables the model topitch, which is rotation in the vertical plane around the horizontal Z and X axes. Therotor generating the horizontal thrust is called the tail rotor. This enables the model toyaw, which is rotation in the horizontal plane around the vertical Y axis.

3

Page 14: report

4 CHAPTER 2. SYSTEM DESCRIPTION

Sensors on the system measure the pitch and yaw angles of the model and the angularvelocities of the rotors. The inputs to the system are the voltages applied to the mainand tail rotors, which can be applied ±19.5V and ±14.5V respectively.

To interface with the model, a PC with a PCL-812 I/O board is used. The PC isequipped with the software tools Matlab and Simulink along with tools to performmeasurements on the system and to implement controllers in real-time. The communi-cations between the PC and the TRMS system is seen in Fig. 2.2.

Rotor angular velocitiesand pitch and yaw angles

MATLAB/SIMULINKRotor voltages

TRMS system

Input

OutputI/O board

PC

Actuators

Sensors

Figure 2.2: Inputs and outputs of the TRMS. The angular velocities of the rotorsand pitch and yaw angles of the beam is sampled by the I/O board and used byMatlab and Simulink to generate the output voltages to the motors.

The resting point is defined to be where the TRMS settles when no input is given tothe rotors.

The working point of the TRMS is defined to be when the main beam is horizontal andparallel with the front of the stand. In App.A a system performance test shows that inthis position the velocities of the rotors are

ωm = 54rads

ωt = −44rads

(2.1)

where ωm and ωt are the angular velocity of the main and tail rotor, respectively. Fromthe working point, the model can turn ±2.82 rad in the horizontal plane and from−1.05rad to 1.22rad in the vertical plane as shown in Fig. 2.3.

θh,+max=2.82rad

θh,-max=−2.82radHorizontal x-axis

Horizontal z-axis Vertical y-axis

Horizontal x-axis

θv,-max=−1.05rad

θv,+max=+1.22rad

Figure 2.3: The model is locked mechanically so it cannot move more than ±2.82radin the horizontal plane and from −1.05rad to +1.22rad in the vertical plane.

Having described the important concepts and the movements of the system, a require-ment specification for the system can be made.

Page 15: report

Chapter 3Requirement Specification

In App. A graphs of the step responses of the system revealed a minimum rise time of2.5s in the vertical plane from resting point to the maximum vertical position and 2.8sin the horizontal plane from resting point to the maximum horizontal position.

It is decided to be acceptable to be within 2 s from the minimum rise times found andthus the requirement for rise time in the vertical plane is 4.5s and 4.8s in the horizontalplane.

The maximal acceptable overshoot is chosen to be 10% of the step. When a step isgiven in one plane only, the allowed overshoot in the other plane is 10% of this step.

The settling time is chosen to be below 6s. The settling time are determined in App. Ato be when the oscillations are less than ±5% of the step size. If the step is less than0.4 rad the settling time parameter is changed to a fixed value of ±0.02 rad. When astep is given in one plane only, the other plane is said to be settled when its position iswithin ±0.02rad of the reference.

It is chosen to have zero steady-state error at step inputs. As zero steady-state error isnot realizable, it is defined as when the system settles within ±0.02rad of the reference.

The specified transient requirements are listed in Tab. 3.1:

Vertical Plane Horizontal PlaneRise Time [s] 4.5 4.8Overshoot [%] 10 10Settling Time [s] 6.0 6.0

Table 3.1: The requirements of the final system based on the preliminary test.

Finally the system must be able to track a sine with a frequency of 0.42 rad/s and anamplitude of 0.3rad in the vertical plane and 0.5rad in the horizontal plane.

5

Page 16: report
Page 17: report

Part II

Modelling

In this part a mathematical model of the TRMS is developed. By splitting the model intoseveral sub-models, which are modelled independently, the complexity of the modellingprocedure is reduced.

A non-linear model of the motor system and the mechanics of the TRMS is rigorouslydeveloped by the means of the method of First Principle, where the principles and lawsof physics are used to determine the dynamics of the system. The parameters for themodel are obtained using the Matlab toolbox Senstools on system measurements.The aerodynamic torques created by the rotors are modelled using a black-box systemidentification technique.

To enable design of the controllers for the system, the entire model is linearized.

Page 18: report

Chapter 4Modelling Strategy

This chapter explains the strategy used for modelling the TRMS and the simplificationsused to obtain the models.

Sub-models of the TRMS

The strategy for modelling the TRMS is splitting the model into three sub-models forboth the horizontal and vertical plane. All six sub-models are modelled separately.

DC−motor+ load

Vmain

Vtail DC−motor+ load

Rotoraerodynamics

τ m

τ m,p

τ t,p

τ t

θ

θRotoraerodynamics Mechanics

Mechanics

Horizontal plane

Vertical plane

ω

ω

m

t

v,res

h,res

Figure 4.1: A block diagram of the TRMS model and the couplings in the system.The system is divided into six sub-models which are each modelled independently.

Figure 4.1 shows a block diagram of the sub-models of the TRMS and the couplings ofthese. The sub-models are the DC-motors, the rotor aerodynamics and the mechanicsfor both the horizontal and the vertical plane. The DC-motor block has a main andtail voltage input, and returns the angular velocities ωm and ωt respectively. The rotoraerodynamics has an angular velocity as input, and returns the aerodynamic torques τm,τt, τm,p and τt,p. The mechanics of the system has inputs in the form of an aerodynamicforce from the same plane, and the angular velocity and an aerodynamic force of theother plane. Ex. the horizontal plane has the input τm from the horizontal plane andτt,p and ωt from the vertical plane. The cross-couplings of the two planes are indicatedby dashed lines. The output from the mechanics block is the azimuth angle θres for thehorizontal and the pitch angle for the vertical plane.

8

Page 19: report

9

Model Simplifications

To simplify the modelling procedure, certain assumptions and simplifications are madeconcerning the system environment.

System Isolation The system is considered isolated. That is, it has a stationary (non-accelerated) inertial frame with no external forces acting on the model.

Inertia calculations The calculations of the moments of inertia have been simplifiedby assuming the parts of the TRMS to be geometrically simple. Ex. the rotorblades are modelled as rectangular plates.

Center of rotation It is assumed that the beam with the rotors are attached to thecenter of the tower and hence the yaw motion is around this axis, even though itis displaced.

Friction Stiction and dry friction are not included in the models.

Page 20: report

Chapter 5Modelling the DC Motors with Rotors

The purpose of this chapter is to develop a model for each of the two DC motorspowering the rotors of the TRMS, thus identifying the relationship between the appliedvoltage to each motor and the resulting angular speed of their respective loads, i.e. therotors.

Since the two motor systems are very similar, i.e. the two DC motors are of the samemake and product series, and only the power of the motors and their rotor-loads differ,the systems are modelled theoretically by developing a common basic model. As a resultthe two models will have the same structure, but different working point and parametervalues.

The parameter values are experimentally determined using Senstools, and can befound in App. B.

In the first section of this chapter a non-linear model is developed, which is linearized inthe second section, thus yielding the transfer function of the system. Last the parametersof each system is inserted and the model is verified.

5.1 Non-linear Model of DC Motor with Rotor

The non-linear model of the motor system is developed by combining models of theelectrical and the mechanical characteristics of the DC motor with load.

5.1.1 Electrical Properties of the DC Motor

The DC motors of the TRMS are permanent magnet DC motors. These motors developtorque by utilizing the fact that a force is exerted on a conductor placed in a magneticfield whenever current passes trough the conductor. This is summarized in Laplace’slaw [Andersen and Pedersen, 2005]

dF = i(dl×B) [N ] (5.1)

where dF is the force on a infinitesimal conductor of length dl carrying a current iplaced in an magnetic field with magnetic flux density B .

Thus by having a U-shaped coil placed in a magnetic field a torque can be created asillustrated in Fig. 5.1. However, the direction of the torque reverses every half turnif the current in the coil maintains the same direction. To maintain the rotationaldirection, the coil is connected to a segmented ring called a commutator which reversesthe direction of the current at each rotation.

As both the commutator and the coil rotates, the current is fed to the commutatorusing carbon contacts called brushes.

10

Page 21: report

5.1. NON-LINEAR MODEL OF DC MOTOR WITH ROTOR 11

Figure 5.1: Illustration of the principle of the permanent magnet DC motor. Thebrushes and the commutators reverses the direction of the current ia in the coil tokeep the torque produced by the force F in the same direction.

A permanent magnet DC motor is made of multiple U-shaped coils, similar to the onedescribed, placed within evenly spaced slots of a cylinder of magnetic material calledthe armature. These coils are connected to the commutator, which is segmented toaccommodate the number of coils. [Bateson, 1996]

As the magnetic field acts perpendicular to the coil, the force F on the coil can by useof Eq. (5.1) be expressed as

F (t) = Bia(t)l [N ] (5.2)

where ia is the armature current.

As a result, the average torque τmotor produced by N U-shaped windings is N times theproduct of the force F and the average moment arm of a full revolution

τmotor(t) = ia(t) N 2l B1π

∫ π

0

r cos θ(t) dθ = kmia(t) [Nm ] (5.3)

where r is the radius at which the coils are placed and θ is the angular position of acoil.

Hence the torque produced by a DC motor is proportional to the armature current iawith the proportionality factor km called the motor constant. The unit of km is Nm/A.[Andersen and Pedersen, 2005]

When the coils of the motor rotate in a magnetic field a voltage, known as an elec-tromotoric force (emf), is induced in the coils. This voltage can be determined as[Andersen and Pedersen, 2005]

dem = (v ×B) · dl [V ] (5.4)

where dem is the electromotoric force induced in an infinitesimal conductor piece oflength dl with velocity v .

As the velocity of the coils is rωa, where ωa is the angular velocity of the armature, thetotal induced voltage in the armature is:

em(t) = ωa(t) N 2l B r1π

∫ π

0

cos θ(t) dθ = kmωa(t) [V ] (5.5)

Thus the total induced voltage in the armature em, also known as the back emf, isproportional to the angular velocity of the armature with the same motor constant kmfound in Eq. (5.3). Note that the unit of km can be expressed as both Nm/A and V s.

Page 22: report

12 CHAPTER 5. MODELLING THE DC MOTORS WITH ROTORS

The coils or the armature of the DC motor also exhibits some ohmic resistance Ra andinductance La, yielding the electric equivalent depicted in Fig. 5.2.

1

Ra

Ra L

a

km motor⋅ω

ia

ua u

r

ia

(a) (b)

ur

Figure 5.2: Illustration (a) shows the electric equivalent of the DC motor, whichconsists of a resistor, an inductance, and a controlled voltage source to model theback emf. The voltage ua is the voltage applied to the motor. The voltage dropacross Ra is non-linear as seen in illustration (b).

The resistance Ra in the electric equivalent is modelled non-constant in order to ac-commodate for a non-linear voltage drop across the carbon brushes of the commutator.This is approximated using a piecewise constant resistance for Ra as shown in Fig. 5.2(b). [Knudsen and Jensen, 1995]

From the electric equivalent, the following differential equation can be obtained:

ua(t) = Ra(ur) ia(t) + Ladia(t)

dt+ kmωa(t) [V ] (5.6)

This equation relates the applied motor voltage ua with the angular velocity of themotor, thereby bridging between the electric and mechanical part of the DC motor.

5.1.2 Mechanical Properties of DC motor

The mechanical part of the DC motor model consists of the motor shaft directly con-nected to a rotor. An illustration of the system is seen in Fig. 5.3.

τmotor

τfτ

J

ωa J

a

Figure 5.3: Illustration of the mechanical part of the DC motor, where the inertiaJa is the total inertia seen by the motor. The torque τmotor is the torque deliveredfrom the motor, τJ is the torque required to accelerate the inertia of the system andτf is the torque due to friction. The positive rotational direction and velocity is ωa.

The torque τJ required to accelerate the total inertia seen by the motor Ja is given as:

τJ(t) = Jaωa(t) [Nm ] (5.7)

The torque τf is the total torque due to friction, which is composed of the four types offrictions depicted in Fig. 5.4.

Page 23: report

5.1. NON-LINEAR MODEL OF DC MOTOR WITH ROTOR 13

viscous friction coulomb friction stiction drag friction

ωm

ωm

ωm

ωm

τΒτ

c τs τ

D

τn

-τn

Ba

D⋅ωm

2

-D⋅ωm

2

Figure 5.4: The four types of frictions affecting the rotation of the motor armatureand load. In the figures ωm is the angular velocity of the armature and load, and τis the torque developed by the respective friction. [Andersen and Pedersen, 2005]

These frictions are characterized as: [Andersen and Pedersen, 2005]

• The viscous friction τB is a friction proportional to the angular speed ωa, thusτB = Baωa.

• The Coulomb friction τc is a constant friction, which only depends on the signof ωa when rotating. If the motor torque applied is less then τn, the Coulombfriction τc is equal to the negative of the applied torque.

• The stiction τs only occurs when ωa is zero (or very close to zero).

• The drag friction τD is due to the air resistance experienced by the rotor, and isproportional to the square of the angular speed ωa, thus τD = Dω2

a .[Walker and Jenkins, 1997]

Using these considerations a non-linear differential equation of the mechanical part canbe obtained:

τJ(t) = τmotor(t)− τf(t)⇓

Jaωa(t) = kmia(t)−Dω2a(t)−Baωa(t)− Tc

(ωa(t)

)− Ts(ωa(t)

)[Nm ] (5.8)

Using Eq. (5.6) and Eq. (5.8), a block diagram of the non-linear DC motor system withload can be constructed as seen in Fig. 5.5.

Figure 5.5: A block diagram of the non-linear DC motor system with load. Thedashed line is the boundary between the electrical and mechanical part.

Having obtained a complete non-linear model of the DC motor system, the system isready to be linearized.

Page 24: report

14 CHAPTER 5. MODELLING THE DC MOTORS WITH ROTORS

5.2 Linear Model of DC Motor with Rotor

The non-linear model of the DC-motor with rotor is linearized in this section. Thisincludes a brief description of the linearization method used. Afterwards the transferfunction of the system is developed.

5.2.1 Linearizing the DC Motor Model with Rotor

Linearizing in a Working Point:

Linearizing in a working point is done by expressing the model variables as a sum oftheir working point value and a small signal value [Andersen and Pedersen, 2005]

x = x + x (5.9)

where x is the working point value of the variable x and x is the small signal value.

The working point values x of the variables can be computed by solving thenon-linear equations at steady-state in the desired working point.

The remaining non-linear terms of the model are approximated using a first orderTaylor approximation: [Andersen and Pedersen, 2005]

f(x + x) ≈ f(x) +∂f(x)

∂x

∣∣∣∣x=x

x (5.10)

This also applies to a function of two or more variables:

f(x + x, y + y) ≈ f(x, y) +∂f(x, y)

∂x

∣∣∣∣x=xy=y

x +∂f(x, y)

∂y

∣∣∣∣x=xy=y

y (5.11)

As the final step, the working point equation is subtracted from the approximatedlinear equation leaving a linear small signal model.

In order to obtain a linear model of the DC motor system the following assumptionsare made:

• The armature resistance Ra is assumed constant.

• The non-linear Coulomb friction τc and stiction τs are neglected.

• The term Ldiadt in Eq. (5.6) is disregarded.

The reason for disregarding the linear term Ldiadt is that the time constant from this term

is small compared to that of the mechanical part. As a result the dynamics of the systemis not altered significantly by omitting the inductance of the motor. [Bateson, 1996]

Under these assumptions Eq. (5.6) describing the electrical part of the model reduces tothe following linear differential equation:

ua(t) = Ra ia(t) + kmωa(t) [V ] (5.12)

Accordingly Eq. (5.8) describing the mechanical part of the model is reduced to thefollowing non-linear differential equation:

Jaωa(t) = kmia(t)−Dω2a(t)−Baωa(t) [Nm ] (5.13)

Page 25: report

5.2. LINEAR MODEL OF DC MOTOR WITH ROTOR 15

The working point values ia and ua are calculated by choosing ωa and solving Eq. (5.12)and Eq. (5.13) in steady-state:

ua = Ra ia + kmωa [V ] (5.14)

0 = kmia −Dω2a −Baωa [Nm ] (5.15)

By replacing the variables of Eq. (5.12) with the sum of their working points and smallsignal values, and subtracting the working point Eq. (5.14) from it, the following linearsmall signal equation is obtained for the electrical part:

ua(t) = Ra ia(t) + kmωa(t) [V ] (5.16)

Equation (5.13) of the mechanical part contains the non-linear term Dω2a(t). By using

a first order Taylor approximation the non-linear term can be expressed as:

Dω2a(t) ≈ Dω2

a + 2D ωa ωa(t) [Nm ] (5.17)

Inserting Eq.(5.17) in Eq.(5.13), and writing the variables as the sum of a working pointand a small signal, where the working point Eq. (5.15) has been subtracted, yields:

Ja(˙ωa + ˙ωa(t)

)= km

(ia + ia(t)

)−D ω2a − 2D ωa ωa(t)−Ba

(ωa + iωa(t)

)

⇓Ja ˜ωa(t) = kmia(t)− 2D ωa ωa(t)−Baωa(t) [Nm ] (5.18)

Having linearized the two equations describing the DC motor model with rotor, theseequations are ready to be combined into a transfer function of the model.

5.2.2 Transfer Function of DC Motor Model

Laplace transforming Eq. (5.16) and Eq. (5.18) describing the electrical and mechanicalpart yields

Ua(s) = Ra Ia(s) + kmΩa(s) JasΩa(s) = kmIa(s)− 2D ωa Ωa(s)−BaΩa(s)⇓ ⇓

Ia(s) =Ua(s)− kmΩa(s)

RaΩa(s) =

kmJas + 2D ωa + Ba

Ia(s)

where Ωa(s) = Ωa(s)− ωa and Ua(s) = Ua(s)− ua.

The corresponding block diagram using these equations are seen in Fig. 5.6.

Figure 5.6: Block diagram of the linear DC motor model in the working point(ua, ωa).

Page 26: report

16 CHAPTER 5. MODELLING THE DC MOTORS WITH ROTORS

From the block diagram the following closed-loop transfer function is obtained:

Ωa(s)Ua(s)

=kmRa

1Jas+2D ωa+Ba

1 + k2m

Ra

1Jas+2Da ωa+Ba

=km

JaRas + Ra(2D ωa + Ba) + k2m

(5.19)

Having obtained a linear model of the motor system, the parameter values of the mainand tail rotor systems are ready to be inserted.

5.3 DC Motor Models for Main and Tail Rotor

The parameter values for each motor estimated in App. B are listed in Tab. 5.1. Thevariables and parameters of the main and tail rotor are given the index “m” and “t”respectively. For example the armature current of tail rotor is ia,t. The angular speedof the motors ωa,m and ωa,t are equal to the angular speed of the rotors ωm and ωt.

km[ Nm

A

]Ra [Ω] Ja

[kgm2

]Ba

[kgm2

s

]Da

[kgm2

]

Main motor 74.8E-3 6.82 2.76E-3 0.346E-3 23.03E-6Tail motor 88.3E-3 8.05 0.5097E-3 0.250E-3 N/A

Table 5.1: Estimated parameter values for the main and tail rotor.

Note that the drag effect is disregarded when estimating the parameters of the tail rotor,as leaving drag out of the model has no significant influence in the final fit. As a resultthe tail rotor model becomes a linear model with the parameters ka,t, Ra,t, Ja,t andBa,t.

In Ch. 2 the working point value of the tail rotor ωt is determined to be −44rad/s. Thevalues ia,t and ua,t can then be obtained by solving the steady-state equations Eq.(5.14)and Eq. (5.15):

0 = kmia −Baωa

ua = Ra ia + kmωa

ia,t =Ba,tωt

km,t= −0.125A

ua,t =Ra,tia,t + km,tωt = −4.89V

Inserting into Eq. (5.19) yields the following transfer function for the tail motor:

Ωt(s)Ua,t(s)

=km,t

Ja,tRa,ts + Ra,tBa,t + k2m,t

=0.00883

0.00410s + 0.00980(5.20)

In Ch. 2 the working point value of the main rotor ωm is determined to be 54 rad/s.The values ia,m and ua,m can then be obtained by solving the steady-state Eq. (5.14)and Eq. (5.15):

0 = kmia −Daω2a −Baωa

ua = Ra ia + kmωa

⇒ ia,m =

Da,mω2m + Ba,mωm

km,m= 1.15A

ua,m =Ra,mia,m + km,mωm = 11.9V

Inserting into Eq. (5.19) yields the following transfer function for the main rotor:

Ωm(s)Ua,m(s)

=km,m

Ja,mRa,ms + Ra,m(2Da,m ωm + Ba,m) + k2m,m

=0.0748

0.0188s + 0.0249(5.21)

Page 27: report

5.3. DC MOTOR MODELS FOR MAIN AND TAIL ROTOR 17

0 5 10 15 20 25 30−100

−50

0

50

100

Time [s]

Ang

ular

vel

ocity

ωt

[rad

/s]

Tail Rotor

0 5 10 15 20 25 300

20

40

60

80

Time [s]

Ang

ular

vel

ocity

ω

m [r

ad/s

]

Main Rotor

Measured responseLinear model

Measured responseNon−linear modelLinear modelWorking point value

Figure 5.7: Simulated DC motor model responses compared with measured re-sponses. The linear tail rotor model tracks the measurements well, and the linearmain rotor model tracks the response well in the working point.

Figure 5.7 shows the output of the models compared with a measured response. Itis seen that the linear tail model tracks the measured response well, thereby verifyingthe established tail model and justifies the previous assumptions made regarding thesimplifications of the drag, friction and inductance terms.

Accordingly, the main rotor non-linear model tracks the measured response satisfacto-rily. The linearized main rotor model fits the system adequately around the workingpoint ωm = 54rad/s, but as expected, differs when the angular speed approached 0rad/s.

Around 0 rad/s the lack of stiction or Coulomb friction in the models is also seen, butgiving the fact that neither of the working points of the rotors are close to 0rad/s, theresulting error will be small. The working point of the tail rotors is ωt = −44rad/s.

Page 28: report

18 CHAPTER 5. MODELLING THE DC MOTORS WITH ROTORS

Summary of DC Motor Modelling

In this chapter, the DC motors powering the rotors were modelled. Differential equa-tions describing the electrical and the mechanical properties of the motors were derivedusing the basic laws of electric circuit analysis, electromagnetism and mechanics, andcombined into a single model.

The time constant of the electrical part of the model was disregarded in the final model,as its influence was small compared to the larger time constant of the mechanical part.The Coulomb friction and the stiction were also discarded as their influence were small,and the armature resistance was assumed to be constant.

The obtained non-linear model was linearized using a first order Taylor approxima-tion„ and a Laplace transform of the resulting linear differential equations yielded thefollowing first order transfer functions for the main and tail motor

Ωm(s)Ua,m(s)

=km,m

Ja,mRa,ms + Ra,m(2Da,m ωm + Ba,m) + k2m,m

=0.0748

0.0188s + 0.0249

Ωt(s)Ua,t(s)

=km,t

Ja,tRa,ts + Ra,tBa,t + k2m,t

=0.00883

0.00410s + 0.00980

where km is the motor constant, Ja is the total inertia seen by the motor, Ra is thearmature resistance, Da is the drag friction coefficient and Ba is the viscous frictioncoefficient.

The drag was discarded in the tail motor model, as this had no influence in the final fit.

Parameters for the models were estimated using the Matlab toolbox Senstools. Atest showed that the non-linear main motor model fitted the system response adequatelyand likewise for the linear tail motor model. The linear main motor model representedthe physical system well in the working point.

Page 29: report
Page 30: report

Chapter 6Modelling the Aerodynamic Torques

The actuators on the TRMS are two rotors which produce the thrust enabling the modelto yaw and pitch. This chapter explains the theory behind rotor-generated thrust anddevelops a model for the torques created by the rotors about the TRMS’ axes of rotation.

6.1 Rotor Theory

The TRMS model uses two rotors, a main rotor and a tail rotor. The theory in thischapter only deals with the main rotor, as it can be directly applied to the tail rotor bychanging the direction of the torque.

A rotor generates thrust by moving a mass of air from the front of it to the back as seenin Fig. 6.1. Due to the laws of conservation, this means that the rotor must experiencea force opposite to the accelerated air. This force is known as thrust.

Rotor thrust Air acceleration

Figure 6.1: The acceleration of air through the rotor causes it to experience a thrustforce in the opposite direction.

To move the air a rotor uses the aerodynamic principles of an aerofoil. An illustrationof an aerofoil is depicted on Fig. 6.2. An aerofoil uses the Coanda effect (that a movingfluid will follow an object) and Bernoulli’s principle (a faster moving fluid will have alower pressure). It changes the momentum of the wind so it gets a downward velocity.According to Newtons third law this must generate a force on the aerofoil known as lift,which has the opposite direction of the wind direction. Another force, known as dragis also produced, because of the air resistance of the wing. This force is perpendicularto the lift. [Anderson and Eberhart, 2004]

An outline of the important force vectors of the rotor in the TRMS is seen in Fig. 6.3.The angle of attack α is defined as the angle between the chord line c and the relativewind direction seen by the aerofoil. By altering the pitch of the aerofoil, one changes theangle of attack. This changes the magnitude of the lift and drag, but not the direction,as the direction is dependent only on the relative wind direction.

20

Page 31: report

6.1. ROTOR THEORY 21

Drag

Lift

Wind flow lines

Upwash

Downwash

Total force

Figure 6.2: An outline of an aerofoil. At the downwash, the wind is pushed down-wards by the aerofoil, which gives the lift force. A drag force is also produced whichis due to the air resistance of the wing.

Assuming that the entire TRMS model does not experience any wind movement, thenthe relative wind velocity “seen” by the rotor blades is determined by the movementof the rotor blades themselves, and the acceleration of air caused by the rotor. Themovement of the rotor blades is determined by the movement of the beam holding therotor and the circular motion of the rotor blades within the rotor disc area.

The lift Fl is perpendicular to the relative wind velocity and the drag Fd is in thesame direction as the relative wind velocity. The resultant force F can be dissolvedinto two force vectors, a thrust force Ft in the direction of the beam rotation and apetonormal force Fp in the opposite direction of the rotor movement and perpendicularto the thrust.

lF

dF

Wind directioninduced by thebeam rotation andaccelerated air Wind direction

induced by therotor blades

Relative winddirection seenby the blade

Direction of beam rotation

F

Direction ofblade movement

α

Fp

FtChord line c

Figure 6.3: A cross section of a rotor blade. The dotted lines shows the other rotorblade and the center of the rotor. The thrust force Ft and the petonormal force Fp

is determined by the induced relative wind velocity. The angle of attack α is heldconstant during a revolution.

The forces acting to generate a torque is the thrust force and the petonormal force.The source of the petonormal force is shown in Fig. 6.4. As the rotor blade rotates, thedirection of the petonormal force will change, as well as the length and direction of themoment arm. This will result in a net petonormal torque. The thrust force vector neverchanges direction, and yields a net thrust torque. Hence, two torques must be includedin the model. The thrust torque, and the petonormal torque.

Page 32: report

22 CHAPTER 6. MODELLING THE AERODYNAMIC TORQUES

Tor

que

[Nm

]

2π 4π0

0 Mean value

Shield

Tower

θ Moment arm

Rotor blade angle [rad]θ

Fp

Figure 6.4: The petonormal force Fp and the moment arm changes during a revo-lution yielding a net torque. This is seen on the mean value of the graph to the rightshowing that the net torque is slightly below 0.

6.2 Rotor Model

Modelling the aerodynamic torques using the method of first principle may yield a resultthat differ considerably from the actual behavior. Using a black-box test is much simplerand is more likely to produce more accurate results.

Because of gravity pulling the beam down, the main rotor is expected only to work withpositive inputs. The tail rotor is expected to work in its entire range. The measurementreport can be found in App. E.

Figure 6.5 and Fig. 6.6 contains the directions and magnitudes of the measurements. Itcan be seen that the data can be approximated by second and third degree polynomials.Hence, the model governing the rotor generated torque is:

Main rotor:

τm =57.5E-6ω2m + 0.713E-3ωm [Nm ] (6.1)

τm,p =4.80E-6ω2m − 9.35E-6ωm [Nm ] (6.2)

Tail rotor:

τt =59.2E-9ω3t + 2.65E-6ω2

t + 0.251E-3ωt [Nm ] (6.3)

τt,p =5.49E-9ω3t − 0.206E-6ω2

t + 32.5E-6ωt [Nm ] (6.4)

Summary of Aerodynamic Modelling

In this chapter, the theory behind rotor-generated thrust was explained, and a modelof the aerodynamic forces was developed. In addition to the thrust force, a force knownas the petonormal force, perpendicular to the thrust force, was also identified. Therelationship between the angular velocity of the rotors, and the thrusts and petonormalforces of the main and tail rotors were found by experimentation. Thus, by knowing thetransfer function of the DC-motors which includes the dynamics of the rotors, and know-ing the aerodynamic forces generated by the rotors, the complete model of actuators ofthe system have been obtained.

Page 33: report

6.2. ROTOR MODEL 23

0 20 40 600

0.005

0.01

0.015

0.02

0.025

Angular velocity [rad/s]

Tor

que

[Nm

]

Main rotor petonormal torque

measured

fitted

τm,p

= 4.8e−6ω2 − 9.35e−6ω

0 20 40 600

0.05

0.1

0.15

0.2

0.25

0.3

0.35

Angular velocity [rad/s]

Tor

que

[Nm

]

Main rotor thrust torque

fitted

measured

τm

=5.75e−5ω2+0.713e−3ω

−150 −100 −50 0 50 100 150−0.1

−0.05

0

0.05

0.1

0.15

Angular velocity [rad/s]

Tor

que

[Nm

]

Tail rotor thrust torque

fitted

measured

τt = −5.92e−8ω3+2.65e−6ω2

−2.51e−4ω

−150 −100 −50 0 50 100 150

−10

−5

0

5

x 10−3

Angular velocity [rad/s]

Tor

que

[Nm

]

Tail rotor petonormal torque

fitted

measured

τt,p

=5.49e−9ω3−2.06e−7ω2

+ 3.25e−5ω

Figure 6.5: Measurement results from the rotor tests. The main rotor is fitted witha second degree polynomial as it is only given positive input. The tail rotor is fittedwith a third degree polynomial as it works in its entire operating range.

Petonormal

Petonormal

Thrust

Thrust

Figure 6.6: Thrust and petonormal force directions when a positive voltage isapplied to the motors.

Page 34: report

Chapter 7Modelling the TRMS Mechanics

In this chapter a mathematical model of the TRMS is derived. The resulting non-linearmodel is linearized in order to design the controller. Finally the non-linear and linearmodel are verified with measurements performed on the TRMS.

In order to derive the physical model the torques and moments of inertia acting on theTRMS are found. To simplify the derivation the movement of the TRMS is divided intoa vertical and a horizontal plane. With all the torques and moments of inertia found,the laws of conservation of momentum leads to a transfer function in each plane.

7.1 Reference Frames

Two coordinate systems are used depending on which forces are being studied. Thegravitation only affects the vertical plane, and the body frame is non-accelerated in thevertical plane. Hence, when deriving the gravitational forces using Newton’s second lawthe TRMS can be viewed from the body frame. Figure 7.1 illustrates the body frametogether with the fixed global inertial frame.

When deriving the friction force, spring force and centripetal force, there is accelerationin the horizontal plane. Consequently, Newton’s Second Law cannot be used whenviewed from the body frame, so the TRMS is viewed from the non-accelerated globalinertial frame. [Serway and Jewett, 2004]

7.2 Torques in the Vertical Plane

In the vertical plane, five distinct torques act on the TRMS.

• The torque τm generated by the thrust from the main rotor

• The torque τt,p generated by the petonormal force from the tail rotor

• The torque τg generated by the gravitational force

• The torque τc generated by the centripetal force

• The torque τf,v generated by the friction force

The torques from the thrust of the main rotor and petonormal force from the tail rotorare determined in Ch. 6. The remaining three are determined in the following section.

24

Page 35: report

7.2. TORQUES IN THE VERTICAL PLANE 25

y, yb

θv,res

θh,res x

zb

z

xb

Figure 7.1: The model is seen from two inertial reference frames. The fixed globalinertial frame spanned by x, y and z and the body frame spanned by xb, yb and zb.Both frames has origin in the pivot of the model. y and yb are identical, pointing upthrough the tower. x points in the direction of the tail beam when the TRMS is inthe working point and z is perpendicular to y and x as seen in the figure. The bodyframe parts xb and zb follows the TRMS beam in the horizontal plane. The azimuthof the body frame θh,res is given as the angle between z and zb, which is the same asthe angle between x and xb. The pitch angle θv,ref is given as the angle between xband the main beam.

Page 36: report

26 CHAPTER 7. MODELLING THE TRMS MECHANICS

Gravitational Torque

In order to determine the torque from the gravitational force, it is divided into threeparts; the tail part, the main part, and the counterweight part. The forces are depictedin Fig. 7.2.

ltb

mmsg + mmg

mmbg

lcb = lc

mtsg + mtg

lmb

ltb cos(θv,res) = rt

lmb cos(θv,res) = rm

xb-axis

yb-axis

θv,res

mtbg

lc sin(θv,res) = rc

mcg

mcbg

Figure 7.2: The gravitational forces acting on the TRMS seen from the body frame.The forces are acting on the center of mass of the individual parts.

The torque from the tail part:

τg,t (t) = g(mtb

2+ mts + mt

)ltb cos

(θv,res (t)

)[Nm ] (7.1)

The torque from the main part:

τg,m (t) = −g(mmb

2+ mms + mm

)lmb cos

(θv,res (t)

)[Nm ] (7.2)

The torque from the counterweight and counterweight beam,

τg,c (t) = −g(mcb

2lcb + mclc

)sin

(θv,res (t)

)

= −g(mcb

2+ mc

)lc sin

(θv,res (t)

)[Nm ] (7.3)

where lcb = lc.

Combining Eq. (7.1), Eq. (7.2) and Eq. (7.3) gives the net torque exerted by the gravi-tation on the TRMS;

τg (t) = g

((A−B) cos

(θv,res (t)

)− C sin(θv,res (t)

))[Nm ] (7.4)

Page 37: report

7.2. TORQUES IN THE VERTICAL PLANE 27

where

A =(mtb

2+ mts + mt

)ltb [ kgm ] (7.5)

B =(mmb

2+ mms + mm

)lmb [ kgm ] (7.6)

C =(mcb

2+ mc

)lc [ kgm ] (7.7)

The Centripetal Torque

The centripetal force is defined as, [Serway and Jewett, 2004]

Fc = mv2

r[N ] (7.8)

where v is the velocity of the object with mass m moving in a circle with radius r. Todetermine the centripetal forces acting on the TRMS, this is divided into three parts.

The centripetal force from the main part is seen in Fig. 7.3 and can be described as,

Fc,m (t) = mv2

r=

(mmb

2+ mms + mm

) ω2h,res (t) r2

m

rm

=(mmb

2+ mms + mm

)ω2h,res (t) rm [N ] (7.9)

where ωh,res is the velocity in the horizontal plane. Fc,m (t) is the horizontal componentof the string force Fs,m exerted by the main beam.

y-axis

Fc,mv

Fc,tv

x-axisθv,res

−θv,res

θv,res

rm

Fc,m

Fs,c

Fc,c

rt

Fc,cv

rc

θv,res

Axis of rotation

Fs,t

Fs,m

Fc,t

Figure 7.3: The centripetal force acting on the main rotor Fc,m, the tail rotor Fc,t

and the counter weight Fc,c as the model spins around the y axis.

Page 38: report

28 CHAPTER 7. MODELLING THE TRMS MECHANICS

The vertical component is given by multiplying by tangent to −θv,res,

Fc,mv (t) =(mmb

2+ mms + mm

)ω2h,res (t) rm tan

(−θv,res (t))

=

(mmb

2 + mms + mm)ω2h,res (t) cos

(−θv,res (t))sin

(−θv,res (t))lmb

cos(−θv,res (t)

)

= −(

mmb2 + mms + mm

)ω2h,res (t) cos

(θv,res (t)

)sin

(θv,res (t)

)lmb

cos(θv,res (t)

) [N ] (7.10)

where rm = lmb cos(θv,res (t)

).

The torque is obtained by multiplying the force by its moment arm rm, which again isexpressed in lmb:

τc,m (t) =−(mmb

2+ mms + mm

)ω2h,res (t) l2mb cos

(θv,res (t)

)sin

(θv,res (t)

)

=−Bω2h,res (t) lmb cos

(θv,res (t)

)sin

(θv,res (t)

)[Nm ] (7.11)

The centripetal force acting on the tail part is found in the same way:

Fc,t (t) =

(mtb2 + mts + mt

)ω2h,res (t) r2

t

rt

=(mtb

2+ mts + mt

)ω2h,res (t) ltb cos

(θv,res (t)

)[N ] (7.12)

This is the horizontal component which is multiplied with the tangent to get the verticalcomponent.

Fc,tv (t) =sin

(θv,res (t)

)

cos(θv,res (t)

)(mtb

2+ mts + mt

)ω2h,res (t) ltb cos

(θv,res (t)

)

=(mtb

2+ mts + mt

)ω2h,res (t) ltb sin

(θv,res (t)

)[N ] (7.13)

The torque for the tail part is:

τc,t (t) = Aω2h,res (t) ltb sin

(θv,res (t)

)cos

(θv,res (t)

)[Nm ] (7.14)

As this torque has to be referred to the main part of the TRMS the sign of τc,t (t) mustbe altered:

τc,t (t) = −Aω2h,res (t) ltb sin

(θv,res (t)

)cos

(θv,res (t)

)[Nm ] (7.15)

The torque from the centripetal force of the counterweight and counterweight beam isdetermined equivalently:

Fc,c (t) =(mcb

2+ mc

) ω2h,res (t) r2

c

rc

=(mcb

2+ mc

)ω2h,res (t) lc sin

(θv,res (t)

)[N ] (7.16)

To get the vertical component the expression is divided by tangent to θv,res:

Fc,cv (t) =

(mcb2 + mc

)ω2h,res (t) lc sin

(θv,res (t)

)

sin(θv,res (t)

)/ cos

(θv,res (t)

)

=(mcb

2+ mc

)ω2h,res (t) lc cos

(θv,res (t)

)[N ] (7.17)

Page 39: report

7.3. TORQUES IN THE HORIZONTAL PLANE 29

Hence the torque is given by:

τc,c (t) = Cω2h,res (t) lc sin

(θv,res (t)

)cos

(θv,res (t)

)[Nm ] (7.18)

Adding Eq. (7.11), Eq. (7.15) and Eq. (7.18) yields the total torque from the centripetalforces:

τc (t) = −12ω2h,res (t) (Altb + Blmb − Clc) sin

(2θv,res (t)

)[Nm ] (7.19)

Friction Torque

The friction acting on the TRMS consists of two parts, the linear viscous friction andthe non-linear static friction. Neglecting the static friction leaves a linear expression forthe torque caused by the viscous friction: [Serway and Jewett, 2004]

τf,v (t) = −ωv,res (t)µv [Nm ] (7.20)

Net Torque in the Vertical Plane

The torques determined in Eq. (7.4), Eq. (7.19) and Eq. (7.20) combined with the torquefrom the rotors determined in Ch. 6 yields the net torque in the vertical plane:

τv (t) =g[(A−B) cos

(θv,res (t)

)− C sin(θv,res (t)

)]

− 12ω2h,res (t) (Altb + Blmb − Clc) sin

(2θv,res (t)

)

− ωv,res (t) µv + τm(ωm (t)

)+ τt,p

(ωt (t)

)[Nm ] (7.21)

7.3 Torques in the Horizontal Plane

Four different torques are acting on the TRMS in the horizontal plane.

• The torque τt generated by the thrust from the tail rotor

• The torque τm,p generated by the petonormal force from the main rotor

• The torque τf,h generated by the friction force

• The torque τkhgenerated by the spring force

The first two torques are described in Ch. 6 and the friction in the horizontal directionis described as in the vertical plane:

τf,h (t) = −θh,res (t)µh [Nm ] (7.22)

The spring torque originate from the flat cables connecting the computer with theTRMS. As the TRMS rotate these cables influence the TRMS. This influence is alsoassumed to be linear and will be described as: [Serway and Jewett, 2004]

τkh(t) = −θh,res (t) kh [Nm ] (7.23)

Page 40: report

30 CHAPTER 7. MODELLING THE TRMS MECHANICS

Net Torque in the Horizontal Plane

These four torques together gives the torque in the horizontal plane:

τh (t) = −θh,res (t)µh − θh,res (t) kh + τm,p(ωm (t)

)+ τt

(ωt (t)

)[Nm ] (7.24)

7.4 Moment of Inertia of the TRMS

The rotation of the TRMS about the yb-axis, denoted θh,res, is limited to rotate fromθh,res = 0 rad to θh,max = ±2.82 rad as shown in Fig. 7.4. The rotation about the zb-axis, denoted θv,res, is limited to go from θv,+max = 1.22rad to θv,-max = −1.05rad andθv,res = 0rad is defined to be horizontal position.

yb axis

xb axis

zb axisyb axis

θh,res

θv,res

xb axis

θh,-max=−2.82rad

θh,+max=2.82rad

θv,+max=+1.22rad

θv,-max=−1.05rad

xb axis

zb axis

Figure 7.4: The axes around which the TRMS rotates. The arrows around the axesshow the positive direction of rotation. The figure topmost to the right shows therotation around the y-axis and below the rotation around the z-axis.

7.4.1 Moment of Inertia in the Vertical Plane

To determine the total moment of inertia in the vertical plane the TRMS is separatedinto eight parts, each described individually.

The DC-motor is considered a solid cylinder with JCM = 12mmr2

m,m. By the parallel-axistheorem the moment of inertia for the DC-motor placed at a distance of lmb from therotation axis is, [Serway and Jewett, 2004]

Jv,m =12mmr2

m,m + mml2mb

≈ mml2mb [ kgm2 ] (7.25)

since rm,m ¿ lmb.

The moment of inertia for the main beam is given directly by:

Jv,mb =13mmbl

2mb [ kgm2 ] (7.26)

Similarly the moment of inertia of the tail DC-motor with rotor and the tail beam isfound,

Jv,t ≈ mtl2tb [ kgm2 ] (7.27)

Page 41: report

7.4. MOMENT OF INERTIA OF THE TRMS 31

Jv,tb =13mtbl

2tb [ kgm2 ] (7.28)

and for the counterweight and counterweight beam:

Jv,c ≈ mcl2c [ kgm2 ] (7.29)

Jv,cb =13mcbl

2c [ kgm2 ] (7.30)

The main shield in the vertical plane can be approximated by a solid cylinder and usingthe parallel-axis theorem its moment of inertia can be expressed as:

Jv,ms =12mmsr

2ms + mmslmb [ kgm2 ] (7.31)

The tail rotor shield can be approximated by a cylindrical shell, yielding a moment ofinertia given of:

Jv,ts = mtsr2ts + mtsltb [ kgm2 ] (7.32)

Hence the total inertia in the vertical plane is:

Jv ≈mml2mb +13mmbl

2mb + mtl

2tb +

13mtbl

2tb + mcl

2c

+13mcbl

2c +

12mmsr

2ms + mmslmb + mtsr

2ts + mtsltb [ kgm2 ] (7.33)

Entering the values into this equation yields:

Jv ≈ 0.067kgm2 (7.34)

7.4.2 Moment of Inertia in the Horizontal Plane

In the horizontal plane the moment of inertia is divided into eight parts. Using theparallel-axis theorem the moment of inertia of the DC-motor on the main beam can beexpressed,

Jh,m (t) =12mmr2

t,m + mm(lmb cos

(θv,res (t)

))2

≈ mm(lmb cos

(θv,res (t)

))2 [ kgm2 ] (7.35)

since rt,m ¿ lmb.

The moment of inertia of the main beam is:

Jh,mb (t) =13mmb

(lmb cos

(θv,res (t)

))2 [ kgm2 ] (7.36)

The moment of inertia of the DC-motor and beam at the tail rotor is described in thesame way:

Jh,t (t) ≈ mt(ltr cos

(θv,res (t)

))2 [ kgm2 ] (7.37)

Jh,tb (t) =13mtb

(ltb cos

(θv,res (t)

))2 [ kgm2 ] (7.38)

Page 42: report

32 CHAPTER 7. MODELLING THE TRMS MECHANICS

The moment of inertia of the counterweight and counterweight beam:

Jh,c (t) ≈ mc(lc sin

(θv,res (t)

))2 [ kgm2 ] (7.39)

Jh,cb (t) =13mcb

(lc sin

(θv,res (t)

))2 [ kgm2 ] (7.40)

The main shield in the horizontal plane is approximated as a cylindrical shell and usingthe parallel-axis theorem gives its moment of inertia:

Jh,ms (t) = mmsr2ms + mms

(lmb cos

(θv,res (t)

))2 [ kgm2 ] (7.41)

The tail shield is approximated as a solid cylinder

Jh,ts (t) =12mtsr

2ts + mts

(ltb cos

(θv,res (t)

))2 [ kgm2 ] (7.42)

Hence the total moment of inertia in the horizontal plane is,

Jh (t) ≈mm(lmb cos

(θv,res (t)

))2+13mmb

(lmb cos

(θv,res (t)

))2+mt(ltb cos

(θv,res (t)

))2+

13mtb

(ltb cos

(θv,res (t)

))2 + mc(lc sin

(θv,res (t)

))2 +13mcb

(lc sin

(θv,res (t)

))2 +

mmsr2ms + mms

(lmb cos

(θv,res (t)

))2 +12mtsr

2ts + mts

(ltb cos

(θv,res (t)

))2

[ kgm2 ] (7.43)

which can be written as,

Jh (t) ≈ D + E cos2(θv,res (t)

)+ F sin2

(θv,res (t)

)[ kgm2 ] (7.44)

where:

D = mmsr2ms +

12mtsr

2ts [ kgm2 ] (7.45)

E = mmsl2mb + mtsl

2tb+ mml2mb + mtl

2tb +

13(mmbl

2mb + mtbl

2tb) [ kgm2 ] (7.46)

F =13mcbl

2c + mcl

2c [ kgm2 ] (7.47)

7.5 Transfer Function in the Vertical Plane

From conservation of angular momentum of a rigid object, such as the TRMS, thefollowing is stated, [Serway and Jewett, 2004]

Lv,res (t) = Lv (t) + Ltail (t) [Nms ] (7.48)

where Lv is the angular momentum arising from external torque affecting the TRMS,Ltail is the angular momentum from the tail rotor spinning and Lv,res is the resultingangular momentum. Applying the theorem of angular momentum L = Jω on Eq. (7.48)yields:

Jvωv,res (t) = Jvωv (t) + Jtrωt (t) [Nms ] (7.49)

Page 43: report

7.5. TRANSFER FUNCTION IN THE VERTICAL PLANE 33

By differentiating Eq. (7.49) the following expression is obtained:

Jvωv,res (t) = Jvωv (t) + Jtrωt (t)⇓

θv (t) = θv,res (t)− JtrJv

θt (t) [ rads2 ] (7.50)

Applying Newton’s Second Law,θv (t) =

τvJv

[ rads2 ] (7.51)

and substituting in Eq. (7.50) yields:

τv = Jvθv,res (t)− Jtrθt (t) [Nm ] (7.52)

In order to determine Jtr the rotors will be approximated as a rectangular plate whichhas an inertia of J = 1

12M(a2 + b2

):

Jtr =112

mtr(l2tw + l2tl

)[ kgm2 ] (7.53)

All the expressions of the torques and moments of inertia in Eq. (7.52) are now deter-mined and the expression found in Eq. (7.21) is substituted in,

Jvθv,res (t)− Jtrθt (t) =g[(A−B) cos

(θv,res (t)

)− C sin(θv,res (t)

)]

− 12θ2h,res (t) (Altb + Blmb − Clc) sin

(2θv,res (t)

)

− µvθv,res (t) + τm,t(ωm (t)

)+ τt,p

(ωt (t)

)[Nm ] (7.54)

where the functions for τm and τt,p are determined in Ch. 6 to be in the form:

τm(ωm (t)

)= α0,tω

2m (t) + α1,tωm (t) [Nm ] (7.55)

τt,p(ωt (t)

)= β0,pω

3t (t) + β1,pω

2t (t) + β2,pωt (t) [Nm ] (7.56)

The parameters A − B, C, and µv are calculated and fitted in App. C. To obtain atransfer function of Eq. (7.54) it needs to be linearized. The linearization is done byusing a Taylor expansion, see page 14.

This approximation is applied to the non-linear terms of Eq. (7.54) term wise:

α0,tω2m (t) + α1,tωm (t) ≈(α0,tω

2m + α1,tωm) + (2α0,tωm + α1,t)ωm (t)

β0,pω3t (t)+β1,pω

2t (t)+β2,pωt (t) ≈(β0,pω3

t + β1,pω2t + β2,pωt) + (3β0,pω

2t + 2β1,pωt + β2,p)ωt (t)

g(A−B) cos(θv,res (t)

) ≈g(A−B) cos(θv,res

)−g(A−B) sin(θv,res

)θv,res (t) = g(A−B)

gC sin(θv,res (t)

) ≈gC sin(θv,res

)+ gC cos

(θv,res

)θv,res (t) = gCθv,res (t)

12θ2h,res (t) (Altb + Blmb − Clc) sin

(2θv,res (t)

) ≈12

¯θ2h,res (Altb + Blmb − Clc) sin

(2θv,res

)

+ ¯θh,res (Altb + Blmb − Clc) sin

(2θv,res (t)

) · ˜θh,res (t)

+ ¯θ2h,res (Altb + Blmb − Clc) cos

(2θv,res (t)

) · θv,res (t)

= ¯θ2h,res (Altb + Blmb − Clc) · θv,res (t) = 0

as θh,res = 0 in the working point.

Page 44: report

34 CHAPTER 7. MODELLING THE TRMS MECHANICS

These linearized expressions are substituted into Eq. (7.54):

Jv˜θv,res (t)− Jtr

˜θt (t) =g(A−B)− gCθv,res (t)− µv

˜θv,res (t)

+ (α0,tω2m + α1,tωm) + (2α0,tωm + α1,t)ωm (t)

+ (β0,pω3t + β1,pω

2t + β2,pωt) + (3β0,pω

2t + 2β1,pωt + β2,p)ωt (t)

[Nm ] (7.57)

The working point of this equation is given by,

0 = g(A−B) + (α0,tω2m + α1,tωm) + (β0,pω3

t + β1,pω2t + β2,pωt) (7.58)

and the working point is subtracted from Eq. (7.57),

Jv˜θv,res (t)−Jtr

˜θt (t) =− gCθv,res (t)− µv

˜θv,res (t) + (2α0,tωm + α1,t)ωm (t) +

(3β0,pω2t + 2β1,pωt + β2,p)ωt (t) [Nm ] (7.59)

and the linearized equation can then be Laplace transformed:

Jvs2Θv,res(s)−JtrsΩt(s) =− gCΘv,res(s)− µvsΘv,res(s)

+ (2α0,tωm + α1,tωm)Ωm(s) + (3β0,pω2t + 2β1,pωt + β2,p)Ωt(s)

m

Θv,res(s) =(2α0,tωm + α1,t)Jvs2 + µvs + gC

Ωm(s) +

(Jtrs + 3β0,pω

2t + 2β1,pωt + β2,p

)

Jvs2 + µvs + gCΩt(s)

Θv,res(s) =0.00692

0.067s2 + 0.0021s + 0.288Ωm(s)+

43.9E-6s +82.5E-60.067s2+0.0021s+0.288

Ωt(s)

(7.60)

7.6 Transfer Function in the Horizontal Plane

The transfer function in the horizontal plane is determined in the same way as thevertical. First the conservation of angular momentum states:

Lh,res(t) = Lh(t) + Lmain(t) · cos(θv,res(t)

)[Nms ] (7.61)

where Lh is the angular momentum arising from external torque affecting the TRMS.The Lmain is the angular momentum arising from the spinning main rotor and Lh,resis the resulting angular momentum. Using Newton’s Second Law and rearranging theequation the following is obtained:

ωh(t) = ωh,res(t)− Jmr ·ωm(t) · cos

(θv,res(t)

)

Jh(t)[ rad

s ] (7.62)

This expression is to be differentiated with respect to the time t, in order to substitute

Page 45: report

7.6. TRANSFER FUNCTION IN THE HORIZONTAL PLANE 35

in Eq. (7.51) with the horizontal index instead of the vertical index.

d

dt

(−Jmr ·

ωm(t) · cos(θv,res(t)

)

Jh(t)

)=

− Jmr

(−ωm(t) sin

(θv,res(t)

)θv,res + ωm(t) cos

(θv,res(t)

))Jh(t)− ωm(t) cos

(θv,res(t)

)Jh(t)

J2h(t)

[ rads2 ] (7.63)

And substituting with Eq. (7.51),

τhJh(t)

= ωh(t)

m

τhJh(t)

= ωh,res(t)+Jmr

(ωm(t) sin

(θv,res(t)

)θv,res − ωm(t) cos

(θv,res(t)

))Jh(t) + ωm(t) cos

(θv,res(t)

)Jh(t)

J2h(t)

m

τh = ωh,res(t)Jh(t)+Jmr

(ωm(t) sin

(θv,res(t)

)θv,res − ωm(t) cos

(θv,res(t)

)+ ωm(t)

cos(θv,res(t)

)Jh(t)

Jh(t)

)

[Nm ] (7.64)

where τh = −µhθh,res(t)− khθh,res(t) + τt(ωt(t)

)+ τm,p

(ωm(t)

).

The two parameters Jmr and Jh(t) needs to be determined before the equation can belinearized. The inertia Jmr is the inertia of the main rotor blades:

Jmr =112

mmr(l2mw + l2ml) [ kgm2 ] (7.65)

The inertia Jh(t) is found in Eq. (7.44), and hence is Jh(t) given by:

Jh(t) = F · sin(2θv,res(t)

)θv,res(t)− E · sin(

2θv,res(t))θv,res(t)

mJh(t) = θv,res(t)

(sin

(2θv,res(t)

)(F − E)

)[ kgm2

s ] (7.66)

Knowing all the terms in Eq.(7.64) it is linearized in order to set up the transfer equation.The non-linear terms of Eq. (7.64) are listed here:

Term 1: ωh,resE · cos2(θv,res (t)

)

Term 2: ωh,resF · sin2(θv,res (t)

)

Term 3: Jmrωm(t) sin(θv,res(t)

)θv,res

Term 4: − Jmrωm(t) cos(θv,res(t)

)

Term 5: Jmrωm(t)cos

(θv,res(t)

)θv,res(t)

[sin

(2θv,res(t)

)(F − E)

]

D + Ecos2(θv,res(t)

)+ Fsin2

(θv,res(t)

)

Term 6: τm,p(ωm(t)

)=

[α0,pω

2m(t) + α1,pωm(t)

]cos

(θv,res(t)

)

Term 7: τt(ωt(t)) =[β0,tω

3t (t) + β1,tω

2t (t) + β2,tωt(t)

]cos

(θv,res(t)

)

Applying the Taylor approximation as described on page 14 the listed terms are lin-earized:

Page 46: report

36 CHAPTER 7. MODELLING THE TRMS MECHANICS

Term 1 to 4:

ωh,res(t)E · cos2(θv,res(t)

) ≈E ¯ωh,res cos2(θv,res

)−(

¯ωh,resE sin(θv,res

)cos

(θv,res

)θv,res(t)

)2+

E cos2(θv,res

) ˜ωh,res(t) = E( ¯ωh,res + ˜ωh,res(t)

)

ωh,res(t)F sin2(θv,res (t)

) ≈ ¯ωh,resF sin2(θv,res

)+

(¯ωh,resF cos

(θv,res

)sin

(θv,res

)θv,res(t)

)+

F sin2(θv,res

) ˜ωh,res(t) = 0

Jmrωm(t) sin(θv,res(t)

)θv,res ≈Jmrωm sin

(θv,res

) ¯θv,res + Jmr sin

(θv,res

) ¯θv,resωm(t)+

Jmrωm¯θv,res cos

(θv,res

)θv,res(t) + Jmrωm sin(θv,res)

˜θv,res

= 0

−Jmrωm(t) cos(θv,res(t)

) ≈− Jmr ¯ωm cos(θv,res

)−Jmr cos(θv,res

) ˜ωm(t)+Jmr sin(θv,res

) ¯ωmθv,res(t)

= Jmr(− ¯ωm − ˜ωm(t)

)

Term 5:

Jmrωm(t)cos

(θv,res(t)

)θv,res(t)

[sin

(2θv,res(t)

)(F −E)

]

D + E cos2(θv,res(t)

)+ F sin2

(θv,res(t)

) ≈

Jmrωmcos

(θv,res

) ¯θv,res

[sin(2θv,res)(F − E)

]

D + E cos2(θv,res

)+ F sin2

(θv,res

)

+ Jmrcos

(θv,res

) ¯θv,res

[sin(2θv,res)(F − E)

]

D + E cos2(θv,res

)+ F sin2

(θv,res

) ωm (t)

+ Jmrωmcos

(θv,res

) [sin(2θv,res)(F − E)

]

D + E cos2(θv,res

)+ F sin2

(θv,res

) ˜θv,res (t)

+ Jmrωm¯θv,res(F − E)

∂θv,res(t)

(cos

(θv,res(t)

)sin

(2θv,res(t)

)

D + E cos2(θv,res(t)

)+ F sin2

(θv,res(t)

))

θv,res (t)

= 0

In the expression, the first three parts are equal to zero because they have sin(2θv,res(t))in the nominator, and the last expression equals zero because θv,res = 0 in the workingpoint.

Term 6 and 7:

[α0,pω

2m(t) + α1,pωm(t)

]cos

(θv,res(t)

) ≈ [α0,pω

2m + α1,pωm

]cos

(θv,res

)

+ (2α0,pωm + α1,p) cos(θv,res

)ωm(t)

− (α0,pω2m + α1,pωm) sin

(θv,res

)θv,res(t)

=[α0,pω

2m + α1,pωm

]+ (2α0,pωm + α1,p)ωm(t)

[β0,tω

3t (t) + β1,tω

2t (t) + β2,tωt(t)

]cos

(θv,res(t)

) ≈[β0,tω

3t + β1,tω

2t + β2,tωt

]cos

(θv,res

)

+(3β0,tω

2t + 2β1,tωt + β2,t

)cos

(θv,res

)ωt(t)

− [β0,tω

3t + β1,tω

2t + β2,tωt

]sin

(θv,res

)θv,res(t)

=[β0,tω

3t +β1,tω

2t +β2,tωt

]+

(3β0,tω

2t +2β1,tωt+β2,t

)ωt(t)

Page 47: report

7.7. VERIFYING THE MODELS 37

These linearized equations can be substituted into Eq. (7.64),

ωh,resD + E(¯ωh,res + ˜ωh,res(t))− Jmr( ¯ωm + ˜ωm(t)

)=

− µhθh,res(t)− khθh,res(t) +[β0,tω

3t + β1,tω

2t + β2,tωt

]+

(3β0,tω

2t + 2β1,tωt + β2,t

)ωt(t)+[

α0,pω2m + α1,pωm

]+ (2α0,pωm + α1,p)ωm(t) [Nm ] (7.67)

and is solved in the working point:

E ¯ωh,res − Jmr ¯ωm =(β0,tω

3t + β1,tω

2t + β2,tωt

)+

(α0,pω

2m + α1,pωm

)[Nm ] (7.68)

This is subtracted from Eq. (7.67),

˜ωh,res(t)(D + E)− Jmr ˜ωm(t) =

− µh˜θh,res(t)− khθh,res(t) +

(3β0,tω

2t + 2β1,tωt + β2,t

)ωt(t) + (2α0,pωm + α1,p) ωm(t)

[Nm ] (7.69)

and can be Laplace transformed as it is linear:

Θh,res(s)(D + E)s2 − JmrsΩm(s) =− µhΘh,res(s)s− khΘh,res(s)

+(3β0,tω

2t + 2β1,tωt + β2,t

)Ωt(s)

+ (2α0,pωm + α1,p) Ωm(s)m

Θh,res(s) =Jmrs + (2α0,pωm + α1,p)(D + E)s2 + µhs + kh

Ωm(s) +

(3β0,tω

2t + 2β1,tωt + β2,t

)

(D + E)s2 + µhs + khΩt(s)

⇓Θh,res(s) =

0.000276s + 0.0005090.0642s2 + 0.0107s + 0.0093

Ωm(s) +0.000361

0.0642s2 + 0.0107s + 0.0093Ωt(s)

(7.70)

As the two transfer functions have been determined and the relationship between torquesmade by the rotors and the position of the TRMS is known, the model needs to beverified with the actual behavior of the TRMS.

7.7 Verifying the Models

As the linear model only fits TRMS at small angles around the working point, it isdecided first to verify the non-linear model with the TRMS and afterwards verify thenon-linear with the linear around the working point. This is also due to the fact thatthe TRMS always oscillates, so it is impossible to see small changes around the workingpoint. So by verifying the non-linear model with the TRMS and afterwards verifyingthe linear model with the non-linear model, it is adequate to assume that the linearmodel fits the TRMS close to the working point.

The vertical and horizontal models, both the non-linear and linear, have been imple-mented in Simulink and combined with the non-linear and linear models of the DC-motor found in Ch. 5.

Page 48: report

38 CHAPTER 7. MODELLING THE TRMS MECHANICS

7.7.1 Verifying the Working Point

In order to verify the working points of the model Eq. (7.64) and Eq. (7.54) are solvedin steady-state:

0 = g(A−B) + (α0,tω2m + α1,tωm) + (β0,pω3

t + β1,pω2t + β2,pωt)

0 =(β0,tω

3t + β1,tω

2t + β2,tωt

)+

(α0,pω

2m + α1,pωm

)(7.71)

Solving these with Matlab yields the working points of the model:

ωm = 54rads

ωt = −50rads

The experimental determined working points in App. A are ωm=54rad/s and ωt=-44rad/s, so the model has as slightly different working point with respect to the tailrotor.

7.7.2 Verifying the Non-linear Model with the TRMS

The non-linear model has been implemented in Simulink as seen in Fig.7.5. This modelcan also be found in appended document [2]. The plant contains the non-linear motormodels found in Ch. 5 and the mechanical non-linear models found in this chapter.

Main Motor Voltage

Working Point Voltage

Working Point Voltage

Tail MotorVoltage

Vertical Position

Motor Voltage Omega Main

Non−linear Main Motor Model

Omega Main

Omega Tail

Omega_h

Theta_v

Omega_v

Non−linear Vertical Model

Motor Voltage Omega Tail

Non−linear Tail Motor Model

Omega Main

Omega Tail

Theta_v

Omega_v

Omega_h

Theta_h

Non−linear Horisontal Model

Horizontal Position

12

−4.9

Figure 7.5: Implementation of the non-linear model of the TRMS in Simulinkcontaining the DC motor models and the mechanical models.

In order to verify the model, three measurements have been performed on the TRMS.Figure 7.6a through Fig. 7.6d shows the simulation of the non-linear model comparedwith the measurements performed on the TRMS.

As seen in Fig. 7.6a the model has the same oscillating behavior as the TRMS but itdoes not settle at the same angle and the overshoot is not as large. A reason for thisdeviation could be the spring force which differs as the cables on the TRMS changesposition and even small movement of the TRMS changes the settling point. This resultin different settling point from one test to another. When the TRMS has been rotated,it does not settle exactly at the same position as before the rotation. It has also been

Page 49: report

7.7. VERIFYING THE MODELS 39

0 10 20 30 40−3

−2.5

−2

−1.5

−1

−0.5

0

Pos

ition

[rad

](a)

0 20 40 60−1

−0.5

0

0.5

(b)

0 10 20 30 40 50−0.5

0

0.5

1

Pos

ition

[rad

]

(c)

0 10 20 30 40 50

−0.6

−0.4

−0.2

0

0.2

0.4

(d)

0 20 40 60 80−0.015

−0.01

−0.005

0

Pos

ition

[rad

]

Time [s]

(e)

0 20 40 60 800

0.005

0.01

0.015

0.02

0.025

0.03

Time [s]

(f)

measurednon−linear

measurednon−linear

measurednon−linear

measurednon−linear

linearnon−linear

linearnon−linear

Figure 7.6: Results of the verification of the non-linear and linear model of theTRMS. The first column contains plots of the horizontal position and the second ofthe vertical position. Figure (a) to (d) is the results of verifying the non-linear modelwith the actual measurements on the TRMS. Figure (e) and (f) is the results of thelinear model verified with the non-linear model.

Page 50: report

40 CHAPTER 7. MODELLING THE TRMS MECHANICS

seen in simulations how much even small differences in spring force changes the settlingpoint.

In Fig. 7.6b it is seen that the model has the same oscillation as the TRMS as thefrequency is the same. The TRMS is somewhat more dampened but the steady-stateangle is the same. In Fig. 7.6c the dynamics are somewhat the same while the modeldoes not experience the same amount of overshoot which could be a result of a smallerspring constant in the model than in the TRMS. This is in accordance with the resultsfrom Fig. 7.6a where a smaller spring force would lead to a settling position closer tothe measured value. In Fig. 7.6d the same behavior is seen as in Fig. 7.6b. Thesesimilar results can be explained by the small effect the tail rotor has to the verticalposition. The system still has the same oscillation frequency and again the TRMS ismore dampened than the model.

Despite some differences the model fits the measurements performed on the TRMS.

7.7.3 Verifying the Non-linear Model with the Linear Model

The linear model has been implemented in Simulink as seen in Fig.7.7. This model canalso be found in appended document [3]. The plant contains the linear motor modelsfound in Ch. 5 and the mechanical linear models found in this chapter.

Main Motor Voltage

Tail Motor Voltage

Vertical PositionOmega Main

Omega TailTheta_v

Linear Vertical Model

Motor voltage Omega Tail

Linear Tail Motor Model

Motor voltageOmega Main

Linear Main Motor Model

Omega Main

Omega TailTheta_h

Linear Horizontal ModelHorizontal Position

Figure 7.7: Implementation of the linear model of the TRMS in Simulink con-taining the DC motor models and the mechanical models.

Applying small inputs to the linear and non-linear model the linear model is verifiedwith the non-linear model.

Figure 7.6e shows the horizontal position when given a step of -0.02V to the tail rotor.The linear model experience the same oscillation as the non-linear model although theydiffer in steady-state angle and overshoot. A deviation is expected as the linearizingprocedure loses some information.

In the vertical plane the output has been low pass filtered, as the output from the non-linear model was oscillating to much to see the effect of changing the input with 0.2V.This filter was implemented in both the non-linear and the linear model.

Figure 7.6d shows the vertical position when given a step of 0.2V to the main rotor. Asseen the dynamic and the steady-state angle are the same for the linear and non-linearmodel. The only difference is that the non-linear model has some oscillation while thelinear does not.

Page 51: report

7.7. VERIFYING THE MODELS 41

Summary of Modelling the TRMS Mechanics

In this chapter a model of the mechanics of the TRMS was developed. To simplifycalculations, two inertial frames were used; a fixed global frame and a body frame.Furthermore, the model was split into two sub-models; the horizontal plane and thevertical plane. Modelling of the systems was done by identifying the moments of inertiaand the torques working in the planes.

In the vertical plane, the torques were identified as the thrust torque from the mainmotor, the petonormal torque from the tail motor, the torque generated by gravity, thetorque generated by the centripetal force and the torque generated by friction. In thehorizontal plane, the torques were identified as the thrust torque from the tail motor,the petonormal torque from the main motor, the torque generated by friction and thetorque generated by the spring force due to the cables running from the tower to thebeam of the model.

The moments of inertia were calculated by assuming the TRMS parts to be simplegeometric blocks of which the inertia are easily determined. By the laws of the con-servation of angular momentum, the final non-linear models are found. Linearizing thenon-linear models using a first order Taylor approximation yields the following secondorder transfer functions for the vertical and horizontal plane:

Θv,res(s) =(2α0,tωm + α1,t)Jvs2 + µvs + gC

Ωm(s) +

(Jtrs + 3β0,pω

2t + 2β1,pωt + β2,p

)

Jvs2 + µvs + gCΩt(s)

Θh,res(s) =Jmrs + (2α0,pωm + α1,p)(D + E)s2 + µhs + kh

Ωm(s) +

(3β0,tω

2t + 2β1,tωt + β2,t

)

(D + E)s2 + µhs + khΩt(s)

where Jv is the inertia in the vertical plane, Jmr and Jtr are the inertias of the rotors,µv and µh are friction coefficients, αx,t and βx,t represents thrust from main and tailrotor, αx,p and βx,p are coefficients for the petonormal forces from main and tail ro-tors respectively, D+E represents inertia in horizontal plane, C represent the torquegenerated by the counterweight and ωm and ωt are the velocities of the main and tailrotor.

With the models found, Senstools was used to estimate the parameters. Both thenon-linear and linear model were implemented in Simulink and verified with measure-ments performed on the TRMS. Both the non-linear and linear model were verified withsatisfactory results.

Page 52: report

Summary of Part II

In the preceding part the mathematical model of the TRMS was developed. In orderto reduce the complexity of the model it was divided into three sub-models describingthe DC motors, the aerodynamic forces exerted by the rotors, and the mechanics.

A common model were obtained for the DC motors as the two motors are similar. Thismodel is based on the non-linear electrical and mechanical properties of a permanentmagnet DC motor with rotor load and simplifications was made during the modellingprocedure. The parameters of this non-linear model were estimated with the Matlabtoolbox Senstools. Furthermore the non-linear model was linearized which lead tothe following first order models for the main and tail motor:

Ωm(s)Ua,m(s)

=km,m

Ja,mRa,ms + Ra,m(2Da,m ωm + Ba,m) + k2m,m

=0.0748

0.0188s + 0.0249

Ωt(s)Ua,t(s)

=km,t

Ja,tRa,ts + Ra,tBa,t + k2m,t

=0.00883

0.00410s + 0.00980

where km is the motor constant, Ja is the total inertia seen by the motor, Ra is thearmature resistance, Da is the drag friction coefficient and Ba is the viscous frictioncoefficient.

These models were verified with actual measurements made on the DC motors whichrevealed that the model performed satisfactory.

To find the model of the aerodynamic torques of the rotors, a black-box system iden-tification approach was used. It is assumed that the subsystem has no dynamics andthus only consist of a constant gain. Furthermore, the main rotor is never expected tohave a negative angular velocity. Two torques are generated by both the main and tailrotor, the thrust torque and the petonormal torque. These two torques are listed forboth the main and tail rotor:

τm = 57.5E-6 ω2m + 0.713E-3 ωm

τm,p = 4.80E-6 ω2m − 9.35E-6 ωm

τt = 59.2E-9 ω3t + 2.65E-6 ω2

t + 0.251E-3 ωt

τt,p = 5.49E-9 ω3t − 0.206E-6 ω2

t + 0.325E-6 ωt

These non-linear expressions are included in the models of the mechanics and are lin-earized when linearizing the models of the mechanics.

In the mechanics, the system was split up into two sub-models; the horizontal planeand the vertical plane. Modelling of the systems was done by identifying the moments

42

Page 53: report

7.7. VERIFYING THE MODELS 43

of inertia and the torques working in the planes. By the laws of the conservation ofangular momentum, the final non-linear models are found. To enable controller designthese expressions were linearized to find the transfer functions. The linear model of themechanics including the aerodynamic are the following second order transfer functions:

Θh,res(s) =276E-6s + 509E-6

0.0642s2 + 0.0107s + 0.0093Ωm(s) +

361E-60.0642s2 + 0.0107s + 0.0093

Ωt(s)

Θv,res(s) =0.00692

0.067s2 + 0.0021s + 0.288Ωm(s) +

43.9E-6s + 82.5E-60.067s2 + 0.0021s + 0.288

Ωt(s)

where θh,res is the horizontal position and θv,res is the vertical position.

The three sub-models were assembled in Simulink to a complete model of the system,which was tested against measurements on the system. The test showed that the non-linear motor models fitted the system response adequately and that the linear modelsrepresented the physical system well in the working point.

Page 54: report
Page 55: report

Part III

Controller Design

The purpose of this part is to design controllers for the TRMS so it meets the specifiedrequirements.

Three controllers are designed, a classic controller and two state-space controller, bothbased on the model obtained in the previous part.

The classic controller is designed in the first chapter. The design procedure is to de-sign controllers to suppress the cross-coupling between the two planes and afterwardsdesign controllers for the horizontal and vertical plane exclusively. These controllers arefirst tested on the the non-linear model and afterwards implemented and tested on theTRMS.

Two state-space controllers are designed in the second chapter. The procedure is toderive a state-space model of the system using the model obtained in the previous partand afterwards to create a common state-space controller architecture. On this architec-ture a pole-placement controller and an optimal controller is designed. Both state-spacecontrollers are first tested on the the non-linear model and afterwards implemented andtested on the TRMS.

Page 56: report

Chapter 8Classic Controller

In this chapter the classic controller is designed. In the design phase the controller isdesigned using the linear model of the TRMS. In order to verify if the controller performsproperly, the controller is tested on the non-linear model. Finally, the controller isimplemented and tested on the TRMS.

The transfer functions found in Part II are organized in the block diagram shown inFig. 8.1, where:

M1(s) is the transfer function of the main DC-motor.

M2(s) is the transfer function of the tail DC-motor.

H1(s) is the transfer function from main rotor input to the vertical position.

H2(s) is the transfer function from tail rotor input to the vertical position.

H3(s) is the transfer function from main rotor input to the horizontal position.

H4(s) is the transfer function from tail rotor input to the horizontal position.

+

+

+

+

Ua,m

Ua,t

M1

M2

H1

H3

H2

H4

S

S

wmqv,res

wtqh,res

Figure 8.1: Block diagram of the transfer functions found in Part II. The inputsare cross-coupled through H3 and H2.

By designing two controllers to cancel out the effect of the cross coupling between thetwo planes, a controller can be designed which controls the vertical position exclusivelyand one which controls the horizontal position exclusively. The controllers and the waythey are connected to the system are seen in Fig. 8.2.

8.1 Classic Controller Design

The cross-coupling from the vertical plane to the horizontal plane, is eliminated bydesigning Cvh(s) so an input on θv,ref has no effect on θh,res. This is done by setting

46

Page 57: report

8.1. CLASSIC CONTROLLER DESIGN 47

+

+

+

+

+-

-+

Ua,m

Ua,t

M1

M2

S

S

wmqv,res

wtqh,res

H1

H3

H2

H4S

Sqv,set

qh,set

Cvv

Cvh

Chv

Chh

ev

eh

+

+

+

+

S

S

Figure 8.2: Four controllers are implemented. Two which control the direct cou-plings (Cvv, Chh), and two which will be designed to cancel out the cross-couplingsbetween the horizontal and vertical plane (Cvh, Chv).

θh,ref to zero and designing Cvh(s), so θh,res is zero for any value of θv,ref. By assumingθh,res is zero, the feedback loop in the horizontal plane is eliminated. Thus, Cvh(s) canbe derived as follows:

θh,res =evCvv(s)M1(s)H3(s) + evCvh(s)M2(s)H4(s) = 0m

Cvh(s) =− Cvv(s)M1(s)H3(s)M2(s)H4(s)

(8.1)

With the cross-coupling eliminated, the open-loop vertical system can be regarded as aSISO system with the following transfer function:

Gol,vv(s) = Cvv(s)M1(s)H1(s) + Cvh(s)M2(s)H2(s)

= Cvv(s)(

M1(s)H1(s)− M1(s)H3(s)M2(s)H4(s)

M2(s)H2(s))

= Cvv(s)(

M1(s)H1(s)− M1(s)H2(s)H3(s)H4(s)

)(8.2)

Similarly, expressions for Chv(s) and Gol,hh(s) are found:

θv,res =ehChh(s)M2(s)H2(s) + ehChv(s)M1(s)H1(s) = 0m

Chv(s) =− Chh(s)M2(s)H2(s)M1(s)H1(s)

(8.3)

Gol,hh = Chh(s)M2(s)H4(s) + Chv(s)M1(s)H3(s)

= Chh(s)(

M2(s)H4(s)− M2(s)H2(s)M1(s)H1(s)

M1(s)H3(s))

= Chh(s)(

M2(s)H4(s)− M2(s)H2(s)H3(s)H1(s)

)(8.4)

Page 58: report

48 CHAPTER 8. CLASSIC CONTROLLER

Using the Matlab command pzmap the poles and zeros of the open-loop transfer func-tions are depicted as seen in Fig. 8.3 and their exact location are shown in Tab. 8.1.

−20 −15 −10 −5 0 5 10 15

−2

0

2

Pole−Zero Map for Gol,vv

Real Axis

Imag

inar

y A

xis

−20 −15 −10 −5 0 5 10 15

−2

0

2

Pole−Zero Map for Gol,hh

Real Axis

Imag

inar

y A

xis

Figure 8.3: Pole-zero map for Gol,vv at the topmost figure and for Gol,hh below.The nominator is of 2nd order hence two zeros, and the denominator is of 3rd orderhence three poles, both for Gol,vv and Gol,hh.

Gol,vv Gol,hhPoles -1.33, -0.0157 ±2.07j -2.39, -0.0833 ±0.371jZeros -16.2, 12.5 -16.2, 12.5

Table 8.1: Poles and zeros in the open-loop gains.

The controllers are designed using the root-locus method. The root locus for the transferfunctions are found using the rlocus command yielding the plot shown in Fig. 8.4. Asseen the poles for both transfer functions can be placed in the left half plane withinsome controller gain, which enables a stable system. However this does not make thesystem meet the specifications stated in the requirement specification.

To optimize the performance of the system an integrator pole and complex conjugatedzeros are added to both Cvv and Chh. The best performance is obtained by placing thezeros so that they cancel the slow imaginary poles.

Simulations performed in Simulink on the non-linear model showed that the systembecomes unstable in the vertical plane when using pole-cancellation. As the poles arevery close to the imaginary axis for Cvv, a zero not placed directly on the pole cancause the poles to follow a circular arc which can easily cross the imaginary axis. Hence,modelling errors can cause the system to become unstable if pole-cancellation is used inthe vertical plane. Consequently, the zeros placed in Cvv are moved towards the originof the complex plane which forces the root locus from the complex poles to move intothe left half plane regardless of their exact location, as seen in Fig. 8.5. This stabilizesthe system at the expense of performance. The root locus for the system in both planeswith the controllers is shown in Fig. 8.5, where the pole cancellation in the horizontalplane is evident.

Page 59: report

8.1. CLASSIC CONTROLLER DESIGN 49

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−5

0

5Root Locus for G

ol,vv

Real Axis

Imag

inar

y A

xis

−3 −2 −1 0 1 2 3−5

0

5Root Locus for G

ol,hh

Real Axis

Imag

inar

y A

xis

Figure 8.4: Root locus for Gol,vv and Gol,hh. The dashed and solid lines from thepoles show the path of the poles when the gain is altered. The poles of the systemlies in the left half plane so with an appropriate gain the system is stable.

−2 −1.5 −1 −0.5 0 0.5 1 1.5 2−5

0

5Root Locus for C

vvG

ol,vv

Real Axis

Imag

inar

y A

xis

−3 −2 −1 0 1 2 3−5

0

5Root Locus for C

hhG

ol,hh

Real Axis

Imag

inar

y A

xis

Figure 8.5: Root locus for CvvGol,vv and ChhGol,hh. The Cvv controller zeros aremoved towards the real axis to stabilize the system at the expense of performancewhile Chh cancel out the imaginary poles without any stabilization problems.

Page 60: report

50 CHAPTER 8. CLASSIC CONTROLLER

The expressions for the Cvv and Chh are given as follows:

Cvv = 4.32(s + 0.012 + 1.16j)(s + 0.012− 1.16j)

s=

4.32s2 + 0.163s + 5.76s

(8.5)

Chh = 24.2(s + 0.083 + 0.371j)(s + 0.083− 0.371j)

s=

24.2s2 + 4.03s + 3.51s

(8.6)

The controllers Cvh and Chv are derived from Eq. (8.1) and Eq. (8.3):

Cvh = −0.609(s + 2.39)(s + 1.84)(s + 0.019 + 1.16j)(s + 0.019− 1.16j)

(s + 1.33)s

=−0.609s4 − 2.60s3 − 3.60s2 − 3.55s− 3.58

s2 + 1.33s

=0.772

s + 1.33− 2.705

s− 0.609s2 − 1.796s− 1.217 (8.7)

Chv = −0.830(s + 1.88)(s + 1.33)(s + 0.083 + 0.371j)(s + 0.083− 0.371j)

(s + 2.39)s

=−0.830s4 − 2.80s3 − 2.63s2 − 0.730s− 0.300

s2 + 2.39s

=1.031

s + 2.39− 0.1254

s− 0.8299s2 − 0.8145s− 0.6843 (8.8)

The response from the closed-loop system is seen in Fig.8.6 with the performance writtenin Tab. 8.2.

0 2 4 6 8 10 12 14 16 18 20−0.5

0

0.5

1

1.5Closed Loop Step Response for C

vvG

ol,vv

Time (sec)

Am

plitu

de

0 2 4 6 8 10 12 14 16 18 20−0.5

0

0.5

1

1.5Closed Loop Step Response for C

hhG

ol,hh

Time (sec)

Am

plitu

de

Figure 8.6: Step response for the closed-loop with forward gain CvvGol,vv andChhGol,hh respectively and unity feedback.

This design does not meet all the requirements of the requirement specification, but thisis the best design which does not become unstable when implemented and hence it willbe used.

Page 61: report

8.2. VERIFICATION OF THE CLASSIC CONTROLLERS 51

CvvGol,vv Maximum ChhGol,hh MaximumRise time [s] 3.37 4.5 1.23 4.8Overshoot [%] 9.69 10 4.95 10Settling time [s] 9.71 6.0 1.69 6.0

Table 8.2: Performance of the closed-loop system with controllers

8.2 Verification of the Classic Controllers

Before the designed controller can be verified, the quantization introduced by the digi-tization of the TRMS sensor outputs must be taken into account. Hence quantizers areadded to the non-linear Simulink model, see Fig. 8.8, with a quantization step size of0.003 rad. The step size was found by measuring the smallest difference in angle fromthe graphs of the measured input from the physical model. It can be seen from the topgraph in Fig. 8.7 that the system does not behave as designed in the linear model, asthe staircase nature of quantization makes the differential parts of the controllers havea large influence on the response. To overcome this, either the quantization noise hasto be filtered, or the differential parts of the controller must be eliminated. However,adding filters to the input corresponds to adding dynamics in the feedback loop of thesystem, which the controllers have not been designed for. Using low-pass filters with acutoff frequency of 80 rad/s attenuated the quantization noise so performance was ac-ceptable, as seen in the bottom left graph. However, by simply removing the differentialparts of the cross coupling controllers Cvh and Chv, a better performance was achievedas can be seen in the bottom right graph of Fig. 8.7. Hence, the differential parts of thecontrollers was removed in favor of adding filters to the system. The new expressionsfor the controllers are:

Cvh =0.772

s + 1.33− 2.705

s− 1.217

Chv =1.031

s + 2.39− 0.1254

s− 0.6843

At this point the designed controllers can be verified in Simulink on the non-linearmodel to see if the non-linear model cause decreased performance or cause the systemto become unstable when given a step. The controllers Cvv and Chh control the verticaland horizontal position where Cvh and Chv suppress the cross-couplings in the plant.The working point voltage is added as the model of the plant has been linearized in thisworking point.

Four tests are performed on the non-linear model with the designed controllers in orderto verify that the controllers can stabilize and control the system. These tests are listedin Tab. 8.3.

Test number Input to vertical position Input to horizontal position1 -0.4 → 0 0 → 02 0 → 0 -0.5 → 0.53 -0.4 → 0 -0.5 → 0.54 0 → -0.4 0.5 → -0.5

Table 8.3: A list of the four tests which should verify if the classic controller canstabilize and control the non-linear model.

Page 62: report

52 CHAPTER 8. CLASSIC CONTROLLER

0 10 20 30 40 50−1

−0.5

0

0.5

1

Ver

tical

Pos

ition

[rad

]

Time [s]

0 10 20 30 40 50−1

−0.5

0

0.5

1

Time [s]

Ver

tical

Pos

ition

[rad

]

0 10 20 30 40 50−1

−0.5

0

0.5

1

Time [s]

Ver

tical

Pos

ition

[rad

]

Figure 8.7: Simulations of the classic controller given a constant reference of 0 onthe non-linear Simulink model with quantization noise in the vertical plane.Topmost: The controller in the non-linear model. Left bottommost: Thecontroller in the non-linear model with a filter with a bandwith of 80 rad/s.Right bottommost: The Cvh and Chv controller without differential parts. Thesystem behaves similar in the horizontal plane.

Figure 8.9 shows the test results from the verification test. In all four tests the dashedline represents the vertical position where a solid line represents the horizontal positionand the steps are given at time 10s in all tests. Every figure does also contain two bandswhich illustrate the limits where the position should be within before it is consideredsettled. This limit is ±5% of the step size.

The results from Fig. 8.9 are listed in Tab. 8.4 showing that the controllers does notcomply with the requirement specification. The vertical part suffers from high rise- andsettling time but the overshoot is within the limits. The horizontal part suffers fromhigh rise- and settling time as well, and the overshoot is also greater than the limitstated in the requirement specification.

Different design approaches has been tried without improving performance so the con-troller will be used although it does not meet the specified requirements.

The deterioration of the performance of the system from the design to the simulationis partly caused by the fact that the design assume the cross-coupling is eliminatedcompletely, and hence Cvv and Chh are designed as two SISO controllers. As it has notbeen possible to improve the controllers considerably it has been decided to implementthe current controllers on the TRMS system, although the performance does not satisfythe requirement specification.

Page 63: report

8.2. VERIFICATION OF THE CLASSIC CONTROLLERS 53

Vertical Reference

Horizontal Reference

Working Point Voltage

Working Point Voltage

Quantizer

Quantizer

ManualSwitch

ManualSwitch

Vertical Position

Motor voltage

Omega Main

Armature current

Non−linear Main Motor Model

Omega Main

Omega Tail

Omega_h

Theta_v

Omega_v

Non−linear Vertical Model

Motor voltage

Omega Tail

Armature current

Non−linear Tail Motor Model

Omega Main

Omega Tail

Theta_v

Omega_v

Omega_h

Theta_h

Non−linear Horisontal Model

Horizontal Position

Error Out

Cvv

Error Out

Cvh

12

−4.9

Error Out

Chv

Error Out

Chh

Figure 8.8: The four controllers as they are implemented in Simulink. The errorbetween the reference and actual position is the input to the four controllers. Theoutput of the controllers are given as input to the plant with the working pointvoltage added.

0 20 40 60 80 100

−0.4

−0.2

0

0.2

Pos

ition

[rad

]

Test 1

0 20 40 60 80 100

−0.5

0

0.5

1

1.5Test 2

0 20 40 60 80 100

−0.5

0

0.5

1

1.5

Pos

ition

[rad

]

Time [s]

Test 3

0 20 40 60 80 100−1.5

−1

−0.5

0

0.5

Time [s]

Test 4

Figure 8.9: This figure shows the verification test where the designed controllersare tested on the non-linear model. A dashed line indicates the vertical position andthe solid line indicates the horizontal line.

Page 64: report

54 CHAPTER 8. CLASSIC CONTROLLER

Testnumber

Verticalrise time[s]

Verticalsettlingtime [s]

Verticalovershoot[%]

Horizontalrise time[s]

Horizontalsettlingtime [s]

Horizontalovershoot[%]

1 3.0 6.2 3.8 - 0 4.92 - 3.5 2.6 2.5 37 573 3.8 10 6.2 5.0 37 594 5.0 7.8 4.5 7.7 37 54

Table 8.4: Table of the settling time, overshoot and rise time for the classic con-troller. Note that results exceeding the requirements are written in bold.

8.3 Classic Controller Implementation

The controllers are implemented in a Simulink model on the computer connected tothe TRMS. This Simulink model has a real time kernel which collects data from thesensors attached to the TRMS. The four controller blocks are implemented and thesample rate is selected to 125Hz.

In order to avoid problems with windup, an anti-windup circuit is implemented in themodel. As seen on Fig. 8.10 a saturation block is implemented before the plant withthe same saturation parameters as the plant. When the plant saturates, the switch willshut off the integral function in the controller.

Reference

0

1

In1

In2

In3

Out1

controller

Switch

Saturation

In1 Out1

Plant

Figure 8.10: Anti-windup circuit. Whenever the plant saturates the switch willchange from multiplying the integrator inputs by one to multiplying with zero andhence turning of the integral part of the controller.

The first test on the designed controller revealed that it did not fulfill the requirementspecification in neither the vertical nor horizontal part, as expected from the simulations.As seen in Fig. 8.11 the vertical part is simply to slow but does not suffer from to muchovershoot such as the horizontal part. The horizontal part is much to weak. It does notsettle within the limits. As a consequence the controller has been hand tuned in orderto improve the performance. It is mainly the horizontal controller Chh which has beenhand tuned. The proportional gain of the controller has been raised with a factor 5in order to make the controller more aggressive. As a consequence the differential gainhas been lowered with a factor 0.7 as the faster controller made the differential parttoo dominant. In order to compensate for the changes made to Chh, Cvv has also beenaltered. The proportional gain has been raised with a factor 10 while the differentialpart has been raised with a factor 5. Although this hand tuned controller did notfulfill the requirement specification either, it performed much better than the originallydesigned controller in the horizontal plane as seen in Fig. 8.11. For that reason, thiscontroller will be used throughout the rest of the tests conducted in the acceptance test.

Page 65: report

8.3. CLASSIC CONTROLLER IMPLEMENTATION 55

20 25 30 35 40 45 50 55 60

−0.5

0

0.5

Time [s]

Pos

ition

[rad

]

Test 1

original controllerhandtuned controller

20 25 30 35 40 45 50 55 60

−0.5

0

0.5

Time [s]

Pos

ition

[rad

]

Test 2

original controllerhandtuned controller

Figure 8.11: Original controller versus the hand tuned controller. The bottommostgraph illustrates that the hand tuned controller perform significantly better than theoriginal controller in the horizontal plane without the performance in the verticalplane is deteriorated significantly as seen topmost.

Summary of Classic Controller Design

In this chapter a classic controller for the system was designed, tested, and implementedon the TRMS. In the design phase, four controllers were designed, two for suppressingthe effect of the cross-couplings between the planes enabling the remaining two to bedesigned as SISO controllers. The two SISO controllers where designed from the linearmodel and verified against the non-linear model. The quantization in the non-linearmodel caused the system to perform very poorly. By removing the differential partsin the cross-coupling controllers the performance was improved. Even though the con-trollers could still not meet the requirements their performance was considered accept-able. One possible cause of the degraded performance is that the assumption that thecross-coupling is canceled is not strictly true as seen in Fig. 8.9.

Finally, the four controllers were implemented in Simulink and tested on the TRMS.It was found that the performance in the horizontal plane was quite poor and thus theclassic controller was hand tuned which improved the performance in the horizontalplane without a significant performance penalty in the vertical plane.

Thus is the classic controller ready to be tested in order to determine how many of theacceptance tests it can fulfill.

With the classic controller designed, two state-space controllers are designed in thefollowing chapter.

Page 66: report

Chapter 9State-Space ControllerThe scope of this chapter is to design a state-space controller for the TRMS. In orderto design the controller, a state-space model of the TRMS is derived in the first sectionusing the differential equations describing the system derived in Part II. The derivedmodel is inspected for controllability afterwards, and the poles and zeros of the TRMSare determined from the state model.

In the second section an observer based state-space controller architecture is developedaround the state space model with integral control and integrator anti-windup.

The third section contains the design of the controller, where the parameter values of thestate-space controller are determined so the TRMS meets the specified requirements.Two controllers are designed using two different methods.

In the first design, the state space controller is designed using pole-placement, where theclosed-loop poles of the system are placed in desired s-domain locations. The desiredclosed-loop pole locations are found using a second-order system approximation to yielda region in the s-domain where the closed-loop poles of the system should be placed inorder to comply to the specified requirements.

The second design is based on an optimal control design, where the state-space controlleris designed by minimizing a cost function.

In the fifth and last section, the two controllers are implemented and tested on theTRMS.

9.1 State-Space ModelIn a linear state-space model, a dynamic system is described by an organized set of firstorder linear differential equation, where the variables of the differential equations arecalled the states of the system, [Stoustrup, 2006]

x1 = a11x1 + a12x2 + · · ·+ a1nxn + b11u1 + · · ·+ b1mum

x2 = a21x1 + a22x2 + · · ·+ a2nxn + b12u1 + · · ·+ b2mum

...xn = an1x1 + an2x2 + · · ·+ annxn + b1nu1 + · · ·+ bnmum (9.1)y1 = c11x1 + c12x2 + · · ·+ c1nxn + d11u1 + · · · + d1mum

...yp = cp1x1 + cp2x2 + · · ·+ cpnxn + dp1u1 + · · ·+ dpmum

where x1 · · ·xn are the system states, u1 · · ·um are the inputs and y1 · · · yp are thesystem outputs. Note that in this chapter n always denotes the number of states, mthe number of inputs and p the number of outputs.

56

Page 67: report

9.1. STATE-SPACE MODEL 57

In matrix form, the state-space equations can be written as

x (t) = Ax (t) +Bu(t)y(t) = Cx (t) +Du(t)

(9.2)

where x is the state vector, y is the output vector, A is the system matrix, B is theinput matrix, C is the output matrix and D is the direct transmission matrix. A blockdiagram of the state-space model is seen in Fig. 9.1.

For the TRMS m = p = 2 in Eqs. (9.1) since it has two inputs, the main and tail motorvoltage ua,m and ua,t, and two outputs, the vertical and horizontal angular positionθv,res and θh,res.

A

CBx yu

D

ΣΣ+

+ +

+

Figure 9.1: Block diagram of the state-space model showing the locations of thestate-space model matrices.

The states of the system are chosen so all the “energy storages” of the TRMS are repre-sented, yielding all the necessary information to describe the system. [Stoustrup, 2006].

The states of the system have been identified as the following:

State 1: Angular velocity of main motor ωm(t):Represents the kinetic rotational energy of the main motor load.

State 2: Angular velocity of tail motor ωt(t):Represents the kinetic rotational energy of the tail motor load.

State 3: Angular vertical position of the TRMS θv,res(t):Represents the gravitational potential energy of the TRMS.

State 4: Angular horizontal position of the TRMS θh,res(t):Represents the potential energy of the “spring” in the TRMS.

State 5: Angular vertical velocity of the TRMS ωv,res(t):Represents the kinetic rotational energy of the TRMS in the vertical plane.

State 6: Angular horizontal velocity of the TRMS ωv,res(t):Represents the kinetic rotational energy of the TRMS in the horizontal plane.

Thus the system is of 6th order as it contains six energy storages. This yields the statevector, input vector and output vector described Eq. (9.3). Note that for convenience“(t)” is left out in the notation for time varying signals for the rest of the chapter.

x =

ωmωt

θv,resθh,resωv,resωh,res

u =[ua,mua,t

]y =

[θv,resθh,res

](9.3)

Page 68: report

58 CHAPTER 9. STATE-SPACE CONTROLLER

Expressions for the states are found in part II, equations (5.20), (5.21), (7.59) and (7.69).These equations are rearranged in state variable form:

˙ωm =km,m

Ra,mJa,mua,m +

−k2m,m − 2Ra,mDa,mωm −Ra,mBa,m

Ra,mJa,mωm (9.4a)

˙ωt =km,t

Ra,tJa,tua,t +

−k2m,t −Ra,tBa,t

Ra,tJa,tωt (9.4b)

˙θv,res = ωv,res (9.4c)

˙θh,res = ωh,res (9.4d)

˙ωv,res =− gC

Jvθv,res − µv

Jvωv,res +

1Jv

(2α0,tωm + α1,t)ωm+

1Jv

(3β0,pω2t + 2β1,pωt + β2,p)ωt +

JtrJv

˙ωt

⇓˙ωv,res =− gC

Jvθv,res − µv

Jvωv,res +

2α0,tωm + α1,t

Jvωm+

(3β0,pω

2t + 2β1,pωt + β2,p

Jv+−k2

m,tJtr −Ra,tJtrBa,t

Ra,tJvJa,t

)ωt +

Jtrkm,t

Ra,tJvJa,tua,t

(9.4e)

˙ωh,res =− khD + E

θh,res − µh

D + Eωh,res +

1D + E

(2α0,pωm + α1,p) ωm+

1D + E

(3β0,tω

2t + 2β1,tωt + β2,t

)ωt +

Jmr

D + E˙ωm

⇓˙ωh,res =− kh

D + Eθh,res − µh

D + Eωh,res+

(2α0,pωm + α1,p

D + E+−k2

m,mJmr − 2JmrRa,mDa,mωm − JmrRa,mBa,m

(D + E)Ra,mJa,m

)ωm+

3β0,tω2t + 2β1,tωt + β2,t

D + Eωt +

Jmrkm,m

(D + E)Ra,mJa,mua,m (9.4f)

where Eq.(9.4a) and Eq.(9.4b) have been inserted in the expression for ˙ωv,res and ˙ωh,res.

From the state equations (9.4) the state space matrices are derived, The obtained ma-trices are listed on the facing page.

Page 69: report

9.1. STATE-SPACE MODEL 59

System

matrixA:

A=

−k2 m,m−

2Ra,m

Da,m

ωm−

Ra,m

Ba,m

Ra,m

Ja,m

00

00

0

0−

k2 m,t−

Ra,t

Ba,t

Ra,t

Ja,t

00

00

00

00

10

00

00

01

2α0,t

ωm

+α1,t

Jv

3β0,p

ω2 t+

2β1,p

ωt+

β2,p

Jv

+−

k2 m,t

Jtr−

Ra,t

Jtr

Ba,t

Ra,t

JvJa,t

−gC Jv

0−

µv

Jv

02α0,p

ωm

+α1,p

D+

E+−

k2 m,m

Jmr−

2JmrR

a,m

Da,m

ωm−

JmrR

a,m

Ba,m

(D+

E)R

a,m

Ja,m

3β0,t

ω2 t+

2β1,t

ωt+

β2,t

D+

E0

−kh

D+

E0

−µh

D+

E

(9.5)

Inpu

tmatrixB,outpu

tmatrixC

anddirect

tran

smission

matrixD:

B=

km,m

Ra,m

Ja,m

0

0km,t

Ra,t

Ja,t

00

00

0Jtr

km,t

Ra,t

JvJa,t

Jmrk

m,m

(D+

E)R

a,m

Ja,m

0

C=

[ 00

10

00

00

01

00]

D=

[ 00

00]

(9.6)

Insertingthepa

rameter

values

yields

thefollo

wingmatrices:

A=

−1.3

20

00

00

0−2

.39

00

00

00

00

1.00

00

00

00

1.00

0.10

3−0

.334

E-3

−4.2

90

−0.0

313

02.

23E-3

5.63

E-3

0−0

.145

0−0

.167

B

=

3.98

00

21.5

00

00

00.

0141

0.01

710

C

=[ 0

01

00

00

00

10

0]D

=[ 0

00

0](9.7)

Page 70: report

60 CHAPTER 9. STATE-SPACE CONTROLLER

Using the Matlab command ss on the matrices, the poles and zeros of the system arefound using the command pzmap. The result is seen in Fig. 9.2, yielding the same polesand zeros found in Ch. 8.

−20 −10 0 10

−2

−1

0

1

2

Real Axis

Imag

inar

y A

xis

Poles: [rad/s]

p1 = −0.0157 + 2.07j

p2 = −0.0157 − 2.07j

p3 = −0.0833 + 0.371j

p4 = −0.0833 − 0.371j

p5 = −1.33

p6 = −2.39

Zeros: [rad/s]

z

1 = −16.2

z2 = 12.5

Figure 9.2: The pole-zero map of the system shows the exact same location of thepoles and zeros as found in Ch. 8.

Before designing a controller, the system is checked to be controllable, meaning that forevery vector ξ ∈ Rn an input u(t) ∈ Rm exists so that for some T>0, x (T ) = ξ. Thiscan be proven to be true if and only if: [Stoustrup, 2006]

rank[B AB . . . An−1B

]= rank(C) = n (9.8)

where C =[B AB . . . An−1B

]is called the controllability matrix.

The controllability matrix is evaluated using the Matlab command ctrb on the statespace system:

C=

3.98 0 −5.27 0 6.98 0 −9.25 0 12.3 0 −16.2 00 21.5 0 −51.4 0 123 0 −294 0 702 0 −1680 0 0 0.0141 0.411 −7.63E-3 −0.558 −0.0431 −1.03 −6.94E-3 1.47 0.2840 0 0.0171 0 6.03e-3 0.121 −0.0153 −0.310 0.0173 0.726 −0.0213 −1.730 0.0141 0.411 −7.63E-3 −0.558 −0.0431 −1.03 −6.94E-3 1.47 0.284 5.63 −0.214

0.0171 0 6.03E-3 0.121 −0.0153 −0.310 0.0173 0.726 −0.0213 −1.73 0.0284 4.14

The rank of the C is evaluated using theMatlab command rank, yielding that rank(C) =6 = n, hence the system is controllable.

9.2 State-Space Controller Architecture

For a state-space model, a controller is implemented using the following state feedbacklaw:

u = Fx (9.9)

where the feedback matrix F is a k×p -matrix.

Inserting in the state-space system (9.2) gives:

x = Ax +BFx = (A+BF )x = Aclxy = Cx +DFx = Cx

(9.10)

Page 71: report

9.2. STATE-SPACE CONTROLLER ARCHITECTURE 61

where D = 0 according to Eq. (9.7), and Acl is the closed-loop system matrix.

As a result the eigenvalues of the closed-loop system matrix Acl, i.e. the closed-looppoles, can be modified by the feedback matrix F , and it can be shown that any desiredclosed-loop pole configuration can be obtained using state feedback. [Stoustrup, 2006].A block diagram of the system with state feedback is seen in Fig. 9.3a. If the desiredpole locations are known, the feedback matrix can be calculated using the Matlabcommand place,

F=-place(A,B,P) (9.11)

which determines F so the matrix A+BF has the eigenvalues specified in the vectorP .

A

CBFI

F

r x yxI u

+

+

+

+Σ Σ∫Σ∫

A

CB

F

x yu+

+ Σ

(a) (b)

+

-

Figure 9.3: A system with state feedback Fx (a), and (b) a system with statefeedback and integral control, where the state x I representing the energy of theintegrators are feedback by F Ix I. The matrix r is the reference input.

As the requirements to the TRMS specifies zero steady-state error, integrators are imple-mented in the state-space controller for the two outputs θv,res and θh,res. A state-spacecontroller with integrator is seen in Fig. 9.3b, where the input to the integrator is thedifference between the reference input r and the output y . The gain of the integratorfeedback are controlled by the matrix F I which is a p×p -matrix.

Introducing integrators adds additional system energy storages. As a result the outputsof the integrators x I are included as states to represent these. From Fig.9.3 the followingequations are obtained

x = Ax +Bu

x I = y − r

u = Fx + F Ix I

y = Cx

˙[xx I

]

︸︷︷ ︸xe

=[A 0C 0

]

︸ ︷︷ ︸Ae

[xx I

]

︸︷︷ ︸xe

+[B0

]

︸︷︷︸Be

u +[0−I

]r

u =[F F I

]︸ ︷︷ ︸

Fe

[xx I

], y =

[C 0

]︸ ︷︷ ︸

C e

[xx I

] (9.12)

where x e is the extended state vector and Ae, Be and C e are the extended state-modelmatrices.

The extended state model is a system with similar structure as the state model andfeedback law described in Eq. (9.2) and Eq. (9.9). As a consequence the extendedfeedback matrix F e yielding the desired closed-loop poles can be designed usingMatlabaccording to the command in Eq. (9.11)

Fe=-place(Ae,Be,Pe) (9.13)

which determines F e so the matrix Ae+BeF e has the eigenvalues specified in the vectorPe. The matrices F and F I are extracted from the vector F e.

Page 72: report

62 CHAPTER 9. STATE-SPACE CONTROLLER

The closed-loop matrices of the extended system can be deduced from Eq. (9.12),[xx I

]=

[A+BF BF I

C 0

]

︸ ︷︷ ︸Ae,cl

[xx I

]+

[0−I

]

︸ ︷︷ ︸Be,cl

r , y =[C 0

]︸ ︷︷ ︸C e,cl

[xx I

](9.14)

where Ae,cl, Be,cl and C e,cl are the the closed-loop matrices.

The state feedback requires that measurements of all the system states are available,but the TRMS only measures the angular velocities of the rotors ωm and ωt and theangular positions θv,res and θh,res. As a result an observer is used to obtain estimates ofthe states.

The observer constructs states using a full-order model of the plant as illustrated inFig. 9.4a. The observer is given by

˙x = Ax +Bu (9.15)

where x is the estimated state vector.

∫A

CB

L

∫ C

A

B

x y

x

u

yC

Plant

( )A, B

yu

Plant Model

( )A, B

C

yx

x

(a)

plant

observer

(b)

Σ

Σ

Σ

-

++

+

+

+ + +

Figure 9.4: (a): A full-order open-loop observer based on a full-order plant model.(b): A full-order observer with feedback.

In order to get the estimated states to track the true states of the system despite modelinaccuracies and unknown initial conditions, the difference between the measured andestimated outputs are fed back to the observer

˙x = Ax +Bu + L(Cx − y) (9.16)

where the observer gain matrix L is an n×p -matrix. This observer is illustrated inFig. 9.4b, where it is implemented in a state feedback controller with integral control.

If the error of the estimate e is defined as,

e = x − x (9.17)

the dynamics of the estimation error is given by:

e = x − ˙x = Ax +Bu −Ax −Bu − L(Cx − y

)

= Ax −Ax − L(Cx −Cx

)=

(A+ LC

)(x − x

)=

(A+ LC

)e (9.18)

Thus the poles of the observer is the eigenvalues of the matrix A + LC . Hence if theobserver has all its poles in the left half-plane the error e will decay to zero, i.e. theestimated states x will converge to the true states x . [Franklin et al., 2002]

Page 73: report

9.2. STATE-SPACE CONTROLLER ARCHITECTURE 63

An observer gain L resulting in all poles in the left half plane only exists if the system isobservable, i.e. information about all the system state can deduced from the measuredoutput. This can be expressed as: [Franklin et al., 2002] [Stoustrup, 2006]

if y(t) = 0 ⇒ x (t) = 0 (9.19)

It can be shown that a system is observable if and only if the observability matrix Ohas full rank: [Stoustrup, 2006]

rank(O)

= rank

CCA...

CAn−1

= n (9.20)

The observability matrix of the system is computed using the Matlab command obsv:

O =

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

0.103 −0.334E-3 −4.29 0 −0.0313 02.23E-3 5.63E-3 0 −0.145 0 −0.167−0.140 0.809E-3 0.135 0 −4.29 0−3.33E-3 −0.0144 0 0.0241 0 −0.117−0.258 −0.499E-3 18.4 0 0.269 04.15E-3 0.0338 0 0.0170 0 0.04360.370 1.10E-3 −1.16 0 18.4 0

−5.40E-3 −0.0804 0 −6.32E-3 0 9.68E-3

The rank of the O is evaluated using the Matlab command rank, yielding thatrank(O) = 6 = n. Hence the system is observable, and the poles of the observer,i.e. the eigenvalues of A+LC , can be placed in any desired locations using L. This isanalogue with the closed-loop poles given as the eigenvalues ofA+BF . [Stoustrup, 2006]

The observer gain L can be computed using the Matlab command

L = (place(A′,-C′,Pob))′ (9.21)

which gives a gain L that places the eigenvalues of A+LC in the locations specified inPob.

If the poles of the observer is placed reasonably to the left of the systems closed-looppoles, the estimation converges to zero faster than the dynamics of the system, yield-ing x (t) ≈ x (t). Hence the dynamics of the closed loop system is dominated by thecontroller poles.

It is also possible to construct a reduced-order observer which only estimates the statesnot measured, but as the full-order observer also acts as a filter on the measured states,a full-order observer is used. Note that a full-order observer increases the order of theclosed-loop system with the order of the plant. [Franklin et al., 2002]

The observer is implemented in the state-space controller illustrated in Fig. 9.3 givingthe system in Fig. 9.5.

Page 74: report

64 CHAPTER 9. STATE-SPACE CONTROLLER

A

CB

L

C

A

B

FI

F

∫r x y

x

xI u

observer

plant

y

Σ Σ

Σ

Σ

Σ

+

+

+

++

+

-

+

+

+

- ∫

Figure 9.5: A full-order observer based state-feedback controller with integral con-trol.

From Fig. 9.5 the following closed-loop equations are obtained:

x = Ax +Bu˙x = Ax +Bu + L

(y − y

)

x I = y − ru = Fx + F Ix I

y = Cxy = Cx

x = Ax+ BFx +BF Ix I

˙x = −LCx+(A+BF + LC

)x +BF Ix I

x I= Cx+ 0 x + 0 x I − ry= Cx+ 0 x + 0 x I

And in matrix form, where I is the identity matrix:x˙xx I

=

A BF BF I−LC A+BF + LC BF IC 0 0

︸ ︷︷ ︸Acl

xxx I

+

00−I

︸ ︷︷ ︸Bcl

r

y =[C 0 0

]︸ ︷︷ ︸

C cl

xxx I

(9.22)

The closed-loop poles are given as the eigenvalues λ of the system matrix Acl:∣∣∣∣∣∣

A−λI BF BF I−LC A+BF+LC−λI BF IC 0 −λI

∣∣∣∣∣∣= 0 ⇔

∣∣∣∣∣∣

A+BF−λI BF BF I0 A+LC−λI 0C 0 −λI

∣∣∣∣∣∣= 0

⇔∣∣∣∣∣A+ LC − λI

∣∣∣∣∣ = 0

︸ ︷︷ ︸Observer poles

∨∣∣∣∣∣A+BF − λI BF I

C −λI

∣∣∣∣∣ = 0

︸ ︷︷ ︸Controller poles

Thus the closed-loop poles of the system are the observer poles and the controller polesaccording to Eq.(9.14) and Eq.(9.18), enabling a separate design of the observer gainL and the feedback gains F and F I. This result is know as the separation theorem.[Stoustrup, 2006]

During control, actuator saturation might occur, which can result in integrator-windup.To solve this problem an integrator anti-windup “circuit” is implemented in the con-troller. This circuit is based on that the saturation limits of the actuators are known

Page 75: report

9.2. STATE-SPACE CONTROLLER ARCHITECTURE 65

and included as a saturation block at the input to the observer. Thus by taking thedifference of the input and output of the saturation block, a saturation signal w isobtained, which can be fed back to the integrator.

The anti-windup circuit is implemented in the state controller in Fig. 9.6a, where thesaturation signal w is fed back to the integrator through the matrix M I. When thesystem is not saturated the signal w = 0 and the controller functions as normal.

A

CB

L

∫ C

A

B

F

∫r x yxI

u

x yΣ

ΣΣ

+

+

+

-

+

-

ΣΣ

+

+

++

- Σ+

+Σ+

+

MI

FI

A

CB

L

∫ C

A

B

F

∫r x yxI

u

x yΣ

ΣΣ

+

+

+

-

+

-

ΣΣ

+

+

++

- Σ+

+Σ+

+

MI

FI

umax

umax

(a)

(b)

integrator anti-windupcircuit

w=0w=0

w=0

Figure 9.6: (a): An observed based state-feedback controller with integral controland anti-windup circuit in non-saturation mode. (b): The same controller duringsaturation. The control of the plant is lost and receives maximum input umax, buta signal w 6= 0 is fed back to the integrator to avoid windup.

In Fig. 9.6b the system is in saturation, i.e. the system and observer receives a constantinput umax, but the control of the plant is otherwise lost. Here the saturation signalw 6= 0 and gives a feedback to the integrator. From 9.6b the following saturated systemequations are obtained:

x =Ax +Bumax = Ax+ 0 x+ 0 x I +Bumax

˙x =Ax + LCx − LCx +Bumax = −LCx+(A+LC

)x+ 0 x I +Bumax

x I=y−r+M I(Fx+F Ix I−umax

)= Cx+ M IFx+M IF Ix I−r−M Iumax

Closed-loop system-matrix Asat of saturated system:

Asat =

A 0 0−LC A+ LC 0C M IF M IF I

(9.23)

Page 76: report

66 CHAPTER 9. STATE-SPACE CONTROLLER

The poles of the saturated system are given as the eigenvalues of Asat:∣∣∣∣∣∣

A− λI 0 0−LC A+ LC − λI 0C M IF M IF I − λI

∣∣∣∣∣∣= 0

m ∣∣A− λI∣∣

︸ ︷︷ ︸Plant

∣∣A+ LC − λI∣∣

︸ ︷︷ ︸Observer

∣∣M IF I − λI∣∣

︸ ︷︷ ︸Integrator

= 0 (9.24)

From Eq. (9.24) it is seen that the saturation poles consists of the plant poles, observerpoles and integrator poles. The plant poles appears since the plant runs in open-loopduring saturation, and the observer poles remains the same because the process ofestimating the states are not affected of the saturation. If no anti-windup circuit wasimplemented the matrix M I = 0 and the factor

∣∣M IF I−λI∣∣ would result in poles

in zero. These poles appears because of the controllers unstable integrator-poles whenrunning in open-loop. By including M I the unstable integrator poles can be relocatedduring saturation.

The matrix M I can be designed using the Matlab place function

MI=(eye(k)-place(FI′,FI′,Psat))′ (9.25)

where eye(k) is the identity matrix with dimension k. This determines M I so theintegrator poles are in P sat during saturation.

Having completed the design of a state-space controller architecture by identifying itspoles and how to place them, the last thing to inspect is the zeros of the system, wherethe following theorem is used: [Stoustrup, 2006]

A square system, i.e. the number of inputs k equals the number of outputs p, witha state-space model of the form

x = Ax +Buy = Cx +Du

has a zero z ∈ C if and only if:∣∣∣∣A− zI BC D

∣∣∣∣ = 0 (9.26)

The state model of the TRMS is a square as there is two input references and two outputpositions. Using the theorem on the closed-loop matrices of Eq.(9.22) the followingexpression is obtained:

∣∣∣∣Acl − zI BclC cl Dcl

∣∣∣∣=0 ⇒

∣∣∣∣∣∣∣∣

A− zI BF BF I 0−LC A+BF+LC−zI BF I 0C 0 −zI −IC 0 0 0

∣∣∣∣∣∣∣∣=0 ⇔

(9.27)∣∣∣∣∣∣

A− zI 0 B−LC A+ LC − zI BC 0 0

∣∣∣∣∣∣=0 ⇔

∣∣∣∣A+ LC − zI∣∣∣∣

︸ ︷︷ ︸zeros in observer poles

∣∣∣∣A− zI BC 0

∣∣∣∣︸ ︷︷ ︸

plant zeros

=0

From Eq. (9.27) the zeros of the closed-loop system consist of the plant zeros and zerosin the pole locations of the observer, thus the observer dynamics are “invisible” when

Page 77: report

9.3. STATE-SPACE CONTROLLER DESIGN 67

considering the system from the reference to the output. Hence it is not visible to thesystem whether true or estimated states are used for feedback.

The design of a state-space controller architecture is now completed, and ready to beimplemented on the earlier derived state-model, which is both controllable and observ-able.

9.3 State-Space Controller Design

In this section two controllers are designed based on the described controller architec-ture. In the first design, desired s-domain pole-locations are found and the controller isdesigned afterwards using the developed pole-placing techniques.

In the second design an optimal control approach is used, where the state-space con-troller is designed by minimizing a cost function. Both designs are carried out usingMatlab.

9.3.1 Pole-Placement Controller Design

To obtain information about where to place the closed-loop poles so the system meetsthe requirements, a second-order SISO system approximation is used to yield a regionin the s-domain for each set of requirements. If the poles are placed in this region theresponse from each input to the related output should approximately comply to thespecified requirements.

The requirements specified in Ch. 3 are restated here:

Vertical Plane Horizontal PlaneRise Time tr [s] 4.5 4.8Overshoot Mp [%] 10 10Settling Time ts [s] 6.0 6.0

Table 9.1: The system requirements specified in Ch. 3.

According to a second-order system the closed-loop poles should have the followingproperties [Franklin et al., 2002]

ωn ≥ 1.8tr

ζ ≥√− ln2 Mp

ln2 Mp − π2σ ≥ − ln(0.05)

ts(9.28)

where ωn is the natural frequency, ζ is the damping ratio and σ is the real part of thepoles.

Inserting the requirements of Tab. 9.1 gives:

Vertical plane: ωn,v ≥ 0.40rads

ζn,v ≥ 0.59 σn,v ≥ 0.50

Horizontal plane: ωn,h ≥ 0.38rads

ζn,h ≥ 0.59 σn,h ≥ 0.50

These requirement are plotted in Fig. 9.7 along with the plant poles. It is seen that theplant poles are not in the specified region. In Fig. 9.8 the region is plotted again with

Page 78: report

68 CHAPTER 9. STATE-SPACE CONTROLLER

a selected set of pole locations Pe that complies with the requirements:

p1 = −3 p3 = −2.0 + 1.6j p5 = −0.80 + 0.50j p7 = −2.0p2 = −3 p4 = −2.0− 1.6j p6 = −0.80− 0.50j p8 = −2.3

Using the Matlab command from Eq.(9.13) the feedback matrices F and F I are de-termined:

Fe=-place(Ae,Be,Pe); F=Fe(1:6); FI=Fe(7:8);

−3.5 −3 −2.5 −2 −1.5 −1 −0.5 0

−2

−1

0

1

2

Real Axis

Imag

inar

y A

xis

Vertical planeHorizontal planePlant poles

sin−1( ζ )

−σv

−σh

ωv

ωh

Figure 9.7: A plot of the s-region delineated by the transient requirements to risetime, overshoot and settling time for a second-order system. The poles must beplaced in the region to the left of the lines and curves to comply to the requirements.

−3.5 −3 −2.5 −2 −1.5 −1 −0.5 0

−2

−1

0

1

2

Real Axis

Imag

inar

y A

xis

Vertical planeHorizontal planeController poles

Figure 9.8: A plot of the the region delineated by the transients requirements to asecond-order system, and a set of desired closed-loop pole-locations that complies tothe region.

In order to make the estimation error of the observer to decay fast enough compared tothe dynamics of the system, the observer poles are as a rule of thumb placed a factorof 2 to 6 to the left of the controller poles. [Franklin et al., 2002]. Applying this rule tothe chosen controller poles, the following observer poles Pob are chosen:

p1,ob = −10 p3,ob = −11 p5,ob = −10p2,ob = −10 p4,ob = −11 p6,ob = −10

Page 79: report

9.3. STATE-SPACE CONTROLLER DESIGN 69

Using the Matlab command in Eq. (9.21) the observer gain L is determined:

L = (place(A′,-C′,Pob))′

The computed matrices F , F I and L are inserted in the closed-loop matrices of Eq.(9.22)and turned into a Matlab state-model using the command ss. The step response ofthe system is seen in Fig. 9.9, where each input are stepped one at a time.

Step: Horizontal Position

0

0.5

1

1.5Step: Vertical Position

Ver

tical

Pos

ition

[ra

d]

0 2 4 60

0.5

1

1.5

Time [s]

Hor

izon

tal P

ositi

on [

rad]

0 2 4 6Time [s]

tr=1.69s

tr=3.23s

ts=2.68s

ts=4.88s

Mp=0.59%

Mp=0.57%

Peak=0.044rad

Peak=0.19rad

Figure 9.9: The step responses from each input to the two outputs. The dashedlines indicate the region for the settling time, the dot-dash lines indicate the regionfor the rise time and the dotted lines are the reference inputs.

When stepping the vertical position, the response of the vertical position complies to thespecified transient requirements and the horizontal position stays within the specifiedsettling band of ±0.02 rad. Stepping the horizontal position also gives a response ofthe horizontal position that complies to the specified transient requirements, but thevertical position has a peak response of 0.19rad. This is more than the allowed peak of10% of the horizontal step-size.

If the used design method is examined the above result is not surprising, as the usedsecond-order approximation design-method does not consider the cross-coupling be-tween the two inputs and outputs. This design method only “guaranties” a satisfyingresponse from vertical reference-input to vertical position and from horizontal reference-input to horizontal position.

The reason for the poor response of the system can also be seen by inspecting the bodeplot of the closed-loop system, see Fig. 9.10. From the vertical input to the horizontaloutput the attenuation is 24.3dB, hence the horizontal position is only slightly affectedwhen regulating the vertical position in accordance with the step response. But theattenuation from the horizontal input to the vertical output is only 6.7dB thus resultingin a poor decoupling when regulating the horizontal position. This is exactly whathappened in the step response.

When solving the above problem, the system poles should still be in the region specified

Page 80: report

70 CHAPTER 9. STATE-SPACE CONTROLLER

−360−180

0180360

Ver

tical

Pos

.

10−2

100

102

−180

0

180

Hor

izon

tal P

os.

10−2

100

102

−150

−100

−50

0Input: Vertical Reference

Ver

tical

Pos

.Input: Horizontal Reference

−150

−100

−50

0

Hor

izon

tal P

os.

−6.73dBω=1.58rad/s

−24.3dBω=1.33rad/s

−3dBω=1.25rad/s

−3dBω=0.66rad/s

Figure 9.10: Bode plot of the closed-loop system with the closed-loop poles inFig. 9.8. The minimum attenuation from the horizontal input to the vertical outputis only 6.7dB resulting in a poor decoupling of two planes when controlling.

by the second-order approximation, but additionally the pole locations should result ina high attenuation of the coupling between the dynamics of the vertical and horizontalplane. Taking these things into account the following pole location were chosen:

p1 = −1.70 p3 = −1.70 + 1.0j p5 = −1.70 + 1.10j p7 = −2.00p2 = −1.70 p4 = −1.70− 1.0j p6 = −1.70− 1.10j p8 = −2.29

(9.29)

The poles are plotted in Fig.9.11 together with the earlier specified second-order region.All the poles lie within the region. The matrices F and F I are computed as earlier andthe previously determined observer poles are kept. A bode plot of the closed-loop systemis seen in Fig. 9.12, where the minimum attenuation of the couplings are 29.7 dB and28.4 dB, which is an improvement over the previous design. The bandwidth of thecontroller in the vertical and horizontal plane are 1.0 .rad/s and 0.92.rad/s respectively,making the two planes equally fast in their dynamics.

The model of the pole-placement controller implemented on the linear system can befound in appended document [4].

The step response of the system is seen in Fig. 9.13 where all transient requirements aremet. When stepping the vertical position the peak response of the horizontal positionis 0.022 rad which is less than 10% of the vertical step-size. Similar the peak responseof the vertical position is −0.018rad when stepping the horizontal position.

Before testing the controller on the non-linear model, the anti-windup circuit is designed.When the system is saturated, it is chosen to move the integrator poles from zero to -5and -6. The matrix M I can then be designed according to Eq.(9.25):

MI=(eye(2)-place(FI′,FI′,[-5 -6]))′

Having designed all the controller matrices, the controller is ready to be tested on thenon-linear model.

Page 81: report

9.3. STATE-SPACE CONTROLLER DESIGN 71

−3.5 −3 −2.5 −2 −1.5 −1 −0.5 0

−2

−1

0

1

2

Real Axis

Imag

inar

y A

xis

Vertical planeHorizontal planeController poles

Figure 9.11: A plot of the desired closed-loop pole-locations to give a high amount ofdecoupling. The poles are within the specified region to give the system a satisfactoryresponse.

−150

−100

−50

0Input: Vertical Reference

Ver

tical

Pos

.

−360−180

0180360

Ver

tical

Pos

.

−150

−100

−50

0

Hor

izon

tal P

os.

10−2

100

102

−360−180

0180360

Hor

izon

tal P

os.

Input: Horizontal Reference

10−2

100

102

104

−28.4dBω=1.58rad/s

−24.3dBω=1.33rad/s

−3dBω=1.00rad/s

−3dBω=0.92rad/s

Figure 9.12: Bode plot of the closed-loop system with the closed-loop poles inFig. 9.11. The minimum attenuation from the vertical input to the horizontal outputis 29.7dB, and 28.4dB from horizontal to vertical, giving a good decoupling betweenthe dynamics of the two planes.

Page 82: report

72 CHAPTER 9. STATE-SPACE CONTROLLER

−0.2

0

0.2

0.4

0.6

0.8

1

Step: Vertical PositionV

etic

al P

ositi

on [r

ad]

Step: Horizontal Position

0 2 4 6Time [s]

0 2 4 6−0.2

0

0.2

0.4

0.6

0.8

1

Time [s]

Hor

izon

tal P

ositi

on [r

ad]

ts=4.21s

ts=3.97s

Peak=−0.0179rad

Peak=0.022rad

tr=2.29s

tr=2.17s

Figure 9.13: The step responses from each input to the two outputs. The dashedlines indicate the region for the settling time, the dot-dash lines indicate the regionfor the rise time and the dotted lines are the reference inputs.

Verification of Pole-Placement Controller

The state-space controller implemented in Simulink is seen in Fig. 9.15 and can befound in appended document [5]. The saturation limits used by the controllers aregiven as:

Main motor:Upper limit = 19.5V− ua,m

Lower limit = 0.00V− ua,m

Tail motor:Upper limit = 14.5V− ua,t

Lower limit = −14.5V− ua,t

Using the non-linear model derived in Part II as plant, four step-tests are simulated onthe pole-placement controller using the procedures described in Tab. 9.2.

Test number Input to vertical position Input to horizontal position1 −0.4rad → 0rad 0rad2 0rad −0.5rad → 0.5rad3 −0.4rad → 0rad −0.5rad → 0.5rad4 −0.4rad → 0rad 0.5rad → −0.5rad

Table 9.2: Step-test procedure for pole-placement controller on non-linear model.

The simulated responses are plotted in Fig. 9.14 and the transient results are listed inTab. 9.3. The test results show that all rise and settling times are at least one sec-ond faster than specified by the minimum requirements and that the biggest overshootis 4.4% which complies to the maximum of 10%. Hence the system meets all the re-quirements, making the controller ready for implementation on the physical system.The implementation is found in the last section of this chapter, but first an optimalcontroller is designed.

Page 83: report

9.3. STATE-SPACE CONTROLLER DESIGN 73

Testnumber

Verticalrise time[s]

Verticalsettlingtime [s]

Verticalovershoot[%]

Horizontalrise time[s]

Horizontalsettlingtime [s]

Horizontalovershoot[%]

1 2.4 3.8 0.4 - 0.0 4.42 - 0.0 1.4 2.3 3.6 0.63 2.8 4.1 0.5 2.4 3.6 0.44 3.3 4.8 0.3 2.5 3.6 0.0

Table 9.3: Table of the transient values; settling time, overshoot and rise time forthe tests of the pole-placement controller in Fig. 9.14. All values complies with therequirements in Tab. 9.1

0 10 20 30−0.6

−0.4

−0.2

0

0.2Test 1

Pos

ition

[rad

]

0 10 20 30−1

−0.5

0

0.5

1Test 2

0 10 20 30−1

−0.5

0

0.5

1Test 3

Pos

ition

[rad

]

Time [s]0 10 20 30

−1

−0.5

0

0.5

1 Test 4

Time [s]

Figure 9.14: Tests of the pole-placement controller on the non-linear model. Thestep input is given at time 10s. The dashed line is the vertical position and the solidline is the horizontal position. The dotted lines indicate the 5%-settling bands. Allthe transient values of the tests are found in Tab. 9.3.

−4.9

Working PointVoltage Tail

12

Working PointVoltage Main

Vertical Ref.

Saturation Main Motor

SaturationTail Motor

u_main

u_tail

theta_v

theta_h

Plant

MI* u

MI

L* u

L

1s

Integrator2

1s

Integrator1

Horizontal Ref.

FI* u

FI

F* u

F

C* u

C

B* u

B

A* u

A

Figure 9.15: The state-space controller implemented in Simulink.

Page 84: report

74 CHAPTER 9. STATE-SPACE CONTROLLER

9.3.2 Optimal Controller Design

In this section an optimal Linear Quadratic Regulator (LQR) is designed, which is alinear state-space-controller designed by minimizing a cost function. The cost function isdesigned as a weighting of the allowed amount of control effort and the allowed trackingerror of each state.

For a state-space model of the type,

x = Fx +Gu (9.30a)z = Ex (9.30b)

a simplified version of the performance index J minimized by the LRQ is given as,[Franklin et al., 2002]

J =∫ ∞

0

ρz 2(t) + u2(t)dt (9.31)

where z 2(t) is called the tracking error, u2(t) the control effort and ρ is a weightingfactor of designer’s choice.

From Eq. (9.30b) it is seen that z (t) is an output vector containing the states specifiedby the matrix E , and that u is the input to the system. Thus the minimization of theperformance index J is a compromise of regulating the states z (t) specified by E tosteady-state at zero as fast as possible using a minimum “amount” of input u(t). Henceif the performance index J has a minima, the result is a control law u(t) that stabilizesthe system states z (t) at zero. As the system is linear, the obtained control law canthen be used to stabilize the output z (t) at any desired reference point.

By adjusting ρ in the performance function the cost of control effort is weighted. Henceif the value of ρ is high, having a tracking error z 2(t) that decays slowly to zero resultsin a poor performance index in comparison of using a high amount of control effort tobring z 2(t) quickly to zero. Thus increasing ρ decreases the cost of control and gives afaster response and visa versa. This can be summarized as:

Expensive control, ρ → 0:The control law only stabilizes the system.

Cheap control, ρ →∞:The control law stabilizes and increases the speed of the system.

The reason for using the output z = Ex in the performance function and not the normaloutput y = Cx is that it may be of interest to minimize the tracking error of otherthan the output states.

It can be shown that the control law that minimizes Eq. (9.31) is a state feedback of thekind used in the controller architecture section:

u = Fx (9.32)

Thus the result of the LQR is the feedback matrix F .

The LQR function in Matlab lqr minimizes are more general form of Eq. (9.31)[Franklin et al., 2002]

J =∫ ∞

0

xTQx + uTRu dt (9.33)

Page 85: report

9.3. STATE-SPACE CONTROLLER DESIGN 75

but by setting Q = ρETE and R = I , Eq. (9.33) reduces to Eq. (9.31).

For the TRMS it is chosen to minimize the tracking error of the the following states ofthe extended state model in Eq. (9.14):

z =

a 0 0 0 0 00 b 0 0 0 00 0 c 0 0 00 0 0 d 0 00 0 0 0 e 00 0 0 0 0 f

θv,resθh,resωv,resωh,resx I

=

0 0 a 0 0 0 0 00 0 0 b 0 0 0 00 0 0 0 c 0 0 00 0 0 0 0 d 0 00 0 0 0 0 0 e 00 0 0 0 0 0 0 f

︸ ︷︷ ︸E

x e (9.34)

The values a, b, c, d, e and f are weights in the E -matrix of which states should havethe lowest tracking error.

The integrator states x I are included as they are given as the output error y − r , thusmaking them of interest to minimize. Weighting the integral states high using e and fcorresponds somewhat of adjusting the gain of an integrator in a classics PID-controller.Increasing the a, b, c and d gives a more damped output as θv,res, θh,res, ωv,res and ωh,resshould reach steady-state faster.

For the TRMS the following values weights have been chosen:

E =

0 0 8 0 0 0 0 00 0 0 12 0 0 0 00 0 0 0 5 0 0 00 0 0 0 0 3 0 00 0 0 0 0 0 19 00 0 0 0 0 0 0 14

R =[1 00 1

]ρ = 21

The feedback matrices F and F I are obtained using the Matlab command,

Fe=-lqr(Ae,Be,rho*E′*E,eye(2)), F=Fe(1:6), FI=(7:8);

Resulting in the following closed-loop poles:

p1 = −1.7 + 2.8j p3 = −0.97 + 1.4j p5 = −1.6 + 0.92j p7 = −1.1p2 = −1.7− 2.8j p4 = −0.97− 1.4j p6 = −1.6− 0.92j p8 = −2.5

These poles are plotted in Fig. 9.16 along with the region specified using the second-order approximation. It is seen that the LQR poles almost complies to the region andthat is has an extra complex pole-pair compared to the pole-placement controller.

The observer poles chosen in the pole-placement controller are also used for the LQRcontroller.

By considering the bode plot of the system in Fig. 9.18 it can be seen that there is a20dB attenuation of the couplings between the two planes, which is 10dB lower thanthe pole-placement controller. The bandwidth of the vertical and horizontal plane is1.6 .rad/s and 1.0 .rad/s respectively, hence the vertical plane has faster dynamics thanthe horizontal plane.

The model of LQR controller implemented on the linear system can be found in ap-pended document [6]. The step-response of the designed LQR controller on the linear

Page 86: report

76 CHAPTER 9. STATE-SPACE CONTROLLER

−3.5 −3 −2.5 −2 −1.5 −1 −0.5 0−3

−2

−1

0

1

2

3

Real Axis

Imag

inar

y A

xis

Vertical planeHorizontal planeClosed−loop poles

Figure 9.16: A plot of the region delineated by the transient requirements of asecond-order system and the closed-loop poles of the LQR.

system is seen in Fig. 9.17, where the rise times and settling times are more than asecond faster than the minimum requirements in Tab. 9.1. The peak responses of thehorizontal position when the vertical is stepped and visa versa are also lower than theallowed 0.1rad.

The integrator anti-windup circuit designed for the pole-place controller is also used forthe LQR controller, making the controller ready to be tested on the non-linear model.

0

0.2

0.4

0.6

0.8

1

Step: Vertical Position

Ver

tical

Pos

ition

[ra

d]

Step: Horizontal Position

0 2 4 6Time [s]

0 2 4 60

0.2

0.4

0.6

0.8

1

Time [s]

Hor

izon

tal P

ositi

onl [

rad]

tr=1.3s

ts=2.4s

ts=3.8s

tr=2.1sPeak=0.064rad

Peak=0.055rad

Figure 9.17: The step responses from each input to the two outputs. The dashedlines indicate the settling time, the dash-dot lines indicate the rise time and thedotted lines are the reference inputs.

Page 87: report

9.3. STATE-SPACE CONTROLLER DESIGN 77

−200

−100

0Step: Vertical Reference

Ver

tical

Pos

.

−360−180

0180360

Ver

tical

Pos

.

−300

−200

−100

0

Hor

izon

tal P

os.

10−2

100

102

−360

−180

0

180

Hor

izon

tal P

os.

Step: Horizontal Reference

10−2

100

102

104

−20.3dBω=1.75rad/s

−20.5dBω=1.10rad/s

−3dBω=1.60rad/s

−3dBω=1.05rad/s

Figure 9.18: Bode plots of the LQR controller. The minimum attenuation fromthe vertical input to the horizontal output is 20.5dB and 20.3dB from horizontal tovertical. This results in some decoupling of the dynamics between the two planes.

Verification of LQR Controller

The LQR controller is implemented in Simulink in the same manner as the pole-placement controller in Fig. 9.15, and can be found in appended document [7]. Usingthe non-linear model derived in Part II as plant, four step-tests are simulated on theLQR controller using the procedures described in Tab. 9.2.

The simulated responses are plotted in Fig. 9.19 and the transient results are listedin Tab. 9.4. The test results show that all rise and settling times are at least twoseconds faster than specified by the minimum requirements and the greatest overshootis 10% which also complies. Hence the system meets all the requirements, making thecontroller ready for implementaion on the physical system along with the pole-placementcontroller.

Testnumber

Verticalrise time[s]

Verticalsettlingtime [s]

Verticalovershoot[%]

Horizontalrise time[s]

Horizontalsettlingtime [s]

Horizontalovershoot[%]

1 1.4 2.4 2.4 - 2.8 102 - 2.4 5.2 2.2 3.5 1.63 1.2 2.0 1.9 2.2 3.5 1.54 1.4 2.9 3.2 2.3 3.4 0.13

Table 9.4: Table of the transient values settling time, overshoot and rise time forthe LQR controller simulated on the non-linear model. All values complies with therequirements in Tab. 9.1

Page 88: report

78 CHAPTER 9. STATE-SPACE CONTROLLER

0 10 20 30

−0.4

−0.2

0

0.2Test 1

Pos

ition

[rad

]

0 10 20 30

−0.5

0

0.5

Test 2

0 10 20 30

−0.5

0

0.5

Test 3

Time [s]

Pos

ition

[rad

]

0 10 20 30

−0.5

0

0.5

Test 4

Time [s]

Figure 9.19: Tests of the LQR controller on the non-linear model. The step inputis given at time 15s. The dashed line is the vertical position and the solid line isthe horizontal position. The dotted lines indicate the ±5%-settling bands. All thetransient values of the tests are found in Tab. 9.4.

9.3.3 Test and Implementation of State-Space Controllers onthe TRMS

Both controllers are implemented in Simulink as in Fig.9.15 on the computer connectedto the TRMS, where the plant of the Simulink model is replaced with the TRMSsoftware, see App. G. This software is based on a RTK that collects data from thesensors attached to the TRMS.

The sample rate of the system is selected to 125Hz.

A test is performed for each controller on the physical system, where the system isstepped from its resting point to the working point. The step response of the pole-placement controller is seen in Fig. 9.20 and the response of the LQR in Fig. 9.21. It isseen that both tests comply to the requirements with a margin more than a second inboth rise and settling times.

The vertical position of the LQR has a shorter rise time than the pole-placement con-troller as expected, since the bandwidth of the LQR is 1.6rad/s while the pole-placementcontroller has 1.0rad/s. But the pole-placement controller has a shorter rise time in thehorizontal position than the LQR, though they have approximately the same bandwidth.The reason might be that when the LQR controller settles the vertical position fast, thedisturbance to the horizontal position is greater than experienced in the pole-placement,thus slowing the settling of the horizontal position down in the LQR.

As both controllers works on the TRMS they are ready to be acceptance tested in thefollowing part.

Page 89: report

9.3. STATE-SPACE CONTROLLER DESIGN 79

0 5 10 15 20 25

−0.6

−0.5

−0.4

−0.3

−0.2

−0.1

0

Time [s]

Ver

tical

Pos

ition

[rad

]

0 5 10 15 20 25−0.1

0

0.1

0.2

0.3

0.4

0.5

Time [s]

Hor

izon

tal P

ositi

on [r

ad]

ts=3.8s

ts=3.8s

tr=2.1s

tr=2.1s

Figure 9.20: Step response of the pole-placement controller when stepped at time10s from resting point to working point.

0 5 10 15 20 25

−0.6

−0.5

−0.4

−0.3

−0.2

−0.1

0

Time [s]

Ver

tical

Pos

ition

[rad

]

0 5 10 15 20 25−0.1

0

0.1

0.2

0.3

0.4

0.5

Time [s]

Hor

izon

tal P

ositi

on [r

ad]

tr=1.1s

tr=2.4s t

s=4.2s

ts=2.6s

Figure 9.21: Step response of the LQR controller when stepped at Time=10s fromresting point to working point.

Page 90: report

80 CHAPTER 9. STATE-SPACE CONTROLLER

Summary of State-Space Controller Design

The scope of this chapter was to design two state-space controllers.

In order to do so, a state-space model of the TRMS was derived using the differentialequation describing the system derived in Part II. The states of the system were chosenso the “energy storages” of the TRMS are represented, yielding a 6th order system.The states are the angular velocity of the main and tail motor, vertical and horizontalposition of the TRMS and vertical and horizontal velocity of the TRMS.

The derived model was found to be controllable, meaning that any desired output couldbe obtained using the correct input.

Having obtained the state model, an observer based state-space controller architecturewith integral control and integrator anti-windup was developed. The integral controlwas added to the two outputs to give a steady-state error of zero. This increased theorder of the system by two.

As not all of the system states can be measured a full-order observer was designed toestimate all the states. In that regard the system was found observable, meaning thatall states could be estimated using the two measured output along with a full-ordermodel of the system

In addition, an integrator anti-windup circuit was included in the controller architecture.

Having the controller architecture ready, two controllers were designed using two differ-ent methods.

In the first design, a state-space controller was designed using pole-placement, where theclosed-loop poles of the system are placed in desired s-domain locations. The desiredclosed-loop pole locations was found using a second-order system approximation to yielda region in the s-domain where the closed-loop poles of the system should be placed inorder to comply to the specified requirements.

A design was made that complied to the requirements when tested on both the linearand non-linear model, and the one test performed on the physical system.

The second design was based on an optimal control design, where the state-space con-troller was designed by minimizing a cost function. The controller was designed usingMatlab’s LQR-function.

This also resulted in a controller in compliance to the requirements when tested on boththe linear and non-linear model, and the one test performed on the physical system.

Hence the two controllers are ready to be acceptance tested.

Page 91: report

Summary of Part III

In this part a classic, a state-space pole placement and a state-space LQR controllerwere designed.

The design approach when designing the classic controller was to design two controllerswhich repress the cross-couplings between the two planes. This should ensure that anychanges in one plane does not affect the other plane. With the two planes separated itis possible to design two controllers which control either the horizontal or the verticalplane. After the design phase the controllers were tested with the non-linear modelin Simulink, which showed that the controllers did not fulfill the requirements. Thisresulted in additional hand tuning of the controllers which improved the performancealthough the controllers never fulfilled the requirements stated in the requirement spec-ification.

Two state-space controllers were designed using two different design approaches. Thelinear plant was converted into a state-space representation, which allowed the twocontrollers to be designed. The demands to the pole-placement controller emanatefrom the transient requirements which is delineated in the s-domain in order to findvalid locations of the poles. By placing the poles to the left of the delineated region,the controller should adhere to the requirement specification. Tests on the non-linearmodel showed that the controller did fulfill the requirement specification and hence thecontroller is ready to be acceptance tested.

The LQR controller design method is to minimize a cost function. This cost functionis a weighting of the allowed control effort and the allowed tracking error of each state.By tuning the weighting factors a satisfactory result has been achieved. This controllerwas also tested on the non-linear model and the test showed that the controller met therequirements and hence this controller is ready to be acceptance tested.

81

Page 92: report
Page 93: report

Part IV

System Testing and Summary

In this part, the controllers are tested against the physical TRMS to verify if the tran-sient response of the system adhere to the requirement specification set up in part I.

A conclusion will summarize the steps taken to implement the controllers and the resultsfound in the acceptance test. Finally, a closing statement will reflect on the results ofthe project.

Page 94: report

Chapter 10Acceptance Test

In this chapter it is verified if the controllers comply with the requirement specificationin Ch. 2.

In order to test the designed controllers they are implemented in Simulink as seen inFig. 10.1. The reference signal to the controllers can switch between a step and a sinewave. The reference signals to the vertical and horizontal part are fed to the controllertogether with the actual position of the TRMS. The output from the controller is thevoltage to the DC-motor which is transformed by the voltage mapping before it is sentto the Real Time Task which takes care of all the communication with the TRMS.

Step

Step

Sine

Sine

Switch

Switch

In Out

Voltage Map

Feedback

ReferenceOut

Controller

Real Time Task

Position

Figure 10.1: Controller implementation in Simulink. The Real Time Task takescare of all communication with the TRMS. The controllers are implemented as acontinuous model with a step or a sine as input. The output from the controllers aremapped in the voltage map before sent to the Real Time Task.

The acceptance test is divided into three identical test procedures as both the classiccontroller, state-space pole-placement and state space LQR controller are tested. Allthree controllers are tested using the same procedure in order to verify both if they fulfillthe requirement specification and also to test the performance of the three controllersagainst each other.

One test is performed in order to show that the TRMS is stable and settles in the workingpoint. This test is performed by letting the system rest and setting the reference to theworking point of both the vertical and horizontal part. In order to test the controllersability to move from one position to another the system is given a small step in thevertical part, horizontal part and both parts separately. To test the systems stabilitythe same tests are performed with greater steps to both the vertical and horizontal partat the same time. Finally the systems ability to track a path is tested. This is achievedby selecting a sine wave as reference input.

A list of the tests performed are shown in Tab. 10.1. The steps specified in the table

84

Page 95: report

85

Test number Input to vertical position Input to horizontal position1 RP → WP RP → WP2 −0.4rad → 0rad 0rad3 0rad → −0.4rad 0rad4 0rad −0.3rad → 0.3rad5 0rad 0.3rad → −0.3rad6 −0.4rad → 0rad −0.3rad → 0.3rad7 −0.4rad → 0rad 0.3rad → −0.3rad8 0rad → −0.4rad −0.3rad → 0.3rad9 0rad → −0.4rad 0.3rad → −0.3rad10 −0.4rad → 0.2rad −1.0rad → 1.0rad11 −0.4rad → 0.2rad 1.0rad → −1.0rad12 0.2rad → −0.4rad −1.0rad → 1.0rad13 0.2rad → −0.4rad 1.0rad → −1.0rad14 −0.1 + 0.3 sin(0.42t)rad 0.5 sin(0.42t)rad15 −0.1 + 0.3 cos(0.42t)rad 0.5 sin(0.42t)rad

Table 10.1: A list of all the tests which is performed on the TRMS with the threedifferent controllers.

are given at the same time to both the main- and tail controller. All of the test resultsare found on the following pages in small figures, while detailed pictures are found inappended document [8] for more thorough inspection. Each acceptance test is endedwith a discussion concerning the test results. Resting point and working point areabbreviated RP and WP, respectively.

Acceptance Test of the Classic Controller

Throughout the test of the classic controller a solid line indicates the horizontal positionand a dashed line indicates the vertical position, except in test 14 and 15 where thedashed line indicates the position and the solid line indicates the reference. The stepis applied after 20s. The sines in test 14 and 15 are applied at 0s. Each figure alsocontains the ±5%-settling band for each position.

Page 96: report

86 CHAPTER 10. ACCEPTANCE TEST

Testnumber

Verticalrise time[s]

Verticalsettlingtime [s]

Verticalovershoot[%]

Horizontalrise time[s]

Horizontalsettlingtime [s]

Horizontalovershoot[%]

1 5.2 11.3 6.8 1.2 2.5 3.82 3.5 6.0 0.0 - 0.0 4.63 4.5 6.5 0.0 - 7.7 8.74 - 2.6 10.7 1.3 10 205 - 2.3 9.2 0.9 9.0 406 4.0 10 6.0 1.5 12 707 4.3 8.5 10 1.0 13 758 5.0 9.5 6.0 1.3 8.5 759 5.5 7.0 5.0 1.0 13 100

10 4.5 7.5 7.5 1.4 5.0 3.511 4.5 9.0 11 1.5 11 1012 4.8 6.0 5.0 1.8 6.5 2.513 5.4 7.0 5.0 1.5 6.0 2014 - - - - - -15 - - - - - -

Table 10.2: Table of the settling time, overshoot and rise time for the classiccontroller. Note that results exceeding the requirements are written in bold.

10 15 20 25 30 35 40 45 50

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

Time [s]

Pos

ition

[rad

]

Test 1

Figure 10.2: The result of test 1 of the classic controller.

Page 97: report

87

15 20 25 30 35

−0.6

−0.4

−0.2

0

0.2

0.4

Pos

ition

[rad

]

Test 2

15 20 25 30 35 40

−0.6

−0.4

−0.2

0

0.2

0.4

Test 3

15 20 25 30 35

−0.6

−0.4

−0.2

0

0.2

0.4

Time [s]

Pos

ition

[rad

]

Test 4

15 20 25 30 35

−0.6

−0.4

−0.2

0

0.2

0.4

Time [s]

Test 5

Figure 10.3: The results of test 2 to 5 of the classic controller

15 20 25 30 35 40

−0.6

−0.4

−0.2

0

0.2

0.4

Pos

ition

[rad

]

Test 6

15 20 25 30 35 40

−0.6

−0.4

−0.2

0

0.2

0.4

Test 7

15 20 25 30 35 40

−0.6

−0.4

−0.2

0

0.2

0.4

Time [s]

Pos

ition

[rad

]

Test 8

15 20 25 30 35 40

−0.6

−0.4

−0.2

0

0.2

0.4

Time [s]

Test 9

Figure 10.4: The results of test 6 to 9 of the classic controller

Page 98: report

88 CHAPTER 10. ACCEPTANCE TEST

15 20 25 30 35 40−1.5

−1

−0.5

0

0.5

1

1.5

Pos

ition

[rad

]

Test 10

20 30 40−1.5

−1

−0.5

0

0.5

1

1.5Test 11

15 20 25 30 35 40−1.5

−1

−0.5

0

0.5

1

1.5

Time [s]

Pos

ition

[rad

]

Test 12

15 20 25 30 35 40−1.5

−1

−0.5

0

0.5

1

1.5

Time [s]

Test 13

Figure 10.5: The results of test 10 to 13 of the classic controller

0 20 40 60

−0.5

0

0.5

Pos

ition

[rad

]

Test 14

0 20 40 60

−0.5

0

0.5

Test 14

0 20 40 60

−0.5

0

0.5

Time [s]

Pos

ition

[rad

]

Test 15

0 20 40 60

−0.5

0

0.5

Time [s]

Test 15

Figure 10.6: The results of test 14 and 15 of the classic controller. The first columnis the vertical position and the second column is the horizontal position.

Page 99: report

89

Results of Classic Controller Acceptance Test

As seen in Fig. 10.2 the classic controller regulates the TRMS and stabilize it at theworking point without significant oscillation. However it is not able to do so within therequirements in the vertical plane, and hence it fails the test.

Throughout the rest of the tests depicted in Fig. 10.3 to Fig. 10.5 and seen in Tab. 10.2,the classic controller does not fulfill the requirement specification in any test conductedexcept test 2. The controller has no problems with complying to the steady-state errorrequirements and the rise time is well within the limits. However, the horizontal partsuffers from overshoot in general, and the controller does not dampen the system enoughwhich leads to overshoot and a long settling time. The vertical part does not suffer fromthe settling problem but the controller is simply not fast enough.

The assumption made in the design phase of the classic controller that Cvh and Chvshould eliminate the effect of the cross-coupling is proved wrong in Fig. 10.3. Fromthese graphs it is seen that a step in one plane affect the position in the other. This isespecially clear when the reference to the tail rotor is changed hence it is especially Chvwhich fails. This error has not been possible to eliminate.

In test 14-15 where the system should follow a sine wave the horizontal part does followthe sine almost perfectly where the vertical part is out of phase with about π/2 radand it does not reach the amplitude of the reference signal. One of the problems isthat the horizontal controller is much more aggressive than the vertical controller. Thisresult in the horizontal controller is much better at tracking the sine wave but this alsointroduces a significant disturbance in the vertical plane. Even though it is visible thatthe classic controller is able to track a path it does not perform acceptable in the verticalplane and hence it fails the last two test. Hence the classic controller does not meet therequirements.

Acceptance Test of the State-Space Pole-Placement Con-troller

Throughout this test a solid line indicates the horizontal position and a dashed lineindicates the vertical position, except in test 14 and 15 where the dashed line indicatesthe position and the solid line indicates the reference. The step is always applied to theTRMS after 25s. In test 14 and 15 the sines are applied at 0s. The step time is givensimultaneously to both the vertical and horizontal part. Each figure also contains the±5%-settling band for each position.

Page 100: report

90 CHAPTER 10. ACCEPTANCE TEST

Testnumber

Verticalrise time[s]

Verticalsettlingtime [s]

Verticalovershoot[%]

Horizontalrise time[s]

Horizontalsettlingtime [s]

Horizontalovershoot[%]

1 2.5 4.0 3.0 3.2 3.8 2.22 2.6 3.7 0.0 - 0.0 3.93 3.2 4.2 0.0 - 4.0 7.74 - 3.2 8.2 2.7 3.6 2.55 - 3.1 7.7 3.2 3.7 2.06 3.0 4.4 0.0 2.8 3.4 3.07 3.0 4.2 0.0 3.5 4.0 1.78 3.5 4.7 0.0 3.0 3.7 0.09 4.0 4.1 0.5 2.7 3.5 0.0

10 4.0 4.6 5.3 3.0 3.9 2.711 1.5 5.0 10 3.8 4.3 0.012 4.2 4.7 0.0 3.0 3.8 0.013 3.5 5.0 0.0 3.2 4.0 0.014 - - - - - -15 - - - - - -

Table 10.3: Table of the settling time, overshoot, and rise time for the state-spacepole-placement controller.

15 20 25 30 35 40 45 50−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

Time [s]

Pos

ition

[rad

]

Test 1

Figure 10.7: The results of test 1 of the state-space pole-placement controller

Page 101: report

91

20 30 40 50−1

−0.5

0

0.5

Pos

ition

[rad

]

Test 2

20 30 40 50−1

−0.5

0

0.5Test 3

20 30 40 50−1

−0.5

0

0.5

Time [s]

Pos

ition

[rad

]

Test 4

20 30 40 50−1

−0.5

0

0.5

Time [s]

Test 5

Figure 10.8: The results of test 2 to 5 of the state-space pole-placement controller

20 30 40 50−1

−0.5

0

0.5

Pos

ition

[rad

]

Test 6

20 30 40 50−1

−0.5

0

0.5Test 7

20 30 40 50−1

−0.5

0

0.5

Time [s]

Pos

ition

[rad

]

Test 8

20 30 40 50−1

−0.5

0

0.5

Time [s]

Test 9

Figure 10.9: The results of test 6 to 9 of the state-space pole-placement controller

Page 102: report

92 CHAPTER 10. ACCEPTANCE TEST

20 30 40 50−1.5

−1

−0.5

0

0.5

1

1.5

Pos

ition

[rad

]

Test 10

20 30 40 50−1.5

−1

−0.5

0

0.5

1

1.5Test 11

20 30 40 50−1.5

−1

−0.5

0

0.5

1

1.5

Time [s]

Pos

ition

[rad

]

Test 12

20 30 40 50−1.5

−1

−0.5

0

0.5

1

1.5

Time [s]

Test 13

Figure 10.10: The results of test 10 to 13 of the state-space pole-placement con-troller

0 20 40 60

−0.5

0

0.5

Pos

ition

[rad

]

Test 14

0 20 40 60

−0.5

0

0.5

Test 14

0 20 40 60

−0.5

0

0.5

Time [s]

Pos

ition

[rad

]

Test 15

0 20 40 60

−0.5

0

0.5

Time [s]

Test 15

Figure 10.11: The results of test 14 to 15 of the state-space pole-placement con-troller. The first column is the vertical position and the second column is the hori-zontal position.

Page 103: report

93

Results of State-Space Pole Placement Controller AcceptanceTest

As seen in Fig. 10.12 to Fig. 10.15 and summarized in Tab. 10.3 the state-space pole-placement controller fulfill the requirement specification in all the tests except in test11. In test 11 is the steady-state error above the required ±0.02rad. This error has notbeen possible to eliminate.

In test 14 and 15 the controller follows both the vertical and horizontal position quitewell in amplitude but has a constant error in phase. Despite this error the performanceof the state-space pole placement controller is acceptable and hence does fulfill therequirements in test 14 and 15. The phase error occurs due to the fact that the systemis a Type I system. Such a system does only have a steady state error equal to zerowith a step as input. As the input is not at step but a sine wave and the steady stateerror is a constant, this could be interpret as the input is a Type II input and hence theconstant steady-state error. This could be removed by adding at least one integratormore to the system.

The tests showed that the State-Space controller meet all the requirements, except fora steady-state error in the horizontal position in test 13 of 0.07rad.

Acceptance Test of the State-Space LQR Controller

Throughout this test a solid line indicates the horizontal position where a dashed lineindicates the vertical position, except in test 14 and 15 where the dashed line indicatesthe position and the solid line indicates the reference. The step is always applied after25s. In test 14 and 15 the sines are applied at 0s. The step time is given simultaneouslyto both the vertical and horizontal part. Each figure also contains the ±5%-settlingband for each position.

Testnumber

Verticalrise time[s]

Verticalsettlingtime [s]

Verticalovershoot[%]

Horizontalrise time[s]

Horizontalsettlingtime [s]

Horizontalovershoot[%]

1 2.8 3.9 8.5 2.7 4.0 2.92 2.0 2.3 0.7 - 3.3 9.33 2.8 3.2 2.0 - 6.6 204 - 1.3 4.2 3.2 3.8 2.25 - 2.2 4.5 3.2 3.9 1.76 1.8 2.4 4.5 2.3 3.3 4.37 1.7 2.7 1.5 3.3 4.2 2.28 3.0 3.3 1.2 2.7 5.1 5.79 2.5 3.1 3.8 2.1 6.0 0.0

10 1.2 5.2 10 2.5 3.6 3.311 2.2 3.4 3.8 2.6 4.2 1.512 2.5 3.7 5.0 2.2 3.7 0.013 2.0 3.9 9.5 2.5 3.7 0.014 - - - - - -15 - - - - - -

Table 10.4: Table of the settling time, overshoot, and rise time for the state-spaceLQR controller. Note that results exceeding the requirements are written in bold.

Page 104: report

94 CHAPTER 10. ACCEPTANCE TEST

15 20 25 30 35 40 45 50−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

Time [s]

Pos

ition

[rad

]Test 1

Figure 10.12: The results of test 1 of the state-space LQR controller

20 30 40 50−1

−0.5

0

0.5

Pos

ition

[rad

]

Test 2

20 30 40 50−1

−0.5

0

0.5Test 3

20 30 40 50−1

−0.5

0

0.5

Time [s]

Pos

ition

[rad

]

Test 4

20 30 40 50−1

−0.5

0

0.5

Time [s]

Test 5

Figure 10.13: The results of test 2 to 5 of the state-space LQR controller

Page 105: report

95

20 30 40 50−1

−0.5

0

0.5

Pos

ition

[rad

]

Test 6

20 30 40 50−1

−0.5

0

0.5Test 7

20 30 40 50−1

−0.5

0

0.5

Time [s]

Pos

ition

[rad

]

Test 8

20 30 40 50−1

−0.5

0

0.5

Time [s]

Test 9

Figure 10.14: The results of test 6 to 9 of the state-space LQR controller

20 30 40 50−1.5

−1

−0.5

0

0.5

1

1.5

Pos

ition

[rad

]

Test 10

20 30 40 50−1.5

−1

−0.5

0

0.5

1

1.5Test 11

20 30 40 50−1.5

−1

−0.5

0

0.5

1

1.5

Time [s]

Pos

ition

[rad

]

Test 12

20 30 40 50−1.5

−1

−0.5

0

0.5

1

1.5

Time [s]

Test 13

Figure 10.15: The results of test 10 to 13 of the state-space LQR controller

Page 106: report

96 CHAPTER 10. ACCEPTANCE TEST

0 20 40 60

−0.5

0

0.5

Pos

ition

[rad

]

Test 14

0 20 40 60

−0.5

0

0.5

Test 14

0 20 40 60

−0.5

0

0.5

Time [s]

Pos

ition

[rad

]

Test 15

0 20 40 60

−0.5

0

0.5

Time [s]

Test 15

Figure 10.16: The results of test 14 to 15 of the state-space LQR controller. Thefirst column is the vertical position and the second column is the horizontal position.

Results of State-Space LQR Controller Acceptance Test

As seen in Fig. 10.12 to Fig. 10.15 and Tab. 10.4 the controller has no problems withthe steady-state error but fails test 3 due to both overshoot and settling time in thehorizontal plane. The state-space LQR controller is slightly more aggressive in thevertical plane than in the horizontal plane. This is seen in test 2 and 3 where thehorizontal position oscillates more heavily, that the vertical position does in test 4 and5.

The fact that the state-space LQR controller is more aggressive in the vertical planethan in the horizontal plane, is in general seen in the vertical rise times versus thehorizontal rise times in Tab. 10.4. It is only the cross-coupling from the vertical to thehorizontal plane which does not dampen the system sufficiently and hence lead to theovershoot in test 3.

It can also be seen that in test 14 and 15 the vertical controller is more aggressive thanthe horizontal. In test 14 the vertical part follows the sine in amplitude but suffersfrom phase delay such as the pole-placement controller. The horizontal part does alsosuffer from a phase delay but does not reach the same amplitude as the reference. Asthe input is a TYPE higher than the system is has a constant steady-state. When theinput to the vertical part is a cosine, as in test 15, the vertical part follows the cosinefine while the horizontal part has even harder with reaching the same amplitude as thereference. Hence does the state-space LQR controller not perform acceptable in test 15.

The state-space LQR controller meets most of the requirements but not all, and hencefails the acceptance test.

Page 107: report

97

Discussion of the Results

This section will compare the results obtained from the acceptance test of the threecontrollers. The two state-space controllers performed significantly better than theclassic controller. This was expected as the classic controller has to be designed as twoSISO systems whereas the state-space can handle a MIMO system.

One of the reasons why the classic and state-space LQR controller cannot comply withthe requirements is that they control faster in one plane than the other. This canbe experienced as the classic controller priorities the horizontal plane higher than thevertical plane, whereas the state-space LQR controller priorities the vertical plane. Thisresults in too long settling times in the opposite plane, because of the disturbance fromcontrolling fast in the opposite plane.

An explanation as to why the state-space pole-placement controller cannot comply withthe steady-state requirement in test 11 has not been found.

Page 108: report

Chapter 11Conclusion

The main objective of this project was to develop a controller to the Twin Rotor MIMOSystem. This was achieved by using both classic and state-space methods. A lin-ear and non-linear model was produced, and model parameters were estimated usingSenstools. In order to simplify the development process the model was split intothree subparts for both vertical plane and horizontal plane; an electrical part, an aero-dynamic part, and a mechanical part, each to be modelled separately. The final modelswere shown to approximate the actual model output to a satisfactory degree, allowingfor the controller design to be based upon these models. The controller design wasdivided into a classic controller and two state space controllers (pole-placement andLQR), in order to perform a comparison of these methods.

As stated in Part III, a classic and two state-space controllers are implemented inSimulink and run on the actual TRMS. The test results in the acceptance test showedthat the classic controller was able to control the system, and tracking a specific trajec-tory, but had problems meeting the requirements set in the requirement specification.The performance of the classic controller was improved greatly by hand tuning the con-troller, and by removing the differential control. The improvements due to removingthis control is concluded to be due to the quantization of the sensor outputs as theconsequence of this stair-case signal is that the differential parts gain too much influ-ence on the system. Despite this improvement however, the controller still does notcomplete the tests successfully, and does not meet the specified requirements. In par-ticular it had problems with the horizontal overshoot and vertical settling time. Thehorizontal overshoot requirement of 10% failed in 7 of the 13 tests, reaching 100% over-shoot in a single test. The vertical settling time of 6s was exceeded in 9 of the 13 testswith a settling time of up to 11.3s. In total only a single test passed all the requirements.

Both state-space controllers performed better than the classic controller. The state-space pole-placement controller passed all the tests except test 13 due to steady-stateerror. The state-space LQR controller also failed a single test as a result of an overshootin the horizontal plane exceeding the specified maximum of 10% with an overshoot of20%. In the same test the required horizontal settling time of 6s failed with 0.6s as well.This is concluded to be primarily due to the state-space LQR controller not dampeningthe cross-coupling adequately. This is supported by the step response in Fig. 9.17, andthe bode plot in Fig. 9.18, of the system with the state-space LQR controller.

Even though non of the controllers were able to meet the specified requirements, theimplementation is considered a success as the pole-placement and LQR controller metall the requirements except one, and all of the designed controllers are functional andresponds well to external influences and changes in reference input.

98

Page 109: report

Chapter 12Closing Statement

The purpose of this chapter is to take into consideration which improvements should bemade to the developed controllers in order to make them useful in other applications.

Most importantly the system should meet the requirement specification. As the state-space controllers are superior to the classic controller, further work should be con-centrated on the state-space controllers. It has not been possible to determine whichfurther improvements could be made to the state-space pole-placement controller. Theovershoot and settling time error of the state-space LQR controller is due to the cross-couplings between the planes which can be removed by designing the controller so thespeed of both planes are equal. However, this leads to the same steady-state errorexperienced in the state-space pole-placement controller.

The closest application to what the TRMS mimic is a model helicopter. To developthe designed model further to a model helicopter, would require a completely newmechanical model since the physical appearance and the mass distribution in relationto the rotors placement, is very different from the TRMS. A model helicopter will alsobe able to roll which will require another controller to stabilize this angle. Hence morecontrollers are needed and the design will be different. In spite of this the experiences,gained from controlling a MIMO system with cross-couplings and the affect of changingone angle depend on another angle, will be significant when designing controllers forany MIMO systems. The most important experience made is choosing a state-spacedesign method whenever enough information about the system is available.

Implementing the controllers on a model helicopter will also require that they are trans-formed into differential equations. This enables the use of a microprocessor where theapplication can run in real time. Another advantage is that there is no need to buy aMatlab license to every helicopter making mass production cheaper.

These experiences made from designing controllers to a MIMO system with cross cou-plings will not only be useful in controlling a model helicopter. Lots of others applica-tions require knowledge in this area even though the models and hence the controllersare quite different from those made in this report. Therefore the final statement in thisreport must be that the controllers in this report are not useful in any other applicationsthan on the TRMS, but the experiences made in designing the controllers can be usedin many very different applications.

99

Page 110: report

References

[Andersen and Pedersen, 2005] Andersen, P. and Pedersen, T. S. (2005). Modeldan-nelse. Lecture note for the course “Modelling” at 6th semester at the Department ofControl Engineering, Aalborg University.

[Anderson and Eberhart, 2004] Anderson, D. and Eberhart, S. (2004). A physical de-scription of flight. http://www.aa.washington.edu/faculty/eberhardt/lift.htm.

[Bateson, 1996] Bateson, R. N. (1996). Introduction to Control System Technology.Prentice-Hall, Inc., 5th edition. ISBN 0-13-226275-4.

[Franklin et al., 2002] Franklin, G. F., power, J. D., and Emani-Naeini, A. (2002). Feed-back Control of Dynamic Systems. Prentice Hall, 4th edition. ISBN 0-13-098041-2.

[Knudsen, 2004] Knudsen, M. (2004). Experimental Modelling of Dynamic Systems.Lecture note for the course “Simulation and Experimental Modelling” at 6th semesterat the Department of Control Engineering, Aalborg University.

[Knudsen and Jensen, 1995] Knudsen, M. and Jensen, J. G. (1995). Estimation of Non-linear DC Motor Models Using a Sensitivity Approach. Article.

[Serway and Jewett, 2004] Serway, R. A. and Jewett, J. W. (2004). Physics for Scientistand Engineers. David Harris, 6th edition. ISBN 0-534-40949-0.

[Stoustrup, 2006] Stoustrup, J. (2006). State Space Methods. Course material for “StateSpace Methods” at 6th semester at the Department of Control Engineering, AalborgUniversity (See appended document [9]).

[Walker and Jenkins, 1997] Walker, J. F. and Jenkins, N. (1997). Wind Energy Tech-nology. John Wiley & Sons. ISBN 0-471-96044-6.

100

Page 111: report

Appended Documents

[1] Video clip of the TRMS with the designed controllersCD-ROM path: \video\

[2] Non-linear model of the TRMS with classic controllerCD-ROM path: \models\classic\

[3] Linear model of the TRMS with classic controllerCD-ROM path: \models\classic\

[4] Linear model of the TRMS with pole-placement controllerCD-ROM path: \models\state-space\

[5] Non-linear model of the TRMS with pole-placement controllerCD-ROM path: \models\state-space\

[6] Linear model of the TRMS with LQR controllerCD-ROM path: \models\state-space\

[7] Non-linear model of the TRMS with LQR controllerCD-ROM path: \models\state-space\

[8] Detailed figures of the accepttestCD-ROM path: \accepttest.pdf

[9] Course material for “State Space Methods” at 6th semester at the Department ofControl Engineering, Aalborg UniversityCD-ROM path: \state-space slides\

[10] MATLAB scripts used for determining DC motor parameters.CD-ROM path: \mfiles\DCmotor\

[11] MATLAB scripts used for determining the vertical parameters of the TRMS.CD-ROM path: \mfiles\mechanics\

[12] MATLAB scripts used for determining the horizontal parameters of the TRMS.CD-ROM path: \mfiles\mechanics\

[13] Twin Rotor MIMO System - Reference ManualCD-ROM path: \manual\330072M5.pdf

[14] Twin Rotor MIMO System - External InterfaceCD-ROM path: \manual\330073M5.pdf

101

Page 112: report
Page 113: report

Part V

Appendix

Page 114: report

Appendix ASystem Performance Test

The purpose of this appendix is to perform tests on the system, from which reasonablerequirements to the TRMS can be deduced. Furthermore, the working point velocitiesof the rotors are found.

The function hl is called from Matlab, providing a Simulink interface to the TRMS,which is modified to measure the position of the TRMS and angular velocities of therotors. The model is seen Fig. A.1.

theta_v

Vertical position

t_tail

Time to workspace

Tail input Real Time Task

MuxMain input

theta_h

Horizontal position

Demux

Demux

Demux

Clock

w_tail

Angular velocityof tail rotor

w_main

Angular velocityof main rotor

Figure A.1: Simulink model used for system performance test.

First the angular velocities of the rotors in the working point are determined by stepwiseincreasing the input until the vertical and horizontal position of the TRMS is in theworking point. This leads to the following values.

ωm = 54rads

ωt = −44rads

(A.1)

Secondly the TRMS is positioned in its resting point, locked in the horizontal planeand given a maximum voltage to the main rotor to see its vertically response until it isphysically blocked and vise versa. The results are depicted in Fig. A.2a.

Figure A.2a shows that it takes the main rotor about 2.5s to reach the end point,and 2.8s for the tail rotor. The bandwidth of the system is found by calculating themaximum velocity of the system. It is found to be 2rad/s for the horizontal plane and1.12rad/s for the vertical plane.

104

Page 115: report

105

0 1 2 3−1

−0.5

0

0.5

1

1.5

Time [s]

Pos

ition

[rad

]

Main rotor (a)

0 1 2 30

0.5

1

1.5

2

2.5

3

Time [s]

Pos

ition

[rad

]

Tail rotor (a)

0 20 40 60−1

−0.5

0

0.5

Time [s]

Pos

ition

[rad

]

Main rotor (b)

0 20 40 60−0.5

0

0.5

1

Time [s]

Pos

ition

[rad

]

Tail rotor (b)

Figure A.2: (a): Response to maximum input to the main and tail rotor. (b):The open-loop step response in both planes when given a step from resting point toworking point at the same time in both planes.

Finally the TRMS is given an open-loop input which will bring it from resting pointto the working point. These results are depicted in Fig. A.2b. It is seen that the mainrotor settles after approximate 30s, but never oscillates with less than ±5% of the stepsize and the tail rotor never settles within a reasonable margin.

Conclusion

The TRMS is in its working point when the rotors rotates at ωm = 54 rad/s andωt = −44rad/s.

For a larger step in the vertical direction the TRMS cannot have rise time faster than2.5s, hence the rise time in this plane must be close to but above this time. For a largerstep in the horizontal direction the TRMS cannot have a rise time faster than 2.8s,hence the rise time in this plane must be close to but above this time.

When the TRMS receives an open-loop step it never settles within ±5% in either planes.Hence one of the requirements in this project is to keep the TRMS within this marginin both planes, and thus the settling time is defined as when the oscillations are lessthan ±5% of the step.

Page 116: report

Appendix BParameter Estimation of the DCMotors

The purpose of this appendix is to obtain the parameters values of the two DC motorswith rotors. The values are determined by measuring the motor response and then useSenstools to estimate the model parameters. The models used are derived in Ch. 5.TheMatlab files used in the parameter estimation can be found in appended document[10].

In order to obtain accurate parameter estimates the following five-step procedure is usedfor both motors:

1. Obtain a step response of the motor with load to get an estimate of the timeconstant.

2. Design a suitable input signal for parameter estimation using the approximatetime constant and knowledge about the system. Apply the signal to the motorand measure the response.

3. Estimate the parameter values with Senstools.

4. Optimize the input signal with Senstools for best parameter sensitivities. Applythe new input signal and measure the response.

5. Estimate the final parameter values with Senstools.

The appendix is divided into 6 sections. The first contains the test procedure usedfor both motors for applying various input signals and measuring their responses. Thefollowing five sections contain the five steps of the procedure described above.

Test Procedures for Main and Tail Rotor

In order to estimate the parameters of the main and tail motor it is necessary to applya voltage signal to each motor and sample this input signal along with the angularvelocity of the rotors and the armature currents of the motors.

The input voltage signals and angular velocity of rotors can be controlled and sampledusing the TRMS software for Matlab and Simulink, the real-time Simulink modelshl_omv and hl_omh. Modified version of these models are seen in Fig. B.1 and Fig. B.2.

As input argument for applying voltage to the motors, the “Real Time Task” takesan argument in the interval [-1;1], where 1 applies maximum positive voltage to themotors and -1 maximum negative voltage. Thus, in order to apply specific voltages, themapping between [-1;1] and the actual output voltage to the motors must be identified.

106

Page 117: report

107

Select Simulation/Start to start monitoring

IDENTIFICATIONof main motor parameters Creates a positive square−ramp input signal with

frequency "f", start time "1/f", ramp slope "a", stop time "t_end"

MAIN

Choose step or square wave input

t_main

Time to workspace

0

TAILStep with initial value 1,

Final value 0Step time t_end

StepReal Time Task

Ramp with slope aand start time 1/f

Pulse with amplitude 1 and frequency f

ProductMux

ua_mapped

Mapped input voltageto workspace

MATLABFunction

Map voltage to the interval [−1;1]

Manual Switch

ua_main

Input voltageto workspace

DemuxDemux

Clock

STOPPractical

w_main

Angular speed of main rotor to workspace

Figure B.1: The Simulink model used for applying two types of voltage signalsto the main rotor, i.e. a positive square-ramp voltage and a step. The inputvoltage, the mapped input voltage, angular velocity of main rotor and timevector are sampled and saved.

Select Simulation/Start to start monitoring

IDENTIFICATIONof tail motor parametersCreates a square−ramp input signal with

frequency "f", start time "1/f", ramp slope "a", stop time "t_end"

Choose step or square wave input

TAIL

t_tail

to workspace1

Step with initial value 1, Final value 0

Step time t_end

Step

Real Time Task

Ramp with slope aand start time 1/f

Pulse with amplitude 2 and frequency f

Product1

1

Offset

Mux

ua_mapped

Mapped input voltageto workspace

MATLABFunction

Map voltage to the interval [−1;1]

Manual Switch

0

MAIN

ua_tail

Input voltageto workspace

DemuxDemux

Clock

STOPPractical

w_tail

Angular speedof tail rotor

to work space

Figure B.2: The Simulink model used for applying two types of voltage signalsto the tail rotor, i.e. a square-ramp voltage and a step. The input voltage,the mapped input voltage, angular velocity of tail rotor and time vector aresampled and saved.

Page 118: report

108 APPENDIX B. PARAMETER ESTIMATION OF THE DC MOTORS

Determining the Voltage Map for Main and Tail Motor:

The voltage map for the Simulink models are determined by applying a rampinput to the model with a slope of 0.05 and sampling the voltage across the motorswith an Agilient 54621D Oscilloscope. The Simulink models used for applyingthe ramp inputs are seen in Fig. B.3.

Select Simulation/Start to start monitoring

IDENTIFICATIONof tail motor voltage map

TAIL

Select Simulation/Start to start monitoring

MAIN

IDENTIFICATIONof main motor voltage map

Ramp with slope 0.05and initial value 0 Ramp with slope 0.05

and initial value −1

t_tail

to workspace1

Input_main

To work space2

Input_tail

To work space1

t_main

Time to workspace

0

TAIL Real Time Task1 Real Time Task

Mux

Mux

0

MAIN

Demux Demux

Clock1 Clock

STOPPractical

STOPPractical

Figure B.3: Simulink models for applying a ramp input to the “real timetask” for identifying the voltage maps.

The results of the tests are seen in Fig.B.4 where the input to the model is plottedas a function of the output voltage. By fitting, the following maps were established

tail in =5.37E-9V 7in − 1.26E-9V 6

in − 2.41E-6V 5in + 0.602E-6V 4

in+

0.38E-3V 3in − 66.9E-6V 2

in + 0.0473Vin + 0.0125 (B.1)

main in =9.2E-6V 4in − 0.39E-3V 3

in + 0.00579V 2in + 0.0156Vin + 0.867E-3 (B.2)

where main in∈ [0; 1] and tail in∈ [−1; 1].

These two maps are programmed into the Matlab functions of the Simulinkmodels in Fig. B.1 and Fig. B.2.

The Simulinkmodels are not capable of measuring the armature currents of the motors.As a result, a resistor of known resistance is placed in series with each DC motor, wherethe voltage drop of the resistors are sampled with an oscilloscope. The test arrangementand the low pass filter schematic are seen in Fig. B.5.

Resistor Choice:

As resistor R a 0.1Ω power resistor with a maximum power rating of 3W wereused. When applying maximum voltage to the main rotor, the peak current were3A giving a power consumption of maximum

PR = i2aR = (3A)2 · 0.1Ω = 0.9W < 3W (B.3)

making the resistor suitable for the test.

Page 119: report

109

0 5 10 15 200

5

10

15

20

Time [s]

Inpu

t [−

], an

d ou

tput

vol

tage

[V] Main motor

Input to modelVoltage output

0 5 10 15 200

0.2

0.4

0.6

0.8

1Voltage Map Main

Input Voltage [V]

Inpu

t to

mod

el [−

]

Voltage mapFitting

0 10 20 30 40−15

−10

−5

0

5

10

15

Time [s]

Inpu

t [−

], an

d ou

tput

vol

tage

[V] Tail motor

Input to modelVoltage output

−15 −10 −5 0 5 10 15−1

−0.5

0

0.5

1

Input Voltage [V]

Inpu

t to

mod

el [−

]

Voltage Map Tail

Voltage mapFitting

Figure B.4: The input to the Simulink model as a function of the outputvoltage to the motors.

Power amplifier

Oscilloscope

Computerwith M

andI/O board

ATLAB

Lowpass filter

DC motor

+

-

VRR

VR

+

-+

-

+

-

C

R1

R2

Vin

Vout

Z1

Z2

Angular speed

ia

Computer interface

Test arrangement Lowpass filter

Figure B.5: Test arrangement for determining DC motor parameters. The lowpassfilter is included to attenuate high-frequency commutator noise from the measure-ments.

Page 120: report

110 APPENDIX B. PARAMETER ESTIMATION OF THE DC MOTORS

Because of the resistor tolerance, the resistance may vary resulting in a similarerror in the current measurement. Thus the resistance of the used resistors wereexperimentally determined by giving it a current using a “Hameg InstrumentsTriple power supply HM7042-5” and measuring the voltage across it using a “Fluke37 multimeter”. The test results are seen in Fig. B.6, where the resistors in serieswith the main and tail motor were found to be 0.11Ω.

0 0.5 1 1.5 2 2.50

0.05

0.1

0.15

0.2

0.25

Resistor used in main motor

Current [A]

Vol

tage

[V

]

0 0.5 1 1.5 2 2.50

0.05

0.1

0.15

0.2

0.25

Resistor used in tail rotor

Current [A]

Vol

tage

[V

]

v=0.11⋅i+33.7E−6 v=0.11⋅i+52.7E−6

Figure B.6: The measured voltage as a function of the current trough theresistors used in series with the main and tail motor.

Note that from the input voltage to motor the resistor voltage drop is subtracted fromthe output voltage of the Simulink model.

In order to avoid aliasing when sampling and to remove high frequency current noisefrom the commutator, the resistor voltage is low pass filtered.

Low Pass Filter Design:

The oscilloscope used for sampling is able to sample at 40Hz when measuring asequence of 50 s. As a consequence a 1st order filter with a cut off frequency of15Hz were designed.

As the max voltage across the resistor is about 0.3V the signal is also amplifiedto improve the signal to noise ratio using the inverting filter in Fig.B.5 having thefollowing transfer function:

H(s) = −Z2

Z1= −

1sC R21

sC +R2

R1= −R2

R1

1sCR2 + 1

(B.4)

with DC gain −R2R1

and cut off frequency ωn = 1CR2

.

The resistor R2 is chosen to 220kΩ giving a capacitor of:

C =1

R2ωn=

1220kΩ · 2π rad · 15Hz

= 48nF (B.5)

The gain of the filter is adjusted so the signal range utilizes the window [-8V;8V] ofthe oscilloscope for obtaining minimum quantization error. The gain is controlledwith the resistance of R1 without altering the cut off frequency of the filter.

As op-amp a TL081 is used and is supplied by a “Hameg Instruments Triple powersupply HM7042-5”.

Page 121: report

111

Thus the design of the test arrangement and procedure is complete, and is used in thefollowing experiment by:

1. Set the same sampling frequency for the real time Simulink model and the os-cilloscope. As the oscilloscope is used to obtain 2000 samples during 20 or 50seconds, the sample frequency is either 100Hz or 40Hz.

2. Create the desired input signal using Simulink.

3. Adjust the filter amplification to optimize the range of the signal to accommodatethe oscilloscopes window for minimum quantization error.

4. Start the oscilloscope and Simulink. Synchronize the two data sets in time.

5. Subtract the resistor voltage drop from the sampled input voltage to the motor.Divide the voltage across the resistor with the filter amplification and resistorvalue to obtain the current.

Step 1: Obtain a Step Response for Input Design

Both rotors are given a step input, from zero to maximum voltage. The responses areseen in Fig. B.7 where the following time constants are found:

τmain = 0.8s τtail = 0.315s (B.6)

0 2 4 6 80

20

40

60

80

Time [s]

Input vo

ltage [V

] and

Angula

r ve

loci

ty [ra

d/s

] Main Rotor

0 2 4 6 80

20

40

60

80

100

120

Time [s]

Input vo

ltage [V

] and

Angula

r ve

loci

ty [ra

d/s

] Tail Rotor

63%

0.80s

63%

0.315s

Figure B.7: Step responses of main and tail motor with rotor reveals the timeconstants τmain = 0.8s and τtail = 0.315s.

Step 2: Design Input Signal

As both motor systems contain non-linear elements, i.e. dry friction and drag fric-tion, the input signal must have an amplitude distribution to identify these. As aresult a square-ramp input is used, i.e. the product of a square wave and a ramp.[Knudsen, 2004]

In order for the system to reach “steady-state”, the period of the input signal is chosento 10 times the time constants, resulting in frequencies of 0.125Hz and 0.317Hz respec-tively. The ramp is designed so maximum voltage is reached for both motors during20s. Since the main motor is never operated in reverse mode, the motor is given apositive square-ramp. The two input signals are seen in Fig.B.8, along with the motors’responses to the signal.

Page 122: report

112 APPENDIX B. PARAMETER ESTIMATION OF THE DC MOTORS

0 2 4 6 8 10 12 14 16 18 200

10

20

Time [s]

Inpu

t vol

tage

[V

] Main Motor Input

0 2 4 6 8 10 12 14 16 18 20−20

0

20

40

60

Time [s]

u a,m

[V

],ia,

m

[A],ω

m

[rad

/s]

Main Motor Response

0 5 10 15 20−20

0

20

Time [s]

Inpu

t vol

tage

[V

] Tail Motor Input

0 5 10 15 20

−100

−50

0

50

100

Time [s]

u a,t

[V],i

a,t

[A],ω

t [r

ad/s

]

Tail Motor Response

Input voltage [V]Armature current [A]Angular velocity [rad/s]

Input voltage [V]Armature current [A]Angular velocity [rad/s]

Figure B.8: The applied input signal and the responses of the motors. Note thatthe current is scaled by a factor 20.

Page 123: report

113

Step 3: Estimate the Parameter Values with Senstools

The motor model for which the parameters are estimated were developed in Ch. 5. Themodel is seen in Fig. B.9. The model parameters are the motor constant km, armatureresistance Ra, total inertia seen by the motor Ja, viscous friction coefficient Ba and dragfriction coefficient Da.

Figure B.9: DC motor model used for parameter estimation.

The model is programmed into a Matlab function and fitted to the two responses ofthe main and tail motor. The fitted model output are compared to the measured outputin Fig. B.10 and Fig. B.11. Note that the current and angular velocity are plotted inextension.

0 500 1000 1500 2000 2500 3000 3500 4000−1

−0.5

0

0.5

1

1.5

2

2.5

Mea

sure

d an

d si

mul

ated

res

pons

e

Normed system and model output − Main motor

Sample number

errn = 4.1 %

System outputModel output

Figure B.10: The model in Fig. B.9 when fitted to the output of the main motor.

The main motor is fitted with an errn of 4.1%, yielding the following parameters esti-mated with the minimum sensitivity Smin=0.025859:

km,t,est[ Nm

A

]Ra,t,est [Ω] Ja,t,est

[kgm2

]Ba,t,est

[kgm2

s

]Da,t,est

[kgm2

]

Values 82.1E-3 6.45 3.02E-3 0.390E-3 25.5E-6Simin 0.15428 0.36856 0.10624 0.027621 0.063743

Table B.1: Parameter values and sensitivities for the main rotor.

The tail motor is fitted with an errn of 16.3%, yielding the following parameters esti-mated with the sensitivity Smin=0.025859:

Page 124: report

114 APPENDIX B. PARAMETER ESTIMATION OF THE DC MOTORS

0 200 400 600 800 1000 1200 1400 1600 1800

−4

−3

−2

−1

0

1

2

3

4M

easu

red

and

sim

ulat

ed r

espo

nse

Normed system and model output − Tail motor

Sample number

errn = 16.3 %

System outputModel output

Figure B.11: The model in Fig. B.9 when fitted to the output of the tail motor.

km,m,est[ Nm

A

]Ra,m,est [Ω] Ja,m,est

[kgm2

]Ba,m,est

[kgm2

s

]Da,m,est

[kgm2

]

Values 88.2E-3 7.65 0.515E-3 0.113E-3 2.04E-6Simin 0.25454 0.59561 0.10624 0.016011 0.023198

Table B.2: Parameter values and sensitivities for the tail rotor.

It is seen that Ba,t and Da,t are determined with low sensitivities. The reason is thatboth parameters represent a friction force as a function of the angular velocity. Theseparameters have a tendency of becoming correlated. Thus in order to increase thesensitivities, the system output is fitted with a model where the drag is neglected, i.e.a linear model. The resulting fit is seen in Fig. B.12.

The tail motor is fitted with an errn of 16.5% when using a model with no drag included,yielding the following parameters with the sensitivity Smin=0.13731:

km,t,est[ Nm

A

]Ra,t,est [Ω] Ja,t,est

[kgm2

]Ba,t,est

[kgm2

s

]

Values 88.2E-3 7.65 0.506E-3 0.274E-3Simin 0.44233 0.59372 0.25818 0.13857

Table B.3: Parameter values and sensitivities for the tail rotor when using a modelwithout drag.

It is seen that the sensitivity for Ba,t is approximately increased with a factor of ten,and that the model fitness errn is reduced with only 0.3%. As a result a linear modelwithout drag is used for the tail motor.

Having obtained estimates of the motor parameters, these are used for designing a inputsignal to give a system output that increases the parameters sensitivities when fitting.

Page 125: report

115

0 200 400 600 800 1000 1200 1400 1600 1800−5

−4

−3

−2

−1

0

1

2

3

4

Mea

sure

d an

d si

mul

ated

res

pons

e

Normed system and model output − Tail motor

Sample number

errn = 16.5 %

System outputModel output

Current Angular velocity

Figure B.12: The model in Fig. B.9 without drag when fitted to the output of thetail motor.

Step 4: Design of Optimal Input Signal

The input signal is designed by using the Senstools function maininp. This functionutilizes the simulation model and the estimated parameters to calculate at which fre-quency and amplitude a given input signal type gives the optimal output for parameterestimation.

Input signal for main motor

For the main motor, a positive square-ramp input is used, and by use of maininp onthe model and the parameters in Tab.B.1, Fig.B.13 is obtained. From the figure it seenthat the maximum sensitivity is archived at a frequency of 0.1Hz. It is also seen thatas for the tail motor, the sensitivities of the viscous and drag coefficient are low and theparameters have high Ri values implicating correlation. But leaving the drag out of themodel results in the model having a too high angular velocity at high voltages, for thisreason the drag friction is kept in the main motor model.

Having found the optimal frequency, maininp is used to find the optimal amplitude ofthe input signal with frequency 0.1Hz. The result is seen in Fig. B.14. Note that theoptimal amplitude means that the input signal starts at 0V and increases to the givenamplitude.

The Senstools maininp suggest an optimal input amplitude at 7V since this yields thebest compromise for sensitivities. However, a problem arises since the used simulationmodel does not contain dry friction. As a result the voltage range 0V to 7V would resultin too high a value for the viscous friction at the expense of drag friction, in order to fitthe dry friction. Hence, the resulting model might not be applicable at higher voltages.Introducing dry friction into the model is not a solution, as having three different typesof friction result in even more correlation. Thus, for the amplitude, the square-ramp ischosen to have the range 0V to 19V for fitting the motor model in its entire workingarea. The designed input signal is seen in Fig. B.15.

Page 126: report

116 APPENDIX B. PARAMETER ESTIMATION OF THE DC MOTORS

0 0.2 0.4 0.6 0.80.025

0.03

0.035

0.04

Sm

in

Min Sensitivity

0 0.2 0.4 0.6 0.80

0.5

1

Sim

in

Min Sens of Each Param

0 0.2 0.4 0.6 0.825

30

35

Input Frequency [Hz]

R

R=Smax

/Smin

0 0.2 0.4 0.6 0.81

2

3

4

5

Input Frequency [Hz]

Ri

Ri=S

i/S

imin

km

Ra

Ja

Ba

Da

km

Ra

Ja

Ba

Da

Figure B.13: Input design for the main motor using maininp to find the optimalfrequency of a positive square-ramp.

0 5 10 15 200.02

0.03

0.04

0.05

Sm

in

Min Sensitivity

0 5 10 15 200

0.5

1

Si,m

in

Min Sens of Each Param

0 5 10 15 2020

30

40

50

60

Input Amplitude [V]

R

R=Smax

/Smin

0 5 10 15 201

2

3

4

Input Amplitude [V]

Ri

Ri=S

i/S

i,min

km

Ra

Ja

Ba

Da

km

Ra

Ja

Ba

Da

Figure B.14: Input design for the main motor using maininp to find the optimalfinal amplitude of a positive square-ramp.

Page 127: report

117

0 5 10 15 20 25 300

10

20

Time [s]V

otla

ge

[V]

Optimal input signal for main motor

Figure B.15: Optimal input for parameter estimation for main motor.

Input signal for tail motor

For the tail motor, a square-ramp input is used, and by use of maininp on the linearmodel and the parameters in Tab. B.3, Fig. B.16 is obtained. From this figure it seenthat maximum sensitivity is achieved at a frequency of 0.135Hz.

0.1 0.2 0.3 0.4

0.2

0.25

0.3

0.35

Sm

in

Min Sensitivity

0.1 0.2 0.3 0.40

0.5

1

Sim

inMin Sens of Each Param

0.1 0.2 0.3 0.44

6

8

10

12

Input Frequency [Hz]

R

R=Smax

/Smin

0.1 0.2 0.3 0.41

1.5

2

2.5

Input Frequency [Hz]

Ri

Ri=S

i/S

i,min

km

Ra

Ja

Ba

km

Ra

Ja

Ba

Figure B.16: Input design for the tail motor using maininp to find the optimalfrequency of a square-ramp.

As for the amplitude Senstools cannot be used in this case since the model is linear.Instead the amplitude is chosen to 8.5V for the tail motor to fit well around its workingpoint. The signal is seen in Fig.B.17. The two designed input signals are applied to themotor and measured, see Fig. B.18.

Step 5: Estimate the Final Parameter Values with Senstools

Using the same procedure as in step 3, the main and tail motor responses are fittedusing Senstools. The two fits are seen in Fig. B.19 and Fig. B.20, where the followingparameters are estimated with Smin=0.027294 and Smin=0.20178 for the main and tailmotor respectively:

It is seen that while the errn in Fig.B.19 is 2.1% larger than in Fig.B.10, the parameter

Page 128: report

118 APPENDIX B. PARAMETER ESTIMATION OF THE DC MOTORS

0 5 10 15 20 25 30−10

0

10

Vol

tage

[V

]

Time [s]

Optimal input voltage for tail motor

Figure B.17: Optimal input for parameter estimation for tail motor.

0 5 10 15 20 25 30−20

0

20

40

60

Time [s]

u a,m

[V

],ia,

m⋅ 2

0 [

A],ω

m

[rad

/s]

Main motor response

0 5 10 15 20 25 30

−50

0

50

Time [s]

u a,t⋅ 2

[V

],ia,

t⋅ 20

[A

],ωt

[rad

/s]

Tail motor response

Input voltage [V]Armature current times 20 [A]Angular velocity [rad/s]

Input voltage times 2 [V]Armature current times 50 [A]Angular velocity [rad/s]

Figure B.18: Responses of the two motor when applying the optimal inputs.

km,m[ Nm

A

]Ra,m [Ω] Ja,m

[kgm2

]Ba,m

[kgm2

s

]Da,m

[kgm2

]

Values 74.83·10−3 6.816 2.759·10−3 0.346·10−3 23.03·10−6

Simin 0.17208 0.43498 0.12091 0.028779 0.072799

Table B.4: Final parameter values and sensitivities for the main rotor.

km,t[ Nm

A

]Ra,t [Ω] Ja,t

[kgm2

]Ba,t

[kgm2

s

]

Values 88.3E-3 8.05 0.510E-3 0.250E-3Simin 0.55239 0.54164 0.26439 0.21138

Table B.5: Final parameter values and sensitivities for the tail rotor when using amodel without drag.

Page 129: report

119

sensitivities have increased compared to the sensitivities in step 3 as expected. For thisreason, the new parameter values will be used in the model.

0 500 1000 1500 2000 2500−1

−0.5

0

0.5

1

1.5

2

2.5

3

Mea

sure

d an

d si

mul

ated

res

pons

e

Normed system and model output − Main motor

Sample number

errn = 6.2 %

System outputModel output

Figure B.19: Model fitted to the output of the main motor.

0 500 1000 1500 2000 2500−8

−6

−4

−2

0

2

4

6

Sim

ulat

ed a

nd m

easu

red

resp

onse

Normed system and model output − Tail motor

Sample number

errn = 15 %

System outputModel output

Figure B.20: Model fitted to the output of the tail motor.

Summary

The parameter values for the main and tail motor were determined in this appendix bythe use of Senstools. An iterative five step procedure were used in order to design aninput signal which gave the optimal output for parameter estimation. Thus, three itera-tions of obtaining a system response, estimate parameters and design a new input signalwere carried out for both motors. The final result yielded an fitness error of errn=6.2%and errn=15% which is considered acceptable when inspecting the fit graphical as well.

Concerning the tail motor, it was shown that the drag effect was neglectable, leaving alinear model.

Page 130: report

Appendix CParameter Estimation of the VerticalMechanics

Purpose

The purpose of this test is to fit the parameters of Eq. (C.1) which describe the move-ments of the TRMS in the vertical plane.

Theory

The vertical position of the TRMS is described by,

Jvθv (t) + Jtθt (t) =g[(A−B) cos

(θv (t)

)− C sin(θv (t)

)]

− 12θ2h (t) (A + B − C) sin

(2θv (t)

)− µvθv (t) + τv_m(ωm (t)

)+ τv_t

(ωm (t)

)

(C.1)

The TRMS has a fixed horizontal position at ωh,res = 0rad in this experiment. Bothrotors are fixed as well, at τv_t

(ωm (t)

)= 0 and Jtθt = 0. Hence Eq. (C.1) can be

written as,

Jvθv (t) = g[(A−B) cos

(θv (t)

)− C sin(θv (t)

)]− µvθv (t) + τv_m(ωm (t)

)= 0 (C.2)

which is simplified to,

θv (t) = α cos(θv (t)

)− β sin(θv (t)

)− µθv (t) + kτv_m(ωm (t)

)= 0 (C.3)

where

α =g (A−B)

Jvβ =

gC

Jvµ =

µv

Jvk =

1Jv

(C.4)

The parameters decided to be estimated by Senstools are: (A − B), C, and µv. Jvcannot be estimated since it is correlated with the three other parameters, hence it isentered as a constant at 0.067Nm. The gravitational acceleration is 9.82 m

s2 . The twoparameters are calculated to:

(A−B) = (0.104− 0.117) = −0.013kgmC = 0.0143kgm

120

Page 131: report

121

The last parameter is unknown but a guess which proved useful is:

µv = 0.001kgm2

s(C.5)

Equipment

The TRMS is connected to a computer with Matlab installed. Through sensorsmounted on the TRMS, and an I/O card mounted in the computer the angular ve-locity of the rotors and angle of main- and tail beam, are saved in Matlab.

Procedure

In Matlab, the program hl_1doff is opened. The TRMS is fixed in the horizontalplane and held at a constant angle of θv,res ≈ −0.26 rad. When the TRMS is released,the sampling of the vertical position of the beam with a sample period of 0.05s begins.The sampling ends when the beam stops oscillating. The samples are plotted inMatlaband the graph is shown below.

0 50 100 150 200 250−1

−0.9

−0.8

−0.7

−0.6

−0.5

−0.4

−0.3

−0.2

Time [s]

Ver

tical

Pos

ition

[rad

]

Figure C.1: The measured positions in the vertical plane when the main beam isreleased from an angle of θv,res ≈ −0.26rad without any input to the main rotor.

Data Treatment

Senstools is used to fit the model output to the measured response, thus yielding theestimated parameters. To use this toolbox a theoretic model of the TRMS must bedeveloped. To do so, the Eq. (C.3) is expressed in block diagram C.2.

Page 132: report

122 APPENDIX C. PARAMETER ESTIMATION OF THE VERTICAL MECHANICS

Figure C.2: Block diagram of the TRMS model describing the movements in thevertical plane when there is no movement in the horizontal plane.

From this diagram, a simulation model is written in an m-file and can found in appendeddocument [11]. Using this simulation file with Senstools the parameters are fitted to:

(A−B) = −0.0208kgm C = 0.0293kgm µv = 0.0021kgm2

s(C.6)

The graph of the model with the fitted parameters on top of the measured data is seenin Fig. C.3.

0 500 1000 1500 2000 2500 3000 3500 4000 4500−1

−0.9

−0.8

−0.7

−0.6

−0.5

−0.4

−0.3

−0.2

Sample Number

Ver

tical

Pos

ition

[rad

]

System and model output

errn = 1.5 %Estimated

Measured

Figure C.3: The vertical position of the fitted model versus the vertical position ofthe TRMS without input to the main rotor.

Senstools calculates the normalized root mean square output error to errn=1.5%.This error is mainly caused by the difference in oscillation after 150 seconds from thetest start (3000 samples). This difference occur because the model does not take thedry friction into account, which would dampen the small oscillations. Since the errorfrom neglecting the dry friction only is 1.50%, the fitted model is acceptable.

Conclusion

The parameters were fitted acceptably, relative to the actual behavior of the TRMS,and the vertical linear model of the TRMS is ready to be used.

Page 133: report

Appendix DParameter Estimation of theHorizontal Mechanics

Purpose

The purpose of this test is to fit the parameters of the theoretical model, describing theTRMS in the horizontal plane, with the physical parameters.

Theory

The horizontal movement of the TRMS is described by this equation:

ωres(t) · Jh + Jmrot

([ωm(t) sin(θv(t))− ωm(t) cos(θv(t))] + ωm(t)

cos(θv(t)Jh(t))Jh(t)

)=

− µhθres(t)− khθres(t) + τh_tωt(t) + τh_mωm(t) (D.1)

The TRMS has a fixed vertical position at ωv = 0 in this experiment. Both rotors arefixed as well, at τv_t (ωm) = 0 and Jtθt = 0. Hence Eq. (D.1) can be written as:

θres =−µhθres(t)

Jh−khθres(t)

Jh=

−µhθres(t)D + E cos2(θv) + F sin2(θv)

− khθres(t)D + E cos2(θv) + F sin2(θv)

(D.2)

The only unknown parameters are µh and kh, and these are to be estimated.

Equipment

The TRMS is connected to a computer with Matlab installed. Through sensorsmounted on the TRMS, and an I/O card mounted in the computer, states like angularvelocity of the rotors and angel of main- and tail beam, are saved in Matlab.

123

Page 134: report

124 APPENDIX D. PARAMETER ESTIMATION OF THE HORIZONTAL MECHANICS

Procedure

In Matlab the program hl_1doff is opened. The TRMS is fixed in the vertical planeand given an angle of 1.7 rad from steady-state. The system is then given a step = 0by letting to of the beam and the position and sampling time is saved in workspace andshown in Fig. D.1

5 10 15 20 25 30 35 40−1

−0.5

0

0.5

1

1.5

2

Time [s]

Hor

izon

tal P

ositi

on [r

ad]

Figure D.1: The measured positions in the horizontal plane when the main beamis releast from an angle of θh,res ≈ 1.7rad and with no input to the tail rotor.

Data Treatment

Senstools is used to fit the model output to the measured response, thus yielding theestimated parameters. To use this toolbox a theoretical model, see Eq. (D.2), is writtenas an m-file in Matlab. This model can be found on the CD [12]. A block diagram ofthe model is seen on Fig. D.2, with the feedback gains αh = µh/Jh and βh = kh/Jh.

Figure D.2: Block diagram of the TRMS model describing the movements in thehorizontal plane when there is no movement in the vertical plane.

Page 135: report

125

Senstools estimate the parameters to be:

µh = 0.0107kgm2

skh = 0.0093Nm (D.3)

and the result in Fig. D.3 is obtained.

0 500 1000 1500 2000 2500 3000 3500 4000−1

−0.5

0

0.5

1

1.5

2

Hor

izon

tal P

ositi

on

Sample Number

errn = 13.3 %measuredestimated

Figure D.3: Fitted model versus the measured results.

Senstools calculates the normalized root mean square output error to errn=13.3%.The error might be due to the lack of stiction in the model, as this would dampen theoscillation of the model output when approaching zero.

Conclusion

The optimum parameters made the theoretical model mimic the physical model withan accuracy at 13.3%. This is within a reasonable limit and the estimated parametersare used.

Page 136: report

Appendix EDetermination of the AerodynamicTorques

This experiment is conducted in order to measure the thrust torque and petonormaltorque of both the main and the tail rotor as function of the rotor angular velocity.The setup used for the experiment is: A Personal Computer with Matlab 6.5 andSimulink 5.0, the Twin Rotor MIMO System, a digital scale: AUC -LBNR: 08432 andweights.

The TRMS software includes the hl program for Matlab which enables one to measurethe angular velocity of the rotors. The output is given in rounds per minute. For eachangular velocity, the change in weight measured by the scale is logged, and the finalresults are plotted. When the results are plotted, the data points are interpolated by apolynomial of a suitable degree.

Main Rotor Thrust Torque

The setup to measure the thrust torque of the main rotor is seen in Fig. E.1a. Theresults of the test is plotted in Fig. E.1b. Interpolating the results with a second degreepolynomial yields the following equation for the rotor generated thrust torque:

τm = 57.5E-6ω2m + 0.713E-3ωm [Nm ] (E.1)

Main Rotor Petonormal Torque

The setup to measure the petonormal torque of the main rotor is seen in Fig.E.2a. Theresults of the test is plotted in Fig. E.2b. Interpolating the results with a second degreepolynomial yields the following equation for the rotor generated petonormal torque:

τm,p = 4.80E-6ω2m − 9.35E-6ωm [Nm ] (E.2)

Tail Rotor Thrust Torque

The setup to measure the thrust torque of the tail rotor is seen in Fig. E.3a. Theresults of the test is plotted in Fig. E.3b. Interpolating the results with a third degree

126

Page 137: report

127

mg

lF

Counter weight

String

String

Weight

τ = F · l

Scale

(a)

0 20 40 600

0.05

0.1

0.15

0.2

0.25

0.3

0.35

Angular velocity [rad/s]

Tor

que

[Nm

]

Main rotor thrust torque

fitted

measured

τm

=5.75e−5ω2+0.713e−3ω

(b)

Figure E.1: (a): Two weights are attached to the TRMS to keep the beam hor-izontal. A digital scale is used to measure changes in weight caused by the forceproduced by the rotors. (b): The main rotor thrust torque, as function of the mainrotor angular velocity.

Weight

String

Counter weight

String

F

mg

l

τ = F · l

Scale

(a)

0 20 40 600

0.005

0.01

0.015

0.02

0.025

Angular velocity [rad/s]

Tor

que

[Nm

]

Main rotor petonormal torque

measured

fitted

τm,p

= 4.8e−6ω2 − 9.35e−6ω

(b)

Figure E.2: (a): The main rotor is turned 90 to measure the petonormal torque.(b): The main rotor petonormal torque as function of the main rotor angular velocity.

Page 138: report

128 APPENDIX E. DETERMINATION OF THE AERODYNAMIC TORQUES

polynomial yields the following equation for the tail rotor thrust torque:

τt = 59.2E-9ω3t + 2.65E-6ω2

t + 0.251E-3ωt [Nm ] (E.3)

lF

mg

Weight

String

String

τ = F · l

Counter weight

Scale

(a)

−150 −100 −50 0 50 100 150−0.1

−0.05

0

0.05

0.1

0.15

Angular velocity [rad/s]

Tor

que

[Nm

]

Tail rotor thrust torque

fitted

measured

τt = −5.92e−8ω3+2.65e−6ω2

−2.51e−4ω

(b)

Figure E.3: (a) The tail rotor is turned 90 to measure the thrust torque. (b) Thetail rotor thrust torque as function of the tail rotor angular velocity.

Tail Rotor Petonormal Torque

The setup to measure the petonormal torque of the tail rotor is seen in Fig. E.4a. Theresults of the test is plotted in Fig. E.4b. Interpolating the results with a third degreepolynomial yields the following equation for the tail rotor thrust torque

τt,p = 5.49E-9ω3t − 0.206E-6ω2

t + 32.5E-6ωt [Nm ] (E.4)

lF

mg

Weight

String

String

τ = F · l

Counter weight

Scale

(a)

−150 −100 −50 0 50 100 150

−10

−5

0

5

x 10−3

Angular velocity [rad/s]

Tor

que

[Nm

]

Tail rotor petonormal torque

fitted

measured

τt,p

=5.49e−9ω3−2.06e−7ω2

+ 3.25e−5ω

(b)

Figure E.4: (a): Setup to measure the tail rotor petonormal torque. (b): The tailrotor petonormal torque as function of the tail rotor angular velocity.

Page 139: report

Appendix FSenstools

The following section is primarily based on [Knudsen, 2004].

The purpose of this chapter is to give a description of the Matlab toolbox Senstools.Senstools is a toolbox used when performing experimental modelling and estimatingmodel parameters.

Simulation

In order to estimate model parameters through computer fitting, a simulation modelis required. The purpose of the simulation model is to estimate model parameters byexciting the model with the same input, as the input used when performing measure-ments on the system. The model output, is compared with the system output, and thedifference between these, is the model error as shown in Fig. F.1.

System

Simulationmodel

Parameteradjustment

Input Outputu(t) y(t)

Computer

u(k)

Model output

y (k)m

Model error ε(k)

Noise

+

-

Figure F.1: Principle of parameter estimation. The output from the model iscompared with that of the actual system and then are the parameters adjusted tominimize the error between these.

The model error is used to adjust the model parameters, until the minimum is found,as explained in the following section.

Minimisation

Senstools use computer fitting through the least-squares method, and minimises theperformance function Eq. (F.1), by adjusting model parameters until the minimum isfound.

P (θ) =1

2N

N∑

k=1

ε2 (kT, θ) (F.1)

129

Page 140: report

130 APPENDIX F. SENSTOOLS

The model output error is ε2 (kT, θ) at the time t = kT , and is defined by

ε2 (kT, θ) = (y (kT )− y (kT, θ))2 (F.2)

where T is the sampling time, and θ is a vector containing model parameters and N isthe number of samples.

The minimum of the function can be found where the gradient vector is the zero vector

G (θ) =∂P (θ)

∂θ

∣∣∣∣θ=θ0

= 0 (F.3)

and the Hessian, which is the second derivative of the performance function Eq. (F.1),

H (θ) =∂2P (θ)∂θ∂θT

∣∣∣∣θ=θ0

(F.4)

is positive definite.

In order for Matlab to do this, the Hessian must be approximated, which is done inSenstools, using the Gauss-Newton method.

Parameter estimation

When using Senstools for parameter estimation, four things must be done. For aprocess named ’xxx’:

1. The simulation model must be programmed as a Matlab function, having thesyntax y = simxxx(u,t,par), with u being the model input, y the simulationoutput, t the time vector and par being the model parameters.

2. The measured data t, u and y is to be saved as column vectors in a .mat filenamed measxxx.mat.

3. The required program data must be entered. This is done by creating a script fileprogprogxxx.m, containing as a minimum the process name process=’xxx’, andthe initial parameters par0. This script will generate the progdata.mat file usedby the Senstools main program.

4. Execute the main parameter estimation program mainest.m.

Parameter evaluation

Once the mainest program is done fitting the model parameters to the measured out-put, it is necessary to evaluate the outcome. The result from running the Senstoolsparameter estimation program, besides estimated parameters, is a model fit and anassociated normed root mean square error, errn.

errn =

√√√√∑N

k=1 (y (k)− ym(k, θN ))2∑Nk=1 y (k)2

· 100 [%] (F.5)

Page 141: report

131

This error indicates how well the model fits on a particular input. However, it does notnecessarily tell whether or not the parameters are accurate.

To determine the accuracy of the estimated parameters, parameter sensitivities andgraphical interpretation of these are introduced. Insight, common sense and experiencewill go a long way, when evaluating whether or not the parameters are accurate.

In order to obtain accurate parameters, the sensitivity of individual parameters arerequired to be large, seeing as small changes in parameter value affect the resulting out-come considerably, making the parameter easier to determine. However, with multipleparameters this is insufficient in determining accuracy, as two or more parameters maybe correlated. If this is the case, then only the ratio or relation between the values affectthe resulting outcome, and not the actual parameter values.

1/S2min

1/S1min

1/Sm

ax

1/S min

1/S2

1/S1

Figure F.2: A general sensitivity ellipse of two parameters.

In Fig. F.2, a two-dimensional graphical representation of parameter sensitivity is il-lustrated. If the number of parameters d>2 are present, the ellipsoids become d-dimensional. This is difficult to represent graphically, however the sensitivity measuresstill apply. An elongated ellipsoid, indicates a high correlation between parameters.

Smin Minimum sensitivity - as large as possible.Simin Minimum sensitivity of θi - as large as possible.R = Smax/Smin Ratio of maximum and minimum sensitivity - as close to 1 as

possible.Ri = Si/Smin Ratio of sensitivity of θi and minimum sensitivity of θi - as close

to 1 as possible. Ri À 1 indicates correlation between two or moreparameters.

Table F.1: Characteristic parameter sensitivity measures.

The characteristic sensitivity measures shown in Tab. F.1, are dependent of the inputsignal and must satisfy the general requirements given in the second column of thetable. If the sensitivity measurements are not found satisfactory, the input signal mustbe adapted and new measurements performed, for a new parameter estimation.

Input design

When estimating parameters, it is important to have a good input signal, as it effectsthe parameter sensitivity as stated previously.

Page 142: report

132 APPENDIX F. SENSTOOLS

The following procedure is recommended and repeated if necessary:

1. Obtain appropriate parameter estimates.

2. Choose a class of preliminary input signals with feasible frequency and amplitudedistribution.

3. Optimize the signal input for best possible sensitivity measures.

4. Use the determined input signal on the real system, obtaining an improved pa-rameter estimate.

Choosing a class of input signals depend on the type of system used. Intuition and phys-ical insight is of good use when determining input signal class. For linear systems thesignal parameters are based on a single parameter controlling the frequency spectrum.For non-linear systems an additional parameter controlling the amplitude is required.

Senstools determines the optimal input signal parameters, based on the same prin-ciples as determining the system parameters, by minimising the sensitivity ratio R =Smax/Smin. However, instead of altering system parameters, different frequencies and/oramplitudes are run through the simulation.

Running the Senstools input design program is done in much the same way asthe parameter estimation program. For the process named ’xxx’, a script file namedprogproginpxxx.m is made containing the process name process=’xxx’, a signal inputtype e.g. inputt=’inpsqramp’ for a square-ramp input signal. Furthermore the systemparameters must be present as well as the par vector. The input signal parameters ofwhich Senstools are to determine which is the optimal choice are to be input in thefrequency vector f1v and the amplitude vector amv. Once done this data is saved tothe progdatainpxxx.mat file, and the main program maininp is executed, outputtingsensitivity measures, as shown in Fig. F.3.

0 0.05 0.1 0.15 0.20.1

0.2

0.3

0.4

0.5

Sm

in

Min Sensitivity

0 0.05 0.1 0.15 0.20

0.5

1

Si,m

in

Min Sens of Each Param

0 0.05 0.1 0.15 0.22

4

6

8

Input Frequency [Hz]

R

R=Smax

/Smin

0 0.05 0.1 0.15 0.21

1.5

2

2.5

3

Input Frequency [Hz]

Ri

Ri=S

i/S

i,min

Figure F.3: Sensitivity measure example of a square wave input input signal on thesystem H(s) = 1

2s+1.

Page 143: report

Appendix GThe TRMS Software

This appendix is based on [13] and [14].

In order to control the TRMS, it must be connected to a computer through an I/Oboard. The TRMS includes software which creates an interface between the I/O boardand Matlab/Simulink. The included software of interest is briefly described in thefollowing sections, and consist of:

• Real-Time Kernel (RTK)

• TRMS Toolbox

Figure G shows a diagram of the TRMS software.

Algorithms &parametersselection

ωv ωh θv θh, , ,( )Ua,mUa,t

Filters

Internalexcitation

source

Buffer

Communication interface

TRMS toolbox

Matlab 6 + SIMULINK

or RT−DAC

PCL−812 PGD/A

MIMO physical model

state feedback−controller

LQ−controller

PID−controller

controller nr. 99

open−loop−excitation

embedded controllers

Data Aquisition & ControlRTK

ErrorMeasurements

Desired ref. value , vdhdθ θ

, )(

PC + Windows 95 or NT

Xd

Figure G.1: The interface between the computer and the TRMS. The RTK includesthe software for data acquisition from the TRMS, and the embedded controllers forthe system.

133

Page 144: report

134 APPENDIX G. THE TRMS SOFTWARE

Real-Time Kernel (RTK)

The Real-Time Kernel provides means of controlling the TRMS through Matlab inreal-time. The RTK uses timer interrupts to handle the real-time execution. Multipletypes of controllers are embedded directly in the RTK including PID, LQ, state feed-back, and open-loop control. The parameters for the embedded controllers are set andadjusted from Matlab .

The communication interface translates the data format between the RTK library andthe Matlab environment. The RTK library is primarily used by Matlab , however itis possible to set up other Windows programs for this purpose.

TRMS Toolbox

The TRMS Toolbox contains the necessary Matlab M- and S-functions, Simulinkmodels, and DLL-files extending Matlab , thus allowing for modelling and controllingthe TRMS. It handles communication between Matlab and RTK. In contrast to RTK,the toolbox is open for modification which provides the means for easy customizationand/or implementation of Simulink models.

Page 145: report

Appendix HNomenclature

Table of DC Motor Quantities and Parameters

Symbol Description Unitτmotor Torque generated by a DC motor Nmωa Angular speed of motor armature and rotor load 1

sωm Angular speed of main rotor 1

sωt Angular speed of tail rotor 1

sia Armature current of a DC motor Aia,m Armature current of main rotor DC motor Aia,t Armature current of tail rotor DC motor ABa Viscous friction coefficient for DC motor with load kgm

s2

Ba,m Viscous friction coefficient for main rotor kgms2

Ba,t Viscous friction coefficient for tail rotor kgms2

Da Drag friction coefficient for DC motor with load kgm2

Da,m Drag friction coefficient for main rotor kgm2

Ja Total inertia seen by motor kgm2

Ra Armature resistance of a DC motor ΩRa,m Armature resistance of a main DC motor ΩRa,t Armature resistance of a tail DC motor Ωkm Motor constant of a DC motor Nm

Akm,m Motor constant of main DC motor Nm

Akm,t Motor constant of tail DC motor Nm

A

Quantities of the TRMS Mechanics and Aerodynamics

Table of Lengths and Masses of the TRMS

Symbol Description value Unitlc Length of beam from pivot to counterweights center 0.255 mlcb Length of counterweight beam 0.255 mlmb Length of main beam 0.254 mltb Length of tail beam 0.275 mlmw Width of main rotor blade 0.026 mlml Length of main rotor blade 0.281 m

135

Page 146: report

136 APPENDIX H. NOMENCLATURE

Symbol Description value Unitltw Width of tail rotor blade 0.017 mltl Length of tail rotor blade 0.180 mmc Mass of counterweight 0.068 kgmcb Mass of counterweight beam 0.022 kgmmb Mass of main beam 0.015 kgmtb Mass of tail beam 0.016 kgmm Mass of main DC-motor with main rotor 0.228 kgmt Mass of tail DC-motor with tail rotor 0.206 kgmms Mass of main shield 0.225 kgmts Mass of tail shield 0.165 kgmmr Mass of main rotor 0.042 kgmtr Mass of tail rotor 0.016 kgrm Radius of the circle in which the main part of the TRMS

circulate- m

rt Radius of the circle in which the tail part of the TRMScirculate

- m

rc Radius of the circle in which the counterweight of theTRMS circulate

- m

rm,m Radius of the main motor 0.007 mrt,m Radius of the tail motor 0.007 mrms Radius of the main shield 0.155 mrts Radius of the tail shield 0.100 mg Gravitationally acceleration 9.82 m

s2

Table of the Quantities of the TRMS Mechanics and Aerodynamics

Symbol Description UnitJCM Inertia in the center of mass kgm2

Jv Sum of inertia in the vertical plane kgm2

Jh Sum of inertia in the horizontal plane kgm2

Jv,ms Inertia for main shield in the vertical plane kgm2

Jh,ms Inertia for main shield in the horizontal plane kgm2

Jv,ts Inertia for tail shield in the vertical plane kgm2

Jh,ts Inertia for tail shield in the horizontal plane kgm2

Jv,mb Inertia for main beam in the vertical plane kgm2

Jh,mb Inertia for main beam in the horizontal plane kgm2

Jv,tb Inertia for tail beam in the vertical plane kgm2

Jh,tb Inertia for tail beam in the horizontal plane kgm2

Page 147: report

137

Symbol Description UnitJv,cb Inertia for counterweight beam in the vertical plane kgm2

Jh,cb Inertia for counterweight beam in the horizontal plane kgm2

Jv,c Inertia for counterweight in the vertical plane kgm2

Jh,c Inertia for counterweight in the horizontal plane kgm2

Jv,m Inertia for main DC-motor and main rotor in the vertical plane kgm2

Jh,m Inertia for main DC-motor and main rotor in the horizontal plane kgm2

Jv,t Inertia for tail DC-motor and tail rotor in the vertical plane kgm2

Jh,t Inertia for tail DC-motor and tail rotor in the horizontal plane kgm2

Jtr Inertia for tail rotor blades kgm2

Jmr Inertia for main rotor blades kgm2

τm Thrust torque from main rotor Nmτm,p Petonormal torque from main rotor Nmτt Thrust torque from tail rotor Nmτt,p Petonormal torque from tail rotor Nmτg Sum of gravitationally torque Nmτg,t Gravitationally torque from tail part Nmτg,m Gravitationally torque from main part Nmτg,c Gravitationally torque from counterweight and beam Nmτc Sum of centripetal torque Nmτc,m Centripetal torque for the main part Nmτc,t Centripetal torque from tail part Nmτc,c Centripetal torque from counterweight and beam Nmτf,v Friction torque from bearings ect. in vertical plane Nmτf,h Friction torque from bearings ect. in horizontal plane Nmτkh Torque descending from spring effect in horizontal plane NmFc Centripetal force NFc,m Centripetal force of the main part NFc,mv Centripetal force of the main part in vertical direction NFc,t Centripetal force of the tail part NFc,tv Centripetal force of tail part in the vertical direction NFc,c Centripetal force of counterweight and beam NFc,cv Centripetal force of counterweight and beam in vertical direction NFs,m String force of the main beam NFs,t String force of the tail beam NLh,res Sum of angular momenta in the horizontal plane NmsLv,res Sum of angular momenta in the vertical plane NmsLh Sum of angular momenta from external torques in the horizontal

planeNms

Lv Sum of angular momenta from external torques in the vertical plane NmsLmain Angular momentum from the main rotor spinning NmsLtail Angular momentum from the tail rotor spinning Nms

Page 148: report

138 APPENDIX H. NOMENCLATURE

θv,res Angular position of the TRMS in the vertical plane radθh,res Angular position of the TRMS in the horizontal plane radθv,res = ωv,res Angular velocity of the TRMS in the vertical plane rad

sθh,res = ωh,res Angular velocity of the TRMS in the horizontal plane rad

sθv,res = ωv,res = αv,res Angular acceleration of the TRMS in the vertical

plane

rads2

θh,res = ωh,res = αh,res Angular acceleration of the TRMS in the horizontalplane

rads2

θv = ωv Angular velocity from external torques in the verticalplane

rads

θh = ωh Angular velocity from external torques in the hori-zontal plane

rads

θv = ωv = αv Angular acceleration from external torques in the ver-tical plane

rads2

θh = ωh = αh Angular acceleration from external torques in thehorizontal plane

rads2

θm = ωm Angular velocity of the main rotor rads

θt = ωt Angular velocity of the tail rotor rads

θm = ωm = αm Angular acceleration of the main rotor rads2

θt = ωt = αt Angular acceleration of the tail rotor rads2

µv Viscous friction constant in vertical plane kgm2

s

µh Viscous friction constant in horizontal plane kgm2

s

kh Spring constant kgm2

s2