You are on page 1of 29

MATLAB PROJECT REPORT.

MATLAB PROJECT
REPORT.
ALGORITHM & PROGRAMMING / M. NGONO

WAFFO RUDY JARDEL 4/26/23 0


MATLAB
MATLAB PROJECT REPORT.

Name: WAFFO
Pronoun: Rudy Jardel
Matricula: 22P149
Filed: 3 GM
School: National Advanced School of Engineering
Course: Algorithm and Programming
Teacher: M. NGONO

1
MATLAB PROJECT REPORT.

INTRODUCTION
It’s been given to us the project that we have to solve, the objective of the project is to
Study the performance characteristics of first and second order system using the application we
call MATLAB to solve the project which is used to solve, analyze and design processes with a
programming language that expresses matrix and array mathematics directly. We use it here to get
the performance of first and second order systems, yet the performance of a system is what makes
it optimal for end use.

2
MATLAB PROJECT REPORT.

MATLAB PROJECT REPORT


Part one: Performance of first order and second order systems
Objective: Study the performance characteristics of first and second order systems using
MATLAB.
Exercise 1:
1. RC-circuit: First order systems:

𝑑𝑉𝑐 (𝑡) 1 1
Equation of behavior: + 𝑉 (𝑡) = 𝐸 𝑤ℎ𝑒𝑟𝑒 𝑉𝑐 (0) = 𝑉0 𝑎𝑛𝑑 𝑅𝐶 = 𝜏
𝑑𝑡 𝑅𝐶 𝑐 𝑅𝐶
𝑉𝑐 (𝑡) 1
Transfer function: = 𝜏𝑠+1
𝐸(𝑠)

a. Let’s obtain the unit step response of the first order system with the given values of R &
C:
Below is the code of the two values of R and C in one program, and their step response

3
MATLAB PROJECT REPORT.

4
MATLAB PROJECT REPORT.

5
MATLAB PROJECT REPORT.

b. Let’s verify in each case that the calculated value of 𝜏 = 𝑅 ∗ 𝐶 and the one measured from the figure of 63% of the final value
are same:
when the equation line 𝑦 = 0.63 is drawn, it meeting point on the curve is projected on the 𝑥 = 20 for the first curve and 𝑥 = 7.5
for the second curve, which gives the point of intersection on the curve, the plot syntax inside the program allows us to get the
point of intersection.

6
MATLAB PROJECT REPORT.

7
MATLAB PROJECT REPORT.

C. Let’s obtain the steady state value of the system:


The steady state value of the two curves is 1 which are the two blue points shown below:

8
MATLAB PROJECT REPORT.

2. Mass spring systems: second order systems:

𝑑2 𝑥(𝑡) 𝜕𝑥(𝑡)
The differential equation: 𝑀 +𝐵 + 𝐾𝑥(𝑡) = 𝐹(𝑡)
𝑑𝑡 2 𝜕𝑡
𝑂𝑢𝑡𝑝𝑢𝑡 𝐹(𝑠) 1
The transfer function: 𝑇𝐹 = = 𝑋(𝑠) = (𝑀𝑠2 +𝐵𝑠+𝐾)
𝐼𝑛𝑝𝑢𝑡

