0% found this document useful (0 votes)
14 views

Lab-4 Controls

Khan Abdul Moiz conducted a lab experiment to model a translational mechanical system and calculate its responses. He derived equations to represent the system and solved them in MATLAB. This produced transfer functions relating the inputs and outputs. Applying different signals showed the system responses over time. Modeling mechanical systems enables predicting and optimizing behavior, but the accuracy relies on assumptions made. Thorough testing and validation of models is important for engineering applications.

Uploaded by

maryamjavaid028
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Lab-4 Controls

Khan Abdul Moiz conducted a lab experiment to model a translational mechanical system and calculate its responses. He derived equations to represent the system and solved them in MATLAB. This produced transfer functions relating the inputs and outputs. Applying different signals showed the system responses over time. Modeling mechanical systems enables predicting and optimizing behavior, but the accuracy relies on assumptions made. Thorough testing and validation of models is important for engineering applications.

Uploaded by

maryamjavaid028
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

LAB # 4

Name: Khan Abdul Moiz

Registration No. FA21-BEE-071

Course: Control System

Class: 5A

Date: 30th September 2023.

Submitted to: Dr. Ali Arshad


Modeling of Translational Mechanical System and to
Calculate Its Various Responses

Objectives
To demonstrate the key components of a translational mechanical system, model the system and
finally to obtain various responses using computation and observe it on rectilinear plant.

In Lab Task

We get these three equations from fig 5.6

(M1s2 + k1)X1(s) - k1X2(s) = F(s)


(M2s2 + k1 + k2)X2(s) – k1X1(s) - k2X3(s) = 0
(M3s2 + k2 + k3 + cs)X3(s) - k2X2(s)=0
By solving these equations on matlab we get to these results:

Code:
syms f s
m1=1;
m2=1;
m3=1;
k1=6;
k2=4;
k3=3;
c=2;
a=[m1*s^2+k1,-k1,0;
-k1,m2*s^2+k1+k2,-k2;
0,-k2,m3*s^2+k2+k3+c*s;]
b=[f;0;0]
x=inv(a)*b

Output:

Figure 1: Command Window

X1(s)/F(s) = (s4 + 2s3 + 17s2 + 20s + 54)/(s6 + 2s5 + 23s4 + 32s3 + 120s2 + 48s + 72)
X2(s)/F(s) = (6s2 + 12s + 42))/(s6 + 2s5 + 23s4 + 32s3 + 120s2 + 48s + 72)
X3(s)/F(s) = (24)/(s6 + 2s5 + 23s4 + 32s3 + 120s2 + 48s + 72)

Now we apply different signals to these functions.


Code:
clear all;
close all;
B=[1 2 17 20 54];
A=[1 2 23 32 120 48 72];
T1=tf(B,A)
subplot(3,2,1);
step(T1)
grid on;
subplot(3,2,2);
impulse(T1)
grid on;
t=0:0.01:10;
u=t;
y=lsim(T1,u,t);
subplot(3,2,3);
plot(t,y);
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Ramp'
grid on;
f=2;
w=2.*pi.*f;
x=sin(w.*t);
z=lsim(T1,x,t);
subplot(3,2,4);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Sinusoid'
n=t.^2;
z=lsim(T1,n,t);
subplot(3,2,5);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Parabola'
Output:

Figure 2: Output of first transfer function

Code:
clear all;
close all;
B=[6 12 42 ];
A=[1 2 23 32 120 48 72];
T2=tf(B,A)
subplot(3,2,1);
step(T2)
grid on;
subplot(3,2,2);
impulse(T2)
grid on;
t=0:0.01:10;
u=t;
y=lsim(T2,u,t);
subplot(3,2,3);
plot(t,y);
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Ramp'
grid on;
f=2;
w=2.*pi.*f;
x=sin(w.*t);
z=lsim(T2,x,t);
subplot(3,2,4);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Sinusoid'
n=t.^2;
z=lsim(T2,n,t);
subplot(3,2,5);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Parabola'

Output:

Figure 3: Output of second transfer function

Code:
clear all;
close all;
B=[24];
A=[1 2 23 32 120 48 72];
T3=tf(B,A)
subplot(3,2,1);
step(T3)
grid on;
subplot(3,2,2);
impulse(T3)
grid on;
t=0:0.01:10;
u=t;
y=lsim(T3,u,t);
subplot(3,2,3);
plot(t,y);
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Ramp'
grid on;
f=2;
w=2.*pi.*f;
x=sin(w.*t);
z=lsim(T3,x,t);
subplot(3,2,4);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Sinusoid'
n=t.^2;
z=lsim(T3,n,t);
subplot(3,2,5);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Parabola'

Output:

Figure 4: Output of third transfer function


Post Lab

Equations of the system are:

