Robotics Lab

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Robotics Lab

Lab Report # 5
Submitted to: Engr. Shehbaz Khan
Submitted by: Abdul Moiz Qarni
Section: A
Registration # 17PWMCT0564
Due Date: 20th January 2021

University of Engineering & Technology


Peshawar

1
Contents
Introduction .................................................................................................................................... 3
Objective ......................................................................................................................................... 3
Solution ........................................................................................................................................... 3
1) Current Reference Frame: ................................................................................................... 3
2) Fixed Frame: ........................................................................................................................... 6
Conclusion ....................................................................................................................................... 9
References .................................................................................................................................... 10

2
Rigid Motions and Homogeneous
Transformation
Introduction
In robotics, the orientation of a robotic system can be represented in mathematical terms using
rotation matrices. Rotation matrices transform the coordinate axes (e.g. x, y, and z)
representing the orientation of a 3D object in one frame to the coordinate axes of another
frame. These matrices can help us determine how the end effector of a robot changes its
orientation due to changes in a robotic arm’s angle [1]
These matrix manipulation can very well be doing by hand using basic mathematics but gets
impractical in practice, therefore we can use premade toolboxes such as “Robotics, Vision and
Control” toolbox, which is an add-on in Matlab, developed by Peter Corke. [2]

Objective
The main objective of this lab is to proof through graphical representation, calculation and
Matlab commands:

 W.r.t current reference frame: Post-multiplying by successive rotation matrices


 W.r.t a fixed reference frame: Pre-multiplying by successive rotation matrices

Solution
1) Current Reference Frame:
Let’s start off with initially a robotic manipulation, as an example let’s consider the following
robotic manipulation in the attachment below.

 This will be the graphical representation of it:

3
Figure 1 Current Frame graphical representation pt1

4
Figure 2 Current Frame graphical representation pt2

 Now for the calculation:


𝐻 = 𝑇𝑟𝑎𝑛𝑠𝑦,2 𝑇𝑟𝑎𝑛𝑠𝑧,3 𝑅𝑜𝑡𝑥,−𝜋 𝑇𝑟𝑎𝑛𝑠𝑧,5
2

1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0
0 1 0 2 0 1 0 0 0 0 −1 0 0 1 0 0
𝐻 = ∗ ∗ ∗
0 0 1 0 0 0 1 3 0 1 0 0 0 0 1 5
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1

1 0 0 0
0 0 1 7
𝑝0 =
0 −1 0 3
0 0 0 1
 Finally for the Matlab part:
We write the following code in our Matlab:

5
R = transl(0,2,0)*transl(0,0,3)*trotx(-90,'deg')*transl(0,0,5)
trplot(R)
tranimate(R)

This gives us two outputs:


1) The transformation Matrix

Figure 3 Current Frame Transformation Matrix

2) The Visualization of the Transformation.

Figure 4 Current Frame Matlab Visualization

2) Fixed Frame:
The same robotic manipulation would be used as in the part 1:

 This will be the graphical representation of it:

6
Figure 5 Fixed Frame graphical representation pt1

7
Figure 6 Fixed Frame graphical representation pt2

 Now for the calculation:


𝐻 = 𝑅𝑜𝑡𝑥,−𝜋 𝑇𝑟𝑎𝑛𝑠𝑧,2 𝑇𝑟𝑎𝑛𝑠𝑦,−3 𝑇𝑟𝑎𝑛𝑠𝑧,5
2

1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0
0 0 −1 0 0 1 0 0 0 1 0 −3 0 1 0 0
𝐻 = ∗ ∗ ∗
0 1 0 0 0 0 1 2 0 0 1 0 0 0 1 5
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1

1 0 0 0
0 0 1 7
𝑝0 =
0 −1 0 3
0 0 0 1
 Finally for the Matlab part:
We write the following code in our Matlab:
R = trotx(-90,'deg')*transl(0,0,2)*transl(0,-3,0)*transl(0,0,5)
trplot(R)
tranimate(R)

8
This gives us two outputs:
1) The transformation Matrix

Figure 7 Fixed Frame Transformation Matrix

2) The Visualization of the Transformation.

Figure 8 Fixed Frame Matlab Visualization

Conclusion
As noticeable that both the results from fixed and from current frame are equal this normally
shouldn’t be the case if there is more than one rotation matrix, but since in the case of this
example, there was only one rotation matrix, both conditions of having a fixed frame versus
current frame yielded the same result.

9
References

[1] [Online]. Available: https://automaticaddison.com/how-to-find-the-rotation-matrices-for-


robotic-arms/.

[2] [Online]. Available: https://petercorke.com/toolboxes/robotics-toolbox/.

10

You might also like