The generalized notation for a second order system with the step input applied: 𝑌(𝑠) =
2
𝜔𝑛
2)
𝑠(𝑠2 +2𝜁𝜔𝑛 𝑠+𝜔𝑛

𝑀𝑃 −𝑓𝑣
Overshoot: 𝑃. 𝑂 = ∗ 100%
𝑓𝑣

4
Settling time: 𝑇𝑠 = 𝜁𝜔
𝑛

Exercise 2:

𝑛𝜔2
We have: 𝑌(𝑠) = 𝑠(𝑠+2𝜁𝜔
𝑛)

Let’s find the step response of the system for values of 𝜔𝑛 and 𝜁 = 0.1, 0.4, 0.7, 1.0 & 2.0.
and let’s plot all the results in the same figure window and let’s fill the following table:

9
MATLAB PROJECT REPORT.

10
MATLAB PROJECT REPORT.

11
MATLAB PROJECT REPORT.

12
MATLAB PROJECT REPORT.

𝜻 Rise time Peak Time %Overshoot Settling time Steady state


value
0.1 1.1272 3.1416 72.9156 38.3730 1
0.4 1.4652 3.4539 25.3741 8.4094 1
0.7 2.1268 4.4078 4.5986 5.9789 1
1.0 3.3579 9.7900 0 5.8339 1
2.0 8.2308 27.3269 0 14.8789 1

Part two: Effect of feedback on disturbance & control system design


Exercise 1:

13
MATLAB PROJECT REPORT.

a. Let’s get the transfer function from R(s) to Y(s): the transfer function is on the command window

14
MATLAB PROJECT REPORT.

b. Let’s get the transfer function from D(s) to Y(s): the transfer function is on the command window

15
MATLAB PROJECT REPORT.

C. Let’s generate the system response of each value of k due to unit step input -r(t):

16
MATLAB PROJECT REPORT.

17
MATLAB PROJECT REPORT.

18
MATLAB PROJECT REPORT.

d. Let’s generate the system response due to a unit step disturbance -d(t):

19
MATLAB PROJECT REPORT.

20
MATLAB PROJECT REPORT.

21
MATLAB PROJECT REPORT.

e. Table of different values od y(t):


• Due to a unit step input -r(t):
K Rise time %Overshoot Settling time Steady state
value
10 0.2045 0 0.3893 1
20 0.1698 3.8606 0.9133 1
50 0.1261 12.8912 0.7180 1
100 0.0972 22.0164 0.6659 1

• Due to a unit step input -d(t):


K Rise time %Overshoot Settling time Steady state
value
10 2.4509 0 4.4361 0.1
20 1.1364 0 2.0676 0.05
50 0.3763 0.6487 0.5905 0.02
100 0.1856 9.4773 0.5943 0.01

f. Comparison of the results of the both cases:


We notice that in case of input -r(t), the system response reaches the desired value thanks
to the steady state value after a certain time which is called response time, but in case of
input -d(t), the system response doesn’t reach the desired value due to a lag.
g. When the controller is shifted, but in case of input -d(t) system response does not reach at
the desired value. The steady state value of system response decreases while increasing in
controller gain. When controller gain is increases, it boosts up the sensor feedback which
subtracts from the input hence output is reduced.

Exercise 2: Design of a Second order feedback system based on performance

22
MATLAB PROJECT REPORT.

Let’s code the program for each value of 𝐾𝑎 = [20 30 50 60 80], below is the MATLAB code:

23
MATLAB PROJECT REPORT.

24
MATLAB PROJECT REPORT.

We got the transfer function in the command window of the program above.
Ka 20 30 50 60 80
Overshoots 0 1.1758 7.6893 10.8433 16.2929
(%)
Settling 0.5835 0.3176 0.3790 0.3404 0.4038
time (s)

𝑝𝑒𝑟𝑐𝑒𝑛𝑡 𝑜𝑣𝑒𝑟𝑠ℎ𝑜𝑜𝑡 < 8%


So, by MATLAB and the given desired value of the motor system, {
𝑠𝑒𝑡𝑡𝑙𝑖𝑛𝑔 𝑡𝑖𝑚𝑒 < 400 𝑚𝑠𝑒𝑐
The suitable value of Ka is 𝑲𝒂 = 𝟓𝟎.
Below is the code for bode diagram and its curves for each value of Ka:

25
MATLAB PROJECT REPORT.

26
MATLAB PROJECT REPORT.

About the frequency response of the system, we notice that more we increase the value of Ka,
the more the frequency increases and the gain becomes more important.
The command to return step response characteristics is:

Thanks to the “ltiview (Hs)” command surrounded in the program above, run the code, a new
figure window opens, go to “Edit” at the menu bar, then click on “Plot Configurations”, and
select “Step” in the response type frame.

27
MATLAB PROJECT REPORT.

CONCLUSION
At the end of our project, we have studied the behavior of each system that has been given to us,
programmed and plotted the different response curves for first and second order systems and get
the different value of their characteristics, we have also plotted the bode diagram for the last
project to have the gain of the system depending of each value of Ka.

28

You might also like