# Automation and Robotics
Class of Professor Khalid and Frazer
282.762 Robotics and Automation - Each student should take 2 hour(s) of Lecture(s) and 2 hour(s) of Laboratory Class(es) per week.
# Useful links
[JJCraig]('../../Resources/Introduction - jj craig.pdf')
Cross-Platform Application Development with OpenCV 4 and Qt 5
TIP
Very Good link for inverse kinematics of 3-link Manipulator
TIP
Good video on 3DoF manipulator, here
# Flip Cards
# 1. Lecture 1 - 24/02/2020
WARNING
Go to and install:
https://github.com/DrFrazerNoble/machine_vision_tutorials
# Definition of a robot:
The term “Industrial Robot” is defined by ISO 8373:2012 [3] as: An automatically controlled, reprogrammable, multipurpose manipulator programmable in three or more axes, which can be either fixed in place or mobile for use in industrial automation applications.
The terms used in the definition are explained below:
Reprogrammable: the robot is designed so that the programmed motions can be changed without physical alterations.
Multipurpose: the robot is capable of being adapted to a different application with physical alteration.
Physical alteration: alteration of the mechanical system.
Axis: direction used to specify the robot motion in a linear or rotary mode.
# Look for these Books
Isaac Asimov
# Important point in history
- In 1969, GM (USA) used Unimate robots for spot-welding, the Stanford Research Institute (USA) demonstrated the use of machine vision for mobile robot navigation, and Hitachi (Japan) developed the world’s first vision-based, fully-automatic, intelligent assembly robot [4].
# Description of Position and Orientation
In the study of robotics, we are concerned with the location of objects in three-dimensional space.
These objects are the manipulator’s links, the parts and tools it deals with, and objects in the manipulator’s workspace.
In order to describe the position and orientation of a body, we attach a coordinate system, or frame, rigidly to the object.
The position and orientation of the frame is then described with respect to some reference coordinate system.
Any frame can serve as a reference system within which to express the position and orientation, so we often think of transforming or changing the description of these attributes from one frame to another.

# Forward Kinematics of Manipulators
Kinematics is the science of motion that treats motion without regard to the forces that cause it. Within kinematics, position, velocity, and acceleration are studied.
The study of kinematics of manipulators refers to all the geometrical and time-based properties of the motion.
Manipulators consist of nearly rigid links, which are connected via joints that allow relative motion of neighbouring links.
These joints are usually instrumented with position sensors, which allow the relative position of neighbouring links to be measured.
The number of degrees of freedom that a manipulator has is the number of independent position variables that would have to be specified in order to locate all parts of the the manipulator.

At the end of the manipulator is the end-effector. Depending on the robot, the end-effector could be a gripper, a welding torch, a magnet, or a sensor.
The position of the manipulator is usually described by giving a tool frame, which is defined relative to a base frame.
A very basic problem in the study of the manipulator is called forward kinematics. This is the static geometrical problem of computing the position and orientation of the end-effector of the manipulator.
# Inverse Kinematics of Manipulators
The inverse kinematics problem can be summarised as: ”Given the position and orientation of the end-effector of the manipulator, calculate all possible sets of joint angles that could be used to attain this given position and orientation” [9].
This is a rather complex geometrical problem and is not as simple as the forward kinematics one.
Because kinematic equations are non-linear, their solution is not always easy (or possible) in a closed form.
Also, questions about the existence of a solution and about multiple solutions arise.

# Velocities, Static Forces, and Singularities
In addition to dealing with static positioning problems, it may also be necessary to analyse manipulators in motion.
When performing velocity analysis of a mechanism, it is convenient to define a matrix quantity call the Jacobian of the manipulator.
The Jacobian specifies the mapping from velocities in joint space to velocities in Cartesian space.
At certain points, called singularities, this mapping is not invertible.

# Dynamics
Dynamics is a huge field of study dedicated to studying the forces required to cause motion.
In order to accelerate a manipulator from rest, move at a constant end-effector speed, and finally decelerate to a stop, a complex set of torque functions must be applied to the manipulator’s joints.
One method of controlling a manipulator is calculating the actuators’ torques using the dynamic equations of motion of the manipulator.
# Trajectory Generation
A common way of causing a manipulator to move from one point to another in a smooth, controlled fashion is to cause each joint to move via a smooth function of time.
Commonly, each joint starts and ends its motion at the same time. Exactly how to compute these motion functions is a problem of trajectory generation.
Often a path is specified using intermediate points, or via points, and a spline is used for a smooth function that passes through the set points.
In order for the end-effector to follow a path through space, the desired motion needs to be converted to an equivalent set of joint motions. This is Cartesian trajectory generation.

# Manipulator Design and Sensors
Although manipulators are, in theory, universal devices applicable to many situations, economics generally dictates that the intended task domain influence the mechanical design of the manipulator.
Along with issues such as size, speed, and load capability, the designer must also consider the number of joints and geometric arrangement.
These considerations affect the manipulator’s workspace, size and quality, the stiffness of the manipulator structure, and other attributes.
In order to build a useful robot, two approaches can be taken:
- Build a specialized robot. This robot works on a specific task.
- Build a universal robot. This robot would be able to work on a variety of tasks.
# Linear Position Control
Some manipulators are equipped with stepper motors that can execute a desired trajectory directly.
However, the majority of manipulators are driven by actuators that supply a force or torque to cause motion in the links.
In this case, an algorithm is needed to compute torques that will cause the desired motion.
A primary concern of a position control system is to compensate automatically for errors and to suppress disturbances that perturb the system.
To achieve this, position and velocity sensors are used by the control algorithm, which computes the torque commands for the actuators.

# Non-linear Position Control - outside of the scope very advanced
Although control systems based on approximate linear models are popular, it is important to consider the complete non-linear dynamics of the manipulator when synthesizing control algorithms.
Some industrial robots are now being introduced that make use of non-linear control algorithms in their controllers.
# Force Control - outside of the scope very advanced
The ability for a manipulator to control forces of contact when it touches parts, tools, or work surfaces is of importance in applying manipulators to real-world tasks.
Force control is complementary to position control. When a robot is moving in free space, only position control is useful (there’s no surface to touch); when touching a surface, position control could lead to excessive forces at the point of contact, or no contact at all.
Therefore, a hybrid control approach is required with some movements governed by a position-control law, others by a force-control law.
# Programming Robots
A robot programming language serves as the interface between the human user and the industrial robot.
In typical robot systems, there is a shorthand way for a human user to instruct the robot which path it is to follow.
First, a special point of the grasped tool is specified as the operational point, also called the Tool Centre Point (TCP)
Motions of the robot will be described by the user in terms of the desired location of the TCP relative to a user-specified coordinate system.
Most often paths are created from via points. Via points are specified relative to the reference coordinate system and denote locations along the path the TCP should pass through.
In addition, the user may specify the speed the TCP travels at.
# Off-line Programming and Simulation
”An off-line programming system is a robot programming environment that has been sufficiently extended, generally by means of computer graphics, that the development of robot programs can take place without access to the robot itself” [9].
The advantage of off-line programming is that it does not case production equipment, i.e. the robot, to be tied up when it needs to be reprogrammed; hence, factories can stay in production for longer.
Off-line programming tools also enable the use of computer aided design (CAD) models to model the robot’s work-space, ”dramatically reducing programming time required for the manufacturing process” [9].

# Notation
We use the notation outlined in [9]:
- Usually, variables written in upper-case represent vectors or matrices. Lower case variables are scalars.
- Vector:
- Scalar:
- Leading sub- and super-scripts identify which coordinate system a quantity is written in. For example, represents a position vector written in coordinate system A.
- Position vector written in the coordinate system :
- Trailing super-scripts are used for indicating the inverse or transpose of a matrix.
- Inverse:
- Transpose:
- Trailing sub-scripts are not subject to any strict convention, but may indicate a vector component (e.g. or ).
- Vector component: and or and
- Our notation for the cosine of an angle may take the following forms:
- .
Vectors are taken to be column vectors; hence, row vectors will have the transpose indicated explicitly.
# In today’s lecture, we have:
- Defined what an industrial robot is.
- Provided some background.
- Described the mechanics and control of mechanical manipulators.
- Described the notation used.
# 2. Lecture 2
# Descriptions: Positions, Orientations, and Frames
A description is used to specify attributes of various objects with which a manipulation system deals with. Objects include tools, parts, and the manipulator itself.
Here, we are interested in the description of positions, orientations, and frames.
# Description of Position
Once a coordinate system is established, any point in the universe can be located with a 3x1 position vector.
In order to make it clear what coordinate system vectors are defined with, a leading superscript will be used, e.g. .
This means the components of have numerical values that indicate distances along the axes of .
The individual elements of a vector are given the trailing subscripts x, y, and z.

# Description of Orientations
Often it is necessary to describe the orientation of a body in space.
For example, if locates the origin of a manipulator's end-effector, the complete location of the end-effector is not specified until its orientation is given.
In order to describe the orientation of a body, we will attach a coordinate system to the body and then give a description of this coordinate system relative to the reference system.
Given , if is attached to a body, then a description of relative to is sufficient to give the orientation of the body.

