You are on page 1of 13

Name: Lee Swie Oon Student ID: 1091101598 Lab group: 36

Title:
Control System Modeling and Step Response

Objective:
(i) (ii) To design proportional-integral-derivative (PID) controller for closed loop control. To evaluate the performance of different controllers based on maximum overshoot, rise time, settling time and steady-state error.

Procedure:
(a)Open loop system 1) Firstly, a new m-file is created by clicking File -> New -> M-file in the MATLAB command window. A MATLAB editor/debugger window pops up. This is to view the open loop step response. In this window, the following codes is typed and saved as file. num = 1; den = [1 10 20]; step (num, den) num is denoted as the numerator polynomial coefficients in s; den is denoted as the denominator polynomial coefficients in s. Step is a MATLAB function. 3) The m-file is run by clicking Tools -> Run in the MATAB editor/debugger window. The following plot is obtained and shown in figure 1. The final value is checked using Final Value Theorem.

2)

4)

5)

From the response obtained, the maximum overshoot, rise time and settling time is found. (The steady-state error is calculated based on Final Value Theorem.)

Figure 1: Open loop system

(b)Proportional(P) control 1) The closed loop transfer function of the above system with a proportional controller is

The derivation of the closed loop transfer function is shown in table 1. 2) Let the proportional constant equal 300 and the m-file is changed to the following:

= 300; Num=[ ]; Den=[1 10 20+ ]; t=0:0.01:2; step (num, den, t)

3) This m-file is run to obtain the step response plot as shown in figure 2. 4) The relevant entries in Tables 1 and 2 are completed.

Figure 2: Proportional control

(c)Proportional-Derivative(PD) control 1) The closed loop transfer function of the given system with a PD controller is derived and recorded in Table 2. 2) Let equal 300 and let equal 10. A new m-file is created, the necessary codes are typed and the m-file is run and the result is shown in figure 3. 3) The relevant entries are completed in Tables 1 and 2.

Figure 3: Proportional-Derivative control

(d)Proportional-Integral(PI) control 1) The closed loop transfer function of the given system with a PI controller is derived and recorded in Table 1. 2) The Value is reduced to 30, and let equal to 70. A new file is created, the necessary codes are typed and the m-file is run and the results are shown below in figure 4. Note that the proportional constant have been reduced because the integral term also reduces the rise time and the overshoot is increased as the proportional term does (double effect). 3) The relevant entries are completed in Tables 1 and 2.

Figure 4: Proportional-Integral control

(e)Proportional-Integral-Derivative(PID) control 1) The closed loop transfer function of the given system with a PID controller is derived and recorded in Table 1. 2) Trial and error method is used to choose the parameters Four sets of values for are tried and the closed loop step responses are noted. One parameter is varied at one time, in order to see the effects of changing the parameter. These results are recorded in Table 2. The trial and errors are shown in figure 5(i), 5(ii), 5(iii), 5(iv), 5(v). 3) The method is repeated using 4) The relevant entries are completed in Tables 1 and 2. .

Figure 5(i): KP , KI and KD are 1000, 800 and 50 respectively

Figure 5(ii): KP , KI and KD are 400, 400 and 30 respectively

Figure 5(iii): KP , KI and KD are 400, 400 and 50 respectively

Figure 5(iv): KP , KI and KD are 400, 300 and 50 respectively

Figure 5(iv): KP , KI and KD are 350, 300 and 50 respectively

Results:
Table 1
(a) Open loop Transfer function: No. of finite zeros = 0 No. of poles = 2 System order= 2

Final value:

= = = (b) Proportional(P) control Transfer function Derivation: No. of finite zeros = 0 No. of poles = 2 System order= 2 ( )( )

= = Hence, Final value:

= = ( )
( )

=0.938 (c) ProportionalDerivative (PD) control Transfer Function Derivation:


( ( ( )( )( ) ) )

No. of finite zeros = 0 No. of poles = 2 System order= 2

Final value:

= = ( )
( )

= =0.938 (d) ProportionalIntegral(PI) control Transfer Function Derivation: No. of finite zeros = 1 No. of poles = 3 System order= 3

= =

= Final value: = = ( )

= =1 (e) Transfer Function ProportionalDerivation: IntegralDerivative(PID) control ( =


(

No. of finite zeros = 1 No. of poles = 3 System order= 3


) )

= Final value: = = ( )

= =1

Table 2 Controller

Maximum Rise Settling overshoot time (s) time (s)


300 300 30 1000 400 400 400 350 70 800 400 400 300 300 10 50 30 50 50 50 0 40 15.3 1.26 6.24 1.55 0 0 0 0.885 0.0728 0.0779 0.41 0.0322 0.199 0.0504 0.0506 0.0549 1.59 0.772 0.29 0.62 0.137 0.351 0.495 0.820 0.831

Steadystate error
0.95 0.062 0.062 0 0 0 0 0 0

(a) Open loop (b) P (c) PD (d) PI (e) PID (i) (ii) (iii) (iv) (v)

Exercise:

1)
R + e

GC Controller u Plant Y

R + -

2) The transfer function for the PD controller is

The equation in the denominator of the transfer function is used to find damping frequency. Where a = 1, b=20 and c=320 The answer obtained is -20 j28.6. Therefore the system is underdamped.

3) A system without any controller is an open loop system whereas systems with P, PD, PI and PID controllers are closed loop systems.

Conclusion:
Objectives of the experiment are achieved. All the different controllers are evaluated in terms of their performance. Using the PID controller we have made several trial and error using different values of KP, KI and KD and out of the combination of values we have tried with, KP = 400, KI = 400 and KD = 50 (as highlighted) gives the best results with zero maximum overshoot, zero steady state error and the lowest rise time and settling time.

You might also like