Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
11 views

Lab Report-4

This document describes a lab experiment on modeling a translational mechanical system and calculating its various responses. The lab tasks involve deriving the system's transfer functions, simulating its step, impulse, ramp, sinusoidal and parabolic responses using MATLAB, and analyzing the results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Lab Report-4

This document describes a lab experiment on modeling a translational mechanical system and calculating its various responses. The lab tasks involve deriving the system's transfer functions, simulating its step, impulse, ramp, sinusoidal and parabolic responses using MATLAB, and analyzing the results.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

EEE-325 Control Systems

LAB # 04: Modeling of Translational Mechanical System and to


Calculate Its Various Responses

Danish Zulfiqar
Names Farrukh Mukhtar

FA21-BEE-42
Registration Numbers FA21-BEE-048

Class BEE-5B

Instructor’s Name Sir Rizwan Azam

Lab Assessment
Post Lab Total
Pre-Lab In-Lab Data
Data Analysis Writing Style
Presentation
Introduction
In the realm of translational mechanical systems, the core components are mass, spring, and
damper. These systems are characterized by their degrees of freedom, with each representing an
independent motion point. Equations of motion are essential for understanding system behavior,
and they can be derived either through Newton's laws or observation-based methods. Cramer's
rule is often used to solve these equations, allowing us to compute crucial transfer functions.
When it comes to control and stability, PID (Proportional Integral Derivative) controllers are the
go-to choose in industrial applications. They excel at regulating various process variables,
ensuring precision and stability in system operations.

In-Lab Task
Task 01: Make mathematical model of the system using laws of Physics (Single Mass-Spring-
Damper system has been modelled as an example). Calculate the transfer functions X1(s)/F(s) and
X2(s)/F(s) Calculate impulse, step, ramp, parabolic and sinusoidal responses by taking relevant
values of F(s). Plot the time domain results obtained.

:
Code:
Transfer function from 1nd equation of motion (X1(s)/F(s)):

clc
clear
close all

system_tf = tf([1 1 2], [1 1 3 1 1]);


time_span = 0:0.001:10;

[step_response, time] = step(system_tf);


plot(time, step_response, 'linewidth', 2), grid on;
title('Step Response');
xlabel('Time');
ylabel('Amplitude');

figure();

[impulse_response, time] = impulse(system_tf);


plot(time, impulse_response, 'linewidth', 2), grid on;
title('Impulse Response');
xlabel('Time');
ylabel('Amplitude');

figure();

ramp_input = time;
[response_ramp, time] = lsim(system_tf, ramp_input, time);
plot(time, response_ramp, 'linewidth', 2), grid on;
hold on;
plot(time, ramp_input, 'linewidth', 2), grid on;
legend('output', 'input');
title('Ramp Response');
xlabel('Time');
ylabel('Amplitude');

figure();

sinusoidal_input = sin(time);
[response_sinusoidal, time] = lsim(system_tf, sinusoidal_input,
time);
plot(time, response_sinusoidal, 'linewidth', 2), grid on;
hold on;
plot(time, sinusoidal_input, 'linewidth', 2), grid on;
legend('output', 'input');
title('Sinusoidal Response');
xlabel('Time');
ylabel('Amplitude');

figure();

parabolic_input = time.^2/2;
[response_parabolic, time] = lsim(system_tf, parabolic_input,
time);
plot(time, response_parabolic, 'linewidth', 2), grid on;
hold on;
plot(time, parabolic_input, 'linewidth', 2), grid on;
legend('output', 'input');
title('Parabolic Response');
xlabel('Time');
ylabel('Amplitude');

Figure 1: Step response of transfer function X1(s)/F(s)


Figure 2: Impulse response of transfer function X1(s)/F(s)

Figure 3: Ramp response of transfer function X1(s)/F(s)

Figure 4: Sinusoidal response of transfer function X1(s)/F(s)

Figure 5: Parabolic response of transfer function X1(s)/F(s)


Transfer function from 2nd equation of motion (X2(s)/F(s)):
clc
clear
close all

G = tf([1], [1 1 3 1 1]);
t_span = 0:0.001:10;

[y1, t] = step(G);
plot(t, y1, 'linewidth', 2), grid on;
title('Step Response');
xlabel('Time');
ylabel('Amplitude');

figure();

[y2, t] = impulse(G);
plot(t, y2, 'linewidth', 2), grid on;
title('Impulse Response');
xlabel('Time');
ylabel('Amplitude');

figure();

u_ramp = t;
[y3, t] = lsim(G, u_ramp, t);
plot(t, y3, 'linewidth', 2), grid on;
hold on;
plot(t, t, 'linewidth', 2), grid on;
legend('output', 'input');
title('Ramp Response');
xlabel('Time');
ylabel('Amplitude');

figure();

