nicholas_zeigler.pdf

5
National University of Science & Technology Course : EE379 - LCS - F15 LCS LAB Date : 12 th -October-2015 Nicholas-Zeigler PID tuning Prepared by: LE Saad Bin Shams In today’s 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, re- duces the settings that can vary across different systems and lets us focus on the PID tuning. Our question under discussion was as follows: The plant’s transfer function is G(s)= 125,000(s+400) (s+1000)(s 2 +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 1 clc 2 3 syms s 4 5 % G = 125,000(s+400)/(s+1000)(sˆ2+60s+2500) 6 7 num=sym2poly(125000 * (s+400)); 8 den=sym2poly((s+1000) * (sˆ2+60 * s+2500)); 9 10 G = tf(num, den); %used to write the transfer function of the plant 11 12 H=1; %tells us that the system is a unity feedback system 13 14 Kp=97; %It was mentioned in the question that the Kp was 97 1

Upload: zohaibshabir

Post on 03-Feb-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Nicholas_Zeigler.pdf

National University of Science & TechnologyCourse : EE379 - LCS - F15

LCS LAB Date : 12th-October-2015

Nicholas-Zeigler PID tuningPrepared by: LE Saad Bin Shams

In today’s lab we covered the Nicholas-Zeigler method of tuning the PID controller. Weencountered some problems while tuning the PID in MATLAB Simulink. Since Simulinksimulations are computationally intensive, getting the best possible response was provingto be quite bothersome.

This document will provide some clarifications and hone the process of PID tuning. I willbe using a script file in defining our system rather than working in Simulink. This effectivelyyields the same results but takes care of all the intricacies of mathematical modelling, re-duces the settings that can vary across different systems and lets us focus on the PID tuning.

Our question under discussion was as follows:

The plant’s 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 cancopy & paste the code in your system to produce the same output.

MATLAB Script

1 clc2

3 syms s4

5 % G = 125 ,000( s +400) /(s +1000) (s ˆ2+60 s +2500)6

7 num = sym2poly (125000∗( s +400) );8 den = sym2poly ((s +1000) ∗( s ˆ2+60∗s +2500) );9

10 G = tf(num , den ); % used to write the transfer functionof the plant

11

12 H =1; % tells us that the system is a unity feedbacksystem

13

14 Kp =97; %It was mentioned in the question that the Kpwas 97

1

Page 2: Nicholas_Zeigler.pdf

National University of Science & TechnologyCourse : EE379 - LCS - F15

LCS LAB Date : 12th-October-2015

15 Ki =0;16 Kd =0;17

18 C = pid (Kp ,Ki ,Kd); % transfer function of the PIDcontroller is saved in variable C

19

20 T = feedback (C ∗G,H); % feedback function assumes thatit is a form of negative feedback

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

Page 3: Nicholas_Zeigler.pdf

National University of Science & TechnologyCourse : EE379 - LCS - F15

LCS LAB Date : 12th-October-2015

As you can see that the system is producing, albeit decaying but constant time periodoscillations. The time period of these oscillations will be Tc which we were interested tofind in our lab.

We will use the step response to find out the value of the oscillation. By clicking onthe desired locations of the graph labels will appear showing the x & y coordinates of thegraph. We then use these values to find out the time period of the oscillations. Whichwould ultimately be Tc. The values used are as follows:

Figure 3: Finding the time period of the oscillations

This yields Tc = 0.001s. We use this, Kp and the table below to find the values ofKp,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 plugthese values in the matlab script to find the step response of the tuned system. Some furthertuning could be done to yield the desired response of the closed loop system.

3

Page 4: Nicholas_Zeigler.pdf

National University of Science & TechnologyCourse : 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 increasethe 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 nearly0.

4

Page 5: Nicholas_Zeigler.pdf

National University of Science & TechnologyCourse : EE379 - LCS - F15

LCS LAB Date : 12th-October-2015

Note:

• Some of the student’s plots were blowing up. This is because the PID terms of thecontroller were taking the poles of the system in the right-half s-plane and making thesystem unstable. Some tinkering with the values of Kp,Ki & Kd should make thesystem stable again.

• Correction: The transfer function of the unity feedback closed loop system is:

Figure 7: Unity feedback control system

Transfer Function = G(s)H(s)1+G(s)H(s)R(s)

5