© All Rights Reserved

175 views

© All Rights Reserved

- Robust Control
- Neural Networ of Dc Motor
- azbil SDC25
- Thesis
- FB Control Instrumentation Range 2013
- Modeling Control and Simulation of Two Axes Gimbal Seeker Using Fuzzy PID Controller
- Conc Mapa Pr
- 13-17-600 03 10-02-09
- Automatic Temperature Control of Furnace
- 1S9A28_11-10-07_AVy-en
- Pid Ga Keren Itae
- Manual Sf 960 Cct
- position-control-of-servo-systems-using-pid-controller-tuning-with-soft-computing-optimization-techniques-IJERTV3IS110727.pdf
- Fuzzy Logic in Electrical Systems
- Neural network in action
- Advances in Electronic Control of Hydraulic Servo Systems
- Optimal AGC Regulator for Multi Area Interconnected Power Systems With Parallel AC DC Links
- 0241
- Performance analysis of FL, PI and PID controller for AGC and AVR of a Two-Area Power System
- PID

You are on page 1of 8

College of Engineering

Mechatronics Lab

PID TUNING AND STABILITY

(MATLAB Simulation)

Eng. Waleed A. El-Badry

v1.0

1. Objective

The experiment is aimed to make student acquainted with the preliminary steps to manually

tune a PID controller for a plant model by means of MATLAB.

2. Outcome

Writing mathematical models of plants under investigation in Laplace form using MATLAB.

Developing the mathematical Laplace representation of Ziegler-Nicholas PID controller in

MATLAB.

Finding the critical gain (Kc) and the ultimate period (Pu) to calculate PID gains.

3. Prerequisite

Student should be familiar with the following terms:

System response.

PID controller

Ziegler-Nicholas tuning method.

Also basic understanding of MATLAB syntax is preferred.

The below figure represents the generic closed loop system.

FCE

Controller Plant

Point

Current

Level

Feedback

For implementation in this experiment, we are given the following plant model W p(s):

1 1

() = 3

=

(10 + 1) 1000 + 300 2 + 30 + 1

3

1

() = (1 + + )

v1.0

Assuming unity feedback, redrawing the block diagram:

(1 + + )

Point Current (10 + 1)3

Level

a. Launch MATLAB software.

b. From the Home tab, select New -> Function.

c. Write down the generic plant function as shown in the following snippet:

function [ Wp ] = CreatePlant( num,den )

%CreatePlant Creates plant transfer function.

% The returned value is the system in numerator/denomerator format

%% Parameters

% num : Numerator vector (starting from highest order of

coefficients)

% den : Denomerator vector (starting from highest order of

coefficients)

% plant : Plant transfer function

%% EXAMPLE

% num=[1];

% den=[1 0 1];

% sys=CreatePlant(num,den)

%% Result is

% 1

% sys= ---------------

% S^2+1

%% Function implementation

syms s;

Wp=tf(num,den);

end

Snippet 1 CreatePlant function

e. Close the function file.

v1.0

f. Repeat steps b-e for creating the following snippet for Ziegler-Nicholas generic function:

function Wc = ZieglerNicholasPID( Kc,Ti,Td )

% ZieglerNicholasPID function to generate the PID controller

transfer

%% Parameters

% Kc : Critical gain

% Ti : Reset time (minutes)

% Td : Derivative time (minutes)

%% Function implementation

s=tf('s');

Wc=Kc*(1+(1/(Ti*s))+Td*s);

end

Snippet 2 Ziger-Nicholas PID implementation

g. The final function bonds the two functions (plant and controller) to build the closed loop

system:

function sys = CLS( Wp,Wc )

%CLS Closed loop system function

%% Parameters

% Wp : Plant transfer function

% Wc : Controller transfer function

% sys : Closed Loop transfer function with assuming unity

feedback.

%% Function implementation

CLS=feedback(series(Wp,Wc),1);

end

Snippet 3 Closed loop system bonding

v1.0

6. Open loop system response

Set 1 Y(s)

Point (10 + 1)3

a. From MATLAB command window, we will call the function CreatePlant to create the

transfer function mentioned in shown:

step(sys)

b. From the figure opened, right click on it and select characteristics -> Settling Time, Rise

Time and Steady State. Fill in the table:

Settling Time (sec) 75.2

Steady State (sec) 120

v1.0

7. Finding the critical gain (Kc) via Nyquist plot

a. To plot the Nyquist of frequency response of the plant, write down the following code:

Wp=CreatePlant(1,[1000 300 30 1]);

nyquist(Wp);

b. Right click on the plot and select characteristics -> Minimum Stability

Margins as shown in figure

c. Write down the gain margin Gm (in dB) and convert it to magnitude. Write down the

margin frequency Wc .

2 2

d. Calculate = = 8.0011 , and = = 0.173 = 36.32 and consequently

=

v1.0

e. Check that Kc is the critical gain by writing down the following MATLAB code:

t=0:0.01:200;

Wp=CreatePlant(1,[1000 300 30 1]);

%Setting Kc=8, Ki=~0 and Kd=0

Wc=ZieglerNicholasPID(8,100000,0);

sys=CLS(Wp,Wc);

%plotting step response from t0=0 to tf=200 sec

step(sys,t)

Snippet 4 Plotting the system response at critical gain

After obtaining the critical gain from the previous step, we are able to calculate the P,I and D

