Sei sulla pagina 1di 16

Problem 1

Characteristic equation:

() =
1
() =
( + 5)
1
() =
/2 + 1

The open-loop transfer function:


1 1 2
() = ()()() = = 3
( + 5) + 1 + 7 2 + 10
2
The characteristic equation:
2
1 + () = 1 + =0 3 + 7 2 + 10 + 2 = 0
3 + 7 2 + 10

Interval of which the system is stable

Using the Routh-Hurwitz array, we found that:

3 1 10

2 7 2

We need that , > 0:


7 10 1 2 70 2 70
= = >0 < = 35
7 7 2
2 7 0
= = 2 > 0 >0

0 < < 35
Transitory response requirements

The conjugate poles of second-order system are given as:

= + = 1 2

the following requirements has to be satisfied:

settling time less than 5 seconds ( with 2% criterion), i.e. < 5 sec
overshot less than 25%, i.e. P. O. < 25%

For < 5 sec


4 4 4
= <5 = > = 0.8
5
For P. O. < 25%


exp ( ) < 0.25 > 0.4037
1 2

1 2
slope = = = = 2.266
ln(0.25)

Root locus. Gain and required poles

The root locus for this system can be generated using the command rlocus of Matlab.

Root Locus
4
Ts=5

1 K = 3.672, s = -0.8+j0.84853 -->


Imaginary Axis

-1

-2

-3

-4
-5 -4 -3 -2 -1 0 1
Real Axis

Fig.1: Root locus of the system.


= 5
= 0.4037
slope = 2.266

Limit poles


Only this arc satisfies Root locus
the requirements

= 0.8

Fig. 2: Locus of solution

Numerical solution of the gain and poles.

() = 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

= . .
= . (. . < . %)
=
= .
. < <

Steady state error due to a step input, or a step disturbance

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]

Fig.3: Response of the system


In this case, it is unnecessary to modify the controller in order to eliminate the steady state error due to step
input or step disturbance it is unnecessary to modify the controller, because the system has a pole in the origin,
so the system itself remove the steady state error even with a proportional controller. if we need to satisfy zero
error due to ramp input or ramp disturbance, we need to modify the controller by adding a pole in the origin.

Matlab code used to generate the root locus and calculate the poles and gain

num = 2; % numerator of the open-loop transfer function

% (without the K)

den = [1 7 10 0]; % denominator of the open-loop transfer function

Ts = 5; % settling time

OP = 25; % overshoot (percent)

x = -4/Ts; % value of "x" from settling time, x = -4/Ts

rlocus(num,den); % invoke the root locus for this system

% calculating the damping factor from OP

damping = fzero(@(s)exp(-pi*s/sqrt(1-s^2))-OP/100,[0 1]);

% calculate the slope of the line for this value of damping factor

slope = sqrt(1-damping^2)/(-damping);

% function used to find the phase of the transfer function

TFphase = @(s)angle(polyval(num,s)/polyval(den,s));

% solving the value of "y" using fzero of matlab

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);

% plot the lines on root locus figure

hold on; h=line([0 -8], [0 -8*slope]);

set(h,'LineStyle','--');

set(h,'Color',[0 0 0]);

hold on; h=line([0 -8],-[0 -8*slope]);

set(h,'LineStyle','--');

set(h,'Color',[0 0 0]);

hold on; h=line([x x],[-8 8]);

set(h,'LineStyle','--');

set(h,'Color',[0 0 0]);

axis([-5 1 -4 4]);

h=text(-2.5,3.8,['z = ' num2str(damping)]); % add text on diagram

set(h,'FontName','Symbol'); set(h,'FontSize',8);

h=text(-.8,3.8,['Ts=' num2str(Ts)]);

set(h,'FontSize',8);

hold on;

plot([x x],[y -y],'k.');

h=text(x-2,y,['K = ' num2str(K) ', s = ' num2str(x) '+j' num2str(y) ' -->']);

set(h,'FontSize',7);

% display the results using fprintf statements

fprintf('PROBLEM 1\n\n');

fprintf('The pole from root locus is s = %.5f + %.5fi\n',x,y);

fprintf('The gain required is K > %.5f\n\n',K);

% plot the response

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;

plot([0 max(t1)],[1 1 ],'k--');

ylabel('y(t)')

subplot(2,1,2)

plot(t2,E,'k','LineWidth',2);

hold on;

plot([0 max(t2)],[0 0],'k--')

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)

Fig.4: Simulink model


PROBLEM 2

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

Interval of which the system is stable

Using the Routh-Hurwitz array, we found that:

3 1 12 + 0.1

2 12 0.6 80

We need that , > 0:


12 (12 + 0.1) 1 (0.6 80) 0.6 + 224 224
= = >0 > = 373.33
12 12 0.6
(0.6 80) 12 0 80 400
= = 0.6 80 > 0 > = = 133.33
0.6 3

12
12 + 0.1 > 0 > = 120
0.1
> 133.33
Steady state error requirements

steady-state tracking error less than 1% in the presence of the disturbance


(0.1 + 0.6) 0.6
= lim () = lim =
0 0 3 2
+ 12 + 12 80 80
0.6
1 < 100
1 1 0.6 1 80
| | = | |=| | < 0.01 |1 |> or
1 + 0.6 80 0.01 0.6
1 80
1 > +100
{ 80

80 (99) 80 101
< = 13200 or > 13467
0.6 0.6

Transitory response requirements

settling time (with a 2% criterion) less than 4 seconds ( < 4 sec)


percent overshoot less than 30% (P. O. < 30%)

For < 4 sec


4 4 4
= <5 = > =1
4
P. O. < 30%

exp ( ) < 0.30 > 0.3579
1 2

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

K = 667.3683, s = -2.381+j6.2129 -->


6

2
Imaginary Axis

-2

-4

-6

-8

-10
-5 -4 -3 -2 -1 0 1
Real Axis

Fig.5: Root locus of the system

= 4

= 0.3579
slope = 2.6094
Limiting poles

Only this curve satisfies


the requirements


Root locus

= 1

Fig.6: Locus of solution


Numerical solution for the gain and poles .

() = 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

Hence < 667.4


1 1 1
= = = = 0.2497 (25% error)
|1 + | |1 0.6/80| |1 0.6 667.4/80|
> 133.33
< 13200 or > 13467 ( < 1% condition)
< 667.4 (transient response )

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.

= . .
= . (. = %)
= .
= .
= %
. < < .

Transitory response plot due to step disturbance

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]

Fig.7: Response of the system


Matlab code used to generate the root locus and calculate the poles and gain

num = [.1 .6]; % numerator of the open-loop transfer function

% (without the K)

den = [1 12 12 -80]; % denominator of the open-loop transfer function

Ts = 4; % settling time

OP = 30; % overshoot (percent)

x0 = -4/Ts;

figure;

rlocus(num,den); % invoke the root locus for this system

% calculating the damping factor from OP

damping = fzero(@(s)exp(-pi*s/sqrt(1-s^2))-OP/100,[0 1]);

% calculate the slope of the line for this value of damping factor

slope = sqrt(1-damping^2)/(-damping);

% function used to find the phase of the transfer function

TFphase = @(s)angle(polyval(num,s)/polyval(den,s));

% solving the required pole using fzero of matlab

x = fzero(@(x)tan(TFphase(x+i*slope*x)),-2);

y = slope*x;

s = x + y*i;

% find the K using the modulus condition

TFmodulus = @(s)abs(polyval(den,s)/polyval(num,s));

K = TFmodulus(s);

% plot the lines on root locus figure


hold on; h=line([0 -10], [0 -10*slope]);

set(h,'LineStyle','--');

set(h,'Color',[0 0 0]);

hold on; h=line([0 -10],-[0 -10*slope]);

set(h,'LineStyle','--');

set(h,'Color',[0 0 0]);

hold on; h=line([x0 x0],[-10 10]);

set(h,'LineStyle','--');

set(h,'Color',[0 0 0]);

axis([-5 1 -10 10]);

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;

plot([x x],[y -y],'k.');

h=text(x-2.25,y,['K = ' num2str(K) ', s = ' num2str(x) '+j' num2str(y) ' -->']);

set(h,'FontSize',7);

fprintf('PROBLEM 2\n\n');

fprintf('The pole from root locus is s = %.5f + %.5fi\n',x,slope*x);

fprintf('The gain required is K < %.5f\n\n',K);

% plot the response

S = tf('s');

Gc = K*(S + 6)/(S + 10);

G = .1/(S^2 + 2*S -8);

H = 1;
R = 1/S;

TF = G/(1 + Gc*G*H);

Td = 10; % magnitude of the dsturbance

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;

plot([0 max(t1)],[0 0 ],'r--','LineWidth',2);

ylabel('y(t)')

legend('y(t)','r(t)')

subplot(2,1,2)

plot(t2,E,'k','LineWidth',2);

hold on;

plot([0 max(t2)],[0 0],'r--','LineWidth',2)

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)

Fig 8: Simulink model

Potrebbero piacerti anche