One way to describe the body-attached coordinate system, , is to write the unit vectors of the principal axes in terms of the coordinate system .
The unit vectors giving the principal directions of coordinate system are denoted as , , and .
When written in terms of the coordinate system , they are called , , and .
It is convenient to stack these three unit vectors as columns of a 3x3 matrix, in the order , , and .
This is called the rotation matrix and describes relative to .
It is denoted :
We can give expressions for the scalars by noting that the components of any vector are simply the projections of that vector onto the unit directions of its reference frame.
Each component of can be written as the dot product of a pair of unit vectors:
The dot product of two unit vectors yields the cosine of the angle between them and, as such, are often referred to as the direction cosines.
The rows of the matrix are the unit vectors of expressed in ; that is,
Hence, , the description if relative to , is given by the transpose of ; that is,
This suggests that the inverse of a rotation matrix is equal to is transpose,
where is the 3x3 identity matrix. Hence,
# Description a Frame
Descriptions of position and orientation completely specify the whereabouts of a body.
The point on the body whose position described can be chosen arbitrarily. However, for convenience, the point we will describe is chosen at the origin of the body-attached coordinate frame.
The situation of a position and orientation pair arises so often that we define an entity called a frame, which is a set of four vectors giving position and orientation.
For example, frame is described by and , where is the vector that locates the origin of frame :

A frame can be used as as description of one coordinate system relative to another.
A frame encompasses two ideas by representing both position and orientation and can be thought of as a generalization of those two ideas.
Positions can be represented by a frame whose rotation-matrix part is the identity matrix, and an orientation can be represented by a frame whose position-vector part is a zero vector.
# Mappings Involving Translated Frames
Being able to describe position and orientation, we are now interested in the mathematics of mapping in order to change descriptions from frame to frame.
Consider a point defined by vector . We want to express this point in terms of frame , when frames and have the same orientation.
In this case, differs from only by a translation, which is given by , the vector that locates the origin on relative to .
Because both vectors are defined relative to frames with the same orientation, point relative to , , can be calculated by vector addition:
or,

The idea of mapping, or changing the description from one frame to another, is important.
The quantity itself is not changed; only its description is changed.
For translation, the vector defines the mapping because all the information needed to perform the change in description is contained in .
# Mappings Involving Rotated Frames
Orientation can be described by three unit vectors denoting the principal axes of a body-attached coordinate system. Stacking these unit vectors as the columns of a 3x3 matrix, we have the rotation matrix. If a rotation matrix describes relative to , then it is denoted by .
A property of the rotation matrix is that:
Therefore,
Consider a point defined by vector . We want to express this point in terms of , where the origin of frames and are coincident.
In this case, differs from only by a rotation, which defined by .

In order to calculate , the components of any vector are simply the projections of that vector onto the unit directions of its frame.
The projection is calculated using the vector dot product.
In order to express this in terms of the rotation matrix, it can be written as:
For rotation, the rotation matrix defines the mapping because all the information needed to perform the change is description is contained in
The notation that we have used is of great help in keeping track of mappings and frames of reference.
A helpful way of viewing the notation we have used is to imagine that leading subscripts cancel the leading superscripts.
TIP
Given that, , we can cancel
Often we known the descriptions of a vector with respect to some frame, e.g. , and would like to know its description with respect to another frame, e.g. .
Let us consider the general case of mapping. Here, the origin of is not coincident with that of frame , but has a general vector offset, i.e. is translated.
Also, is rotated with respect to , as described by
Given , we want to know .

# Mappings Involving General Frames
We can first change to its description relative to an intermediate frame that has the same orientation as , but whose origin is coincident with . This is done by pre-multiplying by . The translation of origins is accounted by simple vector addition.
The resulting rotation and translation is given by:
This is the general transformation mapping of a vector from its description in one frame to another.
The mapping of a vector from one frame to another can be described as an operator in matrix form,
This aids in writing compact equations and is conceptually clearer.
In order to write the mathematics of the general transformation in the matrix form, we define a 4x4 matrix and use 4x1 position vectors, so that is has the structure:
Multiplying the matrix, we see:
The 4x4 matrix is called a homogeneous transform.
For our purposes, it can be regarded purely as a construction used to cast the rotation and translation of the general transform into a single matrix form.
Just as rotation matrices can be used to specify orientation, transforms can be used to specify a frame.
The description of frame relative to is .
In today's lecture, we have:
- Discussed descriptions of position, orientation, and frames.
- Discussed mappings involving translation, and rotation.
- Discussed mappings involving general frames.
# Exercises Lecture 2
Given:

And considering the position with a capital letter and a superscript such as:
# We can calculate the Dot Product of two vectors this way:
Where:
is the magnitude (length) of vector
is the magnitude (length) of vector
is the angle between and
So we multiply the length of a times the length of b, then multiply by the cosine of the angle between a and b
# Proof
Given:
The three vectors above form the triangle AOB and note that the length of each side is nothing more than the magnitude of the vector forming that side.
The Law of Cosines tells us that,
Also using the properties of dot products we can write the left side as,
Our original equation is then,
# Useful Trigonometry Properties

TIP
Refer to Useful link 5 to youtube video on Coordinate systems and frames of reference
# Properties of Dot Product
, where and are scalars and are vectors.
Here is the list of properties of the dot product:
when and are orthogonal.
Orthogonal. Two lines or planes are orthogonal if they are at right angles (90°) to each other. ... In geometry, the word 'orthogonal' simply means 'at right angles'.
We also sometimes say they are 'normal' to each other. Strictly speaking, the lines do not have to actually intersect.




