0% found this document useful (0 votes)
23 views9 pages

Exp 3

Uploaded by

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

Exp 3

Uploaded by

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

EE-361 Feedback Control Systems

Modeling and Control of Systems in Simulink


Experiment # 3

Date: / / 2023 Section:

Lab Report 3 Requirements


These are the questions/exercises from the handout that have to be answered
in the lab report:

- [1.4] Exercise-1: Find the open loop step response of the system. Save
it to your word file.
- [1.4] Exercise-2: Give the open loop impulse response of the system.
Compare the results obtained from the two methods described in the text.
- [1.4] Exercise-3: Is this system stable in the open loop configuration?
- [1.4] Exercise-4: What is the final value achieved by this system?
- [1.5] Exercise-5: Give the response of the closed loop system with unity
gain.
- [1.5] Exercise-6: What is the final value achieved by the system in closed
loop configuration?
- [1.6] Exercise-7: Apply the following controllers to the system block
diagram and save/verify all the responses and final values achieved by the
system:
P = 10; P = 100; P = 500; P = 10, I = 5; P = 10, I = 1, D = 15.
- [2.3] Exercise-8: Give the open loop step response of the system.
- [2.3] Exercise-9: Is this system stable in the open loop configuration?
- [2.3] Exercise-10: What is the final value achieved by this system?
- [2.3] Exercise-11: Give the response of the closed loop system with unity
gain.

1
- [2.3] Exercise-12: What is the final value achieved by the system in the
closed loop configuration?
- [2.4] Exercise-13: Apply the On/Off control strategy to the system and
and give its response.

- [2.4] Exercise-14: Is the system obtaining a final steady state value with
the On/Off control?
- [2.4] Exercise-15: Apply the following PID controllers to the system and
provide the response and final value achieved by the system:
P = 100; P = 100, I = 25; P = 10, I = 0.8, D = 0.8.

- [2.5] Exercise-16: Give the complete Simulink model of the cascade tank
system in its closed loop form, where h2 is the final output. Show how
you derived the model from the equations for bonus points.
- [2.5] Exercise-17: Apply a PID controller to the closed loop system and
manually tune the controller’s parameters to obtain an optimal response.
Save the response and the parameter values.

2
Instructions
Follow the instructions stated below:
1. All the exercises in this lab handout are to be evaluated by instructors.
After getting a result, ask the instructor to evaluate them.
2. After the lab, you (all members of a group) have to upload the above
mentioned word file into the drop box on LMS with the name of that
file as LabX-Y-N.pdf (X is the experiment number, Y is the day e.g.
Friday(Mor) or Friday(Eve), and N is the name of student).
3. Take care of lab equipment handed over to you during the lab.

1 Modeling/Controlling a Cruise Control Sys-


tem in Simulink
1.1 Objective
This exercise will assist students in checking the performance of a cruise control
system in the open loop and close loop settings.

1.2 Modeling
The model of the cruise control system is relatively simple. If the inertia of the
wheels is neglected and friction is assumed to be the force opposing the motion
of the car, then the problem is reduced to a simple mass and damper system,
as shown in Figure-1.

Figure 1: Cruise Model

Using Newton’s law:


dv
m = u.
dt
Since we are incorporating the frictional force, which is proportional to the
velocity v of the mass, the above equation becomes:
dv
m = u − bv. (1)
dt

3
dv u bv
= − .
dt m m
where u is the force from the engine and b is the constant of proportionality.
For this example, let us assume that:

m = 1000kg
b = 50Nsec/m
u = 500N

1.3 Building the Model in Simulink


This system can be modeled by summing the forces acting on the mass and in-
tegrating the acceleration to get velocity. Build the block diagram to implement
this differential equation according to the one shown in Figure-2.

Figure 2: Block Diagram of the Cruise System

This complete system can also be converted into a subsystem. To build a sub-
system of the cruise control, select all the components except the step input
and the scope blocks. Now right-click on the selected components and select
”Create Subsystem” from the options. This will create a new subsystem of the
cruise control with input and output ports in it.

Figure 3: Subsystem of Cruise Control

4
1.4 Open Loop Response of the System
Connect the step input and scope to the subsystem with the following properties:

Step time = 0
Initial Value = 0
Final Value = 500

Run this simulation for 120 sec.

Figure 4: Open Loop Control

Exercise-1: Find the open loop step response of the system. Save it to your
word file.

Exercise-2: Give the open loop impulse response of the system.

