A control system with a Ziegler-Nichols PID controller is represented as shown below.

The Ziegler-Nichols rule for PID loop tuning is used to obtain approximate values for three gain parameters of the PID controller: the controller’s path gain, Kp, the derivative time constant, Td and integrator time constant, Ti. From the feedback transfer function of the system, the gain margin, Ku and the period of oscillation, Tu at the system stability limits are measured and used for tuning the PID parameters. The goal of Ziegler-Nichols PID tuning is to achieve good disturbance rejection.

In the MATLAB Code attached, the plant transfer function, G(s) is first generated from the inputs entered by the user (numerator and denominator of the transfer function). The plant transfer function is used to obtain the closed loop margins (Ku and Tu). The margins are used to calculate the critical path gain (Kc), integrator time (Ti) and the derivative time (Td) to be used for the Ziegler-Nichols PID tuning. For a classical Ziegler-Nichols controller, the values are calculated as: K_{c}=0.6 ×K_{u},; T_{i}=0.5 × T_{u}; T_{d}=0.125 ×T_{u}

The Ziegler-Nichols PID controller is then obtained as: W_{c}=K_{c} (1+1/(T_{i} s)+T_{d} s). The compensated closed loop response is obtained by combining the Ziegler-Nichols controller in series with the plant in a unity feedback system as CLTF=feedback(series(G,W_{c} ),1)

As an example, the step response of the uncompensated and compensated (controlled) systems for a third-order system transfer function, G=1/(s^{3}+4s^{2}+6s+1) is shown in the figure below:

%% To run the code, write the function name into the command window % For Example: %.........Ziegler_NicholsPID %............and press enter %% Inputs to the Ziegler Nichols PID Tuner % num : Numerator(starting from highest order of coefficients)in % form of [] % den : Denomerator(starting from highest order of coefficients)in % form of [] function ZN =Ziegler_NicholsPID() num=input("Enter the numerator of the open-loop system transfer function, num : "); den=input("Enter the denominator of the open-loop system transfer function, den : "); G=CreatePlant(num,den) %Plant transfer function G1=feedback(G,1); [Kcr,Pm,Wcg,Wcm]=margin(G1); %Finding margins of the uncompensated system Tcr=2*pi/Wcg; %Finding the time from the gain margin frequency. Kc=0.6*Kcr; %Critical gain Ti=0.5*Tcr; %Reset time (minutes) Td=0.125*Tcr; %Derivative time (minutes) %Creating Ziegler-Nichols PIDController transfer function Wc=ZieglerNicholsPIDController( Kc,Ti,Td ) %Closed loop system function with Z-N controller in series with the %plant CLTF=feedback(series(G1,Wc),1) % Wp : Plant transfer function % Wc : Ziegler-Nichols PIDController transfer function % CLTF : Closed Loop transfer function (H=1, Unity feedback). t=0:0.01:10; figure (1) step(G1,t, 'b') hold on step(CLTF,t, 'r') hold off legend ("Untuned system","Zieler-Nichols Tuned System") end %% Creating the plant to control %CreatePlant will create the open loop plant's transfer function with the %num and denomitor values entered function [ Plant ] = CreatePlant( num,den ) syms s; Plant=tf(num,den); end %% ZieglerNicholasPIDController function to generate the PID controller transfer function function Wc = ZieglerNicholsPIDController( Kc,Ti,Td ) %Parameters % Kc : Critical gain % Ti : Reset time (minutes) % Td : Derivative time (minutes) % Wc : Ziegler-Nichols PID controller in Laplace s=tf('s'); Wc=Kc*(1+(1/(Ti*s))+Td*s); end

Assignment Writing Help

- Science Assignment Help
- Math Assignment Help
- Chemistry Assignment Help
- Physics Assignment Help
- Biology Assignment Help
- Psychology Assignment Help
- History Assignment Help
- Geography Assignment Help
- English Assignment Help
- Humanities Assignment Help
- Nursing Assignment Help
- Social Science Assignment Help
- Arts and Architecture Help
- Statistics Assignment Help
- Law Assignment Help
- Computational Mathematics Assignment Help

Engineering Assignment Services

- Programming Assignment Help
- Database Help
- Data Structure Assignment Help
- Operating Systems Assignment Help
- Computer Network Assignment Help
- UML Diagram Assignment Help
- IT Assignment Help
- Game Programming Help
- Computer Science Assignment Help
- Information Systems Assignment Help
- Chemical Engineering Assignment Help
- Civil Engineering Assignment Help
- Electrical, Electronics Help
- Mechanical Engineering Assignment Help
- Petroleum Engineering Assignment Help
- Biochemical and Biotechnology Help

Do My Assignment Help

- Accounting Assignment Help
- Finance Assignment Help
- Economics Assignment Help
- Marketing Assignment Help
- Human Resources Assignment Help
- Operations Management Assignment Help
- Strategy and Planning Help
- Project Management Help
- Case Studies Writing Help
- Political science
- Referencing Help
- Assignment Help Websites
- Online Assignment Help
- Do My Assignment
- Do My Homework
- Health Informatics

Write My Essay Services

- Essay Writing Help
- Business Essay Writing Help
- Assignment Writing Services
- Plagiarism Free Essay Writing
- Essay Editing Service
- Dissertation Writing Services
- Thesis Writing Help
- Custom Writing Help
- Write My Essay
- Write My Paper
- Paper Writing Service
- Academic Writing Help
- College Essay Writing
- Cheap Essay Writing