(M1 s2 + c1 s + k1 + k2) X1(s) – (k2 + c1 s) X2(s) = F(s)


(M2 s2 + k2 + c1 s + k3 + c2 s) X2(s) – (k2 + c1 s) X1(s) – (k3 + c2 s) X3(s) = 0
(M3 s2 + k3 + c2 + k4 + c3) X3(s) – (k3 cs s) X2(s) = 0

We will solve these equations using matlab.

Code:
clc;
syms f s
m1=1;
m2=1;
m3=1;
k1=200;
k2=400;
k3=300;
k4=0;
c1=0;
c2=0;
c3=0.5;

a=[m1*s^2+k1+k2+c1*s, -(k2+c1*s), 0;
-(k2+c1*s), m2*s^2+k2+c1*s+k3+c2*s, -(k3+c2*s);
0, -(k3+c2*s), m3*s^2+k3+c2*s+k4+c3*s;]
b=[f;0;0]
x=inv(a)*b

Output:

Figure 5: Command Window

X1(s) / F(s) = (2s4 + s3 + 2000s2 + 700s + 240000) / (2s6 + s5 + 3200s4 + 1300s3 +


1120000s2 + 260000s + 48000000)
X2(s) / F(s) = (800s2 + 400s + 240000) / (2s6 + s5 + 3200s4 + 1300s3 + 1120000s2 +
260000s + 48000000)
X3(s) / F(s) = (240000) / (2s + s5 + 3200s4 + 1300s3 + 1120000s2 + 260000s +
6

48000000)
Code:
clear all;
close all;
B=[2 1 2000 700 240000];
A=[2 1 3200 1300 1120000 260000 48000000];
T1=tf(B,A)
subplot(3,2,1);
step(T1)
xlim([0 50]);
grid on;
subplot(3,2,2);
impulse(T1)
xlim([0 50]);
grid on;
t=0:0.01:10;
u=t;
y=lsim(T1,u,t);
subplot(3,2,3);
plot(t,y);
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Ramp'
grid on;
f=2;
w=2.*pi.*f;
x=sin(w.*t);
z=lsim(T1,x,t);
subplot(3,2,4);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Sinusoid'
n=t.^2;
z=lsim(T1,n,t);
subplot(3,2,5);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Parabola'
Output:

Figure 6: Output of first Transfer Function

Code:
clear all;
close all;
B=[800 400 240000];
A=[2 1 3200 1300 1120000 260000 48000000];
T2=tf(B,A)
subplot(3,2,1);
step(T2)
xlim([0 50]);
grid on;
subplot(3,2,2);
impulse(T2)
xlim([0 100]);
grid on;
t=0:0.01:10;
u=t;
y=lsim(T2,u,t);
subplot(3,2,3);
plot(t,y);
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Ramp'
grid on;
f=2;
w=2.*pi.*f;
x=sin(w.*t);
z=lsim(T2,x,t);
subplot(3,2,4);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Sinusoid'
n=t.^2;
z=lsim(T2,n,t);
subplot(3,2,5);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Parabola'

Output:

Figure 7: Output of second Transfer Function


Code:
clear all;
close all;
B=[240000];
A=[2 1 3200 1300 1120000 260000 48000000];
T3=tf(B,A)
subplot(3,2,1);
step(T3)
xlim([0 50]);
grid on;
subplot(3,2,2);
impulse(T3)
xlim([0 50]);
grid on;
t=0:0.01:10;
u=t;
y=lsim(T3,u,t);
subplot(3,2,3);
plot(t,y);
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Ramp'
grid on;
f=2;
w=2.*pi.*f;
x=sin(w.*t);
z=lsim(T3,x,t);
subplot(3,2,4);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Sinusoid'
n=t.^2;
z=lsim(T3,n,t);
subplot(3,2,5);
plot(t,z);
grid on;
xlabel 'Time (seconds)'
ylabel 'Amplitude'
title 'Parabola'
Output:

Figure 8: Output of third Transfer Function

Conclusion
Modeling translational mechanical systems is a fundamental aspect of mechanical
engineering and control theory, enabling engineers to predict and optimize the
behavior of various mechanical components and systems. By representing these
systems using mathematical equations, engineers can simulate and analyze their
responses to different inputs and disturbances. This modeling approach is crucial in
designing efficient and reliable machines and mechanisms. However, the accuracy
of the model relies heavily on the assumptions and simplifications made during the
modeling process, which may not always capture the complexities of real-world
systems. Therefore, a critical analysis is essential to ensure that the model's
predictions align with experimental data and that it can effectively guide the design
and control of mechanical systems. Additionally, factors like friction, nonlinearities,
and material properties can significantly affect the accuracy of the model,
highlighting the importance of thorough testing and validation when applying these
models in practical engineering applications.

You might also like