u_sinusoidal = sin(t);
[y4, t] = lsim(G, u_sinusoidal, t);
plot(t, y4, 'linewidth', 2), grid on;
hold on;
plot(t, u_sinusoidal, 'linewidth', 2), grid on;
legend('output', 'input');
title('Sinusoidal Response');
xlabel('Time');
ylabel('Amplitude');

figure();

u_parabolic = t.^2/2;
[y5, t] = lsim(G, u_parabolic, t);
plot(t, y5, 'linewidth', 2), grid on;
hold on;
plot(t, u_parabolic, 'linewidth', 2), grid on;
legend('output', 'input');
title('Parabolic Response');
xlabel('Time');
ylabel('Amplitude');

Figure 6: Step response of transfer function X2(s)/F(s)


Figure 7: Impulse response of transfer function X2(s)/F(s)

Figure 8: Ramp response of transfer function X2(s)/F(s)

Figure 9: Sinusoidal response of transfer function X2(s)/F(s)

Figure 10: Parabolic response of transfer function X2(s)/F(s)


Discussion:
We analyzed a mechanical system, resulting in two equations of motion. We expressed these equations
as transfer functions and utilized MATLAB to visualize the system's behavior under different inputs.
The step and impulse responses were easily plotted using MATLAB's 'step' and 'impulse' functions.
For more complex inputs like ramps, sinusoids, and parabolas, we employed the 'lsim' command to
generate response plots, allowing us to comprehensively examine the system's dynamic behavior
across various input scenarios..

Post Lab Tasks

Task 01

(𝑀1𝑠2 + 𝑘1)𝑥1(𝑠) − 𝑘1𝑥2(𝑠) = 𝐹(𝑠)


𝑀1𝑠2𝑥1(𝑠) + 𝑘1𝑥1(𝑠) − 𝑘1𝑥2(𝑠) = 𝐹(𝑠) − − − 1
−𝑀2𝑠2𝑥2(𝑠) + 𝑘1𝑥1(𝑠) − 𝑘1𝑥1(𝑠) − 𝑘2𝑥2(𝑠) + 𝑘2𝑥3(𝑠) = 0
𝑘1𝑥1(𝑠)−(𝑀2𝑠2 + 𝑘1 + 𝑘2)𝑥2(𝑠) + 𝑘3𝑥3(𝑠) = 0
−𝑘1𝑥1(𝑠)+(𝑀2𝑠2 + 𝑘1 + 𝑘2)𝑥2(𝑠) − 𝑘3𝑥3(𝑠) = 0
f(s) -1 0
|0 s2 + 2 -1 |
𝑥1(𝑠) = 0 -1 s2 + s + 2
∆ f(s)[s4 + s3 + 2s2 + 2s
+ 3]

X1(𝑠) s4
=
F(s) s6 + s5 + 5s4 + 3s3 + 6s2 + s + 1
𝑥1(𝑠) =

Similarly
X2(𝑠) s2+s+2
=
F(s) s6+s5+5s4+3s3+6s2+s+1
X3(𝑠) 1
=
F(s) s6+s5+5s4+3s3+6s2+s+1

II. Find Step response; Code:


Code:
clc
clear
all
close
all
sys=tf([1 1 2 2 3],[1 1 5 3 6 1
1]); step(sys); legend('Step
Response');
Output:

Figure 4 Step Response of X1/F(s)


Code:
clc
clear
all
close
all
sys=tf([1 1 2],[1 1 5 3 6 1
1]); step(sys); legend('Step
Response');
Output:

Figure 5 Step Response of X2/F(s)

Code:
clc
clear
all
close
all
sys=tf([1],[1 1 5 3 6 1
1]); step(sys);
legend('Step Response');

Output:
Figure

Critical Analysis / Conclusion:


In this lab, our focus was on modeling translational mechanical systems and utilizing MATLAB
to explore their dynamic responses. We experimented with various input signals, including step,
impulse, ramp, sinusoidal, and parabolic, to observe how the systems reacted. The core modeling
elements of mass, spring, and damper played a central role in our analysis.

Our modeling approach adhered to Newton's law, ensuring equilibrium between external and
resistive forces. We delved into the purpose and characteristics of different input signals
commonly used in control systems:

- Impulse Input: Ideal for studying transient responses.


- Step and Sinusoid Input: Useful for analyzing both transient responses and steady-state errors.
- Ramp and Parabola Input: Effective in studying steady-state errors.

To capture the essence of these mechanical systems, we constructed free body diagrams and
derived transfer functions. In the case of two-degree-of-freedom systems, we formulated and
simultaneously solved two equations of motion. Subsequently, we employed MATLAB to
visualize and analyze the diverse system responses.

Additionally, we delved into the PID controller, comprehending its significance and components:

1. Proportional Controller: Amplifies the overall response or gain.


2. Integral Controller: Eradicates steady-state errors.
3. Derivative Controller: Mitigates oscillations by enhancing damping.

You might also like