# 3. Lecture 3 - 02/03/2020
# Class Notes
Tools:
Matlab
Numpy for Python
(C++ library: Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.)[http://eigen.tuxfamily.org/index.php?title=Main_Page]
Transforms and the inverse of transforms can be multiplied to carry out complex sets of transform operations.
WARNING
Transform Equations II is worng D should be A on , for
# Introduction
In today's lecture, we will:
- Discuss compound transformations.
- Discuss inverting a transformation.
- Discuss transform equations.
# Transformation Arithmetic
Transforms and the inverse of transforms can be multiplied to carry out complex sets of transform operations.
# Compound Transformation
Consider the following figure, we have and wish to find .

Frame is know relative to frame , and frame is known relative to frame . We can transform into as
Then we can transform into as:
Combining these, we get the result
from which we could define
In terms of the known descriptions of and , we can give the expression for as:
# Inverting a Transform
Consider a frame that is known with respect to a frame , i.e. we know . Sometimes we need to invert this transform to get a description of relative to , i.e. .
A straightforward method is to compute the inverse of the homogeneous transform. However, this is not the easiest way.
To find , we need to compute and from and .
Recall,
Next, we change into using:
The left hand side is zero, so we have:
We can write the form of as:
With our notation,
# Transform Equations
Consider the following figure:

Frame can be expressed as products of transformations in two different ways. First,
second:
We can set these two transformations of equal to construct a transform equation:
Transform equations can be used to solve for transforms in the case of unknown transforms and transform equations.
Consider that all transforms are known, except . We easily find its solution to be:
Consider the following figure:

In all Figures, we have introduced a graphical representation of frames as an arrow pointing from one origin to another origin. The arrow's direction indicates which way the frame is defined: in the previous figure, frame A is defined relative to . In order to compound frames when the arrows line up, we simply compute the products. If an arrow points in the opposite way, we simply compute its inverse first. Two possible descriptions of are:
and
# Lecture 3 Example


# Python implementation of Example 3:
import numpy as np
class Matrix:
"""
Definition: This class generates Homogeneous transform matrices,
that can be used to multiply any matrix and obtain the translation or rotation.
It uses `numpy` to generate the matrices:
np.float32: creates the array with 16 float32 elements
np.reshape: np.reshape rearrange the array into a 4X4 matrix
Returns: It returns Rotation and translation matrices.
Obs: **kwargs (keyword arguments) are used to facilitate the identification of the parameters, so initiate the
object
like: Matrix(x_angle='45', x_dist='100', z_angle='60', z_dist='100'), if an argument is not provided,
the default 0 will be put to the argument.
"""
np.set_printoptions(precision=3, suppress=True)
def __init__(self, **kwargs):
"""
Initializes the Object.
"""
self._x_angle = kwargs['x_angle'] if 'x_angle' in kwargs else '0'
self._x_dist = kwargs['x_dist'] if 'x_dist' in kwargs else '0'
self._y_angle = kwargs['y_angle'] if 'y_angle' in kwargs else '0'
self._y_dist = kwargs['y_dist'] if 'y_dist' in kwargs else '0'
self._z_angle = kwargs['z_angle'] if 'z_angle' in kwargs else '0'
self._z_dist = kwargs['z_dist'] if 'z_dist' in kwargs else '0'
self._m_degrees = kwargs['m_degrees'] if 'm_degrees' in kwargs else 'True'
def trans_x(self, a=0):
"""
Definition: Translates the matrix a given amount `a` on the *X* axis by Defining a 4x4 identity
matrix with `a` as the (1,4) element.
:type a: float
:param a: Distance translated on the X-axis
Returns: The Translation Matrix on the *X* axis by a distance *a*
"""
if a:
self._x_dist = a
trans_x = np.float32([1, 0, 0, self._x_dist,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1])
trans_x = np.reshape(trans_x, (4, 4))
return trans_x
def trans_y(self, b=0):
"""
Definition: Translate the matrix a given amount `d` on the *Z* axis. by Defining a matrix T 4x4 identity
matrix with *b* (3,4) element position.
:type b: float
:param b: Distance translated on the Z-axis
Returns: The Translation Matrix on the *Z* axis by a distance *b*
"""
if b:
self._y_dist = b
trans_y = np.float32([1, 0, 0, 0,
0, 1, 0, self._y_dist,
0, 0, 1, 0,
0, 0, 0, 1])
trans_y = np.reshape(trans_y, (4, 4))
return trans_y
def trans_z(self, d=0):
"""
Definition: Translate the matrix a given amount `d` on the *Z* axis. by Defining a matrix T 4x4 identity
matrix with *c* (3,4) element position.
:type d: float
:param d: Distance translated on the Z-axis
Returns: The Translation Matrix on the *Z* axis by a distance *c*
"""
if d:
self._z_dist = d
trans_z = np.float32([1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, self._z_dist,
0, 0, 0, 1])
trans_z = np.reshape(trans_z, (4, 4))
return trans_z
def rot_x(self, gamma=0, degrees=True):
"""
Definition: Receives an alpha angle and returns the rotation matrix for the given angle at the *X* axis.
If the angle is given in radian degrees should be False.
:type gamma: float
:param gamma: Rotation Angle around the X axis
:type degrees: bool
:param degrees: Indicates if the provided angle is in degrees, if yes It will be converted to radians
Returns: The Rotational Matrix at the X axis by an *gamma* angle
"""
if gamma:
self._x_angle = gamma
if degrees:
self._m_degrees = degrees
self._x_angle = np.deg2rad(gamma)
rot_x = np.float32([1, 0, 0, 0, 0,
np.cos(self._x_angle),
-np.sin(self._x_angle), 0, 0,
np.sin(self._x_angle),
np.cos(self._x_angle), 0,
0, 0, 0, 1])
rot_x = np.reshape(rot_x, (4, 4))
return rot_x
def rot_y(self, beta=0, degrees=True):
"""
Definition: Receives an theta angle and returns the rotation matrix for the given angle at the *Z* axis.
If the angle is given in radian degrees should be False.
:type beta: float
:param beta: Rotation Angle around the Z axis
:type degrees: bool
:param degrees: Indicates if the provided angle is in degrees, if yes It will be converted to radians
Returns: The Rotational Matrix at the Z axis by an *beta* angle
"""
if beta:
self._y_angle = beta
if degrees:
self._m_degrees = degrees
self._y_angle = np.deg2rad(beta)
rot_y = np.float32([np.cos(self._y_angle), 0, 0,
np.sin(self._y_angle),
0, 0, 0, 0,
-np.sin(self._y_angle), 0, 1,
np.cos(self._y_angle),
0, 0, 0, 1])
rot_y = np.reshape(rot_y, (4, 4))
return rot_y
def rot_z(self, alpha=0, degrees=True):
"""
Definition: Receives an theta angle and returns the rotation matrix for the given angle at the *Z* axis.
If the angle is given in radian degrees should be False.
:type alpha: float
:param alpha: Rotation Angle around the Z axis
:type degrees: bool
:param degrees: Indicates if the provided angle is in degrees, if yes It will be converted to radians
Returns: The Rotational Matrix at the Z axis by an *alpha* angle
"""
if alpha:
self._z_angle = alpha
if degrees:
self._m_degrees = degrees
self._z_angle = np.deg2rad(alpha)
rot_z = np.float32([np.cos(self._z_angle),
-np.sin(self._z_angle), 0, 0,
np.sin(self._z_angle),
np.cos(self._z_angle), 0, 0,
0, 0, 1, 0,
0, 0, 0, 1])
rot_z = np.reshape(rot_z, (4, 4))
return rot_z
def main():
"""
Example 3
"""
print('Example 3:')
a1 = Matrix() # Rotation in x by 90
a2 = Matrix() # Translation in X by 0.75
a3 = Matrix() # Rotation in Z by 30
a4 = Matrix() # Rotation in Z by -30
a5 = Matrix() # Translation in X by 0.5
print()
print('Rotation in X by 90:')
print(a1.rot_x(45))
print()
print()
print('Translation in X by 0.75:')
print(a2.trans_x(0.75))
print()
print('Rotation in Z by 30')
print(a3.rot_z(30))
print()
print('First Individual Transform:')
print('Rotation in X by 90 x Translation in X by 0.75 x Rotation in Z by 30:')
print(np.matmul((np.matmul(a1.rot_x(90), a2.trans_x(0.75))), a3.rot_z(30)))
print()
print('Rotation in Z by 30:')
print(a4.rot_z(-30))
print()
print('Translation in X by 0.5:')
print(a5.trans_x(0.55))
print()
print('Second Individual Transform:')
print('Rotation in Z by 30 x Translation in X by 0.5')
print(np.matmul(a4.rot_z(-30), a5.trans_x(0.55)))
print()
print('Product of both transforms:')
a6 = np.matmul(np.matmul((np.matmul(a1.rot_x(90), a2.trans_x(0.75))), a3.rot_z(30)),
np.matmul(a4.rot_z(-30), a5.trans_x(0.55)))
print(a6)
print()
print('G:')
a7 = np.float32([0.1, 0.1, 0, 1])
a7 = np.reshape(a7, (4, 1))
print(a7)
print()
print('Final Countdown:')
print(np.matmul(a6, a7))
return
if __name__ == '__main__':
main()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
Example 3:
Rotation in X by 90:
[[ 1. 0. 0. 0. ]
[ 0. 0.707 -0.707 0. ]
[ 0. 0.707 0.707 0. ]
[ 0. 0. 0. 1. ]]
Translation in X by 0.75:
[[1. 0. 0. 0.75]
[0. 1. 0. 0. ]
[0. 0. 1. 0. ]
[0. 0. 0. 1. ]]
Rotation in Z by 30
[[ 0.866 -0.5 0. 0. ]
[ 0.5 0.866 0. 0. ]
[ 0. 0. 1. 0. ]
[ 0. 0. 0. 1. ]]
First Individual Transform:
Rotation in X by 90 x Translation in X by 0.75 x Rotation in Z by 30:
[[ 8.660e-01 -5.000e-01 0.000e+00 7.500e-01]
[ 3.062e-17 5.303e-17 -1.000e+00 0.000e+00]
[ 5.000e-01 8.660e-01 6.123e-17 0.000e+00]
[ 0.000e+00 0.000e+00 0.000e+00 1.000e+00]]
Rotation in Z by 30:
[[ 0.866 0.5 0. 0. ]
[-0.5 0.866 0. 0. ]
[ 0. 0. 1. 0. ]
[ 0. 0. 0. 1. ]]
Translation in X by 0.5:
[[1. 0. 0. 0.5]
[0. 1. 0. 0. ]
[0. 0. 1. 0. ]
[0. 0. 0. 1. ]]
Second Individual Transform:
Rotation in Z by 30 x Translation in X by 0.5
[[ 0.866 0.5 0. 0.433]
[-0.5 0.866 0. -0.25 ]
[ 0. 0. 1. 0. ]
[ 0. 0. 0. 1. ]]
Product of both transforms:
[[ 1.000e+00 0.000e+00 0.000e+00 1.250e+00]
[ 0.000e+00 6.123e-17 -1.000e+00 0.000e+00]
[ 0.000e+00 1.000e+00 6.123e-17 0.000e+00]
[ 0.000e+00 0.000e+00 0.000e+00 1.000e+00]]
G:
[[0.1]
[0.1]
[0. ]
[1. ]]
Final Countdown:
[[1.350e+00]
[6.123e-18]
[1.000e-01]
[1.000e+00]]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Lecture 3 Worksheet
WARNING
To Be Done
# 4. Lecture 4 - 03/03/2020
TIP
, the order of the rotations matter. Rotation on the then on the is different from Rotation on the then on the .
# Introduction
In today's lecture, we have:
- Discussed additional means of representing orientation.
- Discussed X-Y-Z Fixed Angles representation of orientation.
- Discussed Z-Y-X Euler Angles representation of orientation.
# More on Representation of Orientation
So far, we have represented an orientation using a rotation matrix.
Rotation matrices are special in that all columns are mutually orthogonal and have unit magnitude. Further, the determinant of a rotation matrix is always equal to , which makes rotation matrices "proper".
Now, a rotation matrix has nine numbers; is it possible to describe an orientation with fewer?
Cayley's formula for orthogonal matrices states that, for any proper matrix , there exists a skew-symmetric matrix such that:
where is a unit matrix. Now a skew-symmetric matrix (i.e., ) of dimension 3 is specified by parameters and as:
Therefore, any rotation matrix can be represented by three parameters.
The nine elements of a rotation matrix are not all independent. Given a rotation matrix, , we can write down the six dependencies between the elements. can be defined as:
These are the unit axes of some frame written in terms of the reference frame.
Each is a unit vector, and all must be mutually perpendicular, so we see that there are six constraints on the nine matrix elements:
The question is, how can we express orientation using only three parameters?
Translations along three mutually perpendicular axes are quite easy to visualise, rotations not quite so. One diculty is that rotations don't generally commute, i.e. is not the same as .
Also, because rotations can be though of either as operators or as descriptions of orientation, different representations are favoured for each of these uses.
Rotation matrices are useful as operators; however, they are unwieldy when used to specify orientation.
A representation that requires only three numbers would be simpler.
# X-Y-Z Fixed Angles
One method of describing the orientation of a frame is as follows:
X-Y-Z Fixed Angles
Start with the frame coincident with a known reference frame . Rotate first about by an angle of , then about by an angle of , and, finally, about by an angle $\alpha.
Each of the three rotations takes place about an axis in the fixed reference frame A. This convention is the X-Y-Z Fixed Angles. The word "fixed" refers to the fixed reference frame.

The derivation of the equivalent rotation matrix, , is straight forward, because all rotations occur about axes of the reference frame; that is,
where is shorthand for , for , and so on.
Multiplying out in the order of rotation, we obtain:
The inverse problem, that of extracting equivalent X-Y-Z fixed angles from a rotation matrix, is often of interest.
Let
Therefore,
# Z-Y-X Euler Angles
Another possible description of a frame is as follows:
Z-Y-X Euler Angles
Start with the frame coincident with a known frame . Rotate first about by an angle , then about by angle , and, finally, about by an angle .
In this representation, each rotation is performed about an axis of the moving system rather than one of the fixed reference .
Such a set of three rotations are called Euler angles.
Because the three rotations occur about the axes , we will call this representation Z-Y-X Euler Angles.

We can use the intermediate frames and in order to give an expression for Treating the rotations as descriptions of these frames, we can write:
$^A_BR =
where each of the relative descriptions on the right hand side is given by the statements of the Z-Y-X Euler angle convention.
The final orientation of B is given relative to A as:
where is shorthand for , for , and so on.
Multiplying out in the order of rotation, we obtain:
# Example Lecture 4


# Python implementation for Example 4:
import numpy as np
def main():
"""
Example 4
"""
np.set_printoptions(precision=3, suppress=True)
print('Example 4:')
print()
print('Matrix A:')
ma = np.float32([0.866, -0.5, 0,
0.5, 0.866, 0,
0, 0, 1])
ma = np.reshape(ma, (3, 3))
print(ma)
print()
print('Matrix I:')
mi = np.float32([1, 0, 0,
0, 1, 0,
0, 0, 1])
mi = np.reshape(mi, (3, 3))
print(mi)
print()
print('Matrix I - A:')
print(mi - ma)
print()
print('Matrix I + A:')
print(mi + ma)
print()
print('Matrix (I + A)^-1:')
print(np.linalg.inv(mi + ma))
print()
print('Matrix Q = (I-A)((I + A)^-1):')
print(np.matmul((mi - ma), (np.linalg.inv(mi + ma))))
return
if __name__ == '__main__':
main()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Example 4:
Matrix A:
[[ 0.866 -0.5 0. ]
[ 0.5 0.866 0. ]
[ 0. 0. 1. ]]
Matrix I:
[[1. 0. 0.]
[0. 1. 0.]
[0. 0. 1.]]
Matrix I - A:
[[ 0.134 0.5 0. ]
[-0.5 0.134 0. ]
[ 0. 0. 0. ]]
Matrix I + A:
[[ 1.866 -0.5 0. ]
[ 0.5 1.866 0. ]
[ 0. 0. 2. ]]
Matrix (I + A)^-1:
[[ 0.5 0.134 0. ]
[-0.134 0.5 0. ]
[ 0. 0. 0.5 ]]
Matrix Q = (I-A)((I + A)^-1):
[[ 0. 0.268 0. ]
[-0.268 0. 0. ]
[ 0. 0. 0. ]]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Determinant 3X3
Just a reminder:

# 5. Lecture 5 - 09/03/2020
# Introduction
In today's lecture, we will:
- Discuss manipulator kinematics.
- Describe link descriptions.
- Describe link-connection descriptions.
- Present a convention for axing frames to links.
# Manipulator Knematics
Kinematics is the science of motion that treats the subject without regard to the forces that cause it.
Within kinematics, position, velocity, acceleration, and all higher order derivatives (with respect to time) are studied.
The kinematics of manipulators refers to all the geometrical and time-based properties of the manipulator's motion.
In order to deal with the complex geometry of a manipulator, we ax frames to the manipulator's various parts and then describe the relationships between these frames.
The study of manipulator kinematics involves how the locations of these frames changes as the manipulator moves.
# Link Description
A manipulator may be thought of as a set of bodies connected in a chain by joints. These bodies are called links. Joints form a connection between neighbouring pairs of links.
The term lower-pair is used describe the connection between bodies when the relative motion is characterised by two surfaces sliding over one another.
Mechanical-design considerations favour manipulators being constructed from joints that have just one degree of freedom.
Most manipulators are have revolute or prismatic joints.
In the case that a mechanism is built with n degrees of freedom, it can be modelled as n joints of one degree of freedom connected with links of zero length.

Links are numbered starting from the base of the manipulator, which can be called link 0.
The first moving body is link 1, and so on, out to the free end of the manipulator, which is link .
In order to position an end-effector generally in three dimensional space (3-space), six degrees of freedom are required.
For the purpose of kinematics, each link is \considered only as a rigid body that defines the relationship between two neighbouring joint axes of a manipulator" [1].
Joint axes is defined by a vector direction about which link rotates relative to link .
For any two axes in 3-space, there exists a well-defined measures of distance between them.
This distance is measured along a line that is mutually perpendicular to both axes. It is unique except when both axes are parallel.
The link length, , is measured along the mutually perpendicular line between axis and axis .
The second parameter needed to define the relative location of the two axes is called the link twist, .
Constructing a plane whose normal is the mutually perpendicular line, we can project axes and onto this plane and measure the angle between them.

# Link-Connection Description
In order to completely specify the way in which links are connected together, we need only two quantities.
Let us now consider the case for intermediate links in the chain, and the first and last link in the chain.
# Intermediate Links in the Chain
Neighbouring links have a common joint axis between them.
One parameter of interconnection is the distance along the common axis from one link to another. This is the link offset, .
The second parameter of interconnection is the angle of rotation about the common axis. This is the joint angle, .
# First and Last Links in the Chain
A frame is attached the base of the robot, or link 0, called frame {0}. This frame does not move, and for the problem of kinematics, can be considered the reference frame.
Frame {0} is arbitrary, so it always simplifies matters to choose along axis 1 and to locate frame {0} so that it is coincident with frame {1} when joint variable 1 is zero.
Using this convention, we will have and . For a revolute joint 1, = 0, and for a prismatic joint 1, = 0.
If joint n is revolute, the direction of is chosen so that it aligns with when , and the origin of frame {N} is chosen so that .
If joint n is prismatic, the direction of is chosen so that , and the origin of frame {N} is chosen at the intersection of and joint axis when .

If the link frames have been attached to the links according to our convention, the following definitions of the link parameters are valid:
- the distance from to measured along ;
- the angle from to measured along ;
- the distance from to measured along ;
- the angle from to measured along ;
The following is a summary of the procedure to follow in order to properly attach the link frames [1]:
Identify the joint axes and draw infinite lines along them. For steps 2 through 5 below, consider two of these neighbouring lines (at axes and ).
Identify the common perpendicular between them, or point of intersection. At the point of intersection, or at the point where the common perpendicular meets the ith axis, assign the link-frame origin.
Assign the axis pointing along the joint axis.
Assign the axis pointing along the common perpendicular, or, if the axes intersect, assign to be normal to the plane containing the two axis.
Assign the axis to complete a right-hand coordinate system.
Assign {0} to match {1} when the first joint variable is zero. For {N}, choose an origin location and freely, but generally so as to cause as many linkage parameters as possible to become zero.
# Example Lecture 5
On the link we follow the steps:
- Define Axes
- Define Mutually Perpendicular lines and assign x axis to it
- Draw along the axis
- Draw along the mutually perpendicular line.
- Find the Denavit-Hartenberg notation paramenters.
WARNING
Get photo from phone

WARNING
Get photo from phone, for the formulas

WARNING
From the slides, To get to the formula on the slide"Derivation of link Transformations VI" See the photo about the matrix calculations. taken at 11:24.
# Exercises Lecture 5





# Lecture 5 - Notes
Fixed Angles vs Euler rotation - See video on stream.
Example 4 Python program - 282762_Example_4.py file on Stream.
Take a look at the matrix revision on stream. Co-factors, minors and determinants - Lectures resources
Emphasize on the inverse matrix using Python
Rotation matrix and turn into a Skew matrix
line 113 and 108
Try to do the same on MAtlab.
WARNING
Execute both Matlab and Python examples and complete this class material around inverse matrix.
Also try to use C++ with the matrix library Eigen
Net homogeneous transform - Slide First and Last links in the Chain II - 4 transforms rotation and translation + rotation and translation.
WARNING
Draw this picture 10 times and rotulate
WARNING
Make the 4 matrix from the picture on the cell - in relation to the slide First and LAst Chain Links in the Chain II and the next
# 6. Lecture 6 - 10/03/2020
# Introdution
In today's lecture, we will:
- Present the derivation of the general form of link transformations.
- Describe frames with standard names.
- Describe how link transformations can be used to find the tool frame.
# Manipulator Kinematics
Individual transformations between frames attached to neighbouring links can be concatenated into solve for the position and orientation of link relative to link 0.
# Derivation of Link Transformations
We want to construct the transform that defines frame relative to frame .
In general, this transform will be a function of the four link parameters, and
For any given robot, this transformation will be a function of only one variable, i.e. the joint variable, the other three parameters being fixed by mechanical design.
By defining a frame for each link, we have broken the kinematics problem into n sub-problems.
In order to solve these sub-problems, namely , we will further break them down into four sub-sub-problems.
Each of these four transformations will be a function of one link parameter only and be simple enough that we can write down its form by inspection.
We begin by defining three intermediate frames for each link - , and
- Frame differs from frame only by a rotation of .
- Frame differs from frame only by a translation of .
- Frame differs from frame only by a rotation of .
- Frame differs from frame only by a translation of .

We can write the transformation that transforms vectors written in to their description in as:
or
Where:
Considering each of these transformations, we see that:
or
where the notation stands for the combination of a translation along an axis by a distance and a rotation about the same axis by an angle of .
Multiplying out the terms, we obtain the general from of :
# Concatenating Link Transformations
Once the link frames have been defined and the corresponding link parameters found, developing the kinematic equations is straightforward. From the values of the link parameters, the individual link-transformation matrices can be found. These can then be multiplied together to find a single transformation that relates frame to frame :
# Actuator Space, Joint Space, and Cartesian Space
The position of all of an n degree of freedom manipulator's links can be specified with a set of n joint variables.
This set of variables is often referred to as the joint vector; the space of which is referred to as joint space.
So far, we have been concerned with computing the Cartesian space description from knowledge of the joint space; assuming each kinematic joint is actuated directly.
This is not the case of many industrial robots, e.g. two actuators working together to actuate one joint. Furthermore, the sensors that measure position are often situated on the actuators.
Therefore, some computations may needed to be performed to realise the joint vector from a set of actuator values, or actuator vector.

# Frames with Standard Names
As a matter of convention, it is helpful to assign specific names and locations to certain "standard" frames associated with a robot and its workspace.
The following frames are so often referred to that we will define names for them.
"The naming and subsequent use of these frames in a robot programming and control system facilitates providing general capabilities in an easily understandable way" [1].

# The Base Frame,
is located at the base of the manipulator.
It is another name for frame .
It is axed to a non-moving part of the robot, sometimes called link 0.
# The Station Frame,
is located in a task-relevant location, e.g. at the corner of a table upon which the robot is to work.
As far as the user is concerned, is the universe frame, and all actions of the robot are performed relative to it.
The station frame is always specified with respect to the base frame, i.e.
# The Wrist Frame,
is afixed to the last link of the manipulator.
It is another name for frame , the link frame attached to the last link of the robot.
Often, has its origin fixed at a point called the wrist of the manipulator, and moves with the last link of the manipulator.
It is defined relative to the base frame, i.e. .
# The Tool Frame,
is afixed to the end of any tool the robot is holding.
When the end-effector is empty, is usually located with its origin between the fingertips of the robot.
The tool is always specified with respect to the wrist frame.
# The Goal Frame,
is a description of the location to which the robot is to move the tool. Specifically, this means that the tool frame should coincide with the goal frame.
is always specified relative to the station frame.
# Where is the tool?
One of the first capabilities of a robot must have is to be able to calculate the position and orientation of the tool that it is holding with respect to a convenient system.
That is, we want to know the value of the tool frame, , relative to the station frame, .
Once has been computed, we can use Cartesian transforms to calculate . Solving a simple transform equation leads to:
"This is what is called the WHERE function in some robot systems" [1].
# Lecture 6 Example





# Python Implementation of the example 6:
import numpy as np
import sympy as sympy
class MatrixSymbolic:
"""
Definition: This class generates Homogeneous transform matrices, although it uses a symbolic approach
that can be used to multiply any matrix and obtain the translation or rotation.
It uses `sympy` to generate the matrices:
sympy.Matrix: creates a sympy matrix object.
sympy.Symbol: creates a symbol, Symbols are identified by name and assumptions.
First, you need to create symbols using Symbol("x")
We are assuming here that the symbols are "Real" number.
All newly created symbols have assumptions set according to `args`, for example:
>>> a = symbols('a', integer=True)
>>> a.is_integer
True
>>> x, y, z = symbols('x,y,z', real=True)
>>> x.is_real and y.is_real and z.is_real
True
sympy.cos and sympy.sin: cos and sin for sympy
sympy.simplify: SymPy has dozens of functions to perform various kinds of simplification.
simplify() attempts to apply all of these functions
in an intelligent way to arrive at the simplest form of an expression.
Returns: It returns Rotation and translation matrices.
Obs: **kwargs (keyword arguments) are used to facilitate the identification of the parameters, so initiate the
object
"""
np.set_printoptions(precision=3,
suppress=True)
sympy.init_printing(use_unicode=True,
num_columns=250)
def __init__(self, **kwargs):
"""
Initializes the Object.
"""
self._x_angle = kwargs['x_angle'] if 'x_angle' in kwargs else 'gamma_i-1'
self._x_dist = kwargs['x_dist'] if 'x_dist' in kwargs else 'a_i-1'
self._y_angle = kwargs['y_angle'] if 'y_angle' in kwargs else '0'
self._y_dist = kwargs['y_dist'] if 'y_dist' in kwargs else '0'
self._z_angle = kwargs['z_angle'] if 'z_angle' in kwargs else '0'
self._z_dist = kwargs['z_dist'] if 'z_dist' in kwargs else '0'
def trans_x(self, a='a_i-1'):
"""
Definition: Translates the matrix a given amount `a` on the *X* axis by Defining a 4x4 identity
matrix with `a` as the (1,4) element.
:type a: string
:param a: Distance translated on the X-axis
Returns: The Translation Matrix on the *X* axis by a given distance
"""
if a is '0':
self._x_dist = 0
else:
self._x_dist = sympy.Symbol(a, real=True)
trans_x = sympy.Matrix([[1, 0, 0, self._x_dist],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]])
return trans_x
def trans_y(self, b='b_i-1'):
"""
Definition: Translate the matrix a given amount `d` on the *Z* axis. by Defining a matrix T 4x4 identity
matrix with *b* (3,4) element position.
:type b: string
:param b: Distance translated on the Z-axis
Returns: The Translation Matrix on the *Z* axis by a given distance
"""
if b is '0':
self._y_dist = 0
else:
self._y_dist = sympy.Symbol(b, real=True)
trans_y = sympy.Matrix([[1, 0, 0, 0],
[0, 1, 0, self._y_dist],
[0, 0, 1, 0],
[0, 0, 0, 1]])
return trans_y
def trans_z(self, d='d_i-1'):
"""
Definition: Translate the matrix a given amount `d` on the *Z* axis. by Defining a matrix T 4x4 identity
matrix with *c* (3,4) element position.
:type d: string
:param d: Distance translated on the Z-axis
Returns: The Translation Matrix on the *Z* axis by a given distance
"""
if d is '0':
self._z_dist = 0
else:
self._z_dist = sympy.Symbol(d, real=True)
trans_z = sympy.Matrix([[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, self._z_dist],
[0, 0, 0, 1]])
return trans_z
def rot_x(self, gamma='gamma_i-1'):
"""
Definition: Receives an alpha angle and returns the rotation matrix for the given angle at the *X* axis.
If the angle is given in radian degrees should be False.
:type gamma: string
:param gamma: Rotation Angle around the X axis
Returns: The Rotational Matrix at the X axis by an *given* angle
"""
if gamma is '0':
self._x_angle = 0
else:
self._x_angle = sympy.Symbol(gamma, real=True)
rot_x = sympy.Matrix([[1, 0, 0, 0],
[0, sympy.cos(self._x_angle), -sympy.sin(self._x_angle), 0],
[0, sympy.sin(self._x_angle), sympy.cos(self._x_angle), 0],
[0, 0, 0, 1]])
return rot_x
def rot_y(self, beta='beta_i-1'):
"""
Definition: Receives an theta angle and returns the rotation matrix for the given angle at the *Z* axis.
If the angle is given in radian degrees should be False.
:type beta: string
:param beta: Rotation Angle around the Y axis
Returns: The Rotational Matrix at the Y axis by an *given* angle
"""
if beta is '0':
self._y_angle = 0
else:
self._y_angle = sympy.Symbol(beta, real=True)
rot_y = sympy.Matrix([[sympy.cos(self._y_angle), 0, 0, sympy.sin(self._y_angle)],
[0, 0, 0, 0],
[-sympy.sin(self._y_angle), 0, 1, sympy.cos(self._y_angle)],
[0, 0, 0, 1]])
return rot_y
def rot_z(self, alpha='alpha_i-1'):
"""
Definition: Receives an theta angle and returns the rotation matrix for the given angle at the *Z* axis.
If the angle is given in radian degrees should be False.
:type alpha: string
:param alpha: Rotation Angle around the Z axis
Returns: The Rotational Matrix at the Z axis by an *given* angle
"""
if alpha is '0':
self._z_angle = 0
else:
self._z_angle = sympy.Symbol(alpha, real=True)
rot_z = sympy.Matrix([[sympy.cos(self._z_angle), -sympy.sin(self._z_angle), 0, 0],
[sympy.sin(self._z_angle), sympy.cos(self._z_angle), 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]])
return rot_z
def main():
"""
Example 6:
Calculates the Three-link manipulator kinematics.
At the end we can express a Transform from link 0 to link 3.
"""
print('Example 6:')
a1 = MatrixSymbolic() # Rx(a_i-1)
a2 = MatrixSymbolic() # Dx(a_i-1)
a3 = MatrixSymbolic() # Dz(d_i)
a4 = MatrixSymbolic() # Rz(theta_i)
print()
print('Rx(0):')
print(sympy.pretty(a1.rot_x('0')))
print()
print()
print('Dx(a_i-1):')
print(sympy.pretty(a2.trans_x('a_i-1')))
print()
print()
print('Rz(theta_i):')
print(sympy.pretty(a3.rot_z('theta_i')))
print()
print()
print('Dz(d_i):')
print(sympy.pretty(a4.trans_z('d_i')))
print()
print()
print('t_0_1:')
t_0_1 = (a1.rot_x('0')) * (a2.trans_x('0')) * (a3.trans_z('0')) * (a4.rot_z('theta_1'))
print(sympy.pretty(t_0_1))
print()
print('t_1_2:')
t_1_2 = (a1.rot_x('0')) * (a2.trans_x('l1')) * (a3.trans_z('0')) * (a4.rot_z('theta_2'))
print(sympy.pretty(t_1_2))
print()
print('t_2_3:')
t_2_3 = (a1.rot_x('0')) * (a2.trans_x('l2')) * (a3.trans_z('0')) * (a4.rot_z('theta_3'))
print(sympy.pretty(t_2_3))
t_0_2 = t_0_1 * t_1_2
print()
print('t_0_2:')
print(sympy.pretty(t_0_2))
print()
print('Simplified t_0_2:')
print(sympy.pretty(sympy.simplify(t_0_2)))
t_0_3 = t_0_2 * t_2_3
print()
print('t_0_3:')
print(sympy.pretty(sympy.simplify(t_0_3)))
return
if __name__ == '__main__':
main()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
Output:
Example 6:
Rx(0):
⎡1 0 0 0⎤
⎢ ⎥
⎢0 1 0 0⎥
⎢ ⎥
⎢0 0 1 0⎥
⎢ ⎥
⎣0 0 0 1⎦
Dx(a_i-1):
⎡1 0 0 aᵢ₋₁⎤
⎢ ⎥
⎢0 1 0 0 ⎥
⎢ ⎥
⎢0 0 1 0 ⎥
⎢ ⎥
⎣0 0 0 1 ⎦
Rz(theta_i):
⎡cos(θᵢ) -sin(θᵢ) 0 0⎤
⎢ ⎥
⎢sin(θᵢ) cos(θᵢ) 0 0⎥
⎢ ⎥
⎢ 0 0 1 0⎥
⎢ ⎥
⎣ 0 0 0 1⎦
Dz(d_i):
⎡1 0 0 0 ⎤
⎢ ⎥
⎢0 1 0 0 ⎥
⎢ ⎥
⎢0 0 1 dᵢ⎥
⎢ ⎥
⎣0 0 0 1 ⎦
t_0_1:
⎡cos(θ₁) -sin(θ₁) 0 0⎤
⎢ ⎥
⎢sin(θ₁) cos(θ₁) 0 0⎥
⎢ ⎥
⎢ 0 0 1 0⎥
⎢ ⎥
⎣ 0 0 0 1⎦
t_1_2:
⎡cos(θ₂) -sin(θ₂) 0 l₁⎤
⎢ ⎥
⎢sin(θ₂) cos(θ₂) 0 0 ⎥
⎢ ⎥
⎢ 0 0 1 0 ⎥
⎢ ⎥
⎣ 0 0 0 1 ⎦
t_2_3:
⎡cos(θ₃) -sin(θ₃) 0 l₂⎤
⎢ ⎥
⎢sin(θ₃) cos(θ₃) 0 0 ⎥
⎢ ⎥
⎢ 0 0 1 0 ⎥
⎢ ⎥
⎣ 0 0 0 1 ⎦
t_0_2:
⎡-sin(θ₁)⋅sin(θ₂) + cos(θ₁)⋅cos(θ₂) -sin(θ₁)⋅cos(θ₂) - sin(θ₂)⋅cos(θ₁) 0 l₁⋅cos(θ₁)⎤
⎢ ⎥
⎢sin(θ₁)⋅cos(θ₂) + sin(θ₂)⋅cos(θ₁) -sin(θ₁)⋅sin(θ₂) + cos(θ₁)⋅cos(θ₂) 0 l₁⋅sin(θ₁)⎥
⎢ ⎥
⎢ 0 0 1 0 ⎥
⎢ ⎥
⎣ 0 0 0 1 ⎦
Simplified t_0_2:
⎡cos(θ₁ + θ₂) -sin(θ₁ + θ₂) 0 l₁⋅cos(θ₁)⎤
⎢ ⎥
⎢sin(θ₁ + θ₂) cos(θ₁ + θ₂) 0 l₁⋅sin(θ₁)⎥
⎢ ⎥
⎢ 0 0 1 0 ⎥
⎢ ⎥
⎣ 0 0 0 1 ⎦
t_0_3:
⎡cos(θ₁ + θ₂ + θ₃) -sin(θ₁ + θ₂ + θ₃) 0 l₁⋅cos(θ₁) + l₂⋅cos(θ₁ + θ₂)⎤
⎢ ⎥
⎢sin(θ₁ + θ₂ + θ₃) cos(θ₁ + θ₂ + θ₃) 0 l₁⋅sin(θ₁) + l₂⋅sin(θ₁ + θ₂)⎥
⎢ ⎥
⎢ 0 0 1 0 ⎥
⎢ ⎥
⎣ 0 0 0 1 ⎦
Process finished with exit code 0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# 7. Lecture 7 - 16/03/2020
# Introduction
In today's lecture, we will:
- Discuss issues related to computing a manipulator's inverse kinematics.
- Introduce the notion of manipulator subspace when n < 6.
- Demonstrate how to compute an algebraic, closed-form solution.
# Notes
Compute the transform from one frame to another, by computing the individual transforms relating to , , and
Solve this using Matlab and Python and explain how things are working.
Python library "sympy" - pip install sympy
Rewrite 282762_Example_6_Symbolic to match the exercise
# Inverse Kinematics
Kinematics considers the problem of computing the end-effector's position and orientation using the manipulator's joints' angles.
Inverse kinematics considers the problem of computing the manipulator's joints' angles using the end-effector's position and orientation.
Finding the joint angles to place the tool frame, , relative to the station frame, , is done in two parts: first, transformations to find the wrist frame, , relative to the base frame, , are done; next, inverse kinematics are used to solve for joint angles.
# Solvability
Solving kinematic equations is a non-linear problem; where, given , we attempt to solve [1].
For example, given , solve for . Here, we have a transform for an arm with six degrees of freedom, which has 12 equations and six unknowns.
From the nine equations related to the rotation matrix, only three are independent. These, added to the three equations related to the position vector, give six equations with six unknowns.
These equations are non-linear, transcendental equations and are quite difficult to solve. In solving them, we need to consider the existence of solutions, if there are multiple solutions, and the method used.
# Existence of Solutions
"For a solution to exist, the specified goal point must lie within the manipulator's workspace"[1].
A manipualtor's workspace can be defined as:
- Dextrous workspace. This is the volume of space the end-effector can reach with all orientations.
- Reachable workspace. This is the volume of space the end-effector can reach in at least one orientation.
Consider the workspace of the following two-link manipulator:

If , the reachable workspace is a disk of radius ; the dexterous workspace is a single point, the origin.
If , the reachable workspace is a ring with an outer radius of and an inner radius of ; there is no dexterous workspace.
In the second case, inside the reachable workspace, there are two potential orientations; on the workspace's boundary, there is only one.
Here, we've assumed the manipulator's joints can rotate 360 degrees. Generally, joints are limited to a subset of 360 degrees, which in turn limits the workspace and orientations attainable at a point.
"Workspace also depends on the tool-frame transformation, because it is usually the tool-tip that is discussed when we speak of reachable points in space"[1].
"Generally, the tool transformation is performed independently of the manipulator kinematics and inverse kinematics, so we are often led to consider the workspace of the wrist frame, " [1].
For a given end-effector, a tool frame, , is defined; given a goal frame, , the corresponding frame is calculated, and then we ask: does lie in the workspace?
If is in the workspace, then at least one solution exists.
# Multiple Solutions
Another challenge for computing a manipulator's inverse kinematics is if there are multiple solutions.
Consider the following three-link manipulator:

Here, the manipulator has a large dexterous workspace. Any position in the workspace's interior can be reached with any orientation. The problem is, how do you choose one?
The criteria to choose a solution varies, e.g. \a reasonable method would be choosing the closest one" [1]; where, an algorithm uses the manipulator's current orientation and computes the minimum rotation required to move a tool from point A to point B.
The number of solutions depends on the number of joints, but is also a function of the link parameters , and the joints' range of motion [1].
In general, the more non-zero link parameters, the more solutions. For a manipulator with six degrees of freedom, there are up to 16 potential solutions [1].

