You are on page 1of 2

Exercises 160912

The site at http://ctms.engin.umich.edu/CTMS has several exercises that introduce topics in


control by means ot MATLAB and Simulink.

Exercise 1

Train System: Control

You may already have looked at the example of the Train System at
http://ctms.engin.umich.edu/CTMS/index.php?example=Introduction&section=SimulinkModeling.

If not, go through the example if you feel not so familiar with these kinds of models.
At http://ctms.engin.umich.edu/CTMS/index.php?example=Introduction&section=SimulinkControl, the train
system is used for deriving a PID controller. It describes how to make the model into a subsystem block, in order to generate a controller. Look at how this is done. Thereafter, the
subsystem is subject to feedback control, using a PID controller. In the section Running the
closed-loop model, the first attempt at feedback control is simulated, and a huge instability is
found. Given that the train system seems so robust, this is highly surprising. In fact, this is
incorrect, and depends on an error in the constructed the model in the first place.
Can you find the error in the constructed model?.

Exercise 2

Cruise Control: Control

The page
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=SimulinkControl

describes how to model a PID controller in Simulink using simpler circuits. I do not recommend
to do it this way, since there is already a PID block in Simulink. So then, why not use it? The
page
http://ctms.engin.umich.edu/CTMS/index.php?example=CruiseControl&section=ControlPID describes the basic ideas of P and PI-control on this example. If you do not want to be bothered
with transfer functions, you can still read the aspects about selecting gains for P and I control,
and what happens with system behavior.

Exercise 3

DC Motor: Control

The page
http://ctms.engin.umich.edu/CTMS/index.php?example=MotorSpeed&section=ControlPID

describes how to design P, I, and D components to meet some design criteria for a controller.
Go through this (you need not look at the transfer functions if you do not like to).

Exercise 4

Tuning

Go through the example at


http://se.mathworks.com/help/slcontrol/gs/automated-tuning-of-simulink-pid-controller-block.html

to see how a more complex controller can be tuned.

Exercise 5

Controlling Sequence of Tanks

In this problem, we consider a system of two coupled tanks, with a valve controlling the inflow
to the top valve, as in the below figure. We let hi be the level of water in T anki for i = 1, 2,
and let inflowi be the flow (in m3 /s) of water into T anki for i = 1, 2.
The V alve is controlled by the Controller, which controls the flow of water into T anki .
We assume that the V alve can directly control inflow1 .
Each tank T anki has a surface area which is 1m2 , and a current nonnegative level hi of
water. The maximum water level in each tank is 2m. The water level SHOULD NOT
exceed 2m. It has an outflow which is 0.1 times hi (in m3 /s), and goes to the next T ank2 or
the environment. T anki has an inflow inflowi which comes from the V alve or the previous
T ank1 .
The Controller uses the level h2 of the second tank as sensor input to a PI controller,
which in its turn controls inflow1 via the V alve.

V alve
@
@
6@

inflow
-1




h1
T ank1

inflow
-2




h2

Controller 

T ank2




The problems are as follows.


a) Set up equations for the system of tanks, in which we can see how the levels of water
evolve over time.
b) Make a Simulink model, based on these equations
c) Assume that you want to maintain a constant water level of 1m in T ank2 . Design a PI
controller which maintains such a water level.
d) Simulate your control system, starting from two different initial states
1. with both tanks empty, and
2. with both tanks full.
Check that you avoid overflowing any of the tanks. Also note that the output from the
V alve, i.e., inflow1 , cannot be negative.

You might also like