+ All Categories
Home > Documents > Design of a PID Altitude Controller for a Micro Helicopter

Design of a PID Altitude Controller for a Micro Helicopter

Date post: 10-Mar-2015
Category:
Upload: cocodave
View: 3,002 times
Download: 10 times
Share this document with a friend
Description:
Code is available from:http://pastebin.com/k0PTcNdZVideo documentation is available from:http://www.youtube.com/watch?v=dL30tvTykEE
26
Design of a PID altitude controller for a micro-helicopter D.A Browne University of Birmingham, Department of Mechanical Engineering Abstract A test rig has been designed and constructed to restrict a model helicopter to motion with only one degree of freedom. This simplification has allowed an altitude autopilot to be designed for a micro-helicopter in isolation from cross coupling with other degrees of freedom, as well as allowing the controller to be physically implemented for testing in a low-risk. The autopilot comprises of two SISO controllers; one to maintain a constant rotor blade angular velocity and another to control altitude by varying rotor blade AOA. The controller design has been based upon linearized mathematical models of the micro-helicopters drivetrain and aerodynamics. The controllers have been discretized and tested in combined operation within a non-linear simulation model written in Simulink. Following this the autopilot has been implemented in the C computer language running on a microcontroller that is connected to rotor speed and altitude sensors constructed from Hall-effect devices. The autopilot implementation was successfully tested on a customised Gaui EP-100 micro-helicopter mounted on the test rig. The flight data from this implementation has been recorded to support model verification/refinement as well as to suggest improvements for future autopilot designs. Keywords Micro-helicopter, Autopilot, PID, Flight control, UAV 1. Introduction Micro-helicopters are emerging as a platform for a low cost unmanned air vehicle (UAV) that can carry a small payload such as a camera or other surveillance and reconnaissance equipment. One of the biggest challenges in the implementation of a micro-helicopter UAV is the design of a robust autopilot system due to their fast dynamics, cross coupled degrees of freedom, non-linearity’s and uncertain dynamic parameters. For the case of low cost implementations there are also problems due to inaccurate actuators and low quality sensors. A wide range of research into autopilots for micro- helicopters has already been performed, using a range of different control design methodologies. These include model-based predictive control [1], control [2,3], adaptive control [4] and proportional-integral-derivative (PID) control [5]. The PID autopilot that is proposed in [5] proposes a control structure, but does not suggest a way of obtaining gain values other than through trial and error. The initial aim of this report is to provide the first stage in the derivation of two mathematical models of the micro-helicopter plant to support the design of a PID controller for a new altitude autopilot. The first of these models is to be a linearized continuous time model that can be analysed and used to obtain initial PID gain values. The second model is to be a non-linear model written in the simulation environment Simulink (Mathworks) that can be used to analyse and tune the performance of the controller with various non-linearity’s considered. The aim is for both of these mathematical models to be derived for a generic micro-helicopter design
Transcript
Page 1: Design of a PID Altitude Controller for a Micro Helicopter

Design of a PID altitude controller for a micro-helicopter D.A Browne

University of Birmingham, Department of Mechanical Engineering

Abstract

A test rig has been designed and constructed to restrict a model helicopter to motion with only one degree

of freedom. This simplification has allowed an altitude autopilot to be designed for a micro-helicopter in

isolation from cross coupling with other degrees of freedom, as well as allowing the controller to be

physically implemented for testing in a low-risk. The autopilot comprises of two SISO controllers; one to

maintain a constant rotor blade angular velocity and another to control altitude by varying rotor blade

AOA. The controller design has been based upon linearized mathematical models of the micro-helicopters

drivetrain and aerodynamics. The controllers have been discretized and tested in combined operation

within a non-linear simulation model written in Simulink. Following this the autopilot has been

implemented in the C computer language running on a microcontroller that is connected to rotor speed

and altitude sensors constructed from Hall-effect devices. The autopilot implementation was successfully

tested on a customised Gaui EP-100 micro-helicopter mounted on the test rig. The flight data from this

implementation has been recorded to support model verification/refinement as well as to suggest

improvements for future autopilot designs.

Keywords

Micro-helicopter, Autopilot, PID, Flight control, UAV

1. Introduction

Micro-helicopters are emerging as a platform for a

low cost unmanned air vehicle (UAV) that can carry

a small payload such as a camera or other

surveillance and reconnaissance equipment. One of

the biggest challenges in the implementation of a

micro-helicopter UAV is the design of a robust

autopilot system due to their fast dynamics, cross

coupled degrees of freedom, non-linearity’s and

uncertain dynamic parameters. For the case of low

cost implementations there are also problems due

to inaccurate actuators and low quality sensors.

A wide range of research into autopilots for micro-

helicopters has already been performed, using a

range of different control design methodologies.

These include model-based predictive control [1],

control [2,3], adaptive control [4] and

proportional-integral-derivative (PID) control [5].

The PID autopilot that is proposed in [5] proposes a

control structure, but does not suggest a way of

obtaining gain values other than through trial and

error.

The initial aim of this report is to provide the first

stage in the derivation of two mathematical models

of the micro-helicopter plant to support the design

of a PID controller for a new altitude autopilot. The

first of these models is to be a linearized continuous

time model that can be analysed and used to obtain

initial PID gain values. The second model is to be a

non-linear model written in the simulation

