Sinco
Sinco
A transfer function is the representation of an LTI system in the s-domain. It represents the
ratio between the Laplace transforms of the output and the input of a system.
Y (s )
G ( s )=
R (s )
In practice, the transfer function G ( s ) is usually used as the preferred form of representation
of LTI systems instead of the impulse response g ( t ).
2.1.1 Algebraic Forms of Transfer Functions
As the transfer function is generally the representation of an n th order linear constant-
coefficient differential equation, one of its algebraic forms can be derived by performing the
following sequence of operations. Here, we represent the input of the system as r ( t ) and the
output as y ( t ) .
n n−1 m m−1
d y (t ) d y (t ) d r (t ) d r (t )
an + an−1 + … a 0 y ( t ) =bm +b m−1 + … b0 r ( t )
dt n dt n−1 dt m dt m−1
Applying Laplace transform on this differential equation, we get the following expression.
Note that this step goes with the assumption that all initial conditions are zero.
n n−1 m m−1
a n s Y ( s ) +an −1 s Y ( s ) … a 0 Y ( s )=bm s R ( s )+ bm−1 s R ( s) … b0 R ( s )
26
Factoring out Y (s) and R(s) from both sides, we can rearrange this polynomial equation to
isolate the ratio of Y ( s ) and R ( s ).
m m−1 m−2 0
Y ( s ) b m s +bm −1 s +b m−2 s … b0 s
G ( s )= =
R ( s ) an s n +a n−1 s n−1 +an −2 s n−2 … a0 s 0
The G ( s ) as expressed in the preceding equation is, in essence, a ratio of two polynomials in
s-domain. But G(s) can also be represented algebraically in two other forms. Each form has
its own utility. The description of each of these forms is as follows.
Polynomial form: If the numerator and denominator in the fraction are written as
polynomials, it is known as polynomial form. This form is particularly useful with the direct
implementation of filters. As evident in the following equation, the coefficients in the
numerator are usually represented by b k and the coefficient in the denominator represented by
a k, where k is an integer from 0 to m for the numerator and 0 to n for the denominator. For all
physically realizable systems, the degree of numerator must be smaller than the degree of the
denominator, i.e., m<n.
m
m
bm s +b m−1 s
m−1
+ bm−2 s
m−2
… b0 s
0 ∑ bk s k
G ( s )= n n−1 n−2
= k=0
a n s + an−1 s + an−2 s … a 0 s0 n
∑ ak s k
k=0
∏
k=0
( s− pk )
Residue form: If the fraction representing the transfer function G ( s ) is expressed as a sum of
partial fractions, it is known as the residue form. This form can have various representations,
depending on how we factor the partial fractions. The simplest form is as follows. K ( s ) is the
residue polynomial that remains when degree of the numerator is greater than that of the
denominator in G ( s ). Rk are the numerators of the partial fractions and pk are the system’s
poles.
R1 R2 R3 Rn
G ( s )=K ( s ) + + + …
s− p0 s− p1 s− p 2 s− pn−1
27
2.2 Transfer Functions in MATLAB
Controls Systems Toolbox in MATLAB provides functions and applications to manipulate
and analyze transfer functions, which can be defined in either polynomial or ZPK form. We
can also find the response of an LTI system corresponding to impulse and step inputs.
2.2.1 Defining an LTI System in Polynomial Form
The function tf() defines an LTI system in polynomial form. One of the ways to use this
function is as follows.
28
polynomials to it and it returns the residue polynomial, R, the array of poles P and the array
of partial fraction numerators K. In the following example, the find out the partial fractions
expansion of the transfer function.
( s +2 )2
( s +1 )( s+ 3 )( s+ 4 )
>> a=poly([-2 -2]);
>> b=poly([-1 -3 -4]);
>> [R, P, K] = residue(a, b);
The result of this operation is the following.
R =
1.3333
-0.5000
0.1667
P =
-4.0000
-3.0000
-1.0000
K =
[]
This result represents the given transfer function in the following residue form.
4 1 1
− +
3 ( s+ 4 ) 2 ( s +3 ) 6 ( s+ 1 )
29
>> impulse(sys1)
30
Figure 2-3: Step response of an LTI system
31
Figure 2-4: Pole zero map of an LTI system
32
2.3.3 Evaluate a Polynomial
The function polyval() evaluates the polynomial at a given value of s. In the following
example, we find the value of the polynomial b defined above at s=5.
>> polyval(b, 5)
2.3.4 Product of Two Polynomials
The conv() can be used to find the coefficients of the product of two polynomials. In the
following example, we convolve the polynomials a and b.
2
a ( s ) =s +4 s+ 4
b ( s ) =s 3 +8 s 2 +19 s+ 12
>> a = [1 4 4];
>> b = [1 8 19 13];
>> c = conv(a, b);
2.4 Transfer Functions in Simulink
The transfer function of an LTI system can also be defined in Simulink using the 'Transfer
Function' block. This block is available in the Simulink library in the 'Continuous' section of
the navigation pane. The transfer function block in Simulink is shown in the following
diagram.
The transfer function for the block can be edited by double clicking the block and entering
the coefficients of powers of s for the denominator and the numerator as in the following
diagram.
33
Figure 2-6: Editing the transfer function
You can provide impulse, step, ramp or any well-defined input to this block and observe the
simulated output using the scope block.
34
1. Pre-Lab Use the impedance model of electrical elements to write down the transfer
function of the integrator from v ¿ to v out, in terms of R and C. [3
points]
−1
V out ( s )
G (s ) = RCs
=¿___________________________
V ¿ ( s)
2. Pre-Lab If a unit step is applied as v ¿ to this op-amp circuit, do you think v out will be?
Justify your answer considering the integrator’s mathematical properties. [2 points]
V ¿ (t)=u (t)
where (u(t)) is the unit step function, which is 0 for (t < 0) and 1 for (t > 0).
−1 −1
Vout(t)=
RC
∫ V in(t)dt = RC ∫ u ( t ) dt
−1
V out (t )= t ⋅u (t)
RC
This means that the output will be a negative ramp function starting from (t = 0), with a slope
of (-1/RC). The negative sign indicates that the output voltage decreases over time, which is a
characteristic of the op-amp integrator when a positive step input is applied. The rate of
decrease is determined by the product of the resistance (R) and the capacitance (C). The
larger the product (RC), the slower the output voltage decreases.
3. Using R=1 kΩ and C=100 μF , define the transfer function (found in part 1) of this op-
amp circuit in MATLAB. Plot its step response and paste a screenshot here. Describe the
output in terms of initial value and shape of the graph. Also, describe how its slope varies
over time. [5 points]
35
Initial Value: The graph starts at an initial value of 0 amplitude. This is expected as
the output of an integrator for a step input starts from zero.
Shape of the Graph: The graph shows a straight line decreasing linearly over time.
This is the typical response of an op-amp integrator to a step input. The output is a
ramp function, which is represented as a straight line in the graph.
Slope Variation: The slope of the graph is constant and negative throughout the time
period shown. This indicates a steady rate of decrease in amplitude with respect to
time. The slope of the graph is determined by the values of the resistance (R) and the
capacitance (C) in the op-amp integrator circuit. In this case, the slope is (-1/RC),
which remains constant over time
2.6 Task 2: Cruise Model of a Car
Objective: Simulate the first order differential equation of a cruising car in Simulink.
Investigate the behavior of the car if the load is changed.
The model of a car is given in the following diagram. Here, x represents the displacement of
the car and consequently, ẋ and ẍ represent its velocity and acceleration. The mass of the car
is m and a force u is applied to it by the engine to make it move forward or backward. [7]
36
1. Pre-Lab Using Newton's 2nd law, consider all the forces acting on the car and write down
the first order differential equation relating the velocity of the car, v= ẋ , in terms of the
engine force u and the car’s acceleration ẍ . Ignore the rolling friction between the car’s
wheels and the road. [3 points]
we can express the net force as the sum of these forces:
F=u−bv
Newtons second law: m . a = u – bv
Since acceleration (a) is the time derivative of velocity (v): m . dv/dt = u −¿ bv
dv 1
¿)
=¿_______________________
dt m
2. Pre-Lab Find the transfer function between velocity of the car and engine force, by
applying Laplace transform on the differential equation found in part 1.
[3 points]
1
V (s )
G (s ) = =¿ _______________________
m. s +b
U (s )
3. Now simulate the car as a transfer function in Simulink with a constant engine force of
u=500 N applied to the car. Use m=1000 kg and b=50 Ns m−1 for the car. Run the
simulation for 100 s and insert the graph of the car’s speed here. Describe the behavior of
the car in terms of minimum and maximum values of the speed, settling time and shape of
the graph. [5 points]
37
Minimum and Maximum Speed: The minimum speed of the car is at the start,
which is 0. The car then accelerates and reaches a maximum speed just above 508.
Settling Time: The settling time is the time taken for the speed to reach and stay
within a certain range of the final value. In this case, the settling time seems to be
around 7-8 units of time. This is the time at which the car’s speed reaches near its
maximum and continues at that pace.
Shape of the Graph: The shape of the graph is an S-curve, which is typical for
systems with a smooth acceleration and deceleration. The speed increases rapidly at
first (acceleration), then slows down as it approaches the maximum speed
(deceleration).
This shows that speed of the car is not much effected by external forces really.
4. Using your practical experience, how do you think the speed of the car would change if
an extra 500 kg is loaded on the car? Explain your answer. [3
points]
Ans: Adding an extra 500 kg to the car would likely result in slower acceleration, reduced
maximum speed, increased fuel consumption, longer braking distances, and potential changes
in handling and stability. The additional mass increases the inertia, making it more
challenging for the car to move and stop efficiently.
38
5. Update your Simulink model to incorporate the extra 500 kg mass and simulate it.
Explain any differences from your answer to previous part. [3
points]
Only slightly non noticeable change in the graph happened not any significant to display
differences after adding the addition weight. Which means that car’s pulling force is much
stronger to lift.
2.7 Task 3: Permanent Magnet DC Motor
Objective: Simulate the step response of a permanent magnet DC motor in Simulink using its
transfer function.
Consider a DC motor as shown in Figure 2-9: Permanent magnet DC motor. In this model,
the resistance and inductance of the armature are R and L respectively, the moment of inertia
of the rotor is J , the drag constatnt for the rotor is b and the back EMF and torque constants
are K e and K t respectively. The physical and electrical parameters of the motor are
J=0.01, b=0.1 , K e =K t =0.01 , R=1 , L=1. [8]
39
Figure 2-9: Permanent magnet DC motor
1. Pre-Lab Write down a differential equation that relates the rotation speed of the motor,
ω=θ̇ , and its input voltage v . [4
points]
2. Pre-Lab Find the transfer function between ω and v . Use Ω(s) to represent the Laplace
transform of ω (t). Use L ( ω ( t ) )=Ω ( s ) . [4 points]
Ω (s )
G (s ) = =¿ __________________________________
V (s )
40
3. Use Simulink to simulate the rotational speed of the motor when a constant voltage (DC)
of 5 V is applied. Insert the graph here and describe the shape of the graph in term of
variation in the angular speed, and the initial and steady-state values. [5 points]
The angular speed increases rapidly at first, indicating a quick response to some kind of
stimulus or change in conditions. As time progresses, the rate of increase slows down. This
could be due to the system approaching its limit or due to a decrease in the driving force.
Steady-State Value: The graph eventually reaches a steady-state value, where the angular
speed no longer changes significantly. This value appears to be around 0.5. The steady-state
is typically reached when the forces driving the change are balanced by the forces resisting
the change.
4. Create a new polynomial having roots at s=−1, s=−2 using the poly() function.
[2 points]
5. Convolve the new polynomial with the characteristic polynomial of the PMDC motor
system using the conv() function. [2 points]
41
6. Find the resulting polynomial in the form of partial fractions using the residue()
function in MATLAB. [3 points]
7. Find the roots of the convolved polynomial using the roots() function. [2 points]
8. Use the polyval() function to evaluate the value of the polynomial at s=2.[2 points]
42
Consider the following spring-mass system. The mass of the block is m , the coefficient of
friction b , the spring constant k and the displacement x . A horizontal external force f ( t ) is
applied to the block. Consider rightwards as the positive direction for displacement, velocity
and acceleration.
1. Pre-Lab Recall the differential equation of this system derived in Lab 1. Transform the
differential equation into a transfer function, considering the external force F ( s ) as the
input and the displacement X ( s ) as the output. Write the transfer function in the
polynomial form in terms of m , b and k . The coefficient of the highest power of s in the
denominator must be 1.
[4 points]
(m s2+bs +k) X(s) = F(s)
1
X (s) m
F (s )
= b k
s 2+ s+
m m
1
= 2 where m=b=k=1
s + s +1
2. Pre-Lab If the system has the poles as given below, compare it with your system and find
b k
the values of and for your spring-mass system. [3 points]
m m
s=−0.5 ± √ i
3
2
b/m = -0.5 x sqrt(3)
k/m=(sqrt(3)/2)^2
−√ 3
b/m =
2
3
k/m =
4
43
3. Pre-Lab Is the system overdamped, underdamped or critically damped? [2 points]
b −√ 3
Since the damping ratio is = =
m√3 2
Since ζ is negative, it suggests that the system is underdamped. Therefore, the system is
underdamped.
4. Simulate the system in Simulink using the values found in the previous part and run the
simulation for 25 seconds. Insert the graph of the displacement here and describe the
shape of the curve, time period of oscillation (if they occur), initial and final values. Use
m=2 kg for the simulation. [5
points]
5. Use the Linear System Analyzer app to plot the step response of the system with the
following values of b and for each value, measure and record the parameters in the
subsequent columns. [5 points]
44
2 0.25 Yes 4.4429 59.02 1.0371
3 0.5 Yes 4.421 28.49 1.002
4 1 Yes 4.7894 15.484 1
5 2 No 6.263 8.4326 1
6 10 No 71.727 38.53 0.9938
45
6. In this part, you will simulate the response of the system if a sinusoidal input force is
applied. A sinusoidal input can be modeled as follows, f ( t )= A sin ( ωt ), where A is the
amplitude and ω is the angular frequency of the oscillation. Simulate the system against
each of the following sinusoidal inputs. Explain how the displacement of the mass
behaves in terms of its frequency and amplitude of oscillations in each case. [4
points]
i. f ( t )=sin ( t )
1. f(t) = sin(t): The system shows regular oscillations with a moderate amplitude. This
suggests that the frequency of the input is close to the natural frequency of the system,
but not enough to cause resonance. The system is able to follow the input closely.
2. f(t) = sin(√3/2 t): The system still shows regular oscillations, but at a higher
frequency compared to the first case. This indicates that the frequency of the input is
46
higher than the natural frequency of the system, but the system is still able to respond
to the input without significant distortion.
3. f(t) = sin(10t): The graph appears as a solid blue area due to the high frequency of the
input. This suggests that the frequency of the input is much higher than the natural
frequency of the system. The system is not able to follow the input closely, leading to
smaller oscillations.
4. f(t) = sin(100t): Only one significant spike is visible due to the very high frequency
of the input. This indicates that the frequency of the input is significantly higher than
the natural frequency of the system. The system is not able to respond to the input,
resulting in a very small amplitude of oscillation.
3. Pre-Lab Use the impedance models of linear circuit components, to derive the transfer
function between V 0 ( s ) and V i ( s ). [3 points]
47
4. Use MATLAB to generate a system with this transfer function in the polynomial form.
Plot the step response of this circuit in MATLAB and describe its shape in terms of the
initial value, final value, and the time constant. [3
points]
5. Without first simulating in MATLAB, think about how would the step response of the
circuit change if the value of L is doubled? [2 points]
6. Make appropriate changes in your simulation to simulate the circuit if the inductance is
twice its current value. Measure the time constant of the output voltage. [2 points]
τ =¿ ___________________
48
Assessment Rubrics
EE361: Control Systems – Lab 2
Method: Lab reports and instructor observation during lab sessions
Outcome Assessed:
a. Ability to conduct experiments, as well as to analyze and interpret data (P).
b. Ability to function on multi-disciplinary teams (A).
c. Ability to use the techniques, skills, and modern engineering tools necessary for
engineering practice (P).
Exceeds expectation Meets expectation Does not meet
Performance Marks
(4-5) (3-2) expectation (1)
Selects relevant Needs guidance to Incapable of
equipment to the select relevant selecting relevant
experiment, develops equipment to the equipment to
1. Realization of setup diagrams of experiment and to conduct the
Experiment [a, c] equipment develop equipment experiment,
connections or wiring. connection or wiring equipment
diagrams. connection or wiring
diagrams are
Actively engages and Cooperates with other Distracts or
cooperates with other group members in a discourages other
2. Teamwork [b] group members in an reasonable manner. group members
effective manner. from conducting the
experiment.
Does proper Calibrates equipment, Unable to calibrate
calibration of examines equipment appropriate
equipment, carefully moving parts, and equipment, and
3. Conducting examines equipment operates the equipment operation
Experiment [a, c] moving parts, and equipment with minor is substantially
ensures smooth error. wrong.
operation and process.
49
Exceeds expectation Meets expectation Does not meet
Performance Marks
(5-4) (3-2) expectation (1)
Plans data collection to Plans data collection Does not know how to
achieve experimental to achieve plan data collection to
5. Data objectives, and experimental achieve experimental
conducts an orderly objectives, and goals; data collected is
Collection [a]
and a complete data collects complete data incomplete and
collection. with minor error. contain errors.
Total
Signature: Signature:
Date: Date:
50