Anda di halaman 1dari 6

Assignment One

Neil Vinson-359875 Let G(s) be the transfer function for the system, ( ) ( )( )

Rearranging G(s) gives, ( )

Using Matlab BODE plot generator (refer to appendix for code), the following plot has been produced in Figure 1.

Figure 1: Bode plot of transfer function

( )

2. Consider the BODE diagram from Figure 1

From diagram, when Phase Angle is equal to -180, the frequency is equal to 0.4528 rad/s. The corresponding amplitude ratio is 0.8668. As such,

Ultimate gain (Kcu) = 1/0.8668 = 1.1537 Calcultating the ultimate period (Pu),

Now,

s For Z-N tuning with a PID control,

Kc PID Kcu/1.7

Hence, Kc = 0.6786 1 = 6.938 d = 1.7345

For T-L tuning with a PID control

Kc PID Kcu/2.2

Hence, Kc = 0.5244 1 = 30.53 d = 2.203

3. In order to input values into Simulink the following conversions were made P = Kc

Based on the fact that for a PID controller the transfer function is,

Gc(s)= Kc (1 + 1/s + s )

For ZN

Kc = 0.6786 Kc = 0.6786

i = 6.938 I = 0.0978

d = 1.7345 D = 1.177

For TL

Kc = 0.5244 Kc = 0.5244

i = 30.53 I = 0.01718

d = 2.203 D = 1.15525

The following set up was used to model the system:

Figure 2: System set up in simulink.

Figure 3: Temperature change vs. Time in system Figure 3 compares the process when different tuning constants are used to control the process. It can be seen that the TL constants allow the system to return to stability more quickly when a step change is introduced. Furthermore the TL constants make the system more robust to disturbances as can be seen occurring at 100s. When ZN tuning constants are used, the system takes longer to return to stability. For this system the TL tuning parameters are better able to control the process.

Appendix
Matlab Code for BODE plot:
% Bode Plot Generator; G = (18e^-1s)/96s^2+20s+1) close all gain = 18; % Note: Magnitude of the gain tdead = 1; % Deadtime / time delay in same time units as s num = [1]; % Numerator coefficients of polynomial as^n + bs^(n-1) ... + 1 den = [96 20 1]; % Denominator coefficients of polynomial as^n + bs^(n-1) ... + 1 G = tf(gain*num, den); % Define the transfer function G points =50000; % Define the number of data points ww = logspace(-6, 6, points); % Frequencies (ww) to be evaluated, log scale. Make sure it includes desired range [mag, phase, ww] = bode(G, ww); % Generate numerical values for Bode plot w/o tdead yet AR = zeros(points, 1); % Preallocate vectors for Amplitude Ratio (AR) PA = zeros(points, 1); % Preallocate vectors for Phase Angle (PA) for i = 1 : points % FOR loop to calculate AR and PA for all points AR(i) = mag(1, 1, i); % AR is a function of mag only PA(i) = phase (1, 1, i) - ((180/pi)*tdead*ww(i)); % PA is a function of phase and tdead end figure % Routine to plot AR and PA. Change axis range as appropriate. subplot(2, 1, 1) % Adds subplot to figure for AR loglog(ww, AR) % Plot AR vs ww on log-log scale axis([0.001 2 0.1 2000]) % Lower, upper ww; lower, upper AR. Frequency must lie in range defined above title('Bode Plot') ylabel('Amplitude Ratio [-]') subplot(2, 1, 2) % Adds subplot to figure for PA, below AR semilogx(ww, PA) % Plot PA vs ww on semi-log scale axis([0.001 5 -400 60]) % Lower, upper ww; lower, upper PA. Frequency must be same as for AR ylabel('Phase Angle (degrees)') xlabel('Frequency (rad/s)') % Implies seconds as time units. Change as appropriate

Anda mungkin juga menyukai