You are on page 1of 21

Sana’a University Analog Control Systems MT311

Faculty of Engineering 3rd Level


Mechatronics Engineering Department

Practical Lab of Analog Control Systems

PID Controller Design

Lab 2

Eng. Moayad A.Hakim


Winter, 2023
1
Agenda 2

 Introduction to PID Controller.


 PID Overview.
 The Characteristics of the P, I, and D Terms.
 Definition of a PID controller in MATLAB using a transfer
function model directly.
 Example Problem1.
 General Tips for Designing a PID Controller.
3
Introduction to PID Controller
 The PID controller is widely employed because it is very
understandable and because it is quite effective. One
attraction of the PID controller is that all engineers understand
conceptually differentiation and integration, so they can
implement the control system even without a deep
understanding of control theory.
 We will discuss the effect of each of the PID parameters on
the dynamics of a closed-loop system and will demonstrate
how to use a PID controller to improve a system's
performance.
PID Overview 4

The output of a PID controller:


The Characteristics of the P, I, and D Terms 5

 Increasing the proportional gain (Kp) has the effect of :


• Cause the closed-loop system to react more quickly,
but also to overshoot more.
• Reduce, but not eliminate, the steady-state error.
The Characteristics of the P, I, and D Terms 6

 The addition of a derivative term to the controller (KD) :


• Adds the ability of the controller to "anticipate" error.
• Tends to add damping to the system, thereby
decreasing overshoot.
• KD has no effect on the steady-state error.
The Characteristics of the P, I, and D Terms 7

 The addition of an integral term to the controller (Ki) :


• Tends to help reduce steady-state error.
• A drawback of the integral term, however, is that it
can make the system more sluggish (and oscillatory).
The Characteristics of the P, I, and D Terms 8

 The general effects of each controller parameter (Kp,KD ,Ki)


on a closed-loop system are summarized in the table
below.
Definition of a PID controller in MATLAB using a 9
transfer function model directly,
Alternatively, we may use MATLAB's PID object 10
Example Problem1: 11

Suppose we have a simple mass-spring-damper system.


Example Problem1: 12

The goal of this problem is to show how each of the terms Kp,
Ki and KD , contributes to obtaining the common goals of:
• Fast rise time
• Minimal overshoot
• Zero steady-state error

Let
m = 1 kg
b = 10 N s/m
k = 20 N/m
F=1N
Example Problem1: 13

Open loop step response:

What do you
notice?!
Example Problem1: 14

Proportional Control

Let the proportional gain (Kp) equal 300 and change the m-file
to the following:
Example Problem1: 15

Proportional Control

Let the proportional gain (Kp) equal 300 and change the m-file
to the following:
Example Problem1: 16

Proportional-Derivative Control
Let Kp equal 300 as before and let Kd equal 10.
Example Problem1: 17

Proportional-Integral Control
Let's reduce Kp to 30, and let Ki equal 70:
Example Problem1: 18

Proportional-Integral-Derivative Control
After several iterations of tuning, the gains Kp= 350, ki= 300,
and Kd= 50 provided the desired response.
General Tips for Designing a PID Controller 19

When you are designing a PID controller for a given system, follow the steps
shown below to obtain a desired response:

1. Obtain an open-loop response and determine what needs


to be improved.
2. Add a proportional control to improve the rise time.
3. Add a derivative control to reduce the overshoot.
4. Add an integral control to reduce the steady-state error.
5. Adjust each of the gains Kp, Ki , Kd and until you obtain a
desired overall response.
Assignment 1: 20

Performance specifications
1. Rise time < 5 s.
2. Overshoot < 10%.
3. Steady-state error < 2%.

The parameters used in this example are


as follows:
1. (m) vehicle mass 1000 kg
2. (b) damping coefficient 50 N.s/m
3. (r) reference speed 10 m/s
21

Any Questions?!

You might also like