Lab # 2
Introduction to Control Systems and MATLAB
Objective:
1. An Overview of Control Application in Our daily life
2. Learn the basics of modeling of different systems in MATLAB.
1. Overview of Control Application
To this Modern day, different types of engineering techniques are being put together to make the
life easy for a normal man. Control system is just one and the most important of these fields.
Whenever the name of Control systems is taken, it always comes with the name of Control
Systems Analysis. It basically analyses the system parameters like velocity, temperature,
mass, damping ratio, etc. which are necessary for its quality output. Using these parameters
one can judge its real-life state and then implement it. WWII accelerated the development of
classical control theory and practice. Heavy guns had to be rapidly and accurately positioned.
Precise navigation and target tracking were increasingly important, and aircraft performance
was improved greatly with the incorporation of complex control systems to aid the pilot.
Today, control systems are pervasive in industry and in our everyday lives. They range from
governmental regulation (such as that governing monetary policy) to automated and highly
flexible manufacturing plants to sophisticated automobiles, household appliances, and
entertainment systems. Our purpose is to learn to design control systems for a wide variety of
applications.
Control systems in Human body:
The human body contains numerous control systems that help maintain its functions and keep it
in a state of homeostasis, which is the stable internal environment necessary for survival. These
control systems involve various organs, hormones, and feedback mechanisms that work together
to regulate physiological processes. Here are some of the key control systems in the human
body: Nervous System, Endocrine System, Cardiovascular System etc.
These control systems often work together in a coordinated manner to maintain equilibrium and
respond to changes in the internal and external environment. They rely on feedback mechanisms
that involve sensors, effectors, and communication pathways to ensure that physiological
parameters remain within a narrow range conducive to health and survival.
2. Modeling of different systems in MATLAB:
Modeling different systems in MATLAB involves representing real-world systems or processes
using mathematical equations or simulations. MATLAB is a powerful software tool for
numerical computation and modeling, making it useful for various applications, including
control systems, signal processing, image processing, and more. Here are the basics of modeling
different systems in MATLAB:
Define Your System:
Before you start modeling, you need a clear understanding of the system you want to represent.
This could be a physical system (e.g., an electrical circuit, mechanical system) or an abstract
concept (e.g., financial market dynamics, population growth).
Choose the Modeling Approach:
Depending on the nature of the system, you may choose different modeling approaches, such as:
A. Transfer functions: These relate inputs and outputs of linear time-invariant systems.
Modelling through Transfer Functions in MATLAB
Transfer function:
A Transfer Function is the ratio of the output of a system to the input of a system, in the
Laplace domain considering its initial conditions and equilibrium point to be zero. This
assumption is relaxed for systems observing transience. If we have an input function of X(s),
and an output function Y(s), we define the transfer function H(s) to be:
𝐻(𝑆) = 𝑌(𝑠)/𝑋(𝑠)
Lab Task 1:
Q1.a) Find the Laplace transform of the following differential equations and determine
their transfer function:
1) 𝑥′′ + 3𝑥′ + 2 = 4𝑦′ + 12𝑦 2) 𝑥′′′ + 19𝑥′ = 𝑦
Q1.b) Repeat the above question but this time using MATLAB.
Write MATLAB code for the above Question if transfer function exists
Lab Task 2:
Modeling of the RC Circuit in Frequency domain
Figure 2: RC Series Circuit
Where,
Vin is the input voltage applied
Vout is the output voltage.
R=1ohm C=1 Farad
Step 1: Find the transfer function Vout /Vin.
Step 2: Write code for the transfer function of the above RC circuit in MATLAB.
Step 3: Take step of the transfer function. The graph will be display as shown below
Figure.3, shows step response for the RC Series Circuit.
Step 4: Take 63 percentage of the final value as shown in graph above. The value of
time at this amplitude will be equal to T
Step 5: Now put values in the first order general transfer function
𝐴
TF = 𝑇𝑠+1
Where A is final value
T is 63% of final value.
Step 6: Write the simplified equation for the transfer function after following the above steps
Lab Task 3:
Modeling of a Mechanical System in Frequency domain
Cruise Control Model:
Following is the equation of motion for an automobile.
v'+(b/m)v=u/m
Using this differential equation, we can find the transfer function of this cruise control.
Now implement the transfer function in MATLAB and analyze its output. Use the values of
m = 1580 kg , b = 26 N*sec/m period of time. Its output will be quite like a car whose
driver accelerates it for instance and then leaves the car to decelerate at its own speed.
Figure.4, shows Cruise Control Model
Step 1. Find the relation between the input force (u) and the output velocity (v) using Laplace
Transformation
Step 2. Simulate the system in MATLAB
Step 3: Take step of the transfer function. The graph will be display as shown below
Figure.5, shows step response for the Cruise Control Model
Lab Exercise and Summary
Summary should cover Introduction, Procedure, Data Analysis and Evaluation.
LABORATORY SKILLS ASSESSMENT (Psychomotor)
Total Marks: 100
Criteria Level 1 Level 2 Level 3 Level 4 Score
(Max Marks) 0% ≤ S < 50% 50% ≤ S< 70% 70% ≤ S< 90% 90%≤ S ≤100% (S)
Selects inappropriate Selects and applies Selects and applies Selects and applies
Procedural skills and/or partially appropriate the considerably the completely
Awareness strategies to write skills and/or appropriate strategies appropriate strategies
(20) and compile the strategies required by and/or skills specific and/or skills specific
programs. the programs. to the programs. to the programs.
Makes major critical Makes numerous Makes minor non- Applies the
errors in applying critical errors in critical errors in procedural
Practical
procedural applying procedural applying procedural knowledge in
Implementation
knowledge related to knowledge related to knowledge related to optimized ways
(20)
Mathematical Mathematical Mathematical related to Mathematical
Modeling. Modeling. Modeling. Modeling.
Program logic has Program logic has Program logic is Program logic is
many errors with some errors with mostly correct, but correct, with no
majority of several contradictory may contain known errors, and no
Program Logic
contradictory conditions. occasional errors or redundant or
(20)
conditions. redundant/ contradictory
contradictory conditions.
conditions.
Program does not Program partially Program adequately Program completely
follow proper syntax follows the proper follows the proper follows proper syntax
Syntax of Simulink syntax of Simulink syntax of Simulink of Simulink
Correctness and modeling and does modeling and modeling and modeling and
Results not produce desired produces appropriate produces appropriate produces appropriate
(20) results for most results for few inputs. results for most results for all inputs
inputs. . inputs. tested.
Uses software tool, Uses software tool, Uses software tool, Uses software tool,
Use of Software
with limited with some with considerable with a high degree of
Tool
competence. competence. competence. competence.
(10)
Requires Requires some Follows safety Routinely follows
Safety Constant reminders reminders to follow procedures with only safety procedures.
(10) to follow safety safety procedures. minimal reminders.
procedures.
Marks Obtained
Instructor’s Signature: ___________________ Date: ___________________
LABORATORY SKILLS ASSESSMENT (Affective)
Total Marks: 40
Criteria Level 1 Level 2 Level 3 Level 4
Score
(Max. Marks) 0% ≤ S < 50% 50% ≤ S < 70% 70% ≤ S < 90% 90% ≤ S ≤ 100%
Introduction Very little Introduction is brief Introduction is nearly Introduction complete
(5) background with some minor complete, missing and well-written;
information mistakes. some minor points. provides all necessary
provided or background principles
information is for the experiment.
incorrect.
Procedure Many stages of the Many stages of the The procedure could The procedure is well
(5) procedure are not procedure are be more efficiently designed and all stages
entered on the lab entered on the lab designed but most of the procedure are
report. report. stages of the entered on the lab
procedure are entered report.
on the lab report.
Data Record Data is brief and Data provides some Data is almost Data is complete and
(10) missing significant significant complete but has some relevant. Tables with
pieces of information and has minor mistakes. units are provided.
information. few critical mistakes. Graphs are labeled.
All questions are
answered correctly.
Data Analysis Data is presented Data is presented in Data is presented in Data is presented in
(10) in very unclear ways that are not ways that can be ways that best facilitate
manner. clear enough. understood and understanding and
interpreted. interpretation.
Report Quality Report contains Report is somewhat Report is well Report is well
(10) many errors. organized with some organized and organized and cohesive
spelling or cohesive but contains and contains no
grammatical errors. some grammatical grammatical errors.
errors. Presentation seems
polished.
Marks Obtained
LABORATORY SKILLS ASSESSMENT (Cognitive)
Total Marks: 10
(If any)
Marks Obtained
Instructor’s Signature: ___________________ Date: ___________________