# Method of Solution
When considering solving a set of nonlinear equations, we need to know what is a solution.
Here, a manipulator is considered solvable if "the joint variables can be determined by an algorithm that allows one to determine all the sets of joint variables associated with a given position and orientation"[1]. Solution strategies can be categorised as:
Closed-form solutions. This solution method is based on analytical expressions or on the solution of a polynomial expression.
Numerical solutions. This solution method is based on numerical approximations of the solution.
Within the class of closed-form solutions, there are two methods of obtaining a solution: algebraic and geometric. These method are similar and "differ" perhaps in approach only"[1].
# Manipulator Subspace When n < 6
A manipulator's set of reachable goal frames constitute its workspace.
For a manipulator with n degrees of freedom (where n < 6), this reachable workspace can be thought of as a portion of an n degree of freedom subspace.
"One way to specify the subspace of an n degree of freedom manipulator is to express its writes or tool frame in terms of n variables that locate it"[1].
"If we consider these variables to be free, then, as they take on all possible values, the subspace is generated"[1].
In defining an n degree of freedom manipulator's goal, n parameters are used. Subsequently, we will not be able to reach the goal if a manipulator with less than n degrees of freedom is used.
When specifying general goals for a manipulator with fewer than six degrees of freedom, one strategy is as follows [1]:
Given the goal frame, , compute a modified goal frame, , so that it lies in the manipulator's subspace and is near . A definition of "near" must be chosen.
Compute the inverse kinematics to find the joint angles using as the desired goal. A solution is only possible if the goal is in the manipulator's workspace.
# Algebraic Closed-Form Solutions
Consider the following three-link manipulator:

The manipulator's link parameters are tabulated below:
i | ||||
---|---|---|---|---|
1 | 0 | 0 | 0 | |
2 | 0 | 0 | ||
3 | 0 | 0 |
The manipulator's kinematic equations are given by:
Let's assume the goal point is a specification of the wrist frame relative to the base frame, i.e. .
Given our manipulator, the goal point can be specified using three variables: x, y, and , where is link three's orientation relative to axis.
We also assume 's structure is as follows:
All attainable goals must lie in the subspace implied by this structure.
Equating (1) and (2), we arrive at a set of four nonlinear equations that must be solved for , , and :
We can now start our algebraic solution. If we square both (5) and (6) and add them, we obtain:
where we have made use of
Solving (7) for , we get
For a solution to exist, the right hand of (9) must have a value between -1 and 1. If this condition isn't met, then the goal point is too far away for the manipulator to reach.
Assuming the goal is in the workspace, can be expressed as:
The choice of signs here corresponds to the multiple solutions in which we can choose the "elbow-up" or "elbow-down" solution [1].
Finally, we compute as
Having found , we can solve (5) and (6) for . We write (5) and (6) in the form:
Where,
In order to solve an equation of this form, we perform a change of variables, i.e. we change the way we write and .
if,
and
then,
"This substitution constitutes a method of solution of a form appearing frequently in kinematics"[1].
Equations (12) and (13) can now be written as:
so,
Subsequently,
and so,
Finally, from (3) and (4), we can solve for the sum of through :
From this, we can solve for , because we know the first two angles.
"An algebraic approach to solving kinematic equations is basically one of manipulating the given equations into a form for which a solution is known"[1].
# Lecture 7 Example









