Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Characteristic equation:
() =
1
() =
( + 5)
1
() =
/2 + 1
3 1 10
2 7 2
0 < < 35
Transitory response requirements
= + = 1 2
settling time less than 5 seconds ( with 2% criterion), i.e. < 5 sec
overshot less than 25%, i.e. P. O. < 25%
exp ( ) < 0.25 > 0.4037
1 2
1 2
slope = = = = 2.266
ln(0.25)
The root locus for this system can be generated using the command rlocus of Matlab.
Root Locus
4
Ts=5
-1
-2
-3
-4
-5 -4 -3 -2 -1 0 1
Real Axis
Limit poles
Only this arc satisfies Root locus
the requirements
= 0.8
() = 1 () = 180
() = ( + 5) (/2 + 1)
= +
+
0 ( + ) ( + + 5) ( + 1) = 180
2
( + ) = tan1 (/), then
tan1 (/) tan1 ( ) tan1 ( ) = 180
+5 +2
solving for , , using the Matlab function fzero() and angle() to find the root:
tan (tan1 ( ) tan1 ( ) tan1 ( )) = tan(180) = 0.8485
0.8 0.8 + 5 0.8 + 2
= + = 0.8 0.8485
2 3 + 7 2 + 10
1+ =0 = | |
+ 7 2 + 10
3 2
3 + 7 2 + 10 (0.8 0.8485)3 + 7 (0.8 0.8485)2 + 10 (0.8 0.8485)
= | | = | | = 3.672
2 2
> 3.672
= . .
= . (. . < . %)
=
= .
. < <
1 1 1
= = = =0
1 + lim () 1 + lim 2
0
0 3 + 7 2 + 10
response due to unitary step input using the Matlab code
1.5
1
y(t)
0.5
0
0 1 2 3 4 5 6 7 8 9 10
0.5
e(t)
-0.5
0 1 2 3 4 5 6 7 8 9 10
Time [seconds]
Matlab code used to generate the root locus and calculate the poles and gain
% (without the K)
Ts = 5; % settling time
% calculate the slope of the line for this value of damping factor
slope = sqrt(1-damping^2)/(-damping);
TFphase = @(s)angle(polyval(num,s)/polyval(den,s));
y = fzero(@(y)tan(TFphase(x+i*y)),1);
s = x + y*i;
% find the K using the modulus condition
TFmodulus = @(s)abs(polyval(den,s)/polyval(num,s));
K = TFmodulus(s);
set(h,'LineStyle','--');
set(h,'Color',[0 0 0]);
set(h,'LineStyle','--');
set(h,'Color',[0 0 0]);
set(h,'LineStyle','--');
set(h,'Color',[0 0 0]);
axis([-5 1 -4 4]);
set(h,'FontName','Symbol'); set(h,'FontSize',8);
h=text(-.8,3.8,['Ts=' num2str(Ts)]);
set(h,'FontSize',8);
hold on;
h=text(x-2,y,['K = ' num2str(K) ', s = ' num2str(x) '+j' num2str(y) ' -->']);
set(h,'FontSize',7);
fprintf('PROBLEM 1\n\n');
S = tf('s');
Gc = K;
G = 1/(S*(S+5));
H = 1/(S/2 + 1);
TF = Gc*G/(1 + Gc*G*H);
MaxTime = 10;
[y,t1] = step(TF,MaxTime);
[E,t2] = step(1/(1+Gc*G*H),MaxTime);
figure;
subplot(2,1,1)
plot(t1,y,'k','LineWidth',2);
hold on;
ylabel('y(t)')
subplot(2,1,2)
plot(t2,E,'k','LineWidth',2);
hold on;
ylabel('e(t)')
xlabel('Time [seconds]')
e(t)
1
3.672
s2 +5s output response y (t)
Step controller Gc (s) process transfer fun .
1
0.5s+1
H(s)
Characteristic equation
+6
() =
+ 10
0.1
() =
2 + 2 8
() = 1
The open-loop transfer function
+6 0.1 (0.1 + 0.6)
() = ()()() = 2 1= 3
+ 10 + 2 8 + 12 2 + 12 80
The characteristic equation
(0.1 + 0.6)
1 + () = 1 + =0 3 + 12 2 + (12 + 0.1) + (0.6 80) = 0
3 + 12 2 + 12 80
3 1 12 + 0.1
2 12 0.6 80
12
12 + 0.1 > 0 > = 120
0.1
> 133.33
Steady state error requirements
80 (99) 80 101
< = 13200 or > 13467
0.6 0.6
1 2 1 0.35792
slope = = = = 2.6094
0.3579
Root locus. Gain and required poles
Now, we can generate the root locus for this system, using the command rlocus() of Matlab.
Root Locus
10
Ts=4
2
Imaginary Axis
-2
-4
-6
-8
-10
-5 -4 -3 -2 -1 0 1
Real Axis
= 4
= 0.3579
slope = 2.6094
Limiting poles
Root locus
= 1
() = 1 () = 180
() = + ( + 6) ( + 10) + (0.1) ( 2 + 2 8)
= +
0 + ( + + 6) ( + + 10) + 0 (( + )2 + 2( + ) 8) = 180
( + ) = tan1 (/),
2 + 2
tan1 ( ) tan1 ( ) tan1 ( 2 ) = 180
+6 + 10 2 + 2 8
solving for , , using the Matlab function fzero() and angle() to find the root:
2 + 2
tan (tan1 ( ) tan1 ( ) tan1 ( 2 )) = tan(180)
+6 + 10 2 + 2 8
= 2.6094
= + = 2.3810 6.2129
4 4
= = = 1.68 sec
2.381
(0.1 + 0.6) 3 + 12 2 + 12 80
1+ =0 = | |
+ 12 2 + 12 80
3 0.1 + 0.6
3 + 12 2 + 12 80
=| || =
0.1 + 0.6 = 2.3810 6.2129
(2.3810 6.2129)3 + 12 (2.3810 6.2129)2 + 12 (2.3810 6.2129) 80
=| | = 667.4
0.1(2.3810 6.2129) + 0.6
requirements of transient response , stability and error simultaneously cannot meet because the
incompatibility of inequalities. Modification ofthe controller can reduce error, and it means modify all root
locus and all above values. we can also reduce the error increasing the gain to be greater than 13467 but this
will affect the transient response.
= . .
= . (. = %)
= .
= .
= %
. < < .
response due to unitary step disturbance of magnitude 10, i.e. = 10/ can be plotted using the Matlab code
0.04
y(t)
0.03 r(t)
y(t)
0.02
0.01
0
0 0.5 1 1.5 2 2.5 3
-0.01
e(t)
-0.02
-0.03
-0.04
0 0.5 1 1.5 2 2.5 3
Time [seconds]
% (without the K)
Ts = 4; % settling time
x0 = -4/Ts;
figure;
% calculate the slope of the line for this value of damping factor
slope = sqrt(1-damping^2)/(-damping);
TFphase = @(s)angle(polyval(num,s)/polyval(den,s));
x = fzero(@(x)tan(TFphase(x+i*slope*x)),-2);
y = slope*x;
s = x + y*i;
TFmodulus = @(s)abs(polyval(den,s)/polyval(num,s));
K = TFmodulus(s);
set(h,'LineStyle','--');
set(h,'Color',[0 0 0]);
set(h,'LineStyle','--');
set(h,'Color',[0 0 0]);
set(h,'LineStyle','--');
set(h,'Color',[0 0 0]);
h=text(-4.5,9.6,['z=' num2str(damping)]);
set(h,'FontName','Symbol'); set(h,'FontSize',8);
h=text(-.9,9.6,['Ts=' num2str(Ts)]);
set(h,'FontSize',8);
hold on;
h=text(x-2.25,y,['K = ' num2str(K) ', s = ' num2str(x) '+j' num2str(y) ' -->']);
set(h,'FontSize',7);
fprintf('PROBLEM 2\n\n');
S = tf('s');
H = 1;
R = 1/S;
TF = G/(1 + Gc*G*H);
MaxTime = 3;
[y,t1] = step(Td*TF,MaxTime);
[E,t2] = step(-Td*TF,MaxTime);
figure;
subplot(2,1,1)
plot(t1,y,'k','LineWidth',2);
hold on;
ylabel('y(t)')
legend('y(t)','r(t)')
subplot(2,1,2)
plot(t2,E,'k','LineWidth',2);
hold on;
ylabel('e(t)')
xlabel('Time [seconds]')
e(t)
s+6 0.1
666 .7
s+10 s2 +2s-8 output response y (t)
Step r (t) Gain K controller process transfer fun .
disturbance Td (s)
1
1
H(s)