Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Faculty of Engineering Technology

Electrical Engineering Department

ELE 4623: Control Systems


LABORATORY WORK

LAB #1
Basic MATLAB Computational Tasks for
Control Systems

BY
Name ID

Abdulla Sulaiman H00350247

Submission Date:
Instructor Name:

LAB. General Description


Objective: The purpose of this experiment is to perform basic control systems task such as
residues; roots; system response analysis using MATLAB

Method:
1. Installing and prepare MATLAB environment for computational tasks
2. Using MATLAB command window as a computational platform for several control systems
task
3. Develop MATLAB scripts to solve differential equations; plot system response obtain from
Laplace transform solution, present results
4. Prepare report
Lab resources:
1. Computer systems /Laptops
2. MATLAB software
Expected Outcome:
1. Computational results with MATLAB commands in Table format
2. Sample of MATLAB mfile
3. Plot of the system response
4. Report submission

GENERAL INFORMATION AND GUIDE


 This Lab. manual should be used together with the class notes/lecture by
each student.
 Each student should work independently as much as possible. Direct
copy of work will be highly penalized. (-100%).
 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 submit both the print out copy and
softcopy through the BBlearn.
Diagram/Picture should be neatly and clearly prepared in the report. For
the text font, use 12 points, Time New Roman and double spacing.
 Each student should demonstrate the experiment / MATLAB session to
the instructor for Lab. grading.
 Report submission due date will be announced during the class.
 Assessment Approach per each experiment:
Report: 60% (Content, Neatness, Quality of report)
Demonstration: 40% (in the Lab. And video clip)
NOTES: Show your MATLAB session to the instructor for grading.

PART A: General Computational Task


Use MATLAB to perform the following tasks and present the results (code and results):

Task Code and Results (Neat and properly formatted)

o
a. If θ=30 , determine using Code:
MATLAB the following: %Part A
x=2 e θ %a
Theta_D = 30
Theta_R = Theta_D*(pi/180)
x = 2*exp(Theta_R)
y = cos(1.5*Theta_R)
z = exp(2*Theta_R)*cos(1.5*Theta_R + 0.5)

y=cos ⁡( 1.5 θ) Results:

z=e2 θ cos ⁡(1.5 θ+ 0.5)

b. Poles of the characteristic Code:


equations: %b
roots([1 5 1 1])
3 2
s +5 s +s +1=0
Results:

y=2+3 e−2 t ,∧t=0 :0.1 :3

c. ( n , x ) wherePoles of the Code:


characteristic equations: %c
roots([1 1 20 30 5])
4 3 2
s + s + 20 s +30 s +5 = 0
plot ( t , y ) where Results:
d. Expand the following rational We need to simplify the equation first, therefore we get
transfer function using residue the following equation:
function in MATLAB. s+2 A B C
s+2 X ( s )= = + +
X ( s )= s( s+3)(s+ 4) s s+3 s+ 4
S ( s +7 s +12 )
2

Code:
%d
[roots, poles] = residue([1 2],[1 7 12 0])

Results:
PART B: System Analysis Application
Figure 1(a) below shows basic capacitive-discharge defibrillator circuit comprises charging and
discharging sub-circuit, while figure 1(b) shows the discharging circuit after the capacitor is
charged to the voltage, V c .

Figure 1(a) Figure 1(b)

Vc
For a given charged capacitor voltage, ,the transfer function of the output current, I is given as:
s
Vc
I ( s) =
1
L s 2 +s R L +
C

If the capacitor is charged to 20V, C=20 μF , L=0.2 H∧R L =1 K Ω, the current output in time
domain is given by:
i (t )=( 0.02 e−51 t −0.02 e−4950t ) u( t )

a. Write a MATLAB script to plot the current output using MATLAB for 0 ≤ t ≤ 0.5 second at
step of 0.001s.

Copy of your MATLAB script (paste copy of MATLAB codes, neat and well formatted)

Code:
%Part B
t = 0:0.001:0.5;
i = (0.02*exp(-51*t)-0.02*exp(-4950*t));
plot (t,i,'r')
xlabel('Time t sec')
ylabel('Current i A')
title ('Current o/p plot')
b. Present the current output plot (Neat and well label graph)

Results(Plot):

Note: Show the result to the instructor.

c. From the plot, determine the following:

Question Answer

1 The peak current 0.01886 A

2 Time taking to reach 10% of the peak 0.01886(10/100) = 1.886 mA


current
3 Value of current at the end of the 0.1 0.0001219
second.
Post LAB Activity

Investigate the effect of capacitor values on the capacitive-discharge defibrillator circuit


(a) If the capacitor value in the above defibrillator circuit is increased to 40 μF ,
(i) Determine the current output in time domain, i(t):
Code:
i (t )=( 0.02 e ) u (t)
−25.1 t −4975t
%Post lab −0.02 e
%Part a_i
[roots, poles] = residue([20],[0.2 1000 25000])

Results:

(ii) Plot the current output using MATLAB for 0 ≤ t ≤ 0.5 second at step of 0.001s.
Code:
%Part a_ii
t = 0:0.001:0.5;
i = (0.02*exp(-25.1*t)-0.02*exp(-4975*t));
plot (t,i,'r')
xlabel('Time t sec')
ylabel('Current I A')
title ('Current o/p plot')

Results:
(iii) Determine the following response parameters from the plot.
Question Answer

1 The peak current 0.01937 A

2 Time taking to reach 10% of the peak 0.01937(10/100) = 1.937 mA


current

3 Value of current at the end of the 0.1 0.001625 A


second.

(b) If the capacitor value in the above defibrillator circuit is decreased to 10 μF ,


(i) Determine the current output in time domain, i(t):

Code: i (t )=( 0.02 e−102.1 t −0.02 e−4898t ) u( t )


%Part b_i
[roots, poles] = residue([20],[0.2 1000 100000])

Results:

(ii) Plot the current output using MATLAB for 0 ≤ t ≤ 0.5 second at step of 0.001s.
Code:
%Part b_ii
t = 0:0.001:0.5;
i = (0.02*exp(-102.1*t)-0.02*exp(-4898*t));
plot (t,i,'r')
xlabel('Time t sec')
ylabel('Current I A')
title ('Current o/p plot')

Results:

(iii) Determine the following response parameters from the plot.

Question Answer

1 The peak current 0.01791 A

2 Time taking to reach 10% of the peak 0.01791(10/100) = 1.791 mA


current

3 Value of current at the end of the 0.1 7.36e-07 A = 0.000000736 A


second.
(c) Compare the current value at the end of 0.1 second for the three values of capacitor and
describe your observation regarding the effect of the capacitor value on the system response.

Comparative Table:
Case Capacitor value Value of current at the end of the 0.1 second (mA)
s
1 10 μF 7.36e-07 A = 0.000000736 A

2 20 μF 0.0001282 A

3 40 μF 0.001625 A

Observation: Effect of Capacitor value on system response (minimum 50 words)

When we look at the influence of the capacitor value on the


system response, we can see that as the capacitor value increases,
so does the current. And this finding confirmed the direct
relationship between the capacitor value and the current, i.e., if
we raise the capacitance, we also increase the current.

You might also like