environment Simulink (Mathworks) that can be

used to analyse and tune the performance of the

controller with various non-linearity’s considered.

The aim is for both of these mathematical models

to be derived for a generic micro-helicopter design

Page 2: Design of a PID Altitude Controller for a Micro Helicopter

so that they are easily applicable to a range of

different micro-helicopters.

In order to focus on altitude control, a test-rig has

been designed and constructed to hold a micro-

helicopter and to restrict all of its available degrees

of freedom except altitude. The use of this test-rig

has been included in the two mathematical models.

The second aim of this report is to utilize the two

mathematical models to support the design and

tuning of an autopilot for the Gaui EP-100 micro-

helicopter. Once the design of this autopilot has

been completed, it will be implemented on a

modified version of the micro-helicopter that is

mounted on the test-rig. Several tests will then be

performed to provide verification for the two

mathematical models and control design, as well as

suggest future refinements that could be made.

2. Equipment

2.1 Test-rig

Figure 1. Diagram of test-rig design

The test rig that has been designed consists of a rod

that is pivoted at one end, with the helicopter fixed

on the other (figure 1). The helicopter is therefore

restricted to flying through a circular arc about the

pivot.

Although this design does not perfectly represent a

helicopter flying vertically, it greatly simplifies the

equipment design, due to the simple joint

mechanism.

For the case of a helicopter mounted on this test-rig

the altitude is related to the angle made between

the rod and the horizontal (θ). The controller will

use this angle as the altitude parameter to be

controlled.

A small magnet is placed upon the test-rig pivot, so

that it rotates with the rod. The angle of the rod is

then detected using a rotary Hall Effect sensor

which detects the local magnetic field direction.

2.2 Gaui EP-100a

The drivetrain on the Gaui EP-100 is typical for a

micro-helicopter and consists of a number of

components; a battery source, an electronic speed

controller (ESC), a brushless direct current (BLDC)

motor and a set of gears that connect it to 2 rotor

blades. The angle of attack (AOA) of the rotor

blades is controlled through a cyclic / collective

pitch mixing (CCPM) swash-plate mechanism which

is positioned by three servo motors. The height of

the swash plate governs the collective AOA input,

and the orientation governs the cyclic input.

The customized Gaui EP-100 micro-helicopter uses

a Hall Effect switch to measure the speed of the

rotor blades. An on-board microcontroller takes

inputs from the test-rig angle sensor and speed

sensor and outputs control signals to the 3 servo

motors and the ESC. The customized version of the

micro-helicopter has been named the ‘Gaui EP-

100a’ (“a” for autopilot) to differentiate it from the

off-the-shelf version.

The full details of the micro-helicopters

components are found in Appendix 1, a labelled

photo of the micro-helicopter mounted on the test-

rig is shown in Appendix 2 and an electronic

schematic diagram is shown in Appendix 4.

3. Autopilot design

3.1 Overview of proposed autopilot

The altitude of a micro-helicopter is related to two

control inputs; rotor blade collective AOA input and

main rotor angular velocity. These two inputs adjust

the total lift that is produced by the main rotor and

therefore the vertical acceleration of the micro-

helicopter.

θ

Page 3: Design of a PID Altitude Controller for a Micro Helicopter

To control the micro-helicopters altitude, the

autopilot designed in this report uses an approach

of maintaining a constant ‘trim’ rotor blade angular

velocity ( ) and adjusting lift by varying rotor

blade collective AOA.

The autopilot consists of 2 single-input-single-

output (SISO) control systems that are run

simultaneously. Throughout this report, these two

systems will be referred to as the ‘Altitude

controller and the ‘Drivetrain controller’. Each

control system consists of a PID structure

complemented with feed forward terms. The

controllers have been designed using a classical

continuous-time design procedure, and have then

been discretised.

3.2 Controller design specification

The main requirement of the speed controller is

that it maintains a constant trim rotor speed with

zero steady state error. A damping ratio shall be

selected which offers the best trade-off between

the magnitude of the maximum error from

disturbances, and the settling time.

The requirements of the altitude controller are that

it has a steady state error of less than 1° with no

overshoot.

3.3 Linearized continuous time model

3.3.1 Drivetrain

A common assumption that is used in this report is

that the BLDC motor can be analysed in analogy

with a brushed DC motor [6]. For this case it is

considered that there is a direct voltage ( ) applied

by the ESC across the motor stators that causes a

current ( ) to flow that is inversely proportional to

the stator resistance ( ). The magneto-motive

force of this current generates a torque ( ) on

the stator that is proportional to a torque

coefficient ( ) and the motor efficiency ( ). This

torque is summed with any torque load on the

motor ( ), and the net torque ( ) causes an

acceleration of the armature ( ) that is

proportional to the total inertia of the entire

drivetrain at the point of the motor ( ). As the

stator rotates it generates a back EMF ( ) that

opposes the motion due to Lenz’s law [6], with a

magnitude that is proportional to the angular

velocity ( ) and a back EMF constant ( ). The

net voltage applied across the stator therefore

decreases, and so does the acceleration. This

process repeats itself until steady-state when the

net torque is zero {1-4}.

* +

( )

* +

* +

* +

For the brushed DC motor analogy it is assumed

that the voltage that is applied across the motor is

governed by a pulse-position-modulation (PPM)

signal sent to the ESC. The length of the pulse in this

signal corresponds to a certain percentage of the

total battery EMF that is applied by the ESC across

the motor.

The total inertia at the motor consists of a value

equal to the motors own inertia ( ) summed with

the inertia of each of the two rotor blades ( ) and

the gear cog ( ) transferred through the gear ratio

( ){5}[7].

( ) * +

BLDC motors, such as the GUEC GM-812 provided

with the Gaui EP-100 are often provided with a

rating that can be used to approximate the

maximum angular velocity that the motor can

operate at under no load {6}. They are also provided

with an efficiency ( ), maximum power ( )

( ) and voltage ( ) rating.

* +

By considering the relationship between electrical

and mechanical power, the data that is provided

with the motor is used to calculate the back EMF

and torque coefficients {7-11}.

Page 4: Design of a PID Altitude Controller for a Micro Helicopter

* +

* +

( ) * +

( ) * +

* +

Finally, by considering the maximum voltage and

power ratings of the motor, and at what angular

velocity they occur, it is possible to derive the

resistance of the motor stator {12-16}.

( )

* +

( )

* +

( )

* +

* +

* +

The rotor blades on the Gaui EP-100 are assumed to

be symmetrical and have a constant chord. The

aerodynamics of each rotor blades are then

assumed to follow ‘Thin Aerofoil Theory’ (TAT). This

allows the coefficient of lift ( ) and drag ( ) for

each blade to be calculated based upon its

dimensions and AOA {17-18}. It will later be seen

that high AOA values will be used on the blades,

and it is therefore assumed that the parasite drag is

negligible compared to the induced drag {19}.The

validity of these assumptions for other micro-

helicopters will depend on their rotor blades.

* +

* +

* +

For a given gear ratio between the motor and the

rotor ( ), the angular velocity of the rotor can be

related to the angular velocity of the motor {20}.

* +

The lift force and torque acting on each blade can

then be calculated by considering the contribution

made by each element of the blades using the

modern lift equation {21,23} and then integrating

over their entire length {22,24} [8].

( )

* +

* +

( ) ( )

(

) * +

The torque load acting at the motor can be

calculated by considering the transfer of torque

through the motor-rotor gearing for a given number

of rotor blades ( ){25}.

* +

In order to derive a drivetrain transfer function that

relates motor velocity to supply voltage ( ){26},

the torque load at the motor must be linearized

with respect to motor velocity. It is assumed that

with controller action, the motor velocity does not

deviate far from its trim value and therefore can be

approximated by {27}. This allows equation {25} to

be approximately differentiated with respect to

motor angular velocity as shown in {28}. By

considering the applied voltage, back EMF and

torque load together it is possible to calculate the

transfer function as being {29}. This is represented

in block diagram form in (Figure 3a).

Page 5: Design of a PID Altitude Controller for a Micro Helicopter

( ) ( )

( ) * +

* +

(

)

( )

