0% found this document useful (0 votes)
47 views11 pages

EE 340: Control Systems: Lab 5 P, PI and PID Controllers

The document describes Lab 5 tasks on implementing P, PI, and PID controllers in Simulink. Students are asked to build a cruise control system model and use a proportional controller to meet a control objective. Later, they implement a PI controller and adjust the gains to reduce overshoot. Finally, they design a PID controller for a spring damper system to achieve fast response without overshoot or steady-state error. Key Simulink blocks for building models are also listed.

Uploaded by

Muhammad Abbasi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views11 pages

EE 340: Control Systems: Lab 5 P, PI and PID Controllers

The document describes Lab 5 tasks on implementing P, PI, and PID controllers in Simulink. Students are asked to build a cruise control system model and use a proportional controller to meet a control objective. Later, they implement a PI controller and adjust the gains to reduce overshoot. Finally, they design a PID controller for a spring damper system to achieve fast response without overshoot or steady-state error. Key Simulink blocks for building models are also listed.

Uploaded by

Muhammad Abbasi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Fall2021 Control Systems Lab 5

EE 340: Control Systems

Lab 5
P, PI and PID controllers

Student’s Name

Roll No.

Date Performed

Marks Obtained

Instructor’s signature

Instructors: Dr. Sami Ud Din


Lab Engineer: Engr. Awais Yaqoob

Page 1
Fall2021 Control Systems Lab 5

Document history
Version no. Date Modified Author
1 Dec, 2020 Awais Yaqoob

Page 2
Fall2021 Control Systems Lab 5

Introduction
In this lab session an introduction to implementing feedback control in Simulink is given to the
students they implement a PI controller for the cruise control system. Later, the students will be
introduced on how to setup and acquire data using the Simulink Support Package for Arduino
Hardware. This hardware will be used in the remaining Lab sessions of the course.
Task 1: Implementing a Controller for the Cruise Control System in Simulink
Recall the cruise control system of Figure 1 that you modeled in last week’s Lab session.

Figure 1: Cruise Model


Recall that the dynamics of the system were given by:
𝑑𝑣 𝑢 𝑏
= − 𝑣
𝑑𝑡 𝑚 𝑚
where u is the force from the engine and b is the constant of proportionality. For this example, let
us assume the following parameters for the system
m = 1000 kg
b = 50 N sec/m
The model of the system you built has been replicated in Figure 2.

Page 3
Fall2021 Control Systems Lab 5

Figure 2: Cruise Control Block Diagram


Control Objective
The control objective of the system is that the vehicle is required to accelerate from rest to 10
m/s in under 5 secs.
Open-loop response of the system
You had observed in the last lab that the open loop response of the system turned out to be as
given in Figure 3.

Figure 3: Open loop response of the cruise system

Page 4
Fall2021 Control Systems Lab 5

Obviously, the open loop system does not meet the control objective. In this task, you are
required to meet the control objective by implementing a feedback control mechanism. Construct
the block diagram given in Figure 4 in you Simulink model.

Figure 4: PI Cruise control system

A Simple Proportional Controller


For the following Exercises, set KI = 0. The implemented control scheme is now a simple
proportional controller.
Exercise 1
Obtain the closed loop step response of the system described above, slowly increase the value of
Kp and keeping Ki = 0. Does system met the control objective given above? Is there any steady-
state error? (Simulate for 10 sec only)
Ans:

Exercise 2
What is the value of Kp for which system reached nearly 99% of the reference value? Is it
possible for a physical system to achieve object that is obtained for this Kp value? What is the
Solution?
Ans:

Page 5
Fall2021 Control Systems Lab 5

A Proportional-Integral (PI) Controller


In the following, you will be choosing a positive value for the KI gain. Now, the control action
consists of terms that are both proportional to the error and its integral.
Exercise 3
Repeat the simulation with Kp = 600 and increasing Ki. Comment on the response in relation to
the design objective. (Simulate for 40 sec)
Ans:

Exercise 4
What values of Kp and Ki satisfy our control objective? How much is the overshoot in the
system?
Ans:

Exercise 5
Find the value of Kp and Ki for which overshoot is less than 2%. what do you think is the role of
the integral component of the PI controller in the overall response?
Ans:

A Proportional-Integral-Derivative (PID) Controller


PID (Proportional Integral Derivative) controllers are the most widely used controllers in
industrial settings because of their ease of use and the satisfaction of performance they are

Page 6
Fall2021 Control Systems Lab 5

capable to provide the user for many processes. Although the cost/benefit ratio provided by these
controllers is way more than provided by any other controller. Many techniques have been
proposed for their design, because of their widespread use, for the tuning of the parameters of
PID i.ie Kp, Ki and Kd and for the implementation of additional functionalities that improve
their performance. But keep in mind that you do not need to implement all three controllers
(proportional, derivative, and integral) into a single system, if not necessary. For example, if a PI
controller meets the given requirements (like the above exercise), then you do not need to
implement a derivative controller on the system. Keep the controller as simple as possible.
Let suppose a simple spring damper system with following transfer function.
1
𝑇=
𝑠 2 + 10𝑠 + 20

We must design a closed-loop system with PID controller having no overshoot, fast rise time
(less than 0.2s), and no steady-state error.
Exercise 6
Build above system on Simulink and keep values of Kp, Ki, Kd equal to 1.

Exercise 7
Find the appropriate values for Kp, Ki and Kd to meet the control objective.

Exercise 8
Use PID control block provided in Simulink, enter the same parameter, and plot the results.
Simulink→Continuous→PID

Page 7
Fall2021 Control Systems Lab 5

Exercise 9
Convert governing differential equation of cruise control system to transfer function. Use PID
control block as used in Exercise 8 and parameter values from exercise 5 to build model and plot
output graphs.

Page 8
Fall2021 Control Systems Lab 5

Important Simulink Blocks


Constant
Simulink → Sources (or Commonly Used Blocks) → Constant
Integrator
Simulink → Continuous (or Commonly Used Blocks) → Integrator
Transfer Function
Simulink → Continuous → Transfer Fcn
State Space
Simulink → Continuous → State-Space
Saturation
Simulink → Discontinuities → Saturation
Zero-order hold
Simulink → Discrete → Zero-order Hold
Subtract
Simulink → Math Operations → Subtract
Sum
Simulink → Math Operations → Sum
Subsystem
Simulink → Ports and Subsystems → Subsystem
Mux
Simulink → Signal Routing → Mux
Scope
Simulink → Sinks → Scope
To File
Simulink → Sinks → To File
To Workspace

Page 9
Fall2021 Control Systems Lab 5

Simulink → Sinks → To Workspace


Pulse Generator
Simulink → Sources→ Pulse Generator
Ramp
Simulink → Sources→ Ramp
Signal Generator
Simulink → Sources→ Signal Generator
Step
Simulink → Sources→ Step
MATLAB Function
Simulink → User-defined Functions → MATLAB Functions
PID
Simulink → Continuous → PID Controller
Simulink Design Optimization
MATLAB Command line → srolib

P a g e 10
Fall2021 Control Systems Lab 5

P a g e 11

You might also like