You are on page 1of 4

University of Alberta

Department of Electrical and Computer Engineering


EE462 Fundamentals of Control Systems Engineering

Lab #2: PI Controller Design and Second Order


Systems

1 Objective
The objective of this lab is an introduction to controller design. You will design a PI controller
for a DC motor using second order system formula for percent overshoot and settling time
specifications. You are also introduced to Simulink which provides an alternate means for
simulating a broad class of systems. Simulink is integrated as part of Matlab.

2 Introduction
In Lab #1, an armature-controlled DC motor was studied. The open-loop characteristics of
the system were determined. Then it was put under feedback control and the closed-loop
characteristics were studied. In this lab, control of the same DC motor is considered. We try
to control the angular velocity of the shaft (the output of the plant) y = ω by changing the
armature voltage (the input to the plant) u = va . As in Lab #1, the transfer function of the
DC motor is:
Y (s) Km
P (s) = = ,
U (s) (Js + b)(La s + Ra ) + Kb Km

where Km is the motor torque constant, J is the rotor inertia, b is the viscous friction constant,
La is the armature inductance, Ra is the armature resistance and Kb is the back emf constant.
For the nominal transfer function, the parameters are:
Nm Nm Nm
Km = 0.1 , J = 4 × 10−4 , b = 1 × 10−3 ,
A rad/sec2 rad/sec
V
La = 8 × 10−3 H, Ra = 2.0 Ω, Kb = 0.1 ,
rad/sec

We will consider a closed-loop system in a negative unity feedback configuration as shown in


Figure 1, where C(s) is the transfer function of the controller. In a typical tracking control
system, one expects the output of the plant y to follow a given reference signal r. An important
consideration is that the output tracks the reference input asymptotically, i.e., the magnitude of
the steady state error ess = limt→∞ e(t) = limt→∞ (r(t) − y(t)) is sufficiently small. In addition
to this desired asymptotic behaviour, we often want to adjust the transient performance of the
closed-loop. For example, we might want the closed-loop step response to have a fast rise time
Tr1 . Other measures of transient performance are step response percent overshoot P.O., peak

1
R- mE - C(s) U - P (s) Y -
−6

Figure 1: Unity feedback control system

time Tp , and settling time Ts . Another important consideration is the size of the controller
output u. All physical controllers can only provide a finite amount of energy to the plant.
Hence, in practice we must keep u sufficiently small.
A PI controller is given as:
KI
C(s) = KP + .
s
PI controllers are often used in practise to improve transient and steady-state performance of
the closed-loop system. In this lab we try to design a PI controller (i.e., find KP and KI ) to
achieve the desired tracking performance for the DC motor, both in transient and steady-state.

3 Lab Procedure
1. Plot the step response of P (s). Plot the step response of the DC motor when La = 0
on the same axis (using hold). Compare the step responses. Find the poles of the two
systems and explain why they almost have the same step response.
KI
2. When La = 0, find the closed-loop transfer function from R to Y with C(s) = KP + s
.
Write ζ and ωn in terms of KP and KI .

3. Design a PI controller based on the following specifications:

• percent overshoot (P.O.) in step response is less than 10%


• settling time (Ts ) in step response is less than 0.1 sec.

As seen in Step 1, assuming La = 0 does not noticeably change the step response of the
open-loop system. So you can make the assumption La = 0 and use the formulas for
second order systems to design the controller.

4. When La = 0 plot the step response of the closed-loop system with the controller designed
in Step 3. Find the steady-state error (ess ) of the closed-loop system. Compare the actual
percent overshoot (P.O.) and settling time (Ts ) with the design specifications. Why do
you think the actual time specifications are different from the desired values? Find the
poles and zeros of the closed-loop system and comment on the effect of the zeros (if any).
Plot the control effort u and the error signal e.

2
5. Let T (s) be the transfer function of the closed-loop system from R to Y with the original
plant P (s) (i.e., when La = 0.008) and the controller designed in Step 3. Plot the step
response of T (s). Find percent overshoot (P.O.), settling time (Ts ) and rise time (Tr1 )
and evaluate the transient performance. Plot the control effort u and the error signal
e. Find poles and zeros of the closed-loop system and compare them with the poles and
zeros in Step 4.

6. Comparing the results of Step 4 and Step 5, comment on the effect of PI controller on
the steady state error (in step response).

7. Use Simulink to build the block diagram of the closed-loop control system (Figure 1)
with the original plant P (s) (i.e., when La = 0.008) and the controller designed in Step 3.
Set the step input magnitude to 1 and run the simulation. Plot the system output y,
the error e and the control signal u. Include a printout of your Simulink model in your
report. A brief introduction to Simulink is provided at the end of this lab manual.

4 Lab Report
An individual lab report for everyone is required although you may work in groups.

• Your report should be concise and relevant. You should include all the results (including
all plots), Simulink model, analysis and discussion of the results and brief answers and
discussions to the questions posed in the lab manual.

• Limit all numbers to five digits (default format for displaying numbers in Matlab).

• To save the amount of paper used, you are encouraged to place multiple curves on a single
plot (using hold) and multiple plots on a single sheet of paper (using subplot). However,
every curve and plot should be properly labeled.

5 An introduction to Simulink
Simulink is an extension to Matlab for rapid prototyping and simulation. It allows the user to
build models of dynamic systems using block diagrams. Together with the auto-code generator
(RTW), it can be used for real-time control and simulation. Figure 2 shows an example system
model built in Simulink.

1
1 simout
s+1
Step Gain Transfer Fcn To Workspace

Scope

Figure 2: A Simulink model

3
To run Simulink, type simulink at the Matlab prompt. The Simulink Library Browser
window opens, which contains all the blocks available for building models. To create your own
model, click on File, then on New>>Model. You get a new system window, which is used to
build a new Simulink model. This model can be saved as a mdl-file for further editing and
simulation.
Clicking on any of the groups in the Simulink Library Browser will open a sub-group which
contains useful blocks. To build a block diagram, you can get different blocks, such as transfer
function, gain, sum, integrator, etc. from the Simulink Library Browser by dragging and
dropping them onto your model window. Connections can also be made between two blocks by
clicking and dragging. To change parameters within a given block, double-click on that block.
A list of parameters will appear where you can change the parameter values.
¿From the sub-group Sources in the Simulink Library Browser, you can choose the input
signal. From the sub-group Sinks, you can choose different ways to obtain your output sig-
nals. As a useful graphical tool, Scope plots the time response along with the progress of the
simulation. A more elegant way to work with or plot the data generated by Simulink is to use
To Workspace (available from sub-group Sinks). This block transfers the data from Simulink
to Matlab where it can subsequently be viewed, analyzed and plotted. After adding the
To Workspace block to your Simulink model, double click on the block. Give an appropriate
name (e.g., y) to the variable that will hold the data, then under Save format select Array.
Now if you run the simulation, you will have two new variables in Matlab: y holds the data
and tout holds the time. The Simulink generated data can now be plotted in Matlab (e.g.,
by using plot(tout,y)).
Once the system is built, you can run the simulation by clicking on the play (I) button in
the toolbar, or choosing Start from the Simulation menu.

You might also like