(

*

* +

3.3.2 Kinetics

The lift that the rotor blades produce always acts

perpendicular to the test-rig rid. The lift force

therefore generates a torque about the test-rig

pivot ( ) that is proportional to length of the rod

( ) and is uniform with respect to test-rig angle

{30}. The weight of the rod and micro-helicopter

always acts vertically downwards, and therefore

generates a torque that varies with the cosine of

the test-rig angle ( ) {31}.

* +

( * * +

The net torque acting on the rod is the sum of the

torque due to the lift and weight forces. This net

torque causes the rod to angular accelerate at a

rate inversely proportional to the total inertia of the

test-rig system ( ) {32}. The total inertia is

calculated by modelling the system as a lump mass

on the end of a rod {33}.

* +

* +

In order to derive a kinetics transfer function that

relates rotor blade AOA to altitude ( ( )){34}, {32}

must be separated into the lift and weight

components. The transfer function then models the

lift component, and the weight is considered as a

constant disturbance on the system for any given

test-rig angle ( ( )){35}, as shown by the block

diagram in (Figure 3c). The resultant transfer

function is given in {36}.

( ) ( )

( ) * +

( ) (

)

* +

( )

* +

3.4 Gaui EP-100a Parameter trimming

For the drivetrain controller being designed in this

report, the rotor blade angular velocity will be

maintained at a single trim rotor blade velocity. The

trim velocity is selected such that when the rotor

blades are at a chosen trim AOA ( ) the net torque

on the test-rig is zero when it is perfectly horizontal

{37}.

√ (

)

( )

( )

* +

The trim AOA is chosen based on the relationship

between the steady state motor velocity and AOA

for an arbitrary voltage applied across the motor.

Considering the motor resistance to be constant,

this is related to the electrical power being applied

as seen in {1,2,9}. The steady state speed is

obtained by equating the torque load on the motor

to the torque provided by the motor {38-41}. By

considering the lift produced with this steady state

velocity and AOA combination it is possible to

derive a lift to electrical power discharge ratio. By

selecting the AOA which gives the highest ratio, the

fly time of the helicopter can be maximised.

( )

(

) * +

( )

( )

( )

* +

Page 6: Design of a PID Altitude Controller for a Micro Helicopter

( ( )

*

(

* (

*

The lift-voltage relationship for the Gaui EP-100

with a 7.4V input is plotted in (Figure 2). It is

revealed that it is most power efficient to operate

at high rotor blade AOA. However, TAT does not

take into account stalling, which will occur

approximately after 15degrees, and dramatically

reduce lift.

For a controller to use AOA as a control input, it

requires a reasonable range of possible values to be

available. Considering that the maximum AOA

before stalling occurs is 15°, a trim AOA of 10° is

selected for the Gaui EP-100a as a trade-off

between operating range and power efficiency {41}.

Using {37} this results in a trim rotor velocity of

or a trim motor velocity of

{42}.

* +

* +

Figure 2. Lift to electrical power ratio for

GUEC GM-812 with 7.4v applied voltage

3.5 Gaui EP-100a Hardware

limitations

It is recommended from empirical reasoning that

the time sampling frequency of a discretized

controller ( ) is at least 10 times faster than the

closed loop bandwidth frequency ( ){43-44}. It is

also recommended that the controller sample time

( ) is 10 times smaller than the required settling

time ( ) {45}[9]. It will later be seen that the

closed loop system for both the SISO controllers are

second order. The 5% settling time for a second

order system can be approximated as being equal

to 3 time constants {46}[10]. The consequence of

this is that the closed loop bandwidth frequency of

both the altitude and drivetrain controllers is

limited by the minimum possible sample time.

* +

* +

* +

* +

3.5.1 Drivetrain controller limitations

The speed sensor used on the Gaui EP-100a outputs

a reading with a time period ( ) that is inversely

proportional to the rotor velocity {47}.

* +

At the operational trim speed, is calculated as

being equal to . However, to account for

disturbances to the speed and to leave a factor of

safety, the microcontroller samples the speed

reading every 30ms. This time period is used as the

discretized drivetrain controller sample time

( ){48}. Using {43-46}, this restricts the drivetrain

closed loop bandwidth frequency ( ) to the

limitations given in {49-50}.

* +

* +

* +

Page 7: Design of a PID Altitude Controller for a Micro Helicopter

Due to its method of operation, the instantaneous

speed sensor reading represents the average speed

reading over half a cycle. This can be approximated

as a speed reading with a time delay ( ). There is

also potential for there to be an additional speed

reading time delay due to the microcontroller

calling a speed response before a new speed

reading is available( ). The maximum time delays

that will be considered will be when speed reading

time period is and the speed reading is an

entire cycle old {51-53}. The total delay has the

potential to make the controller become unstable,

and will therefore have to be analysed before the

design is completed.

* +

* +

* +

The drivetrain controller is also limited to applying a

maximum voltage of across the motor due to

the battery supply and motor ratings. This

saturation has the potential to make the physically

implemented controller behave differently to the

linear system analysis that will be performed. This

limitation will also have to be analysed before the

design is completed.

3.5.2 Altitude controller limitations

The servo motors which control the rotor blade

AOA on the Gaui EP-100a are limited to a no load

velocity of . When these motors are used

to control the rotor blade AOA, they are placed

under a torque load due to the aerodynamic turning

moment of the rotor blades. It is therefore

conservatively assumed that the maximum servo

motor velocity under load is . From the

swash-plate mechanism analysis in (appendix 3),

the maximum rate of change of AOA can then be

approximated as being {54} .

* +

The servo motors on the Gaui EP-100a are required

to vary angle of attack through a range of .

A time sample rate ( ) of is therefore

chosen to give the servo motors time to move the

blades through their full range of AOA before the

next controller demand {55}. Using {43-46}, this

restricts the altitude closed loop bandwidth

frequency to the limitations given in {56-57}.

* +

* +

* +

For the altitude controller it is considered that any

hardware time delays other than that due to the

sample time of the microcontroller are negligible,

and therefore the maximum time delay is equal to

the sample time {58}. Like with the drivetrain

controller, this delay must be analysed before the

altitude controller is completed.

* +

The servo motors on the Gaui EP-100a also have a

minimum resolution of rotation which from the

swash-plate analysis can be seen to correspond to

an equivalent of change in rotor blade AOA. It

can therefore be assumed that at steady state, the

achieved AOA is on average from the

demanded AOA. This is considered as a steady state

“quantization” disturbance ( ) acting on the

micro-helicopter {59} as seen in (figure 3b).

( )

* +

3.6 Controller design

3.6.1 Drivetrain controller design

The drivetrain controller ( ( )) controls the

drivetrain plant by sending a PPM signal to the ESC

that corresponds to a desired voltage to be applied

across the BLDC motor. This voltage depends upon

the error in motor velocity ( ( )){60}. The

Page 8: Design of a PID Altitude Controller for a Micro Helicopter

drivetrain plant ( ( )) is a type 0 first order

system, which means that a proportional plus

integral controller is required to remove steady

state errors for step inputs {61}[11]. The controller

in series with the drivetrain plant results in the

open ( ( )) and closed ( ( )) loop transfer

functions given in {62,64}.

( ) * +

( ) ( )

( ) (

* * +

( )

( )

(

*

* +

( )

(

)

The effect of the hardware time delay on the

drivetrain controller can be analysed by modelling it

as its own transfer function ( ( )) using a

second order Pade approximation {64-65}[13]. The

controller with the time delay ( ( )) can then

be modelled as the closed loop transfer function in

series with the time delay transfer function {66}.

( ) ( ) * +

( √

)( √

)

( √

)( √

)

( ) ( ) ( ) * +

As stated in the design specification, the damping

ratio will be chosen to offer the best trade-off

between settling time and maximum overshoot. A

value that is commonly used to meet this is 0.707;

the lowest value for which there is no resonance

response for any frequency {67}[12]. For this case,

{49} imposes the limitation for the value of and

the highest possible value is chosen to obtain the

smallest possible settling time {68}. The drivetrain

controller gains are then chosen by pole placement

on the close loop transfer function, neglecting the

effect of the time delays {69-70}

* +

* +

* +

* +

The robustness of the controller using the gains

obtained in {69-70} for the system with the

maximum expected time delays is first tested using

a Root Locus (figure 4a) and then a Bode plot (figure

4b).

The Root Locus plot reveals that the gain values

selected using pole placement result in a system

that is under-damped ( ). With a gain

modification of 0.12, the system is reverted to the

initially desired damping factor ( ) {71-

72}. If the time delay is smaller than the maximum

values that have been analysed, the system

becomes critically damped.

The Bode plot reveals that with the gain

modification, the controller has an acceptable

phase and gain margin of and

respectively.

( ) * +

( ) * +

Page 9: Design of a PID Altitude Controller for a Micro Helicopter

Figure 3. Block diagram of: a) Drivetrain plant, b) Drivetrain plant + controller, c) Altitude

plant, d) Altitude plant + controller

A)

B)

C)

D)

Page 10: Design of a PID Altitude Controller for a Micro Helicopter

Figure 4. Drivetrain system a) Bode Plot b) Root Locus Plot

Page 11: Design of a PID Altitude Controller for a Micro Helicopter

As the drivetrain plant can be modelled with

reasonable accuracy, it is possible to implement a

feed-forward term to complement the feed-back

controller. It will be seen later that this reduces the

maximum overshoot from a speed disturbance.

The feed-forward controller ( ) is made up of 2

terms. The first term is an applied voltage that is

used to match the back EMF of the motor at the

trim motor speed. The second term is another

applied voltage that is used to match the

aerodynamic torque load for varying AOA at the

trim motor speed {73-74}.

* +

(

) * +

The exact drivetrain controller values that are used

for the Gaui EP-100a are given in {75-77}.

* +

( )

* +

( ) ( ) ( ) * +

3.6.2 Altitude controller design

It is has been seen in section 3.3.2 and 3.5.2 that

there are 2 disturbances acting on the altitude

plant; weight and quantization. The controller uses

an approach of applying a feed-forward AOA term

that which is expected to make the rotor generate

enough lift to cancel out the weight disturbance

{78}.

* +

In reality, the feed-forward term will not perfectly

cancel out the weight disturbance due to

inaccuracies in the calculations for the lift

coefficient. For this controller, it is assumed that the

feed-forward term will be calculated to within 10%

accuracy of the value required to perfectly cancel

out the weight disturbance. It is therefore

considered that there is still a reduced modified

weight disturbance ( ( )( )) acting on the micro-

helicopter {79}.

( )( ) (

)

* +

Feed-back control is used to increase the lift to

provide acceleration for changing position as well as

to remove error due to the 2 disturbances. It

achieves this by varying the rotor blade AOA with

respect to altitude error ( ( )) {80}.

( ) ( ) ( ) * +

The altitude plant ( ) is a type 2 second order

system, which means that the altitude controller

( ) requires proportional ( ) plus derivative

action ( ) to provide a stable controller response

{81}. Integral action cannot be easily implemented

on this system, as it will result in a negative phase

margin. The controller in series with the altitude

plant results in the open and closed loop transfer

functions given in {82,83}.

( ) ( )

( ) * +

( ) (

)

* +

( )

(

)

* +

Like the drivetrain controller, the time delay of the

system is analysed using a Pade approximation {84-

85}, which is then modelled in series with the

closed loop transfer function {86}.

( ) * +

( √

)( √

)

( √

)( √

)

Page 12: Design of a PID Altitude Controller for a Micro Helicopter

( ) ( ) ( ) * +

Type 0 second order systems will have steady state error gains when subject to a disturbance [11]. The magnitude of the steady state error is calculated by taking the limit of error as time goes to infinity {87}.

( ( )

) * +

The altitude controller requirement for a steady

state error less than 1° can then be achieved by

selecting an appropriate value for {88}.

It is seen through pole placement that this gain

value results in a closed loop bandwidth {90} that is

achievable with the selected controller sample time

limitations {56-57}{91}.

( ( )

)

* +

* +

* +

The altitude controller requirement for no

overshoot can then be achieved by selecting a value

for through pole placement that results in a

critically damped system {91-92}.

* +

* +

The robustness of the controller using the gains

obtained in {88,91} for the system including time

delays is also tested using a Root Locus (figure

5a)and then a Bode plot (figure 5b). The Root Locus

plot reveals that no gain modification is required to

obtain the desired damping ratio. The Bode plot

reveals that the system has a high gain and phase

margin of 30dbB and 73.4deg respectively.

The exact altitude controller values that are used

for the Gaui EP-100a are given in {93-94}.

( ) * +

( ) ( ) ( ) * +

3.7 Controller discretization

The two finished controllers are discretized using a

zero-pole match algorithm. The discretization uses

the time samples given in {48,55}.

3.7.1 Drivetrain controller discretization

The results for the drivetrain controller

