Sie sind auf Seite 1von 5

National University of Science & Technology

Course : EE379 - LCS - F15


LCS LAB
Date : 12th -October-2015

Nicholas-Zeigler PID tuning


Prepared by: LE Saad Bin Shams
In todays lab we covered the Nicholas-Zeigler method of tuning the PID controller. We
encountered some problems while tuning the PID in MATLAB Simulink. Since Simulink
simulations are computationally intensive, getting the best possible response was proving
to be quite bothersome.
This document will provide some clarifications and hone the process of PID tuning. I will
be using a script file in defining our system rather than working in Simulink. This effectively
yields the same results but takes care of all the intricacies of mathematical modelling, reduces the settings that can vary across different systems and lets us focus on the PID tuning.
Our question under discussion was as follows:
The plants transfer function is

G(s) =

125,000(s+400)
(s+1000)(s2 +60s+2500)

We know that the value of Kp is 97 to make the system marginally stable.


I am including a MATLAB script that simulates the system under analysis. You can
copy & paste the code in your system to produce the same output.

MATLAB Script

clc

2
3

syms s

4
5

% G = 125 ,000( s +400) /( s + 1 0 0 0 ) ( s 2+60 s + 2 5 0 0 )

6
7
8

num = s y m 2 p o l y ( 1 2 5 0 0 0 ( s +400) ) ;
den = s y m 2 p o l y (( s + 1 0 0 0 ) ( s 2 + 6 0 s + 2 5 0 0 ) ) ;

9
10

G = tf ( num , den ) ; % used to write the t r a n s f e r f u n c t i o n


of the plant

11
12

H =1; % t ells us that the s y s t e m is a unity f e e d b a c k


system

13
14

Kp =97;
% It was m e n t i o n e d in the q u e s t i o n that the Kp
was 97
1

National University of Science & Technology


Course : EE379 - LCS - F15
LCS LAB
Date : 12th -October-2015
15
16

Ki =0;
Kd =0;

17
18

C = pid ( Kp , Ki , Kd ) ; % t r a n s f e r f u n c t i o n of the PID


c o n t r o l l e r is saved in v a r i a b l e C

19
20

T = f e e d b a c k ( C G , H ) ; % f e e d b a c k f u n c t i o n a s s u m e s that
it is a form of n e g a t i v e f e e d b a c k

21
22

step ( T )

After you run the script you should get a step response of the system under analysis.
Which is as follows:

Figure 1: Step Response of the system under analysis with Kp = 97


You can also use this step response graph to find out the settling time which is as follows:

Figure 2: Finding the settling time of the system using the step response graph
2

National University of Science & Technology


Course : EE379 - LCS - F15
LCS LAB
Date : 12th -October-2015
As you can see that the system is producing, albeit decaying but constant time period
oscillations. The time period of these oscillations will be T c which we were interested to
find in our lab.
We will use the step response to find out the value of the oscillation. By clicking on
the desired locations of the graph labels will appear showing the x & y coordinates of the
graph. We then use these values to find out the time period of the oscillations. Which
would ultimately be T c. The values used are as follows:

Figure 3: Finding the time period of the oscillations


This yields T c = 0.001s. We use this, Kp and the table below to find the values of
Kp, Ki, Kd.

Figure 4: Table used that yields the values of Kp, Ki & Kd directly
From this table we get the values of Kp = 58.2, Ki = 1.164 & Kd = 0.0073. We plug
these values in the matlab script to find the step response of the tuned system. Some further
tuning could be done to yield the desired response of the closed loop system.

National University of Science & Technology


Course : EE379 - LCS - F15
LCS LAB
Date : 12th -October-2015
The Nicholas Zeigler tuned system response is as follows:

Figure 5: Step response of the tuned system


Further fine tuning would make the response to our liking. As an example I will increase
the Kd from 0.0073 to 0.073 and the result is as follows:

Figure 6: Step response of the system under analysis


As we can see that the settling time has increased but the overshoot is reduced to nearly
0.

National University of Science & Technology


Course : EE379 - LCS - F15
LCS LAB
Date : 12th -October-2015
Note:
Some of the students plots were blowing up. This is because the PID terms of the
controller were taking the poles of the system in the right-half s-plane and making the
system unstable. Some tinkering with the values of Kp, Ki & Kd should make the
system stable again.
Correction: The transfer function of the unity feedback closed loop system is:

Figure 7: Unity feedback control system

T ransf er F unction =

G(s)H(s)
1+G(s)H(s) R(s)

Das könnte Ihnen auch gefallen