You are on page 1of 8

1|Page

DEPARTMENT OF MECHATRONICS ENGINEERING


UNIVERSITY OF ENGINEERING & TECHNOLOGY, PESHAWAR
Robotics MtE-405L, 7th Semester

Student Name: Imad Ahmad


Reg No: 20PWMCT0732
Instructor Name: Dr. Riaz Akbar Shah
Submission Date:

Lab No 5:

Lab Rubrics:
BelowBasic (1)
Criteria Excellent (4) Proficient (3) Basic (2) Student’s
Score
Report is mostly
Report is
Report is as per as per the Sections/Steps
disorganized
To organize the the guidelines. are not ordered
guidelines and and follows
lab report and All and Report is
most some
practice sections/steps not as per the
sections/steps guidelines
th e writing skills are clearly guidelines
but most of
as per the organized in a are ordered well
the guidelines
guidelines logical order. but requires are missing
minor
improvements.
The report
completely The report The report The report is
discusses the discusses the discusses the totally irrelevant
To discuss the required task in required task lab work but to the lab work
actual own words with have
task some relevant irrelevant
additional information
information
Calculations Calculations and Most data and Calculations and
and data analysis observations data analyses of
were performed were lab were missing
data analyses
To perform accurately, but recorded
calculations and minor errors adequately,
were performed
data analysis were made both but with
clearly,
in calculations several
concisely, and
and in applying significant
accurately, with
correct units errors
correct
units. or omissions.
Graphs, if Graphs, if Graphs, if Major
necessary, were necessary, were necessary, components of
To present results drawn drawn were drawn but lab
in the form of accurately and adequately inadequately. were
graphs neatly and were missing
clearly labelled.

Course Instructor: Dr. Riaz Akbar Shah


2|Page

Table of Contents
Contents
Objectives..............................................................................................................................................................
Theory....................................................................................................................................................................
Types of Robotic Arm...........................................................................................................................................
Lab-Volt Automation 5250-A0 Servo Robot Training System.............................................................................
ProArm RS2200 Robot by Marcraft Int ................................................................................................................
Mobile Robot.........................................................................................................................................................
The Khepera IV Mobile Robot..............................................................................................................................
Unimate PUMA 500..............................................................................................................................................
Pick and Place Robotic Arm..................................................................................................................................
Conclusion............................................................................................................................................................
References.............................................................................................................................................................

Course Instructor: Dr. Riaz Akbar Shah


3|Page

Lab No: 5 ANALYZE MATRIX MUPLICATION SIMULATION AND SEE ROLL,


PITCH & YAW MOVEMENTS

Objectives:
 To study about Euler Angles.
 To study about Rotation Matrix.
 To study about Coordinate Transformation.

Theory:
Coordinate Transformation:
In robotics applications, many different coordinate systems can be used to define where robots, sensors,
and other objects are located. In general, the location of an object in 3-D space can be specified by position and
orientation values. There are multiple possible representations for these values, some of which are specific to
certain applications. Translation and rotation are alternative terms for position and orientation. Robotics
System Toolbox™ supports representations that are commonly used in robotics and allows you to convert
between them.

Euler Angles:
The Euler angles are three angles introduced by Leonhard Euler to describe the orientation of a rigid
body with respect to a fixed coordinate system.

Numeric Representation: 1-by-3 vector of scalar angles


For example, a rotation around the y -axis of pi would be expressed as:
eul = [0 pi 0]

Homogeneous Transformation Matrix


Abbreviation: tform
A homogeneous transformation matrix combines a translation and rotation into one matrix.

Numeric Representation: 4-by-4 matrix

Course Instructor: Dr. Riaz Akbar Shah


4|Page

For example, a rotation of angle α around the y -axis and a translation of 4 units along the y -axis would
be expressed as:

Rotation Matrix:
They can be used to rotate a vector into a new position or they can be used to rotate a coordinate basis
(or coordinate system) into a new one. Each rotation is specified by an angle of rotation. The rotation angle is
defined to be positive for a rotation that is counterclockwise when viewed by an observer looking along the
rotation axis towards the origin. Any arbitrary rotation can be composed of a combination of these three.
The rotation matrices that rotate a vector around the x, y, and z-axes are given by:

MATLAB TASKS:

Rotation Matrix:

Code Explanation:
 Frist of all I declared a variable “a” and stored value of roty(45) in it.
 Then I used trplot function to plot rotation vectors in frame.
 Then I similarly created variables “b” and “c” and store rotx and rotz values in it.
 And then using trplot function I plotted rotation rotation vector across x and z axis.

Course Instructor: Dr. Riaz Akbar Shah


5|Page

Outputs:

Multiplication of Matrix:

Outputs:

Euler Angle:

Code Explanation:
First of all I declared a variable eul. This variable contains Roll, pitch and yaw values. Then after that i
declared variable rotm and store the value obtained from eul2rotm() function. Then at last I plotted results
using trplot function.

Conclusion:
In this lab we learned about Robots. We learned how Robots are making humans life easier. We also
studied different types of Robot. And in Robotics Lab Hall we seen different types of robots, like mobile
robot, robotic arms etc.
Course Instructor: Dr. Riaz Akbar Shah
6|Page

Figure 1 output of Euler angle

Task:
Simulation A 3x3 Matrix And Draw Their Equalent Euler Angles(Roll, Pitch,
Yaw):

Matlab Code:
R = [cos(pi/4) -sin(pi/4) 0;
sin(pi/4) cos(pi/4) 0;
0 0 1];
% Extract Euler angles (in radians)
theta_x = atan2(R(3,2), R(3,3)); % Roll
theta_y = atan2(-R(3,1), sqrt(R(3,2)^2 + R(3,3)^2)); % Pitch
theta_z = atan2(R(2,1), R(1,1)); % Yaw

% Convert angles to degrees


theta_x_deg = rad2deg(theta_x);
theta_y_deg = rad2deg(theta_y);
theta_z_deg = rad2deg(theta_z);

% Display the results


fprintf('Original Rotation Matrix:\n');
disp(R);

fprintf('Roll (theta_x): %.2f degrees\n', theta_x_deg);


fprintf('Pitch (theta_y): %.2f degrees\n', theta_y_deg);
fprintf('Yaw (theta_z): %.2f degrees\n', theta_z_deg);

% Visualize the rotation using quiver3


axis_vectors = R * eye(3);
figure;
quiver3(0, 0, 0, axis_vectors(1,1), axis_vectors(2,1), axis_vectors(3,1), 'r', 'LineWidth',
2);
hold on;

Course Instructor: Dr. Riaz Akbar Shah


7|Page

quiver3(0, 0, 0, axis_vectors(1,2), axis_vectors(2,2), axis_vectors(3,2), 'g', 'LineWidth',


2);
quiver3(0, 0, 0, axis_vectors(1,3), axis_vectors(2,3), axis_vectors(3,3), 'b', 'LineWidth',
2);
axis equal;
xlabel('X-axis');
ylabel('Y-axis');
zlabel('Z-axis');
title('Visualization of Rotation');
legend('X-axis', 'Y-axis', 'Z-axis');
grid on;

Command Window Output:

Output:

Course Instructor: Dr. Riaz Akbar Shah


8|Page

Figure 2 Euler Angles

References:
[1] https://www.indiamart.com/proddetail/pick-place-systems-6600798248.html
[2] https://www.ebay.com/itm/293659659435
[3] https://americanhistory.si.edu/collections/search/object/nmah_1028521
[4] https://www.mathworks.com/help/phased/ref/rotx.html

Course Instructor: Dr. Riaz Akbar Shah

You might also like