# MATLAB Simulations ```Lab tasks, to be solved at the lab
Use Simulink to simulate the system depicted in Fig. 1. let Gc = K; Gp =
Decide the following by simulating in Simulink.
s3
+
3s2
1
.
+ 3s + 1
(a) Maximum gain, Kmax , before the system starts to oscillate.
(b) Steady-state error when V = 0, U is a unit step and K has the values 0,
Kmax 3Kmax
,
.
2
4
(c) Steady-state error when V is a unit step, U = 0 and Khas the values 0,
Kmax 3Kmax
,
.
2
4
Kmax
,
4
Kmax
,
4
V(s)
U(s) +
-
Gc(s)
+
+
GP(s)
Y(s)
Figure 1: Feedback system (Task 1)
Do the same as in the previous task, but set Gc =
K
s
Use MATLAB to draw the Bode diagram for the system depicted in Fig. 2 with Gc = 2.5
e−s
and Gp =
and decide if the system is stable. If so, decide the phase margine, Φm ,
1 + 2.5s
and the amplitude margin Am . The delay can be modeled in the MATLAB by specifying
Gp as Gp =tf(1, [2.5 1]), ’InputDelay”,1).
1
Lab tasks, to be solved at the lab
X(s)
+
-
Gc(s)
GP(s)
Y(s)
Figure 2: Feedback system (Task 3)
1
heater process has the transfer function Gp (s) =
. It is regulated by a controller
(1 + 3s)2
1
with transfer function Gc (s) = 3 1 +
. The sensor used to feed back the output
2s
signal has the transfer function Gs (s) = 1.
(a) Construct the system in Simulink.
(b) Simulate a unit step input signal. Measure maximum overshoot, settling time and
rise time. Also check control input.
(c) Simulate a unit step disturbance. Again measure maximum overshoot, settling time,
rise time and check control input.
(d) What type of controller is used?
2
```