0% found this document useful (0 votes)
19 views5 pages

Exp 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

Exp 4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

SYSTEM THEORY

Experiment 4: State feedback controller for a tracking problem

AIM:

Using Matlab, to design a state feedback controller for a type 1 servo system
THEORY :

The state equation of a constant field, armature controlled system is given by

PROCEDURE :

i. In the ‘main’ script file, check for controllability as the first step. If the system is
controllable, proceed with the controller design. Use the acker ()command of
MATLAB for the design of the controller, and step() command to simulate the step
response of the system without and with control, for comparison and study. Use the
following syntax of acker and step:
K = acker(A, B, P)
[y t X] = step(sys,T)
ii. Plot the graphs of the states vs. time (a) for the uncontrolled, (b) controlled system,
and (c) graph of control input u = −Kx + kr vs. time.

MATLAB CODE :

Dc motor speed control


%%Motor Parameter Specification
Ra = 0.25;
La = 0.5;
Kb = 0.1;
Kt = 1;
Bm = 0.01;
J = 0.1;

A = [0 1 0; 0 -Bm/J Kt/J; 0 -Kb/La -Ra/La]; %%X=[theta; omega; ia]


B = [0;0;1/La];
C = [1 0 0];
D = 0;

t = 0:0.1:10;
%%Testing for Controllability
M_c = ctrb(A,B);

if rank(M_c)<size(A,1)

disp('system is not controllable');


return;

elseif rank (M_c)==size(A,1)

disp('system is controllable');
end

system is controllable

%%Step 5: Controller design - feedback gain value

%%closed loop pole location that have been chosen


P = [-9 -3-i -3+i];

%%Obtaining the Gain valeues using the Ackermann method

K = acker(A,B,P);

A_cl = A - B*K;
B_cl = B*K(1); %%it is so for a servo operation (tracking problem)

%%Open loop system

sys = ss(A,B,C,D);

[y,t,x] = step(sys,t); %%step() function for the system to return step response

figure(1);
subplot(3,1,1), plot(t,x(:,1)), ylabel('O.L \theta'),xlabel('t'),grid on;title('Open loop response');
subplot(3,1,2), plot(t,x(:,2)), ylabel('O.L \omega'),xlabel('t'),grid on;
subplot(3,1,3), plot(t,x(:,3)), ylabel('O.L Ia'),xlabel('t'),grid on;

%%Closed loop system


sys_cl = ss(A_cl,B_cl,C,D);

[y_cl t x_cl] = step(sys_cl,t);


figure(2);
subplot(3,1,1), plot(t,x_cl(:,1)), ylabel('\theta'), xlabel('t'),grid on;title('Closed loop response');
subplot(3,1,2), plot(t,x_cl(:,2)), ylabel('\omega'),xlabel('t'),grid on;
subplot(3,1,3), plot(t,x_cl(:,3)), ylabel('Ia'), xlabel('t'),grid on;

figure(3);
plot(t,-K*x_cl'+K(1)*1),ylabel('u'),title('Controller output: u = -KX+k_1r'),grid on;
disp('Simulation is finished')

Simulation is finished

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy