Practical 2
Practical 2
Objective:
Tools/Software Requirement
MATLAB
Symbolic Math Toolbox
Control Toolbox
Simulink
Recommended Books:
Feedback Control Systems by Charles L. Phillips & Royce D. Harbor
Control Systems by Norman Nise
Theory
Introduction to Control Systems
Suppose a slave who used to fan his master using some kind of a cloth and he does this all day long. To
make his life easy, fans were introduced. 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. It is our purpose to learn to design control systems for a wide variety of applications.
Control systems in Human Body
Human body contains various control mechanisms like the balancing mechanism is carried out by gyros
in our ear, all the six senses are very good example of control systems as they are giving feedback
required by the body to function accurately, if any one of our senses gets disturbed we can our self-feel
the malfunctioning of our body like this example, just stand with your feet one in front of other and place
your hands on your back and make sure your eyes are open. After you are in the desired position close
your eyes, you will notice the importance of feedback control systems.
Transfer functions in MATLAB
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:
𝐻(𝑆) = X (s)
Y ( s)
Lab Task 1:
Q1.a) Find the Laplace transform of the following differential equations using MATLAB:
˙ x
1) ÿ +3 ẏ +2 y= ẋ +3
2) ẍ +3 ẋ+2=4 ẏ+ 12 y
The pop-up windows can be moved by users. Blocks can be copied from one window to another by
dragging them from the original location to the new location by holding down the left mouse button.
Assemble the following diagram in your working window. [e.g. Step Input -> Sources; Sum ->Math
operations, Transfer Fcn -> Continuous; Scope -> Sinks]
Location Icons
Lab Task 2:
Q: Investigate the open loop step response of the integrator.
Step 7: Now plot your own graph below and compare it with Figure 5.
Graph 2.1
Attach graph that you made using MATLAB here:
Now plot your own graph below and compare it with Figure 2.7
Graph 2.2
Attach graph that you made using MATLAB here:
Compare Figure 2.7 and Graph 2.2 at the given place below
Mathematical Modeling:
Mathematical modeling is the mathematical representation of any system. System can belong to
any field of science. A mathematical model is the replica of the exact behavior of the system, it
represents the relations between the inputs and outputs and how the output corresponds by
changing the inputs.
1
−V ¿ + iR+
C
∫ i ( t ) dt=0
1
−V ¿ (s )+ I (s)R + I (s)=0
Cs
[
I ( s ) R+
1
Cs ]
=V ¿ ( s)
1
V out =I ( s )
Cs
I ( s )=Cs V out Eq (ii)
V ¿ (s)
=C (s)V out
[ R+
1
]
cs
c (s )V ¿ (s )
=C (s)V out
[ 1+ Rcs ]
V out 1
= Eq (iii)
V ¿ 1+ RCs
Eq-(iii) is showing the transfer function required.
Here, R = 1k Ω C=1µF
V out
Finding the transfer function
V¿
Step 1: Write the transfer function in MATLAB for the given values of R and C.
Step 2: Click on Run in the bar above and click on scope icon.
The graph will be displayed as shown below
Graph 2.3:
Graph 2.4:
Observations
Write your observations for RC Circuit when C was constant and R varied. Did the system slow
down?
Yes, the system slows down as the resistance (R) increases in an RC circuit with constant
capacitance (C). This is evident from the increased charging and discharging times, larger time
constant, decreased peak values, and prolonged time to reach steady-state response.
Time Constant: The time constant of the RC circuit, τ=R×C, increases with higher
resistance (R). A larger time constant indicates a slower response of the circuit to changes
in input signals. Therefore, the system slows down as the resistance increases.
Steady-State Response: A higher resistance (R) results in a longer time for the circuit to
reach steady-state conditions. Steady state is reached when the capacitor is fully charged or
fully discharged, and the voltage or current across it remains constant. The slower response
due to higher resistance prolongs the time to reach this steady-state condition.
Write your observations for RC Circuit when C was constant and R varied. Mention the effect
observed:
In an RC circuit where the capacitance (C) is constant and the resistance (R) varies, several effects
can be observed:
Charging Time Constant: The time constant of the circuit τ=R×C, determines how
quickly the capacitor charges or discharges. When the resistance (R) increases, the charging
time constant also increases, resulting in a slower rate of charging and discharging.
Charging and Discharging Rates: With a higher resistance (R), the capacitor charges and
discharges at a slower rate. This means it takes longer for the capacitor to reach its
maximum voltage during charging and to discharge to a lower voltage during discharging.
Peak Voltage and Current: As the resistance (R) increases, the peak voltage across the
capacitor during charging decreases, and the peak current during discharging also decreases.
This is because a higher resistance limits the flow of current in the circuit, resulting in lower
peak values.
Time to Reach Steady State: A higher resistance (R) leads to a longer time for the circuit
to reach steady-state conditions. Steady state is reached when the capacitor is fully charged
or fully discharged, and the voltage or current across it remains constant.
Frequency Response: The RC circuit's frequency response, particularly in applications like
filtering, changes with variations in resistance. A higher resistance (R) can shift the cutoff
frequency of the circuit, affecting its frequency response characteristics.
Overall, varying the resistance (R) in an RC circuit with constant capacitance (C) affects the time
dynamics, peak values, and steady-state behavior of the circuit, ultimately influencing its
performance and applications.
Provide MATLAB code for the above equations in the given space
Design the Simulink model in the space given below
1
−V ¿ + iR+ L∫ i ( t ) dt+ ∫ i (t ) dt=0
c
1
−V ¿ ( s ) + I ( s ) R+ LsI ( s ) + I (s)=0
Cs
[
I ( s ) R+ Ls +
1
Cs]=V ¿ (s)
V ¿ (s)
I ( s )=
[ R+ Ls+
1
Cs ]
1
V out =I ( s )
Cs
I ( s )=Cs V out
V ¿ (s)
=C(s)V out
[ R+ Ls+
1
cs ]
C (s)V ¿ (s)
=C (s)V out
[ 1+ LC s 2 + RCs ]
V out 1
=
V ¿ 1+ LC s 2+ RCs
Finding the relation between the output voltage of capacitor to the input voltage applied. Use
RL= 1 kΩ, L= 1 mH, C= 1 µF.
Step 1: Write the transfer function in MATLAB for the given values of R, L and C.
Step 2: Click on Run in the bar above and click on scope icon.
Step 3: Now plot some more graphs by changing the value of L from 1 mH to 10mH, 100 mH and
1000mH while keeping RC values constant and observe the changes in the Graph. Paste the Graph below
at the space provided for Graph 2.5.
Step 4: Similarly plot some more graphs by changing the value of C to 10 µF and 100 µF by keeping R =
1k Ω and L = 1mH and observe the changes in the graph. Paste the Graph below at the space provided for
Graph 2.6.
Graph 2.5:
Graph 6:
Observations
Write your observations for RLC Circuit when R & C were constant and L varied.
Write your observations for RLC Circuit when C varied and R,L were kept constant. Mention the effect
observed:
Provide MATLAB code for the above equations in the given space
Lab Task 2:
v̇+ ( mb ) v= mu
Using this differential equation, we can find the transfer function of this cruise control. Now implement
the transfer function using Simulink and analyze its output. Use the values of m = 1580 kg , and b = 26
N*sec/m period of time. Its output will be quite similar to a car whose driver accelerates it for instance
and then leaves the car to decelerate at its own speed. Also, use the differential equation to make a second
model of the same system using Simulink.
Compare the output of both the systems now. It should be same.
1. Find the relation between the input force (u) and the output velocity (v)
2. Simulate the system on MATLAB and Simulink.
3. Find the transfer function.
4. Compare results of step 1 and 3.
Provide MATLAB code for the above equations in the given space and attach graph
Observations/Analysis:
Write your analysis in the given space.
Design the model in Simulink and sketch the model in the space given below
Task #2:
Q2. Simulate the step response of the transfer functions given in question 1(a) in MATLAB and Simulink.
Evaluation Criteria:
written in a incomplete
complete form. sentence.
Lab Instructor: