ELE 4623: Control Systems: Faculty of Engineering Technology
ELE 4623: Control Systems: Faculty of Engineering Technology
LAB #06
Bode Plot and Gain Compensator Design
BY
Name: ID
Abdulla Sulaiman H00350247
Submission Date:
Instructor Name: Velmurugan
GENERAL INFORMATION AND GUIDE
• This Lab manual should be used together with the class notes/lecture.
• Each student / group should work independently; direct copy of work will be highly
penalized according to the HCT policy.
• For group work, contribution of each member of the team should
• You are advised to follow the guide provided here for smooth and timely completion
of the experiments.
• The following should be noted regarding the report format:
Prepare the report in softcopy, and upload in the appropriate BBL section.
Diagram/Picture should be neatly and clearly prepared in the report.
For the text font, use 12 points, Time New Roman and double spacing.
• Lab. demonstration of the experiment will be assessed during the Lab. session. See
rubric for the assessment in the BBL.
• Report submission due date : check the announcement on the course BBL
Assessment Approach per each experiment:
Report: 60% (see report rubric) Demonstration: 40% (see
practical/simulation rubric)
Method:
1. Create a MATLAB script to create and plot Bode diagram of an LTI system.
2. Perform stability analysis of the system in frequency domain using the Bode plot technique
3. Design a gain compensator for a given performance specification.
4. Evaluate and compare the system’s step response performance for both uncompensated and
compensated system.
5. Prepare report
Lab resources:
1. Computer systems /Laptops
2. MATLAB software
Expected Outcome:
1. Sample of MATLAB mfile and SIMULINK block
2. Results of system responses
3. Report submission
1.1 Background
Frequency response analysis involves the study of a system’s response to various input frequencies.
This study provides insight on the system gain and stability. For a given Linear Time Invariant
(LTI) system shown in Figure 1, let the input signal be a sinusoidal signal:
𝑥(𝑡) = 𝐴𝑖𝑛𝑠𝑖𝑛(𝜔𝑖𝑡 + 𝜑𝑖𝑛) (1) the output will be a sinusoidal signal:
𝑦(𝑡) = 𝐴𝑜𝑢𝑡𝑠𝑖𝑛(𝜔𝑖𝑡 + 𝜑𝑜𝑢𝑡) (2)
where 𝑨𝒊𝒏 and 𝝋𝒊𝒏 , are respectively the input signal amplitude and phase at frequency, 𝝎𝒊 , and
𝑨𝒐𝒖𝒕 and 𝝋𝒐𝒖𝒕 , are respectively the output signal amplitude and phase at same frequency, 𝝎𝒊 .
Quantitatively, the system PM and GM values are indication of how much stability a system has.
This is a valid metric in comparing stability of systems, and specify desired stability for a given
application.
Here are the key points to note:
• The higher the margins (PM & GM), the better a system stability.
• More stability implies less oscillation / overshoot. This is due to direct relationship between
damping factor and PM.
• More stability may leads to less speed or slow transient response. This is a typical challenge
in control system design, and a drive for advanced compensator where necessary.
LAB Exercises
System Description:
The block diagram in Figure 2 below model a simple DC motor robot arm gripper position control.
Input , 𝜃𝑖𝑛(𝑠), is the desired robot arm position, and the output , 𝜃𝑜𝑢𝑡(𝑠), is the actual robot arm
position. Position sensor, H, measure the actual position for the feedback system.
Figure 2: Block Diagram of a DC Motor robot arm gripper position control system.
PARTA
Uncompensated Bode Plot Analysis
A.1. Derive the open loop transfer function (“GH” see equation (6)) of the above system
Step should be clearly shown for full mark.
A.2. Perform Bode plot analysis of the system (uncompensated, K=A = 1) using MATLAB.
syms A=1 s;
Rf=10
Km=550 J=1 b=1 H=1
num=A*Km*H;
den=sym2poly(s*Rf*(J*s+b));
sysOL= tf(num,den);
bode(sysOL)
[Gm,Pm,Wcg,Wcp]=margin(sysOL)
grid on title('Bode plot')
A.2.2. Show the Bode plot with indication of its PM & GM: [format, label, correctness and
neatness]
A.2.3. Provide stability analysis of the system stating PM and GM (minimum 50 words)
From the bode plot of compensated system It may be observed that the PM of the system
is 7.71 and GM is Infinity. With the Gain-compensator we can achieve the desired
performance. Also, the system is stable as Gain Phase crossover is negative for frequency.
A.3 Evaluate the closed-loop unit step response of the uncompensated system.
syms s;
A=1
Rf=10
Km=550 J=1
b=1 H=1
num=A*Km*H;
den=sym2poly(s*Rf*(J*s+b)); sysOL=
tf(num,den);
sysCL=feedback(sysOL,1)
step(sysCL)
title('STEP RESPONSE')
A.3.2 Show the system Step response plot: [format, label, correctness and neatness]
A.4 Determine the Uncompensated Step Response Performance parameters
As we can see from the step response, we can see that it is second order we find the phase
margin and the gain margin by using the code margin to the total gain and we got the phase
margin equal to 7.71 while the gain margin is infinite. The steady state is zero in this case.
PARTB
Gain Compensated Design Using Bode Plot Technique
Design Problem Statement (Design specifications):
Design and evaluate a gain compensator using the Bode plot technique to achieve the following
control objectives:
• Phase Margin greater than or equal to 45o (PM ≥45o) and at least 6dB gain margin
(GM ≥ 6dB)
• Overshoot less than or equal to 20%
• Rise time less than or equal to 15 seconds
Design Steps
By trying different k and write the series code we find the k that will give as the right data
for the overshoot and the phase margin and the gain margin.
Show the uncompensated Bode plot with designed gain indicated [format, label, correctness
and neatness]
State the compensated Open loop transfer function with the gain-compensator (new transfer
function with the designed gain)
syms s; A=1
Rf=10
Km=550 J=1
b=1 H=1
num=A*Km*H
;
den=sym2poly(s*Rf*(J*s+b));
sysOL_uncomp= tf(num,den);
freq=0.8;
[mag,phase,wout]= bode(sysOL_uncomp, freq);
mag_dB=20*log10(mag);
K=10^(-mag_dB/20)
sysOL_compensated= K*sysOL_uncomp
figure
bode(sysOL_compensated)
grid on
title(['bode plot of compensated system'])
Show the compensated Bode plot with indication of its PM & GM [format, label, correctness
and neatness]
Observation/comment: : From the bode plot of compensated system It may be observed that the
PM of the system is now increased to 51.3° and GM is Infinity.
B.2 Evaluate the closed-loop unit step response of the compensated system (system with gain
compensator).
Present the MATLAB Codes (Note: Show your codes to the instructor.)
Rf=10Km=550
J=1 b=1 H=1 num=A*Km*H;
den=sym2poly(s*Rf*(J*s+b));
sysOL_uncomp= tf(num,den);
freq=0.8;
[mag,phase,wout]= bode(sysOL_uncomp, freq);
mag_dB=20*log10(mag); K=10^(-mag_dB/20)
sysOL_compensated= K*sysOL_uncomp
sysCL_compensated= feedback(sysOL_compensated,1) figure
step(sysCL_compensated);
stepinfo(sysCL_compensated);
title('step response')
Show the system Step response plot: [format, label, correctness and neatness]
Determine the compensated Step Response Performance parameters from the plot above
As we can see the data that has been given are achieved, we got the phase margin more
than 45 degree which is 51.3 and we got the gain margin more than 6db which is infinite and
the overshoot which is 16.8.
PARTC
Comparative Analysis
Compare and present comparative analysis of uncompensated and compensated systems in PartA
and PartB
C.2. Comparative step response plots: provide step response plots of both compensated and
uncompensated systems on one graph
C.3. Comparative analysis: provide comparative report of both systems (minimum 50 words)
As we can see there is a large difference between the compensated and the
uncompensated the phase margin different is almost 70 degrees. Furthermore, the settling
time almost the same for both and the steady state error is zero for the uncompensated
while it is 0 for the compensated. From the figure we can noticed that the vibration on the
uncompensated part is large while on the uncompensated there are almost no vibration.
To conclude we can change the phase margin, overshoot and the rise time by
adding a gain k in series to the system as we did on this lab. The gain that we added was
a specific value that will give us specific data.