discretization are given in {95,96}.

( )

* +

3.7.2 Altitude controller discretization

The results for the altitude controller discretization

are given in {97,98}.

( ) * +

* +

3.8 Non-linear Simulink model

The non-linear model of the micro-helicopter is

presented in this report in 3 layers.

The first layer, shown in (figure 6a), models the

discretized controllers in series with the micro-

helicopter plant. The two controllers can be

simulated operating simultaneously. On this layer

the time delays due to the microcontroller sample

time is modelled, as well as the voltage and AOA

saturation limits, and the quantization and

maximum rate of change of the AOA demand.

The second layer and third layer, shown in (figure

6b-c), models the kinetics of the micro-helicopter

mounted on the test-rig as well as the drivetrain

and the aerodynamics.

Page 13: Design of a PID Altitude Controller for a Micro Helicopter

Figure 5. Altitude controller a) Root Locus plot b) Bode plot

Page 14: Design of a PID Altitude Controller for a Micro Helicopter

Before the two discretized controllers are physically

implemented, three tests are performed using this

non-linear with the Gaui EP-100a and autopilot

parameters. Based upon the assumption made in

{78}, the aerodynamic drag and lift on the rotor

blades is modelled as being of the value that is

estimated using TAT.

In total 3 simulations are performed; an isolated

drivetrain controller test, an isolated altitude test

and a simultaneous speed and altitude controller

test.

3.8.1 Isolated drivetrain controller

simulation

This simulation shows the controller response to a

change in rotor AOA from (figure 7a-c)

with a constant speed demand of . For

comparison the result for the feed-back controller

are shown against the feed-back plus feed-forward

controller.

It is first seen that even for a large step change, the

controller response does not suffer from saturation.

As expected there is no steady state error and the

disturbance is removed in approximately . The

feed-forward term alongside the feed-back

controller reduces the maximum error by

approximately .

3.8.2 Isolated altitude controller

simulation

This simulation shows the controller response to a

change in altitude demand from test-rig

angle with the rotor angular velocity fixed at its trim

value (figure 8a-c).

The results show that the steady state error of the

system is kept below the 1° specification. The AOA

response does saturate for short periods of time

when rising and falling, but this does not seem to

have a negative impact on the controller

performance. The controller does show some

undesirable overshoot when it is decreasing

altitude, but its small size means that it doesn’t

cause concern. Despite the AOA quantization, the

simulation results show the controller holding a

steady height without any oscillation.

3.8.3 Simultaneous controller simulation

This simulation models the same change in altitude

demand as 3.8.2, but with a controlled rather than

constant speed (figure 9a-d). No adverse effects are

noticed in the altitude response compared to the

isolated altitude controller simulation.

4. Results

To demonstrate the physical implementation of the

flight controller on the Gaui EP-100a, two tests are

performed. In each test, the ESC PPM range is

calibrated to operate from 0% battery EMF at

pulse length to 100% at pulse

length.

The first test records the isolated drivetrain

controller response to a change in rotor blade AOA

from 5 to 10° whilst trying to maintain a constant

motor speed of . For this test, the drivetrain

controller’s response is deliberately restricted to a

PPM signal with a maximum pulse length

of (an approximate voltage demand of

) as a safety precaution following several

hardware failures.

The second test records the responses from the

speed and altitude controllers running

simultaneously. In this test the altitude demand is

stepped up from test-rig angle and the

speed demand is kept as . In this test the safety

precautions are removed and maximum PPM pulse

length is .

The results from these 2 tests were obtained

through serial telemetry between the

microcontroller and a laptop computer. The results

of these tests are presented in (figure 10a-c) and

(figure 11a-f) respectively.

Page 15: Design of a PID Altitude Controller for a Micro Helicopter

Figure 6. Non-linear Simulink model: a) Overview, b) Helicopter Plant, c) Main Rotor

Page 16: Design of a PID Altitude Controller for a Micro Helicopter

Figure 7. Isolated: a) Drivetrain response, b)

Drivetrain error, c) Applied voltage

Figure 8. Isolated: a) Altitude response, b)

Altitude error, c) Rotor blade AOA

A)

B)

C)

A)

B)

C)

Page 17: Design of a PID Altitude Controller for a Micro Helicopter

Figure 9. Simultaneous Altitude and Drivetrain controller: a) Altitude response, b) Altitude

error, c) Rotor blade AOA, d) Drivetrain response, e) Drivetrain error, f) Applied voltage

A)

B)

C)

D)

E)

F)

Page 18: Design of a PID Altitude Controller for a Micro Helicopter

Figure 10. Physical isolated drivetrain controller results: a) Drivetrain response, b) Drivetrain

error, c) PPM pulse length, d) Rotor blade AOA

A)

B)

C)

D)

Page 19: Design of a PID Altitude Controller for a Micro Helicopter

Figure 11. Physical simultaneous controller results: a) Altitude response, b) Altitude error, c)

Rotor blade AOA, d) Drivetrain response, e) Drivetrain error, f) PPM pulse length

A)

B)

C)

D)

E)

F)

Page 20: Design of a PID Altitude Controller for a Micro Helicopter

5. Discussion

5.1 Isolated speed test

The isolated speed test reveals that for the test

duration, the controller closely matches the results

seen in non-linear simulation3.8.1. The controller

