Control Systems & Transfer Functions
Afficher commentaires plus anciens
I am trying to do multiple things:
- Examine the stability of the Closed Loop Transfer Function (CLTF)
- Using Simulink & MATLAB, simulate the system via plotting individual transfer function blocks and the overall CLTF
- Plot the difference between the output of the simulations against time
My simulink configuration is ODE4 Runge-Katta and my start times are 0.
In essence, my graphs & plots appear as completely unusual to me and I have no reference to see if my simulations are correct. Any help would be greatly appreciated!
Figure of System:

Transfer Function Definitions:

I have attached 'model.slx' which is my Simulink model which should appear as:

MATLAB Editor Code:
% Defining Transfer Functions
Gn = [3 2.4];
Gd = [1 2 3];
Gsys = tf(Gn, Gd); % G(s)
C = [5];
Csys = tf(C, 1); % C(s)
Hn = 0.25;
Hd = [1 25];
Hsys = tf(Hn, Hd); % H(s)
sysCGtf = series(Csys, Gsys);
sysCLTF = feedback(sysCGtf, Hsys);
% Closed Loop Transfer Function (CLTF) Should Look like this:
% C(s)*G(S) + G(S)
% ---------------------------------
% 1 + [C(s)*G(S) + G(s)]*H(s)
B = isstable(sysCLTF); % Stability Check
% Plotting CLTF as a whole:
figure(1)
hold on
plot(step(sysCLTF))
grid on
ylabel('Amplitude')
xlabel('Time')
hold off
% Plotting G(s)
figure(2)
subplot(2, 1, 1)
step(Gsys)
grid on
subplot(2, 1, 2)
step(Hsys)
grid on
% Plotting H(s)
figure(3)
a = sim('model.slx');
b = a.y.data;
c = a.t.data;
plot(c, b);
Réponse acceptée
Plus de réponses (1)
Gideon
le 11 Mai 2024
0 votes
% Defining Transfer Functions
G = tf([3 2.4], [1 2 3]); % G(s)
C = pid(5); % C(s), proportional control
H = tf(0.25, [1 25]); % H(s)
F1 = feedback(G, H) % group G and H
F3 = feedback(C*F1, H)
F5 = series(1.2, F3) % corresponding CLTF
% checking zeros and poles of the corresponding CLTF
zero(F5)
pole(F5)
F6 = minreal(F5)
Catégories
En savoir plus sur PID Controller Tuning dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



