0% found this document useful (0 votes)
55 views24 pages

Lab Manual Template Solved

Uploaded by

fezkhansteam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views24 pages

Lab Manual Template Solved

Uploaded by

fezkhansteam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

LABORATORY MANUAL

Mechanical Engineering Department

Mechanical Instrumentation & Control

Submitted by

STUDENT NAME | CMS ID

Instructor

Dr. Babar Ali


Lecturer, Department of Electronic Engineering,
Faculty of Information & Communication Technology,
BUITEMS, Quetta.

Session Fall –2024


LAB MANUAL Mechanical Instrumentation & Control

CERTIFICATE

This is certified that Mr./Miss. _________________ bearing CMS ID #

_______________ has successfully completed the laboratory manual of

Semiconductor Devices in his/her ____ semester of BS

(______________________________), Batch Fall-_____ under the supervision of

his/her lab instructor _________________________.

_________________ __________________

Lab Manual Marks Instructor Signature


LAB MANUAL Mechanical Instrumentation & Control

TABLE OF CONTENTS
TABLE OF CONTENTS 1
CLOs PLOs Mapping and List of Experiments 2
Lab Title 1
LAB MANUAL Mechanical Instrumentation & Control

CLOs PLOs Mapping

S# CLO, Course Learning Outcome Domain Level PLO


Develop mathematical models of various physical
1. Cognitive 6 3
systems in t-domain and s-domain
Analyse various engineering problems using
2. mathematical models and control techniques to Cognitive 4 2
examine system properties
Apply the mathematical modelling and control
3. techniques to design and develop a controller to Cognitive 3 3
achieve desired output
Understand the construction, working and
4. applications of various sensors, and measuring Cognitive 2 1
devices.
Use data acquisition method/devices to collect Psychomoto
5. 3 5
sensor data r
LAB MANUAL Mechanical Instrumentation & Control

LAB NO. 1 DD//YYYY

An Introduction to MATLAB

Lab Outcomes:
To become familiar with the basics of Matlab.

Corresponding CLO and PLO:


CLO-1

Theory:
What is MATLAB
The name MATLAB is short for MATrix LABoratory. It is a commercial software
package whose main function is to perform calculations on matrices, row vectors and
column vectors. It is widely used in both industry and academic institutions. It possesses
many of the features of a high level, numerically oriented programming language, but in
addition has a large collection of built-in functions for performing matrix and vector
operations in a way that is very simple for the user. For example, to find the determinant
of a matrix A one need only enter:
det(A)
MATLAB commands can be entered one line at a time, or the user can write programs of
MATLAB code and define his or her own functions. In this session, we shall only use the
one-line-at-a-time “interpretive” mode for simplicity, but the regular user will find that
the power of the package is considerably extended by writing his or her own programs
and functions.
Entering and quitting MATLAB
To enter MATLAB, simply double click on the MATLAB icon. To leave MATLAB and
return to the PC’s operating system
Simply type: quit
Creating and manipulating matrices and vectors

1
LAB MANUAL Mechanical Instrumentation & Control

MATLAB works on matrices and vectors that may be real or complex. Variables do not
have to be “declared”. Results can be displayed in a variety of different formats.
Let us enter a row vector into the MATLAB workspace. Type in:
v = [2 4 7 5]
This creates a variable v whose current value is a row vector with four elements as
shown. After pressing “return” the value of v will have been echoed back to you. To
suppress the echo, one uses a semi-colon following the command line. Thus
w = [1 3 8 9];
Creates another row vector w, but does not echo. To check that w has appeared in the
MATLAB workspace, type,
who
Which will display all the variables in the MATLAB workspace, and to check the value
of w simply type w
Operations on row vectors can be best illustrated by some simple exercises.

Equipment:
1) PC
2) MATLAB Version 7 or above

Procedure:
Exercise#1: Investigate the effect of the following commands:
(a) v(2) (b) sum = v + w (c) diff = v – w (d) vw = [v w]
(e) vw(2:6) (f) v’

One way to generate a column vector is to take the transpose of a row vector, as you will
have found in exercise 1(f). Column vectors can be typed in directly in one of two ways.
For example, to enter the command vector

[]
1
z= 1
0
0
you can type
z = [1; 1; 0; 0]; or
z = [1
1
0

2
LAB MANUAL Mechanical Instrumentation & Control

0];

Exercise#2: Investigate the effect of the following commands

(i) z’ (b) z*v (c) [v; w] (d) v*z (e) [z; v’] (f) z + v’
One way of creating matrices is by multiplying row and column vectors as seen in the
above exercises. There are various ways of entering matrices. For example, to enter the
matrix

M=
[ ]
1 2
3 4
the most obvious ways are to type
M = [1 2; 3 4]; or
M = [1 2
3 4];
but there are more perverse ways such as
M = [[1 3]’[2 4]’];

Exercise#3:Investigate the effect of the following commands:

(a) N = inv(M) (b) M*N (c) I = eye(2) (d) M + I (e) M*z(1:2) (f) v(3:4)*M
(g) M(1,1) (h) M(1:2,1:2) (i) M(:,1) (j) M(2,:)

Observations:
Exercise # 1:
>> v = [2 4 7 5]

v=

2 4 7 5

>> w = [1 3 8 9];
>> v(2)

ans =

>> sum = v + w

sum =

3
LAB MANUAL Mechanical Instrumentation & Control

3 7 15 14

>> diff = v - w

diff =

1 1 -1 -4

>> vw = [v w]

vw =

2 4 7 5 1 3 8 9

>> vw(2:6)

ans =

4 7 5 1 3

>> v'

ans =

2
4
7
5

Exercise # 2:
>> z = [1; 1; 0; 0];
>> z'

ans =

1 1 0 0

>> z*v

ans =

4
LAB MANUAL Mechanical Instrumentation & Control

2 4 7 5
2 4 7 5
0 0 0 0
0 0 0 0

>> [v; w]

ans =

2 4 7 5
1 3 8 9

>> v*z

ans =

>> [z; v']

ans =

1
1
0
0
2
4
7
5

>> z + v'

ans =

3
5
7
5

Exercise # 3:
>> M = [1 2; 3 4];

5
LAB MANUAL Mechanical Instrumentation & Control

>> N = inv(M)

N=

-2.0000 1.0000
1.5000 -0.5000

>> M*N

ans =

1.0000 0
0.0000 1.0000

>> I = eye(2)

I=

1 0
0 1

>> M + I

ans =

2 2
3 5

>> M*z(1:2)

ans =

3
7

>> v(3:4)*M

ans =

22 34

>> M(1,1)

6
LAB MANUAL Mechanical Instrumentation & Control

ans =

>> M(1:2,1:2)

ans =

1 2
3 4

>> M(:,1)

ans =

1
3

>> M(2,:)

ans =

3 4

7
LAB MANUAL Mechanical Instrumentation & Control

Conclusion:
In this lab, we successfully achieved the objective of becoming familiar with MATLAB.
We explored its interface, basic functionalities, and key commands.

References:
https://www.mathworks.com/help/matlab/getting-started-with-matlab.html

8
LAB MANUAL Mechanical Instrumentation & Control

Rubrics
Student is Student can Student has Student has Student
unable to understand followed constructed perfectly
follow the the provided instructions the implemented a
provided laboratory to construct functional/ working
instructions instructions the working model/ logic/
properly. and familiar fundamental schematic/ circuit/ block
with the lab schematic/ model/ block diagram/ code
The student
environment block diagram/ and
can name the
(Trainer/ diagram/ code, and successfully
Demonstration Absent hardware or
software/ code/ model have executed the
simulation
IDE), but on the successfully lab objective
platform, but
cannot protoboard/ executed the in Realtime or
unable to
implement trainer/ program/ run in a
implement
on the simulation circuit on simulation
anything
platform software. software environment
practically or
practically or platform and produced
on the
on the the desired
software
software results

Category Ungraded Very Poor Poor Fair Good Excellent

Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]

Marks 0.0 0.01 - 0.20 0.21 - 0.40 0.41 - 0.60 0.61 - 0.80 0.81 - 1.0

Date Total Marks Instructor’s Signature

Correctly
drawn
Plagiarized Requirements Observations Appropriate conclusion
content are listed and are recorded computations with
Laboratory Report not
presented or experimental along with or numerical
Reports submitted exact results
incomplete procedure is detailed analysis is
submission presented procedure performed and complete
report in all
respects

Category Ungraded Very Poor Poor Fair Good Excellent

Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]

Marks 0.0 0.01 - 0.20 0.21 - 0.40 0.41 - 0.60 0.61 - 0.80 0.81 - 1.0

Date Total Marks Instructor’s Signature

9
LAB MANUAL Mechanical Instrumentation & Control

10
LAB MANUAL Mechanical Instrumentation & Control

LAB NO. 2 DD//YYYY

Basic Scalar Operations

Lab Outcomes:
To become familiar with the Basic Scalar Operations of Matlab.

Corresponding CLO and PLO:


CLO-1

Theory:
When you add, subtract, multiply or divide a matrix by a number, this is called the scalar
operation.
Scalar operations produce a new matrix with same number of rows and columns with each
element of the original matrix added to, subtracted from, multiplied by or divided by the number.

Equipment:
1) PC
2) MATLAB Version 7 or above

Procedure:
disp(‘YOUR NAME, YOUR CMS ID’) % this command displays what we type as a string.

x=1 % declaring variable.

x % Shows the value of a variable.

x=2; % Changing Variable x=2.

y=2*x % Declaring variable y.

y % Shows the value of y.

x=x+1 % Incrementing x by 1.

z=2*x % Declaring z.

z % Sowing value of z.

11
LAB MANUAL Mechanical Instrumentation & Control

difference = z-y % Subtracting z and y.

who %It shows all the variable that are stored in memory.

whos % Shows Al variables but also shows Class & Attributes.

whos difference % Shows only variables that wants to show.

clear difference % It will delete the specific variable.


clear % this will clear all the variables stored.
who % No variables remain.
x=5 ; y = 13; w= 2*x + y; who; % Again declaring new variables in One line.

clear all % Removing all variables that are declared ones.


who % No variables appear in memory

Observations:

>> disp('Babar Ali, 12345')


Babar Ali, 12345
>> x=1

x=

>> x

x=

>> y = 2*x

y=

>> y

y=

12
LAB MANUAL Mechanical Instrumentation & Control

>> x = x+1

x=

>> z = 2*x

z=

>> z

z=

>> diff = z-y

diff =

>> who

Your variables are:

diff x y z

>> whos
Name Size Bytes Class Attributes

diff 1x1 8 double


x 1x1 8 double
y 1x1 8 double
z 1x1 8 double

>> clear diff


>> clear
>> who
>> x = 5; y = 13; w = 3*x+y; who

13
LAB MANUAL Mechanical Instrumentation & Control

Your variables are:

w x y

>> clear all


>> who

Conclusion:
In this lab, we successfully performed basic scaler operations.

References:
https://www.mathworks.com/help/matlab/getting-started-with-matlab.html

14
LAB MANUAL Mechanical Instrumentation & Control

Rubrics
Student is Student can Student has Student has Student
unable to understand followed constructed perfectly
follow the the provided instructions the implemented a
provided laboratory to construct functional/ working
instructions instructions the working model/ logic/
properly. and familiar fundamental schematic/ circuit/ block
with the lab schematic/ model/ block diagram/ code
The student
environment block diagram/ and
can name the
(Trainer/ diagram/ code, and successfully
Demonstration Absent hardware or
software/ code/ model have executed the
simulation
IDE), but on the successfully lab objective
platform, but
cannot protoboard/ executed the in Realtime or
unable to
implement trainer/ program/ run in a
implement
on the simulation circuit on simulation
anything
platform software. software environment
practically or
practically or platform and produced
on the
on the the desired
software
software results

Category Ungraded Very Poor Poor Fair Good Excellent

Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]

Marks 0.0 0.01 - 0.20 0.21 - 0.40 0.41 - 0.60 0.61 - 0.80 0.81 - 1.0

Date Total Marks Instructor’s Signature

Correctly
drawn
Plagiarized Requirements Observations Appropriate conclusion
content are listed and are recorded computations with
Laboratory Report not
presented or experimental along with or numerical
Reports submitted exact results
incomplete procedure is detailed analysis is
submission presented procedure performed and complete
report in all
respects

Category Ungraded Very Poor Poor Fair Good Excellent

Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]

Marks 0.0 0.01 - 0.20 0.21 - 0.40 0.41 - 0.60 0.61 - 0.80 0.81 - 1.0

Date Total Marks Instructor’s Signature

15
LAB MANUAL Mechanical Instrumentation & Control

LAB NO. 8 DD//YYYY

Signal Generation and Plotting - Sinusoidal

Lab Outcomes:
To become familiar with the Signal Generation and Plotting of sinosoidal function of
Matlab.

Corresponding CLO and PLO:


CLO-1 CLO-2 CLO-3

Theory:
Sinusoidal function is a function that is based on the sine function, which is a periodic function
that smoothly oscillates between high and low values. Sinusoidal functions can also be based on
the cosine function since it is just a horizontal shift of the sine function. The most basic
sinusoidal function is the function sin(x)

Equipment:
1) PC
2) MATLAB Version 7 or above

Procedure:
A=4; %Set Amplitude
w=20*pi; %Set Phase

16
LAB MANUAL Mechanical Instrumentation & Control

theetha=pi/6; %Set Shift


t=0:0.001:1; %Set time period
y=A*cos(w.*t+theetha); %Cosine equation
plot(t,y)
grid on
title('YOUR NAME – YOUR CMS ID’)
xlabel('Time(Sec)')
ylabel('Amplitude')

Observations:

17
LAB MANUAL Mechanical Instrumentation & Control

Conclusion:
In this lab, we explored the use of the MATLAB plot function for graphical
representation. Additionally, we generated and analyzed a basic sinusoidal waveform.

References:
https://www.mathworks.com/help/matlab/ref/plot.html

18
LAB MANUAL Mechanical Instrumentation & Control

Rubrics
Student is Student can Student has Student has Student
unable to understand followed constructed perfectly
follow the the provided instructions the implemented a
provided laboratory to construct functional/ working
instructions instructions the working model/ logic/
properly. and familiar fundamental schematic/ circuit/ block
with the lab schematic/ model/ block diagram/ code
The student
environment block diagram/ and
can name the
(Trainer/ diagram/ code, and successfully
Demonstration Absent hardware or
software/ code/ model have executed the
simulation
IDE), but on the successfully lab objective
platform, but
cannot protoboard/ executed the in Realtime or
unable to
implement trainer/ program/ run in a
implement
on the simulation circuit on simulation
anything
platform software. software environment
practically or
practically or platform and produced
on the
on the the desired
software
software results

Category Ungraded Very Poor Poor Fair Good Excellent

Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]

Marks 0.0 0.01 - 0.20 0.21 - 0.40 0.41 - 0.60 0.61 - 0.80 0.81 - 1.0

Date Total Marks Instructor’s Signature

Correctly
drawn
Plagiarized Requirements Observations Appropriate conclusion
content are listed and are recorded computations with
Laboratory Report not
presented or experimental along with or numerical
Reports submitted exact results
incomplete procedure is detailed analysis is
submission presented procedure performed and complete
report in all
respects

Category Ungraded Very Poor Poor Fair Good Excellent

Percentage [0] [1-20] [21-40] [41-60] [61-80] [81-100]

Marks 0.0 0.01 - 0.20 0.21 - 0.40 0.41 - 0.60 0.61 - 0.80 0.81 - 1.0

Date Total Marks Instructor’s Signature

19
LAB MANUAL Mechanical Instrumentation & Control

20

You might also like