maintains a near-zero steady state error and during

the AOA step, shows an error with a maximum

deviation of 3rad/s which is removed within a 1

second period. Both these results confirm that the

controller meets the initial specifications.

It is seen that the feed forward voltage term that is

applied to counter drag torque is higher than

required and causes an increase in velocity during

the step.

As the test runtime increases the battery which

powers the micro-helicopter discharges and the

battery EMF decreases. This means that

maintaining the same applied voltage across the

motor requires the drivetrain controller to increase

the PPM pulse length throughout time. An example

of this behaviour is observed within the

time frame. As the battery drains, the rotor velocity

repeatedly begins to fall causing the controller’s

integral action to increase the pulse length from

1890ppm to 1930ppm. This increase in pulse length

is roughly equivalent to a 0.25V decrease in battery

EMF or a rate of decrease). Within the

duration of the test the battery drain does not

cause the EMF to drop beneath the controller

demand, and therefore does not present a problem

to the controller.

5.2 Simultaneous controller test

The first observation to be made about the

simultaneous controller test is that compared to the

simulation in 3.8.2 the real altitude controller

response is very noisy. This behaviour suggests that

limit cycle oscillation is occurring in the real system

due to non-linearity’s that were not considered in

the simulation [12].

The simulations performed considered the

following non linearity’s; saturated AOA at due

to stalling {41}, quantization of AOA {59} and

maximum rate of change of AOA {54}}. Additional

non-linearity’s that are expected to exist in the real

system are; quantization and noise of the angle

sensor and coulomb friction in the servo motors

and swash-plate linkages.

The second observation is that within the

time-frame the altitude controller

demands the maximum allowable AOA of 15˚.

During this time period the drivetrain controller

voltage demand exceeds the batter EMF and it is

therefore unable to maintain the rotor trim speed.

Consequently, it is seen that the speed drops to

approximately . It is also seen that in

this same time period the altitude decreases to

approximately test-rig angle, suggesting that

the lift torque being produced is not enough to

balance weight torque. However, at the given rotor

velocity and AOA, TAT predicts that the lift torque

should be greater than the weight torque. This

discrepancy suggests that either the lift/drag-AOA

relationship is highly non-linear in the high AOA

region, or that stall is occurring before AOA.

When the altitude step from occurs at

it is observed that the both the altitude and

drivetrain controllers performance improve. When

the altitude demand is requested, the rotor

blade AOA term reduces below stall value, and it is

seen that the lift of the micro-helicopter increases.

The micro-helicopter rises to the new altitude with

a rise time of approximately 2 seconds. At the

higher altitude, the test-rig angle is held with a

maximum error of . Due to the noise in the

system the controller does not reach a steady state.

At the lower rotor blade AOA value the PPM signal

required to maintain trim speed also decreases and

the drivetrain controller is again able to increase

the rotor speed to trim value. At this point the

drivetrain controller holds the speed value with an

oscillating error with a maximum magnitude of

approximately .

5.3 Recommendations for future work

One of the underlying problems with the autopilot

seems to be that it suffers from non-linear lift

Page 21: Design of a PID Altitude Controller for a Micro Helicopter

coefficients at high AOA. As this report was

concerned with designing a controller for a general

helicopter no lift tests were performed on the Gaui

EP-100’s specific rotor blades. In future it is

recommended that such a test is performed to

accurately predict the AOA when stall will occur. It

would also be recommended that the controller

design procedure is repeated with a lower trim AOA

coupled with a higher trim rotor velocity to reduce

the chance of stalling.

A second recommendation would be to model the

extra non-linearity’s mentioned in 5.2 to try and

replicate the limit cycle that was observed in the

physical system. Additionally it would be

recommended that low noise transmission is added

to any future altitude controller design

specification.

Although the test-rig used in this report was simple

to implement, it doesn’t perfectly replicate a micro-

helicopters altitude DOF due to the varying weight

torque. Given more time and budget, a third

recommendation is that this test rig be replaced

with one which allows the micro-helicopter to fly

vertically rather than through a circular arc. This will

allow any future design to be more easily

implemented on a 6dof micro-helicopter without

modification.

6. Conclusion

In this report a linearized mathematical model of a

micro-helicopter mounted on a test-rig has been

derived for the purpose of supporting the design of

an altitude autopilot. A non-linear model of the

same system has been written in Simulink to

simulate the autopilots response to change in

altitude demand.

These two models have been validated by being

used to design the altitude autopilot for a Gaui EP-

100 micro-helicopter. This autopilot has been

physically and has shown impressive isolated

drivetrain controller results. The results of the test

involving the drivetrain and altitude controllers

running simultaneously has shown some design

choice and modelling errors, and has been used to

suggest future refinements which are expected to

yield a high performance autopilot.

Page 22: Design of a PID Altitude Controller for a Micro Helicopter

Appendices

Appendix 1. Gaui EP-100 parameters

Parameter Value

Unit

4800 ~ 85% ~

15 V

200 W

16/120 ~

145 mm 20 mm 2.7X10-6 Kg m2

900 Mm

Appendix 2. Labelled photograph of Gaui EP-100a

Swashplate

Battery

Servo Motor

ESC

BLDC Motor

Rotor

Microcontroller

Cantilever

Appendix 3. Swash-plate analysis

Page 23: Design of a PID Altitude Controller for a Micro Helicopter