# 8. Lecture 8 - 17/03/2020
# Introduction
In today's lecture, we will:
- Demonstrate how to compute a geometric, closed-form solution.
- Discuss the standard frames and solving the manipulator's inverse kinematics.
# Notes
Elbow up and down configuration using cosine's law.
See picture at the phone took before 10:30am
We went through the lecture 7 slide.
# Geometric Closed-Form Solutions
The geometric approach decomposes a manipulator's spatial geometry into several plane-geometry problems, and (when or ) can be done quite easily [1].
Consider the following three-link manipulator:

There is a triangle formed by , , and the line connecting frame and frame .
Considering this triangle, we can use apply the "law of cosines" to solve for :
Now, , so we have:
In order for this triangle to exist, the distance to the goal,, must be less than or equal to the sum of the link lengths, and .
Assuming a solution exists, this equation is solved for the value of that lies between 0 and -180 degrees.
To solve for , we find expressions for angles and .
First, may be in any quadrant, depending on x and y's signs. So we must use a two-argument arctangent:
We again apply the law of cosines to find :
Here, the arccosine must be solved so that , in order that the geometry leading to (4) is preserved.
We then have,
where the plus sign is used if and the minus sign if .
We know that angles in a plane add, so the sum of the three joint angles must be the orientation of the last link:
This is solved for to complete the solution.
# The Standard Frames
Consider the standard frames:

"The ability to solve for joint angles is really the central element in many robot control systems" [1].
The standard frames are used in this context as follows:
The user specifies where the station frame, , is. is defined relative to the base frame, .
The user specifies where the tool frame, , is. is defined relative to the wrist frame, .
The user specifies where the goal frame, , is relative to .
The robot calculates a series of joint angles to move the joints through to move to .
"The SOLVE function implements Cartesian transformations and calls the inverse kinematics function" [1].
Given the goal-frame specification, , SOLVE uses the tool and station definitions to calculate the location of relative to , :
Then, the inverse kinematics take as an input and calculate through .
# Lecture 8 Example




# 9. Lectures 9 - 20/04/2020
# Introduction
In today's lecture, we will:
- Describe how to compute the derivative of a vector.
- Discuss linear and angular velocities of rigid bodies.
- Describe how to propagate the linear and angular velocities from link to link.
# Notes
# The derivative of position is velocity and of velocity is acceleration?
# The derivative of the velocity, which is the second derivative of the position function, represents the instantaneous acceleration of the particle at time t.
Jacobians for kinematic equations
Homogenous transforms
Rotaion Matrix
Numerical Question
Inverse kninematics for 2 degree freedom
# homagenoeous transforms
Whats the h t that describes point a in relation of plan b
Here is bp what is ap?
# Class 21/04/2020
What this equations are while rotating what III and ZZZ is. : Linear Aceleration - Linear Velocity
Rot_X(alpha_i)=
⎡1 0 0 0⎤
⎢ ⎥
⎢0 cos(αᵢ₋₁) -sin(αᵢ₋₁) 0⎥
⎢ ⎥
⎢0 sin(αᵢ₋₁) cos(αᵢ₋₁) 0⎥
⎢ ⎥
⎣0 0 0 1⎦
2
3
4
5
6
7
8
9
# Jacobians
Kinematics is the science of motion that treats the subject without regard to the forces that cause it.
Within kinematics, position, velocity, acceleration, and all higher order derivatives (with respect to time) are studied.
Here, we consider the linear and angular velocities of rigid bodies.
# Differentiation of Position Vectors
The derivative of a vector can be defined as:
Here, we are calculating the velocity of relative to frame .
A velocity vector can be described in terms of any frame, which is indicated with a leading superscript:
The velocity's numerical value depends on the frame the differentiation was done in and the frame in which the velocity is expressed.
When the differentiation is done in the same frame as it is expressed in, the notation simplifies; for example,
The leading superscript can be removed by including the rotation matrix that accomplishes the change in reference frame; for example,
Here, we will write expressions in the form of the right-hand side of (4) so that symbols representing velocity will always mean velocity in the frame of differentiation [1].
Rather than considering a general point's velocity relative to an arbitrary frame, we often consider the velocity of the origin of a frame relative to an understood reference frame [1].
For this case, we define a shorthand notation,
Here, is the velocity of frame 's origin relative to frame .
# Angular Velocity Vectors
"Where linear velocity describes an attribute of a point, angular velocity describes an attribute of a body" [1]. Given we attach frames to a body, angular velocity describes the rotational motion of a frame."

The direction of indicates the instantaneous rotation of relative to , and the magnitude of indicates the speed of rotation.
An angular velocity can be expressed in terms of any frame, which is indicated with a leading superscript; for example,
As before, we often consider the angular velocity of a frame relative to an understood reference frame [1].
For this case, we define a shorthand notation,
Here, is the angular velocity of frame relative to frame .
# Linear Velocity
Consider the following frames. We want to describe the motion of relative to frame .

Frame is described relative to frame via and .
If is not changing with time, then point Q's motion relative to is due to or changing with respect to time.
In this case, can be computed as:
This is true only when the relative orientation of and remains constant.
# Angular Velocity
Consider the following frames. We want to describe the motion of relative to frame .

Frame and frame 's origins are coincident. Frame is described relative to frame via .
If is not changing with time, then point Q's motion relative to is due to changing with respect to time.
We can use an intuitive approach to find . Consider the following figure:

The differential change in must be perpendicular to both and . Its magnitude is given by:
As such, the can be computed using the vector cross-product:
This is true only when is not changing with time.
In general, Q would be changing relative to frame . Adding this, we have:
Substituting a rotation matrix in place of the leading superscript, we have:
# Simultaneous Linear and Rotational Velocity
Combining both linear and rotational velocities, the velocity of a vector fixed in frame with respect to frame can be expressed as
# Motion of a Robot's Links
In considering a robots link's motion, frame is used as the reference frame.
is the linear velocity of the origin of frame , and is the angular velocity of frame .
At any instant, each robot's link in motion has some linear and angular velocity.