parameters and perform comparison of each controller type. According to Ziegler Nicholas

table:

Table 2 Ziegler Nicholas Tuning Chart

P 0.5*Kc = 0.5*8=4 100000 0

PI 0.45*Kc = 0.45*8=3.6 0.83*Pu=0.83*36.32=30.1 0

PID 0.59* Kc = 0.59*8=4.7 0.5*Pu=0.5*36.32=18.2 0.12*Pu =0.12*36.32=4.4

v1.0

Plot the step response of each controller over the plant by writing the following code:

Wp=CreatePlant(1,[1000 300 30 1]);

Wcp=ZieglerNicholasPID(4,100000,0);

Wcpi=ZieglerNicholasPID(3.6,30.1,0);

Wcpid=ZieglerNicholasPID(4.7,18.2,4.4);

t=0:0.01:500;

sys=CLS(Wp,Wcp);

step(sys,t)

hold on

sys=CLS(Wp,Wcpi);

step(sys,t)

sys=CLS(Wp,Wcpid);

step(sys,t)

legend('P','PI','PID')

v1.0

- Robust ControlUploaded bycarlogarro
- Neural Networ of Dc MotorUploaded byedcocu
- azbil SDC25Uploaded byhafizuddinrazali
- ThesisUploaded bySlavisa Kondic
- FB Control Instrumentation Range 2013Uploaded byDaniela Londoño
- Modeling Control and Simulation of Two Axes Gimbal Seeker Using Fuzzy PID ControllerUploaded byRonald Caravaca
- Conc Mapa PrUploaded byRicardo Fujihara
- 13-17-600 03 10-02-09Uploaded byCheleViorel
- Automatic Temperature Control of FurnaceUploaded byAtul Kumar
- 1S9A28_11-10-07_AVy-enUploaded byYen Kong Hau
- Pid Ga Keren ItaeUploaded byMardi Santoso
- Manual Sf 960 CctUploaded bykennty
- position-control-of-servo-systems-using-pid-controller-tuning-with-soft-computing-optimization-techniques-IJERTV3IS110727.pdfUploaded byPhan Anh Tú
- Fuzzy Logic in Electrical SystemsUploaded byGRD Journals
- Neural network in actionUploaded bySerag El-Deen
- Advances in Electronic Control of Hydraulic Servo SystemsUploaded byCamilo Manrique
- Optimal AGC Regulator for Multi Area Interconnected Power Systems With Parallel AC DC LinksUploaded bySai Krishna Velicheti
- 0241Uploaded byOluwaseun Godson
- Performance analysis of FL, PI and PID controller for AGC and AVR of a Two-Area Power SystemUploaded byIJSRP ORG
- PIDUploaded byprashantshivanagi
- 8.pdfUploaded byYulia Sayank Ayah
- Work Shop (23 Hlm)Uploaded byferdhian Rahmansyah
- Ceng4480 A4 PIDUploaded byBUBUN
- H82FPC CW 1 autumn 2018-19 (1)Uploaded byJayshree Mohan
- L14Uploaded byManoj Gupta
- yu2010Uploaded byTolony Tukku
- CristianCastroACCA2014ISSN0719-5567Uploaded byEduardo Lay
- PaperGasificador-PedroAlegríaUploaded byPedroA
- Discrete PID.pptxUploaded byala
- Fc100 Doc Mg11cd02 Vlt Hvac ProgrammingUploaded byapok2040

- spc200Uploaded byIoana Petre
- Pendulum ModelUploaded byVera Kodini
- 1394221Uploaded byAmiroucheBenlakehal
- Auto Matic Flight Controll 4-2Uploaded bytarakae04
- DORNA DLB1 Series Inverter ManualUploaded byjose
- PDF v f Using PID and Encoder EnUploaded byacount.br
- A Comparison of Robustness Fuzzy Logic, PID, And Sliding Mode ControlUploaded byFabiola Gonzalez
- Servo Magazine 2007-12Uploaded byapi-3776285
- An 3318Uploaded byapi-26587237
- ie0512901Uploaded byromuald ouabo
- Controlling Fuel Gas to a Fired HeaterUploaded byMuhammad Imran
- Assignment 1 cpdicUploaded byeja70
- 54395114763_en-USUploaded byRicardo Pinheiro
- Ldc AssignmentUploaded bySneha Mathur
- 7ab9f12748505a763165d069a60c2e2ef962Uploaded byGary Diaz
- PID ScrollbarUploaded byJulieta Maria Rodriguez
- RAM ArticleUploaded byJessica Ross
- Control problemsUploaded bycivaas
- simulare termocuplaUploaded byroscovanul
- fulltext01.pdfUploaded byShaheer Durrani
- Modul II Sensor Dan AkuatorUploaded byPriyono Baron
- Fluids i MenusUploaded byFabio Pompeu Eleuterio Nogueira
- usingdllUploaded byNguyen Anh Duc
- Quanser Robotics Platforms BrochureUploaded byAdriano Nogueira Drumond
- Air-craft- Landing Gear Simulation and ControlUploaded byBerkanErol
- Dc Dc BuckDc Buck Boost ConverterUploaded byrkp369
- Internal Model Control. 4. P I D Controller Design-Rivera 86Uploaded byjricardo01976
- Dynamic responsesUploaded byMelita Ćališ
- Control Systems Aug Aep 2007Uploaded by29viswa12