Appendix 4. Electronic schematic diagram

Page 24: Design of a PID Altitude Controller for a Micro Helicopter

Nomenclature Abbreviation Extended

PID Proportional-integral-derivative

AOA Angle of attack

SISO Single-input-single-output

ESC Electronic speed controller

BLDC Brushless direct current

TAT Thin aerofoil theory

CCPM Cyclic / collective pitch mixing

PPM Pulse position modulation

(S),(Z) Analysis in the laplace / discrete time domain

Symbol Definition

Universal constants

g Acceleration due to gravity

Atmospheric air density

BLDC motor

Applied voltage/back EMF

Current

Electrical resistance

Power efficiency

Manufacture specified speed coefficient/back EMF coefficient/torque coefficient

Torque applied by motor/loaded on motor/net

Mechanical/electrical power

Kinetics

Angular velocity of motor shaft/rotor shaft

Trim angular velocity of motor shaft/rotor shaft

Angle of test rig test-rig relative to horizontal

Inertia of entire gearing system at motor/isolated motor/isolated hinged rotor blade/isolated gear cog

Inertia of micro-helicopter and test-rig about pivot

Rotor-motor gearing ratio

Mass of micro-helicopter/ test-rig rod

Torque exerted about the test-rig rod pivot by lift/weight

Aerodynamics

Rotor blade AOA/trim rotor blade AOA

Coefficient of lift/drag for a single rotor blade

Parasite drag coefficient

Rotor blade Oswald’s efficiency

Rotor blade aspect ratio

Lift/drag torque exerted by a single rotor blade

Number of rotor blades

Dimensions

Rotor blade chord/length

Distance from the inner edge of each Rotor blade to the element being considered

Distance from the rotor shaft to the inner edge of each Rotor blade

Page 25: Design of a PID Altitude Controller for a Micro Helicopter

Length of test-rig rod

Control

Controller sample frequency of general/drivetrain/ altitude controller

General controller settling time

Closed loop damping ratio for general/drivetrain/altitude controller

Speed sensor time period

Discretized controller sample time for general/drivetrain/altitude controller

Closed loop bandwidth frequency of general/drivetrain/altitude controller

Time delay acting on drivetrain controller

Time delay acting on drivetrain controller due to speed sensor characteristic / microprocessor sample time

Time delay acting on altitude controller

Drivetrain / altitude controller transfer function

Drivetrain controller proportional / integral gain

( ) ( ) Drivetrain controller modified proportional / integral gain

, altitude controller proportional / differential gain

( ) ( ) Altitude controller modified proportional / differential gain

Angular motor velocity / angle error

Drivetrain/altitude plant transfer function

Open / closed loop transfer function of drivetrain plant plus controller

Open / closed loop transfer function altitude plant plus controller

Transfer function of time delays on drivetrain/altitude controller

Closed loop transfer function of drivetrain plant / altitude plant in series with their respective time delays

Disturbance on altitude controller due to weight/quantization of AOA

References

1. Du, J.F. et al., 2008. Modelling and control of

a small-scale unmanned helicopter.

Proceedings of the Institution of Mechanical

Engineers, Part I: Journal of Systems and

Control Engineering, 222(6), pp.481-492.

2. Wang, W.E.I., 2010. Autonomous Control of

Micro Flying Robot. Journal of Vibration and

Control, 16(4), pp.555-570.

3. Schafroth, D. et al., 2010. Modeling, system

identification and robust control of a coaxial

micro helicopter. Control Engineering

Practice, 18(7), pp.700-711.

4. Dzul, a, Lozano, R. & Castillo, P., 2003.

Adaptive altitude control for a small

helicopter in a vertical flying stand. 42nd IEEE

International Conference on Decision and

Control (IEEE Cat. No.03CH37475),

(December), pp.2710-2715.

5. Raptis, I.A. & Valavanis, K.P., 2010. Linear and

Nonlinear Control of Small-Scale Unmanned

Helicopters (Intelligent Systems, Control and

Automation: Science and Engineering),

Springer.

6. Yedamale, P., 2003. Brushless DC (BLDC)

Motor Fundamentals. Microchip Technology

Inc., pp.1-20.

7. Mazurkiewicz, J. & Co, B.E., 1995. Precision

Motor Control: The basics of motion control

— Part 1. Power Transmission Design,

(September), pp.43-45.

Page 26: Design of a PID Altitude Controller for a Micro Helicopter

8. Bramwell, A.R.S., Balmford, D. & Done, G.,

2001. Bramwells Helicopter Dynamics, A

Butterworth-Heinemann Title.

9. Leigh, J.R., 1985. Applied Digital Control:

Theory, Design and Implementation,

Longman Higher Education.

10. Poo, A. (National University of Singapore).

2010. System Response. In Feedback Control

Systems. pp. 1-33.

11. Poo, A. (National University of Singapore).

2010. Steady State Characteristics. In

Feedback Control Systems. pp. 1-9.

12. Healey, M., 1975. Principles of Automatic

Control, Butterworth-Heinemann Ltd.

13. Mathworks, Analyzing control systems with

delays demo. Control system toolbox.

Available at:

www.mathworks.com/products/control/demo

s.html?file=/products/demos/shipping/control

/MADelayResponse.html [Accessed April 29,

2011].


Recommended