# Propagating Velocity Link to Link
"A manipulator is a chain of bodies, each one capable of motion relative to its neighbours. Because of this structure, we can compute the velocity of each link, starting from the base" [1].
Link 's velocity is link 's velocity plus the velocity added by joint . Each link's velocities are expressed with respect to the link's frame.

Rotational velocities can be added when both vectors are written with respect to the same frame.
The angular velocity of link is the same as link i plus the rotational velocity at joint , which can be written as:
Note that:
Here, the angular velocity is expressed in terms of frame .
By premultiplying (15) by , the angular velocity can be expressed in terms of frame :
The linear velocity of link is the same as link i plus the linear velocity caused by joint , which can be written as:
By premultiplying (17) by , the linear velocity can be expressed in terms of frame :
The correpsonding relationships for the case where joint is prismatic are:
Applying these equations, link to link, we can compute and .
# Lecture 9 Example




# 10. Lecture 10
# Introduction
In today's lecture, we will:
- Describe how to compute the Jacobian of a manipulator.
- Discuss singularities of the mechanism.
- Describe how to propagate forces and moments from link to link.
- Describe how the Cartesian transform of velocities and static forces.
# Jacobians - Velocities and Static Forces
Kinematics is the science of motion that treats the subject without regard to the forces that cause it.
Within kinematics, position, velocity, acceleration, and all higher order derivatives (with respect to time) are studied.
Here, we consider the Jacobian: "a multidimensional form of the derivative" [1], which can be used to relate joint velocities to Cartesian velocities.
The Jacobian is a multidimensional form of the derivative. Suppose we have six equations with six independent variables:
These equations can be written in vector notation:
If we want to calculate the differentials of as a function of diferentials of , we use the chain rule to get
These equations can be written in vector notation:
The matrix of partial derivatives is called the Jacobian, . If the functions of through are nonlinear, then the partial derivatives are a function of the , so, we can use the notation
Dividing both sides of the equation by the differential time element, , we can think of the Jacobian as mapping velocities in to those in :
We see that as changes with respect to time, so too does the transform, . As such, the Jacobian is a time-varying linear transform.
In robotics, Jacobians are used to relate joint velocities to Cartesian velocities. For example,
where is the vector of the manipulator's joint angles and is the vector of the Cartesian velocities.
As the Jacobian is a time-varying transform, the relationship between the joint velocities and the Cartesian velocities is an instantaneous one.
Jacobians of any dimension can be defined.
For a six degree of freedom manipulator, the Jacobian is a matrix, is a vector, and is a vector. This Cartesian velocity vector is the stacked linear and angular velocity vectors:
The number of rows is equal to the number of degrees of freedom in the Cartesian space.
The number of columns is equal to the number of joints in the manipulator.
Consider the following manipulator:

For a two degree of freedom manipulator, we can write the Jacobian as a matrix, is a vector, and is a vector. The Jacobian of frame is written as:
and written in frame is
# Changing a Jacobian's Frame of Reference
Given a Jacobian written in frame , that is,
we might want to express it in frame .
The Cartesian velocity vector given in is described relative to by the transformation:
Hence,
It is then clear that changing the frame of reference of a Jacobian is achieved by the following relationship:
# Singularities
Given that a Jacobian is a linear transform that relates joint velocities to Cartesian velocities, a reasonable question to ask is: is it invertible?
If the Jacobian is non-singular, then it is invertible and we can then calculate joint velocities from Cartesian velocities:
This means that we can specify a manipulators tool's velocity in the Cartesian space and compute joints' velocities to achieve this.
Where a Jacobian becomes singular is called a singularity of the mechanism, or a singularity.
"All manipulators have singularities at the boundary of their workspace, and most have loci of singularities inside their workspace" [1].
We can class singularities into two categories:
Workspace-boundary singularities. This type occurs when the manipulator's end-effector is very near the workspace's boundary.
Workspace-interior singularities. This type occurs when the manipulator's joints are lined up.
When a manipulator is in a singular configuration, it has lost one or more degrees of freedom (as viewed from Cartesian space).
Also, as the singularity is approached, the joint velocities approach infinity.
# Static Forces in Manipulators
In a similar way that linear and angular velocities propagate from one link to another, forces and moments propagate from link to link.
Typically, a manipulator's end-effector will be pushing on a surface or is supporting a load. We want to determine the joint torques required to keep the system in static equilibrium.
When considering static forces, we treat the manipulator as a structure. Each link is then considered and a force-moment balance is written. The static torque about each joint is then computed.
Here, we will consider the static force and torque acting on a manipulator's last link.
We define the following symbols for the force and torque exerted by a neighbouring link:
. The force exerted on link by link .
. The torque exerted on link by link .
The following illustrates the static forces and moments acting on link :

Summing the forces and setting them equal to zero, we have:
Summing torques about the origin of frame , we have
To calculate the force and moment applied by each link, we work from the manipulator's end-effector down to the base. Formulating (16) and (17) in terms of higher numbered links, we have:
To express forces and moments in terms of their own frame, we use the rotation matrix, . This leads to the result for static force propagation:
To find the joint torque required to maintain static equilibrium, the dot product of the joint-axis vector with the moment vector acting on the link is computed:
\tau_i = ^in_i^T ^i \hat Z_i\qquad(20)
In the case the joint is prismatic, we compute the joint actuator force as:
# Jacobians in the Force Domain
Using the principal of virtual work, we can equate the work done in the Cartesian space to that done in the joint space.
In the multidimensional case, work is the dot product of a force or torque vector and a displacement vector:
where is a Cartesian force-moment vector acting at the end-effector, is a infinitesimal Cartesian displacement of the end-effector, is a vector of torques at the joints, and is a vector of infinitesimal joint displacements.
We can express (22) as:
The definition of the Jacobian is:
so we may write:
which must hold for all ; therefore, we have:
Transposing both sides yields this result:
The Jacobian transpose maps Cartesian forces acting at the manipulator's end-effector into joint torques.
When written in terms of frame , then force vectors written in frame can be transformed:
Note, at a singularity, could be changed without much affect on the calculated . This means, for small joint torques, large forces can be generated at the end-effector.
# Cartesian Transformation of Velocities and Static Forces
A body's general velocity can be expressed as a vector:
where is a linear velocity and is a angular velocity.
Similarly, the general force vectors can be expressed as a vector:
where is a force vector and moment vector. Therefore, there must be a transformation that maps these quantities from one frame to another.
The transform of the general velocity vectors in frame to frame is given by:
where the cross product is understood to be the matrix operator:
Now, (34) relates velocities in one frame to those in another. This operator is called the velocity transformation, . Here, it maps velocities in frame to frame , so we use the following notation:
We can invert the transform to compute the general velocity vectors written in frame to frame :
or,
Similarly, the transform of the general force vectors written in frame to frame is given by:
or,
This transform is called the force-moment transformation.
"Velocity and force transformations are similar to Jacobians in that the relate velocities and forces in different coordinate systems" [1].
As with Jacobians, we have:
# Lecture 10 Example




# Test Questions
# 1. Given point , what is the vector that describes in terms of , ?

# Answer:
# 2. Given point , what is the vector that describes in terms of , ?

# Answer:
# 3. Given frame and frame , what is the vector that describes the origin of frame in terms of , ?

# Answer:
# 4. Given frame and frame what is the rotation matrix that describes frame ’s orientation in terms of frame ^A_BR?

# Answer:
# 5. Given frame and frame what is the rotation matrix that describes frame ’s orientation in terms of frame , ?

# Answer:
# 6.

# Answer:
# 7.

# Answer:
# 8.

# Answer:
# 9. Consider the two-link planar RR manipulator shown in the figure. Frames have been attached to the manipulator; however, some information is missing in the diagram, what is it?

# Answer:
# 10. Given the following link parameters, what is ?

# Answer:
# 11.

# Answer:
# 12. Consider the two-link RR manipulator shown in the figure. Each link is 100 mm long. Derive the kinematic equations for this manipulator. Show your working.

# Answer:
# 13.

# Answer:
# 12. Lecture 12
utils.py have some tools for transform
Function (37) (42)(43) to (45)
are implemented in python on the newton_euler.py @ is matrix multiplication and * is scalar multiplication and symbols are scalars
Open Modelica is an open source tool to simulate things as simulink. The example in Modelica is on stream.
For the project do some python programs, for the automation modeling project, assessment 02.
# Assignment 02 - Robotic arm

Solidworks arm modeling with mate controllers

Solidworks arm modeling with simulink
Solidworks arm modeling with simulink




# OpenModelica class
First, get a world component from Mechanics > Multibody > world
Then add a Revolute joint on Mechanics > Joints > Revolute
Then add a bodyshape as link1 on Mechanics > Parts > BodyShape
Then adjust the Link parameters as shown below, where r for the link is the link length since it doesn't change on the y and z axis. the r_CM is the center of mass and that's the middle since the part is symmetric.
The parameters can be adjusted as below:

The body center of mass and mass can be found at Solidworks at Tools > Evaluate > Mass properties

An important step is to export the file from Solidworks to OpenModelica, we have to set the STL document parameters to meters and check the "Do not translate..." checkbox as shown below:
