Block Diagram in MATLAB: Control Engineering Dr. Rafid Abbas
Block Diagram in MATLAB: Control Engineering Dr. Rafid Abbas
Rafid Abbas
H1 = tf(2,[1 3 0])
H1 =
2
---------
s^2 + 3 s
H2 = zpk([],-5,5)
H2 =
5
-----
(s+5)
Series Connection
Use the * operator or the series function to connect LTI models in series, for example:
H = H2 * H1
H =
10
-------------
s (s+5) (s+3)
Or
H = series(H1,H2);
Parallel Connection
[email protected] Page 1 of 3
Control Engineering Dr. Rafid Abbas
Use the + operator or the parallel function to connect LTI models in parallel, for example:
H = H1 + H2
H =
5 (s+0.7566) (s+2.643)
----------------------
s (s+3) (s+5)
Or
H = parallel(H1,H2);
Feedback Connections
The standard feedback configuration is shown below:
2 (s+5)
--------------------------------
(s+5.663) (s^2 + 2.337s + 1.766)
Note that feedback assumes negative feedback by default. To apply positive feedback, use
the following syntax:
H = feedback(H1,H2,+1);
[email protected] Page 2 of 3
Control Engineering Dr. Rafid Abbas
F = 3/(s+2);
G = 1/(s^2+5*s+1);
C = 2*(s^2+s+6)/(s^2+4*s+4);
S = 1/(s+1);
You can compute the closed-loop transfer T from r to y as
T = F * feedback(G*C,S);
K = tf(T)
step(T), grid
[email protected] Page 3 of 3