Assignment Final 2 Complete
Assignment Final 2 Complete
Figure 01: Asymptotic Bode plot of a system with four poles and one zero (Source: Assignment Brief)
𝑟𝑎𝑑
It is clear from above plot that as before 10−2 𝑠
frequency, there is no zero or pole since the magnitude
plot is straight and thus represents the gain value only i.e., 𝐾 = 0 𝑑𝐵. Therefore:
0
𝐾 = 1020 = 100 = 1
Also, there is a slope of −20 𝑑𝐵𝑠 per decade frequency for frequency range between 10−2 < 𝜔 < 10−1.
𝑟𝑎𝑑
It means, there is a pole corresponding to frequency 𝜔 = 10−2 . Also, for frequency range between
𝑠
−1 0
10 < 𝜔 < 10 , the scope becomes −40 𝑑𝐵𝑠 per decade frequency i.e., a decrease of 20 𝑑𝐵𝑠 per decade
𝑟𝑎𝑑
frequency. It means, there is a second pole corresponding to frequency 𝜔 = 10−1 𝑠
. Now, for frequency
0 1
range between 10 < 𝜔 < 10 , the slope further decreases by 20 𝑑𝐵𝑠 per decade frequency i.e., the slope
becomes −60 𝑑𝐵𝑠 per decade frequency. It indicates that presence of another pole i.e., third pole of system
𝑟𝑎𝑑 𝑟𝑎𝑑
which corresponds to a frequency 𝜔 = 100 𝑠
=1 𝑠
. In a similar fashion, it is seen from above figure
that the slope of the system decreases by another 20 𝑑𝐵𝑠 per decade frequency for frequency range 101 <
𝜔 < 102 and slope of magnitude plot becomes −80 𝑑𝐵𝑠 per decade frequency which indicates presence
𝑟𝑎𝑑
of forth pole of system that corresponds to frequency of 𝜔 = 101 𝑠
. The slope remains same i.e., −80 𝑑𝐵𝑠
for frequency range of 102 < 𝜔 < 103 which indicates there is no pole or zero corresponds to this
frequency range. Finally, for 103 < 𝜔 < 104 frequency range, the slope of magnitude plot has been
increased by 20 𝑑𝐵𝑠 i.e., the slope of magnitude plot becomes −60 𝑑𝐵𝑠 per decade frequency indicating
𝑟𝑎𝑑
presence of zero corresponding to frequency of 𝜔 = 103 . So, the corresponding system identified would
𝑠
be represented as:
𝑗𝜔 𝑠
𝐾 ( 3 + 1) 1 ( 3 + 1)
𝑡𝑓𝑖𝑑𝑒𝑛 (𝑠 = 𝑗𝜔) = 10 = 10
𝑗𝜔 𝑗𝜔 𝑠 𝑠
(10𝑗𝜔 + 1)(𝑗𝜔 + 1) ( + 1) ( 2 + 1) (10𝑠 + 1)(𝑠 + 1) ( + 1) ( 2 + 1)
10 10 10 10
Or, alternatively, we have:
1 3
10 3 (𝑠 + 10 )
𝑡𝑓𝑖𝑑𝑒𝑛 (𝑠) =
1 1 1
10 (𝑠 + 10) (𝑠 + 1) (10) (𝑠 + 10) ( 2 ) (𝑠 + 102 )
10
0.1(𝑠 + 1000)
𝑡𝑓𝑖𝑑𝑒𝑛 (𝑠) =
(𝑠 + 0.1)(𝑠 + 1)(𝑠 + 10)(𝑠 + 100)
b) Bode plot of system using margin () command in MATLAB with gain and phase
margins
The following MATLAB code has been written to obtained the bode plot of the system identified in task
a). The corresponding plot obtained with grid and four parameters i.e., gain margin, phase margin, phase
crossover frequency and gain crossover frequency are shown in the figure 2 respectively.
clear all;
close all;
clc;
syms s;
s=tf('s');
tf_sys=0.1*(s+1000)/((s+0.1)*(s+1)*(s+10)*(s+100));
[Gm,Pm,Wgm,Wpm]=margin(tf_sys);
margin(tf_sys);
grid on;
Figure 02: Bode plot with phase and gain margins and gain crossover and phase
crossover frequencies indicated on the plot using margin () command in MATLAB
c) Phase lead compensator design
Firstly, we have to satisfy the requirement of position tracking error, so:
0.1(0 + 1000) 100
𝐾𝑝 = lim 𝐶(𝑠)𝐺(𝑠) = 𝐾𝐺(0) = 𝐾 = 𝐾=𝐾
𝑠→0 (0 + 0.1)(0 + 1)(0 + 10)(0 + 100) 100
We choose,
𝐾𝑝 = 𝐾 = 45
Figure 03: Bode plot with ‘K’ as compensator i.e., proportional gain
𝑟𝑎𝑑
It is clear that the gain crossover frequency is estimated to be 𝜔𝑔𝑐 = 1.98 𝑠
as shown in the figure above.
To determine the phase angle ∅, we know that the phase margin of system is -180◦. Therefore, we have:
∅ = 𝑃𝑀𝑑𝑒𝑠 − 𝑃𝑀𝑐𝑢𝑟𝑟 + 5 = 28.5 − (−180) + 10 = 218.5
Therefore:
(1 − sin(∅)) (1 − sin(218.5))
𝛼= = = 4.2982
1 + sin(∅) 1 + sin(218.5)
It means, we can’t design Lead compensator for such system as for lead compensator, 𝛼 < 1. Now, we
will proceed to Lag Compensator.
d) Phase lag compensator design
We need to design a lead compensator that has following specifications:
𝐾𝑝 ≥ 45 𝑎𝑛𝑑 𝑃𝑀 ≥ 28.5°
Before going into the design phase, let us have a bode plot of the system as shown in the figure below
indicating gain and phase margins with their corresponding phase and gain crossover frequencies at phase
(−180° + (28.5° + 5.5°) = −146°).
Figure 04: Bode plot of uncompensated system with indication of point corresponding to −146° phase
𝑟𝑎𝑑
It is clear that phase around −146° at about 𝜔 = 1.3 , the value of gain or magnitude is −26.5 𝑑𝐵𝑠.
𝑠
Let this point be the gain crossover frequency, so we must have to add a constant gain of 26.5 𝑑𝐵𝑠.
Therefore, we have:
20 log10(𝐾) = 26.5
26.5
𝐾 = 10 20 = 21.1349
Now, we will include the value of gain in open loop transfer function. So, the open loop transfer function
will become:
(21.1249)0.1(𝑠 + 1000) 2.1135(𝑠 + 1000)
𝐾𝐺(𝑠) = =
(𝑠 + 0.1)(𝑠 + 1)(𝑠 + 10)(𝑠 + 100) (𝑠 + 0.1)(𝑠 + 1)(𝑠 + 10)(𝑠 + 100)
Now, we will check the response of system in MATLAB. As shown in the figure below, the condition for
phase margin has been successfully achieved.
Figure 05: Frequency response plot with desired phase margin achieved
However, the condition for gain is yet to be achieved. Now, consider:
𝐾𝑝 = 45 (𝑐ℎ𝑜𝑜𝑠𝑒𝑛)
Therefore, we have:
45
𝛼= = 2.1292 ≈ 2.13
21.1349
Now, we choose corner frequency which is ‘10’ times lower than the crossover frequency i.e.,
1.2
𝜔= = 0.12
10
Or, alternatively, we have:
1 1
𝑇= = = 8.33
𝜔 0.12
Therefore, the lag compensator will be:
𝑇𝑠 + 1 8.33𝑠 + 1 8.33𝑠 + 1
𝐶𝑙𝑎𝑔 (𝑠) = 𝐾𝛼 = (21.3149)2.13 = 45.4
𝛼𝑇𝑠 + 1 2.13(8.33)𝑠 + 1 17.743𝑠 + 1
So, the final bode plot or frequency plot is shown in the figure below. It may be noted that we have achieved
the desired parameters i.e.,
𝑃ℎ𝑎𝑠𝑒 𝑚𝑎𝑟𝑔𝑖𝑛 = 31.3°(> 28.5°)
33.1
𝐾𝑝 = 33.1 𝑑𝐵 = 10 20 = 45.19(> 45)
Figure 06: Frequency response with both parameters achieved with lag compensator
The MATLAB source code for above implementation is shown below:
clear all;
close all;
clc;
syms s;
s=tf('s');
%actual system bode plot
tf_sys=0.1*(s+1000)/((s+0.1)*(s+1)*(s+10)*(s+100));
bode(tf_sys);
grid on;
figure;
%implementation of achieving the phase requirements
tf_sys1=21.1349*0.1*(s+1000)/((s+0.1)*(s+1)*(s+10)*(s+100));
margin(tf_sys1);
%define lad compensator
Clag=45.4*(8.33*s+1)/(17.743*s+1);
figure;
%bode plot of complete compensated system
margin(tf_sys*Clag);
e) Step Response with lead and lag compensator designed
As shown in section c), we can’t design lead compensator for our system as it has phase margin of −180°.
So, we can simulate the compensated response only for lag compensator. The following implementation
using MATLAB is performed to implement the step response of compensated system:
Figure 07: Uncompensated response and compensated response in time domain for unit step input
From above figure, it is clear that:
1
𝑒𝑠𝑠 = (1 − 0.978) = 0.0220 =
1 + 𝐾𝑝
Or, alternatively:
1
𝐾𝑝 = − 1 = 45.4545 − 1 = 44.45 ≈ 45 (𝑤ℎ𝑖𝑐ℎ 𝑖𝑠 𝑎𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒𝑙𝑦 𝑎𝑠 𝑝𝑒𝑟 𝑟𝑒𝑞𝑢𝑖𝑟𝑒𝑚𝑒𝑛𝑡)
0.0220
2. Conclusion
The following conclusions have been made as we complete the assignment:
• The system can be easily identified from its frequency magnitude plot response. The system
identification is easier if system frequency response (magnitude plot) is given in asymptotic form
rather than actual bode plot
• The system identified has four number of poles and one number of zero. All zeros and poles are in
left half plane on s-plane. The system identified is:
0.1(𝑠 + 1000)
𝑡𝑓𝑖𝑑𝑒𝑛 =
(𝑠 + 0.1)(𝑠 + 1)(𝑠 + 10)(𝑠 + 100)
In totality, we learn how to identify a system from frequency response, how to apply compensation using
frequency design and what are the limitations of lead and/ or lag compensators.
3. References
Istanbul Bilgi University. (2023). Frequency Response Analysis (Lecture 5), Control Systems
Design (MECA 311). Istanbul: Istanbul Bilgi University.
Mathsworks. (2023). margin(). Retrieved from Mathworks:
https://www.mathworks.com/help/control/ref/dynamicsystem.margin.html
Prof. Dawn Tilbury, P. B. (2017). Frequency Design. Retrieved from Control Tutorials for
MATLAB and Simulink (CTMS):
https://ctms.engin.umich.edu/CTMS/index.php?example=MotorSpeed§ion=SystemModeling