Matlab Program : 660540

Question:

Discuss about the Matlab Program.

Answer:

1

Given data:

The performance index J is given by

Where r > 0 scalar parameter

  • Optimal gain vector K

The state feedback control law is given by u = -kx

To find the value of C (sI – A)-1 B

(SI –A)-1 =

C (sI – A)-1 B = [1 0] -1

= [1 0]

= [1 0] 1/s2+s

= 1/s2+s [1+0]

C (sI – A)-1 B = 1/s2+s

The above equation is representing the value of  Â  =  , B = ,  =[1 0]

A = , B =

Mcx = [B, AB]

AB =

Mcx =

  =  , B =

Mcz = [B, ÂB]

Mcz   =

To find the similarity transform relating the two. It is  given by

Mcz[Mcx]-1 = T

[Mcx]-1  =  1/-1

=

T =

To find the optimal gian vector K

K = ǨT

  =  , B =

Â-BǨ =

The desired pole polynomial is given by S2+2s+1

Now the above value is changed by

Where Ǩ = [3 1]

Now substitute the value for Ǩ in Â-BǨ equation

=

=

Therefore the original feedback system is given by

K = ǨT

K = [3 1]

Finally the optimal gain vector K = [-5 -3]

  • K is critically dampled

Given

The closed loop system is given by

When K=-5

G(s) = c(s)/R(s)

= -5/s2+s-5

=-5/s2+2 ᶓ ωns+ωn2

The critically damped system ᶓ =1

The equation is given by

= -5/ s2+2  ωns+ωn2

= -5/s(s+ωn)2

The closed system with K is critically damped the given equation is

C(s) =-5/s(s+ωn)2

C(s) =-3/s(s+ωn)2

  • The closed loop system poles

The given system is C(s) =-5/s(s+ωn)2

=A/s +B/(s+ωn)2 +C/(s+ ωn)

The pole values are determined by the above equation

= -1+4.582/2  = 1.791

P1 = 1.791

P2 = -2.791

  • Part (a) and (c) using LQR command

 

  • Kalman filter gain L

given

Q = 6xI2×2

R =1

G =I2×2

The given kalman filter gain L is given by

Q = 6x

Q =

G =

L = ½  +1/2 (1)

= +[0.5]

=

The gain value of the kalman filter is givevn by

L =

  • Using LQE

2

(a)

Double pendulum system

 

Given

Solution

Concept of control system in state feedback

State feed back

Impact of state feedback on behaviour

Closed loop poles

It is clear that state feedback changes behavioura and allows us to move the closed –loop poles

The closed –loop poles are eigenvalues of A-BK

Find the impact of the state feedback

closed loop

apply these above values are given below

A     =

14.7     -4.9     0    0

 

B      =      (0 0 0 -1/2(4))

= (0 0 0 -0.125)T

B =

C =

Find the closed-loop poles

A     =

14.7     -4.9     0    0

B=

C =                                  Now K = k1  k2 k3 k4

A-BK= -29.4-K1      19.6-K2

14.7- K3        -4.9-K3

Closed – loop poles

K2=19.6   k3=-29.4

(b)

= -29.4-K1      19.6

14.7- K3        -4.9-K3

K2=19.6   k3=-29.4

(c)

Change the transpose

X(0)=0.1

0

0

0

Open loop and closed loop different values an

step (A,B,C,D)

step (open loop,clos loop)

A = [0.1, 29.4];             B= [0, 19.6];     C = [0, 29.4];     D = [0, 0];     step (A,B,C,D)    (d) LQR

U=-KX

The open loop and closed loop both are same in the LQR system

(e)

The  behaviour of Q is unit step response (time domain) in the given following graph

3

  • White noise

Ideal of white noise

Unconditional mean and variance are constant

Serially uncorrelated men/variance are same

Conditional and unconditional mean /varience are same

Mean and varience

Mean= 70,102.89   -8389.626     -3120

-8770           1026.0084    384

-3120             384                144

Varience =  73984     0  196

Program

output

References

Anon, (2017). [online] Available at: https://www.researchgate.net/post/How_can_we_obtain_the_Gain_Vector_or_Matrix_in_this_form_for_the_LQR_control [Accessed 28 Nov. 2017].

Filter, K. (2017). Kalmanfilter design, Kalman estimator – MATLAB kalman – MathWorks United Kingdom. [online] In.mathworks.com. Available at: http://in.mathworks.com/help/control/ref/kalman.html [Accessed 28 Nov. 2017].

Program

 

%% Plots

% outputs

figure; %create a new plot window

subplot(211); %create plots in 4 rows and 4 column and activate the 1st one

plot(t0,Y0(:,1),’Color’,’k’, ‘LineStyle’, ‘-.’); %plot in black color and

dotted line

hold on; %hold existing plot, don’t erase it and wait for the next plot

plot(t1,Y1(29.4 ,1),’Color’,’b’); % plot in blue color

plot(t2,Y2(19.6,1),’Color’,’r’); % plot in red color

plot(t3,Y3(:,1),’Color’,’b’); % plot in blue color

title(‘System Output’) % add title to the plot

ylabel(‘y_{1}(t)’); % add label to y-axis

xlabel(‘time (sec)’); % add label to x-axis

xlim([0,10]); % determine the range of x-axis

grid; % add grid

legend(‘closed-Loop Response’, ‘Q = 10*I_{4\times4}, R = 1’, …

‘Q = 100*I_{4\times4}, R = 1’, ‘Location’, ‘southeast’); % add legends

subplot(212); % in the current plot window with 4 rows and 4 column, active

the 2 nd one

plot(t0,Y0(:,2),’Color’,’k’, ‘LineStyle’, ‘-.’);

hold on;

plot(t1,Y1(:,2),’Color’,’b’);

plot(t2,Y2(:,2),’Color’,’r’);

plot(t3,Y3(:,2),’Color’,’b’);

subplot(2,1,2);

ylabel(‘y_{2}(t)’);

xlabel(‘time (sec)’);

xlim([0,10]);

grid;

legend(‘Open-Loop Response’, ‘Q = 10*I_{4\times4}, R = 1’, …

‘Q = 100_{4\times4}*I, R = 1’, ‘Location’, ‘southeast’);

%control inputs

figure;

plot(t1, u1(1,:)’);

hold on;

plot(t2, u2(1,:)’);

title(‘Control Input’);

xlim([0 10]);

ylabel(‘u(t)’);

xlabel(‘time (sec)’);

grid;

legend(‘Q = 10*I_{4\times4}, R = 1’, ‘Q = 100*I_{4\times4}, R = 1’,…

‘Location’, ‘southeast’);