Autopilot Design With Root-Locus
Autopilot Design With Root-Locus
Lecture 10
ae2204 Aerospace Systems and Control Theory
On autopilots
Aircraft autopilots are a common example of the application of classical control theory. Because regulations
for autopilots are very strict, there is little opportunity for experimenting with different or advanced methods of
control system design, and classical control laws are the most common. On the other hand, autopilots are
interesting because more than a single feedback loop is closed, the combined design is often intricate, and
simple, but effective. ``Gain scheduling'' schemes are used to make the autopilot adapt to the complete
operating envelope of the aircraft. In gain scheduling, the gains used in the autopilot are adjusted to follow the
changes in aircraft dynamics that occur across the flight envelope. The most common gain scheduling uses
the dynamic pressure q to adjust autopilot gains for different airspeeds. I hope you can appreciate the amount
of work that goes into checking the autopilot performance across the flight envelope.
We will not go that far in this introductory course in control theory. This example shows the design of only a
few autopilot modes, for a single speed of the aircraft (and assuming that the aircraft dynamics can be taken
to be linear). In the course of the lecture, you will see that it takes closing three individual loops to obtain a
functioning altitude hold mode for the autopilot.
Starting out
We will start by seeing how much you understood from the root-locus method, with a few quick questions on
root-locus. Depending on that, we will see how to proceed.
Before we start of with discussing the structure of the altitude autopilot, it seems a good idea to take a quick
test on root-locus. Don't worry, there is not a lot of calculation involved, at least if you approach this in the
right way.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 1/36
6/30/2020 Practicon Exercise System TU Delft
I have got two pop quizzes on root-locus for you, here is the first. Consider the following figure. This figure
shows the poles and zeros of a system, and a root-locus is performed to evaluate the options for the closed-
loop system. Answer the corresponding questions.
Your answer
Put a check mark for statements that are true and answer the open questions:
How many asymptotic directions does the system in the figure above
1
have?
Put a check mark for statements that are true and answer the open questions:
How many asymptotic directions does the system in the figure above
1
have?
Feedback
Look, here is a sketch of the root-locus. From applying the angle condition you know that the part left of the
leftmost pole, and between the two other poles is part of the root-locus.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 3/36
6/30/2020 Practicon Exercise System TU Delft
Very good, a perfect score. Keep up the good work. Proceed to the next question.
OK, here is the second part of these quick questions on root-locus. Another system this time, similar
questions:
Your answer
Put a check mark for statements that are true and answer the open questions:
How many asymptotic directions does the system in the figure above
3
have?
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 4/36
6/30/2020 Practicon Exercise System TU Delft
Explanation / script
Feedback
Look, here is a sketch of the other root-locus. First thing to notice is that there are now three asymptotes.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 5/36
6/30/2020 Practicon Exercise System TU Delft
You can know that there are three asymptotes, because the system has three more poles than zeros, in this
case four poles and one zero. In such a case, asymptotes go to 60, 180 and -60 degrees. With that, you know
that there must be a chance that the system becomes unstable.
Since the asymptotes will originate somewhere on the left real axis (weighted positions of poles - zeros), the
two root-loci that follow the asymptotes will cross the imaginary axis at some point, creating a closed-loop
system with an oscillation at the gain corresponding to that point.
When inspecting the point -1 with the angle condition, you can see that the angle from the two poles to the
right of this point is 180 degrees, and the angles from the zero and the remaining poles to the -1 point is zero.
Labeling the poles from left to right, the angle condition turns out to:
Very good, again a perfect score. Keep up the good work. Now you can proceed to the next topic
Autopilot structure
Mode control panel
Consider the mode control panel for a Boeing 737 (actually, the simulation version we have currently in
SIMONA), in the following picture:
Such a mode control panel is commonly mounted under the glareshield of an airliner, and forms the interface
to the aircraft's autopilot. Pilots can select different ``modes'' for the autopilot, such as:
Often the autopilot is also used in the ``NAV'' mode, a mode in which the Flight Management System (a
computer that can be used to plan, monitor and execute a complete flight) feeds the autopilot with set-points
for the altitude and heading. In ``NAV'' mode the FMS controls the autopilot logic, otherwise the pilot selects
the mode for the autopilot.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 6/36
6/30/2020 Practicon Exercise System TU Delft
In addition to these ``steady-state'' modes, most autopilots include transient modes for the transition between
one autopilot mode to another. For example an ``altitude capture'' mode, which makes the transition between
a climb or descent mode and the altitude hold mode. When close to the selected altitude, the autopilot will
automatically engage the altitude capture mode, make a maneuver to roughly end up in level flight at the
proper altitude, and then the altitude hold mode is engaged.
Nested modes
As you can see from the list of modes in the previous section, it looks like many different autopilot modes are
possible. These modes are not completely disjunct, however, they normally share a limited number of basic
control modes. Instructors tell student pilots to first concentrate on getting the attitude of the aircraft right, and
only then to worry about the altitude or heading. Likewise, autopilots are designed around basic (roll and
pitch) attitude modes, and the other modes such as altitude hold, climb modes, etc. are extensions built on
these basic modes.
For the symmetric motions, the basic autopilot mode is the pitch attitude hold mode. In this lecture we will be
tuning an altitude hold mode, but to start with we will have to get the pitch attitude mode working correctly.
After that, the altitude mode can be created.
Practical limitations
The design of a control system that is actually implementable (in contrast to a system that only exists in
Matlab or some other package), requires that the designer also considers the actuators and sensor used in
the design. In an aircraft, flight parameters are commonly supplied by different sets of instruments:
Air-data instruments. These instruments provide information based on the pressures and temperatures
measured from the air around the aircraft. Common examples are the pressure altimeter, and the
vertical speed meter.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 7/36
6/30/2020 Practicon Exercise System TU Delft
The block with white striping on the altimeter indicates it is an ``encoding'' altimeter. It indicates that this
altimeter (can) send a binary encoded altitude to other instruments.
Radio navigation instruments. These instruments provide signals from on-ground or satellite-carried
navigation transmitters. Examples are the VOR (VHF Omnidirectional Range), DME (Distance
Measuring Equipment), and of course the GPS (Global Positioning System). The ILS (instrument
Landing System) is an important tool for automated precision landings.
Inertial instruments. These measure the motion of the aircraft. Examples are the Inertial Measurement
System, but also the turn indicator and the artificial horizon. The turn indicator is a gyroscopic
instrument that measures the turn rate (rotation rate around the aircraft's top (z) axis) of the aircraft, the
artificial horizon indicates bank and pitch attitude.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 8/36
6/30/2020 Practicon Exercise System TU Delft
The compass, which uses the earth magnetic field to determine the aircraft heading.
The different signals available for automatic control of aircraft differ in their reliability, the bandwidth
(frequency; i.e. can the instrument follow quick changes in the measured value) with which they are available
and the precision with which they can be measured. Air data signals, such as altitude, angle of attack and
vertical speed derived from pressure and flow measurements are relatively ``slow'' and relatively coarse and
unreliable. Static ports (the openings you need to sense the pressure around the aircraft) can and do freeze
up, giving erratic or erroneous readings.
Signals derived from inertial instruments (gyroscopes and accelerometers) are among the fastest and most
reliable. It is also fairly simple to design a redundant system with these components. Thus, aircraft attitude
can be measured by relatively simple and reliable means.
In a naive approach, one would be tempted to use the vertical speed to improve the performance of an
altitude hold controller. However, since the vertical speed is difficult to measure, designers of aircraft
autopilots have been using other means to implement altitude control.
History of autopilots.
Your answer
A little history quiz, which company or person created the first aircraft autopilot?
Sperry, in 1912, demonstrated in 1914
Collins, in 1933
Honeywell, in 1986
Doolittle, in 1929
Autopilots generally don't use the measured flight path angle for altitude modes, why?
Measuring flight path angle is difficult, complicated and can be unreliable, so the angle of attack is
used instead
Measuring flight path angle is difficult, complicated and can be unreliable, autopilots are based on
measurement of pitch attitude instead and rely on the fact that flight path angle and pitch attitude are
related through the aircraft dynamics
What do you mean, autopilots do not use the flight path measurement?
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 9/36
6/30/2020 Practicon Exercise System TU Delft
Feedback
Nice job! It was Sperry who developed the first autopilot in 1912. The autopilot was demonstrated in a flight in
1914. Collins Radio Company designed and produced short wave radio equipment, and supplied the
equipment to establish a communications link to the South Pole in 1933. Since Honeywell purchased Sperry
in 1986, they have an indirect claim to this feat. James Doolittle was the first pilot to perform an all-instrument
(no visuals) flight, including the landing, in 1929. He was involved in the development and testing of the
artificial horizon and the directional gyroscope.
The dynamics of the altitude response to elevator input are given as:
Kq V
Hγ,δ =
e
2 2 2
s (s + 2ζsp ωsp s + ωsp )
−−
Here the damping of the short period ζsp = 2/√13 and the natural frequency of the short period is
−−
ωsp = √13 (You can see that I tweaked the aircraft a bit to get nice numbers!).
Now for the questions, and I dare you to answer all these without so much as thinking about Matlab or
Python:
Your answer
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 10/36
6/30/2020 Practicon Exercise System TU Delft
Feedback
Very good, a perfect score. Keep up the good work. Now you can proceed to the next topic
You could have done this with the computer, but also by applying Evan's rules. There are four poles and no
zeros in this transfer function, so there must be four asymptotic directions, to 45, 135, 225 and 315 degrees.
The poles in the origin must branch off into the complex plane. Verify with the angle condition (see also the
slides, and your textbook) that no part of the real axis is part of the root-locus here, the poles thus cannot
walk left and right. After branching off into the complex plane, two of these root paths will start to follow the 45
and 315 degree asymptotes, resulting in an unstable system.
Consider the transfer functions for the pitch attitude and the flight path angle together:
As a reminder, the pitch attitude is where the aircraft's noise is pointing, and the flight path angle is where
the aircraft is actually going. Any decent aerospace engineer knows that the difference between the two (at
least in still air, no wind or turbulence) is the aircraft's angle of attack, the angle with which the air hits the
aircraft.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 11/36
6/30/2020 Practicon Exercise System TU Delft
You can see that there is little difference between the two transfer functions, and you can see the following
relation:
The time constant is in the order of 1.4 seconds for the Cessna Citation II laboratory aircraft. This tells the
clever aircraft autopilot designer that when he or she manages to control the aircraft attitude, the aircraft flight
path will follow with a short delay. This approach eliminates the need for knowledge of the flight path angle for
altitude control.
With the parameters , , and , and a structure for the inner loop as given in the following figure:
To get a reasonably fast attitude response, the pole in the origin needs to be moved over the negative real
axis. At a location of -0.4 (I hope you still remember that this means that the associated time constant will be
2.5 seconds), the response is probably acceptable.
Use the root-locus method to find a gain needed to get the pole in the origin moved to -0.4.
In Matlab, use rltool to perform the root-locus calculation. rltool gives you a root-locus plot, and some
controls to select points in that plot. If you select a point (move the small magenta blocks) rltool will give
you the gain needed to get on of your poles to that point. At the same time the other magenta blocks move to
where the other closed-loop poles will be for that same gain. Remember to afterwards always create the
closed-loop system and check that it meets the requirements (hint: damp and pole).
In Python, use rlocus to show the root-locus plot. Take care that your axes are properly defined, and the plot
is approximately square. if necessary, use pyplot.axis('equal') to have square axes and zoom in on the
required region. If you have a new version of the python-control toolbox, you can click on the lines in the root-
locus plot, and the rlocus command will print the gain needed to get one of the closed-loop system poles to
that point. Of course, the other poles also change location, but that is not yet visualised as nicely as with the
Matlab rltool command.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 12/36
6/30/2020 Practicon Exercise System TU Delft
One very important thing to remember is that the root-locus plot is a means to determine on the basis of
the open-loop system properties what the gain should be for a correct closed-loop system behaviour. So, the
root-locus plot for tuning for the diagram above, needs to be calculated for the open loop system. If this does
not yet make sense to you, revise the slides for lecture 9.
Note that the transfer function has a minus sign, since . This minus is simply there because of sign
conventions used in the definition of aircraft dynamics. To perform the root-locus without any problems, use
in the root-locus procedure. However, for the answer you fill in below, remember to correct the sign again!
Your answer
What is the gain of you find with the root-locus tuning (check the sign of
-0.43136
your answer!)?
What will be the damping coefficient of the short period motion after this
0.353
tuning?
Feedback
Model answer
To determine the gain needed for this, as always enter the open-loop system. Then use rltool to tune with the
root-locus method.
%% setup
Kq = -24
wsp = sqrt(13)
zsp = 2/sqrt(13)
Tt2 = 1.4
s = tf('s')
Htde = Kq*(1+Tt2*s)/(s*(s^2 + 2*zsp*wsp*s + wsp^2))
%% tool
rltool(-Htde)
Then grab the pole on the real axis and move it to -0.4
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 13/36
6/30/2020 Practicon Exercise System TU Delft
%% result
Ktheta = -0.443 % this is the gain that came out of rltool
Hc = feedback(Ktheta * Htde, 1)
damp(Hc)
Python version
# setup
Kq = -24
wsp = sqrt(13)
zsp = 2/sqrt(13)
Tt2 = 1.4
# tool
rlocus(-Htde)
plt.axis('equal')
# then zoom in to the interesting region around 0
# check that the gain found indeed gives the proper closed-loop system
Ktheta = -0.443
Hc = (Ktheta*Htde).feedback(1)
damp(Hc)
What happened?
You can see that as you make a root-locus to create an attitude controller, that the complex pair of poles of
the short period starts heading towards their asymptotes. The damping of the short period was not too well to
start out with (a damping coefficient of is not really high), and it can only get worse.
I hope you see that you can also draw such a conclusion without using rltool and Matlab. The transfer
function has one zero and three poles, so it will have asymptotic directions to +90 and -90 degrees. It is also
pretty obvious that the badly damped root-locus poles will follow these asymptotes, and thus get even worse
damping, see the sketch below:
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 14/36
6/30/2020 Practicon Exercise System TU Delft
We need a way to fix this, and the most efficient tactic is applying a rate feedback signal, using a rate gyro to
measure the pitch rate . The rate feedback is used to improve the short period damping before we proceed
with the pitch attitude hold loop.
Rate feedback
The transfer function for the pitch rateresponse to elevator input is:
Here the damping of the short period and the natural frequency of the short period is , -24 and .
Now first a pitch-rate feedback loop is closed and tuned. The objective is not to have the aircraft follow a
reference pitch rate, but only to improve the damping of the short period. Thus, a control structure of the
following type is needed:
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 15/36
6/30/2020 Practicon Exercise System TU Delft
Note the difference with proportional control, the pitch rate feedback gain is in the feedback loop, and simply
adds an input to the elevator command given by the pilot (and later by the newly designed autopilot).
Now enter the transfer function into Matlab, and tune the feedback gain with root-locus. Then answer the
following questions:
Your answer
What is the gain that you need to get a damping coefficient of 0.9 for the
-0.088846
short period? (Again, carefully consider the sign!)
What is the real part of the new short-period poles? -3.49
What is the (positive) imaginary part of the new short-period poles? 1.7
What is the (positive) imaginary part of the new short-period poles? 1.6964293
Explanation / script
%inner 2
z = 2/sqrt(13);
Feedback
This should not be difficult for you now.
As always, the root-locus procedure should be performed on the open-loop system. Here the systems in the
open loop are and the controller with the gain which is to be tuned. For the root-locus procedure, take
initially to be 1, and thus perform the root-locus with .
To determine the gain needed for this, as always enter the open-loop system. Then use rltool to tune with the
root-locus method.
%% setup
Kq = -24
wsp = sqrt(13)
zsp = 2/sqrt(13)
Tt2 = 1.4
s = tf('s')
Hqde = Kq*(1+Tt2*s)/(s^2 + 2*zsp*wsp*s + wsp^2)
%% tool
rltool(-Hqde)
Then grab one of the complex period poles it until you get a damping of 0.9.
%% result
Kr = -0.08948 % this is the gain that came out of rltool
Hc = feedback(Hqde, Kr)
damp(Hc)
The root-locus plot for the pitch rate feedback is fairly simple, with one zero and two complex poles. Tune until
you get a damping coefficient of 0.9. As a check, calculate the closed-loop system using feedback, and verify
that the damping of the closed-loop poles is at 0.9. The poles will be at -3.5031.696. In a next step, the
system with pitch rate feedback serves as the starting point for the attitude controller.
# setup
Kq = -24
wsp = sqrt(13)
zsp = 2/sqrt(13)
Tt2 = 1.4
# root-locus plot alone gives us a very strange (way too large) gain
# zoom in near the origin to get a better view
rlocus(-Hqde)
# add a damping line of zeta = 0.9, if this puzzles you, check the slides of lecture 7
# the length 4 is chosen to be long enough to cross the root-locus branch, simply
# look at the plot first and estimate something appropriate
zeta = 0.9
plt.plot([0, -zeta*4], [0, 4*sqrt(1-zeta**2)])
# you can also run sisotool, and use the upper right plot
sisotool(-Hqde)
In the old days, when people did not have Matlab or similar programs, designers thought twice before
grabbing their slide-rule and starting to do all kinds of tedious calculations. Consider again the system with
the pitch rate feedback applied:
The output of this system is still the pitch rate; the rotational rate of the aircraft around its y-axis. To get the
pitch attitude, integrate the pitch rate:
You can figure out that the closed-loop transfer function for the pitch rate feedback loop turns out to be:
is given by the new poles for the improved short-period damping found in the previous root-locus step (). So,
the closed-loop transfer function must simply be:
Slap a onto this transfer function, and you have got the transfer function for with the pitch rate feedback
active.
Now, your generation is different. You have the open-loop transfer function in entered in Matlab or Python.
Entering the above transfer function to proceed at this point is extra work -- and another opportunity to make
typing mistakes -- , and it is better to let the computer take care of all the work.
Let's start with a basis that can cover the whole autopilot. You need a single input (we are only considering
elevator control) multi-output model. The outputs you need are (for the rate feedback), (for the attitude
control), (verifying flight path) and the altitude . To get that into Matlab quickly, we rely on the systems'
cleverness in converting transfer functions. If you list the transfer functions, you need the following:
Look carefully, and you can see these are all variations on the same "theme"
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 18/36
6/30/2020 Practicon Exercise System TU Delft
You already have . I suggest you now feed the above transfer functions to Matlab as a vector of transfer
functions (in that same order), convert it to a state-space system and fill in the A, B, C, and D matrix to check
that we really all entered the same system. Take , , , -24 and .
Also, take care that the system order does not get larger than strictly necessary. Use minreal, but only if you
need to!
If you are using Python, enter the multi-output transfer function by using tf with 2-dimensional numerator and
denominator arrays. Note that in Python a transfer function is in principle multi-input, multi-output, to get a
numerator or denominator polynomial from a 1-in, 1-out (SISO) transfer function H, use H.num[0][0] or
H.den[0][0]
In this question please produce the base system as a state-space system. Let's call this one sys1 In the next
question we will take the step of applying the feedback.
Your answer
Enter the A, B, C and D matrices of your state-space system here.
A = [ -3.1166 -4.9634 1.8754 -3.4184; 2.1946 -0.7463 -0.0206 -0.3770; 0.4017 0.2993
-0.1754 0.8611; 0.0011 -0.0004 -0.0023 0.0382 ]
C = [-0.3621 -0.3212 0.1393 -0.2243; 0.0750 -0.0615 0.0166 -0.1421; 0.0083 0.0346
-0.0059 -0.0732; -2.6748 1.0644 -23.2402 -11.6387 ]
D = [ 0;0;0;0 ]
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 19/36
6/30/2020 Practicon Exercise System TU Delft
B = [ 7.0342149;
21.088254;
-13.746001;
-20.572582 ]
D = [ 0;
0;
0;
0]
Explanation / script
V = 160;
z = 2/sqrt(13);
Feedback
Glad you made it here. In case you did not succeed in getting the proper system in, here is the Matlab code,
keep it as a reference, because the rest of the lecture will revolve around modifying this model:
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 20/36
6/30/2020 Practicon Exercise System TU Delft
Kq = -24
Tt2 = 1.4
wsp = sqrt(13)
zsp = 2/wsp
VTAS = 160
s = tf('s')
% make a system
% note that you need minreal with Matlab, otherwise the system has a
% whopping 14 states, 10 too many!
sys1 = minreal(ss(Hall))
For Matlab, you really need the minreal call at the end, otherwise the system gets to be of 14th order! Python
does a better job here, if you inspect the system after the conversion, you will see that the A matrix is a 4x4
matrix, so the system is 4th order, which we expect on the basis of the order of the transfer function; the
transfer function for altitude is 4th order, and the others are lower order, but the all share poles with the
altitude transfer function. The trick in Python's case is that the combined 1-in 4-out transfer function needs to
be made from 2d lists of numerator and denominator coefficients.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 21/36
6/30/2020 Practicon Exercise System TU Delft
# setup
Kq = -24
wsp = sqrt(13)
zsp = 2/sqrt(13)
Tt2 = 1.4
VTAS = 160
# the following does not work, need to specify 2d lists (one row for each output,
# one column for each input) with numerator and denominator coefficients
#Hall = tf([[Hq],[Htheta], [Hgamma], [Hh]])
Hall = tf([[Hq.num[0][0]],
[Htheta.num[0][0]],
[Hgamma.num[0][0]],
[Hh.num[0][0]]],
[[Hq.den[0][0]],
[Htheta.den[0][0]],
[Hgamma.den[0][0]],
[Hh.den[0][0]]])
sys1 = ss(Hall)
print(sys1)
# Python does not need minreal!
Note that your matrices may differ from the ones in the model answer. There are, after all, infinitely many
forms of setting up a state equation, and the Matlab and Python codes are free to take the most efficient one.
Changes in the conversion from transfer function to state-space, or in the minreal function, may affect how
the state-space system comes out.
If there are differences between the two state-space systems, as a minimal check, the eigenvalues of the two
A matrices should be the same ones. A complete check would be comparing all the transfer functions that
you get when the state-space system is converted to transfer functions again.
Next we will be looking at implementing the feedback loop gains we find with this system.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 22/36
6/30/2020 Practicon Exercise System TU Delft
You determined a pitch rate feedback gain for the transfer function with pitch rate output, . We need to
somehow implement the following feedback, from two questions ago, in the state-space systems SYS1:
In Matlab, you can apply the feedback operator for this. To select the proper output for the feedback, you
need a feedback matrix. When multiplied with the output vector of the system, this matrix should produce a
vector (in this case a scalar) to subtract from the input signals:
The feedback gain matrix will contain mostly zeros, since we are not using , or feedback here, only
feedback. Create the proper feedback matrix, and apply it to the system. Use the same feedback gain that
you found in the root-locus tuning procedure, two questions earlier. I suggest you then also verify that the
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 23/36
6/30/2020 Practicon Exercise System TU Delft
feedback worked as intended. You should see two short-period poles at approximately , and of course you
can find these by calculating the eigenvalues of the new system with the feedback applied. Let's call this new
system SYS2.
You can view the feedback matrix as a matrix that, when multiplied with the output vector, results in the proper
feedback signal, in this case .
It is also a good idea to check that our expectations (a better damped system, but otherwise similar to the
original one) are correct.
Calculate the pitch rate () response of the original system (SYS1) to a unit step input, and do the same for the
system with improved damping (SYS2). Plot and compare.
Your answer
Enter the A, B, C and D matrices of the closed-loop system.
A = [ -4.9220 -6.5647 2.5698 -4.5365; 1.4691 -1.3898 0.2585 -0.8263; 0.8688 0.7136
-0.3550 1.1504; -0.5831 -0.5186 0.2224 -0.3236 ]
C = [-0.3621 -0.3212 0.1393 -0.2243; 0.0750 -0.0615 0.0166 -0.1421; 0.0083 0.0346
-0.0059 -0.0732; -2.6748 1.0644 -23.2402 -11.6387 ]
D = [ 0; 0; 0; 0 ]
What is the final value of the pitch rate in response to a step input in of the
-1.5856
new system (SYS2)?
What is the final value of the pitch rate in response to a step input in of the
-1.8462
original system (SYS1)?
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 24/36
6/30/2020 Practicon Exercise System TU Delft
B = [ 7.0342149;
21.088254;
-13.746001;
-20.572582 ]
D = [ 0;
0;
0;
0]
What is the final value of the pitch rate in response to a step input in of the
-1.5845038
new system (SYS2)?
What is the final value of the pitch rate in response to a step input in of the
-1.8461538
original system (SYS1)?
Explanation / script
%inner 4
Feedback
Fine. You should have seen that the final pitch rate changed somewhat in the system with pitch rate
feedback, which is logical. The pitch rate output is a constant, non-zero rate, and the controller will, in
response to this, produce a constant addition to the elevator angle .
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 25/36
6/30/2020 Practicon Exercise System TU Delft
Kq = -24
Tt2 = 1.4
wsp = sqrt(13)
zsp = 2/wsp
VTAS = 160
s = tf('s', 0)
% transfer function Hq, basis
Hq = Kq * (Tt2*s + 1) /(s^2 + 2* zsp*wsp*s + wsp^2)
% list of tf's in a vector
Hall = [Hq;
Hq/s;
Hq/(s*(1+ Tt2*s));
VTAS*Hq/(s^2*(1+ Tt2*s))]
% make a system
% note that you need minreal with Matlab, otherwise the system has a
% whopping 14 states, 10 too many!
sys1 = minreal(ss(Hall))
Then, using that, the code to get to the model with feedback is:
To calculate the final value, use the step function. Since only pitch rate is asked, you can trim the system
output, this is most efficiently done by pre-multiplying with a row vector, and in the following example we do it
on the fly, in argument to the step call
t = 0:0.1:50;
y0 = step([1 0 0 0]*sys, t);
y2 = step([1 0 0 0]*sys2, t);
y0(end)
y2(end)
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 26/36
6/30/2020 Practicon Exercise System TU Delft
# setup
Kq = -24
wsp = sqrt(13)
zsp = 2/sqrt(13)
Tt2 = 1.4
VTAS = 160
Hall = tf([[Hq.num[0][0]],
[Htheta.num[0][0]],
[Hgamma.num[0][0]],
[Hh.num[0][0]]],
[[Hq.den[0][0]],
[Htheta.den[0][0]],
[Hgamma.den[0][0]],
[Hh.den[0][0]]])
sys1 = ss(Hall)
# results
print(y0[-1], y2[-1])
print(sys2)
Your notes:
You can use to obtain a system with only one output, so that pre-multiplication by a vector is not necessary.
Attitude control
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 27/36
6/30/2020 Practicon Exercise System TU Delft
By now, you created a system with a better short period damping. Now, we will proceed with the attitude
control loop. The idea is that we can supply a reference attitude to the controller, and that the controller will
implement control input to follow this attitude.
The control scheme is slightly different from the one used for the pitch rate feedback:
Here the transfer function is the transfer function for the attitude response to elevator input with the pitch rate
feedback active. The first job is prying this transfer function out of the state-space system (sys2), so that we
can again make a simple feedback tuning with root-locus. Start with the state-space system sys2 that you
created from the original open-loop aircraft dynamics by adding the rate feedback. To get the transfer
function, select the pitch attitude output of the total system (easiest by pre-multiplying the system with a row
matrix), and convert to a transfer function; in Matlab:
In Python
Now, we need to tune the attitude feedback gain we need to get a proper attitude response, again, tune until
the real pole is at -0.4, and then answer the following questions:
Your answer
What is the gain that you need to move the pole that was originally in the
-0.47647
origin to -0.4?
What is the damping coefficient () of the short-period poles after applying
0.617
this attitude feedback?
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 28/36
6/30/2020 Practicon Exercise System TU Delft
Feedback
With sisotool (in Matlab), you can determine which gain you need to move the real pole to the origin. Verify
the location and damping coefficient of the resulting short-period poles. In Matlab, for example
% split off the proper transfer function, assuming sys2 contains the
% state-space representation of the system with pitch rate feedback
Hth = minreal(tf([0 1 0 0]*sys2))
% simply get everything from sisotool
sisotool(Hth)
You see that the damping coefficient of the short period poles started at 0.9 and moved to 0.62 in the process
of creating the pitch attitude hold mode. We will see how much worse or better the damping gets when the
altitude mode is added.
Your notes:
Use a sign as you cannot tune a negative controller!
Recall the control structure that we are using for the pitch attitude controller:
In contrast to the pitch rate feedback, the input of the closed-loop system is now a set-point, in this case for
the pitch attitude (). Create the closed-loop system, now with as input, and with the same outputs as before.
Start with the state-space system that has the rate feedback incorporated (sys2). Note that that system has 4
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 29/36
6/30/2020 Practicon Exercise System TU Delft
outputs (, , and the altitude ). Create the final closed-loop system (sys3) also as a system with four outputs,
and use a feedback matrix that converts the 4-dimensional output to the 1-dimensional () feedback variable.
Your answer
Enter the A, B, C and D matrices of the closed-loop system (sys3, with the feedback applied).
A = [ -2.9328 -8.1966 3.0093 -8.3057; 2.2685 -2.0456 0.4351 -2.3411; 0.3541 1.1358
-0.4688 2.1256; 0.0606 -1.0466 0.3647 -1.5433 ]
C = [-0.3621 -0.3212 0.1393 -0.2243; 0.0750 -0.0615 0.0166 -0.1421; 0.0083 0.0346
-0.0059 -0.0732; -2.6748 1.0644 -23.2402 -11.6387 ]
D = [ 0; 0; 0; 0 ]
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 30/36
6/30/2020 Practicon Exercise System TU Delft
B = [ 7.0342149;
21.088254;
-13.746001;
-20.572582 ]
D = [ 0;
0;
0;
0]
Feedback
The simplest method of creating the new system with pitch rate feedback and pitch attitude control is by
scaling the input with the gain for the pitch attitude controller found previously, and note that the pitch attitude
is fed back with unity gain:
Kth = -0.47
K = [ 0 1 0 0]
sys3 = feedback(Kth * sys2, K)
t = 0:0.05:20;
y = lsim(sys3, ones(size(t)), t);
plot(t, y(:,2))
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 31/36
6/30/2020 Practicon Exercise System TU Delft
Kth = -0.47
# settling times
print(t[(y1 < 0.95) + (y1 > 1.05)][-1])
print(t[(yc < 0.95) + (yc > 1.05)][-1])
You see that we started with a high damping coefficient (0.9) for the aircraft with pitch rate damping and
ended up with a reasonable damping coefficient (0.62).
Note that it is also possible to tune the rate feedback loop after tuning the attitude controller. If you do that,
then you will see that the tuning to improve damping will affect the placement of the pole at -0.4. If you want to
have complete control (note that this falls outside the scope of this lecture), look into techniques for pole
placement.
You might have also noticed that the response of the pitch attitude controller is a bit faster than the response
of a first-order system with a time constant equal to the dominant time constant of the pitch attidude control
system. This is caused by the presence of the zero in the numerator.
Your answer
What is the final value of the flight path angle in response of sys3 to a unit
1.000
step input in ?
What will be the settling time for the flight path angle response of sys3 to a
7.72
step input, using a 5% criterion?
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 32/36
6/30/2020 Practicon Exercise System TU Delft
Feedback
OK. If your third feed back system is correct, the third output of the system is the flight path response. The
input is the reference attitude. Plot the flight path reaction in response to a step in reference attitude , with
Matlab:
t = 0:0.05:20;
y = lsim(sys3, ones(size(t)), t)
plot(t, y(:,3))
% or, equivalent
y = step(sys3, t)
plot(t, y(:, 3)
% the step function is special-purpose, lsim can calculate a more general response,
% but in this case the ones(size(t)) implements a step input
The whole thing again with Python (extending your previous scripts)
# settling time
print(t[(yg < 0.95) + (yg > 1.05)][-1])
You can verify for yourself that the flight path response is basically following the attitude set-points supplied to
the attitude control loop!
Note also that the settling time is really close to the value for a first-order system with a time constant of 2.5 s
(with , check Chapter 4 in Nise if you forgot this). The flight path () response does not have a zero in the
transfer function, and you see that its dominant pole almost completely defines the response.
Altitude controller
Now for the final tuning of the altitude controller. The block diagram for the altitude control is:
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 33/36
6/30/2020 Practicon Exercise System TU Delft
The rate feedback for improving the short period damping (the feedback of with gain .
The attitude controller, creating the attitude hold system (unity feedback of with the proportional
controller with gain )
The altitude controller, creating the altitude hold system, and following a reference altitude .
The green block represents the set of controllers that we have tuned until now (sys3). Now, all that is left is
tuning the altitude controller. Continue with a system that has the pitch rate feedback and the attitude control
loop implemented, and now tune the altitude control.
Now, apply the root-locus method one last time in this lecture, and tune the loop so that the dominant poles
(and I hope you remember which ones these are), have a damping coefficient of 0.7.
Before you do that, a few hints. On my version of Matlab, the transfer function for altitude does not turn out
that logical, first run:
% assuming that sys3 is the system with theta and q feedback, and its
% fourth output is the altitude:
>> H = tf([0 0 0 1]*sys3)
Transfer function:
-5.62e-13 s^3 - 2.173e-12 s^2 - 6.483e-12 s + 1805
--------------------------------------------------
s^4 + 6.99 s^3 + 30.93 s^2 + 11.28 s
The zeros appear due to numerical inaccuracies. Minreal does not remove them. For easier calculations with
rltool, it is simplest to remove them by hand:
With Python:
H = tf(sp.matrix([[0, 0, 0, 1]])*sys3).minreal()
# the removal process is slightly different here, we just remove the small leading terms of th
H.num[0][0] = H.num[0][0][-1:]
print(H)
Your answer
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 34/36
6/30/2020 Practicon Exercise System TU Delft
What is the gain of you find with the root-locus tuning? 0.00119
What will be the settling time to a step response, with a 5% criterion? 10.9
What will be the settling time to a step response, with a 5% criterion? 10.85
Explanation / script
Feedback
Select the proper transfer function, so you can start working with evans or sisotool. In Matlab:
Hh = minreal(tf([0 0 0 1]*sys3))
sisotool(Hh)
Matlab does not manage to properly clean the transfer function, there are some (very small) components with
, and in the numerator. These are annoying, but not really a problem for subsequent work with the sisotool.
Watch the scales on the root-locus plot, and instead zoom in to a more reasonable range, on a 10x10 plot.
Then pick the proper points with a damping coefficient of 0.7. Note that for the dominant poles, you have to
pick the pair close to the origin. These start as real poles (at 0 and -0.4), move towards each other and then
branch off into the complex plane.
With a gain of =0.0012, these poles will have a damping coefficient of 0.7.
H = tf(sp.matrix([[0, 0, 0, 1]])*sys3)
H.num[0][0] = H.num[0][0][-1:]
rlocus(H, sp.logspace(-4, -1, 500))
This concludes the e-lecture on applying the root-locus method in aircraft autopilot design. Summarising, we
have covered:
Some of the principles of autopilot modes. Autopilots provide many modes of operation. Most of these
modes are created by combining basic attitude control (pitch, roll) with a control for the desired
parameter.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 35/36
6/30/2020 Practicon Exercise System TU Delft
It is not always economically feasible to measure the variables you would initially want for a certain
controller. For example flight path angle and angle of attack measurements are difficult or unreliable.
(see the Boeing 737MAX problems for this!)
If you know enough about the dynamics of the system you are trying to control, you can exploit this
knowledge to use other variables in your feedback loop; in aircraft, we use the fact that there is a more
or less fixed relationship between the pitch attitude and the flight path angle to create an altitude
controller with an attitude inner loop.
When working with a computer package, the state-space representations are handy for bookkeeping,
and creating the systems with closed control loops, while keeping a full set of inputs and outputs.
Your notes:
Check this lecture again. Poles were off.
https://practicon.lr.tudelft.nl/practicon/index.html?extauth=1 36/36