Since there is no block for the impulse input in MATLAB, we can generate this
input indirectly using either of the two methods described below:
Method-1: The impulse response is the derivative of the step response.
Method-2: Use two step functions to generate the impulse function.

Compare the results obtained from the above two methods.


Exercise-3: Is this system stable in the open loop configuration?

Exercise-4: What is the final value achieved by this system?

1.5 Closed Loop Response of the System


Now connect the system in a closed loop setting with unity gain. Run the sim-
ulation for 250 sec. Perform the following exercises:

Exercise-5: Give the response of the closed loop system with unity gain.

Exercise-6: What is the final value achieved by the system in closed loop con-
figuration?

5
1.6 Controller Implementation
In this section, we will apply different controllers to the previous system.

Instead of using the direct PID block, build the PID block using discrete blocks
and generate it into a new subsystem. The subsystem of the PID block is shown
in Figure-5.

Figure 5: Subsystem of PID Controller

Exercise-7: Apply the following controllers to the system block diagram and
save/verify all the responses and final values achieved by the system:
1. P = 10
2. P = 100 (This gain is not realistic)
3. P = 500 (This gain is not realistic)
4. P = 10, I = 5
5. P = 10, I = 1, D = 15

NOTE:
ALL RESPONSES MUST BE PROPERLY SCALED. IT IS NOT
ACCEPTABLE TO DIRECTLY COPY PASTE THE RESPONSE
FROM THE SCOPE.

2 Tank level modeling and Control in Simulink


2.1 Objective
The aim of this exercise is to model a water tank and simulate it in a closed
loop configuration with different controllers.

6
2.2 Modeling
Consider an open water tank with cross-sectional area A, illustrated in Figure-
6. Water is pumped into the tank from the top at a rate of “bV ” cubic meters
per second, where V is the horizontal velocity through the orifice and b is some
constant of proportionality. Water flows out through a hole at the bottom of
the tank.

Figure 6: Schematic Diagram of Water Tank System

A differential equation for the height of the water in the tank, H, is given by:

d(V ol) dH
=A , (2)
dt dt
where
d(V ol)
= F lowin − F lowout .
dt
dH √
A = bV − a H, (3)
dt
where. ”Vol” is the volume of water in the tank, A is the cross-sectional area of
the tank, b is a constant related to the flow rate into√the tank, and a is a con-
stant related to the flow rate out of the tank, i.e. ”a H”. The above equation
describes the height of water, H, as a function of time, due to the difference
between flow rates into and out of the tank.

The equation contains one input, V , and one output, H. It is nonlinear due to
its dependence on the square-root of H.

7
Model parameters are given as
a = 2 cm2 /s
A = 20 cm2
b = 5 cm3 /(sV )

2.3 Simulink Model


Build a Simulink model of the tank system using the differential equations. Now
perform the following exercises, saving all the responses.
Exercise-8: Give the open loop step response of the system.

Exercise-9: Is this system stable in the open loop configuration?

Exercise-10: What is the final value achieved by this system?

Now close the system with unity feedback.

Exercise-11: Give the response of the closed loop system with unity gain.

Exercise-12: What is the final value achieved by the system in the closed loop
configuration?

2.4 Controller Implementation


In this section, we will apply different controllers to the tank system. We first
apply the On/Off control strategy to the system.

Exercise-13: Apply the On/Off control strategy to the system and and give
its response.

Exercise-14: Is the system obtaining a final steady state value with the On/Off
control?

Focus on the output response of the system. You will see oscillations in the
response.

Exercise-15: Apply the following PID controllers to the system and provide
the response and final value achieved by the system:
1. P = 100.
2. P = 100, I = 25.
3. P = 10, I = 0.8, D = 0.8.

8
2.5 Cascade System
Consider a system consisting of two tanks in series where the outflow of the first
tank is the inflow of the second tank, as shown in Figure-7.

Figure 7: Two water tank in series

Exercise-16: Give the complete Simulink model of the cascade tank system in
its closed loop form, where h2 is the final output.
Show how you derived the model from the equations for bonus points.

3
Exercise-17: Apply a PID controller to the closed loop system and manually
tune the controller’s parameters to obtain an optimal response (that would be
an important part of learning here). Save the response and the parameter values.

NOTE:
ALL RESPONSES MUST BE PROPERLY SCALED. IT IS NOT
ACCEPTABLE TO DIRECTLY COPY PASTE THE RESPONSE
FROM THE SCOPE.

You might also like