Gandhi Asu 0010N 19027
Gandhi Asu 0010N 19027
And
By
May 2019
ABSTRACT
The construction industry is very mundane and tiring for workers without the assistance
of machines. This challenge has changed the trend of construction industry tremendously
by motivating the development of robots that can replace human workers. This thesis
scale, 5 degree-of-freedom (DOF) robotic arm that are useful for construction operations,
specifically bricklaying. A software framework for the robotic arm with motion and path
planning features and different control capabilities has also been developed using the Robot
mathematical model is presented for the 5-DOF robotic arm. A model-based computed
torque controller is designed for the nonlinear dynamic robotic arm, taking into
consideration the dynamic and kinematic properties of the arm. For sustainable growth of
this technology so that it is affordable to the masses, it is important that the energy
consumption by the robot is optimized. In this thesis, the trajectory of the robotic arm is
optimized using sequential quadratic programming. The results of the energy optimization
A construction test bed setup is simulated in the ROS platform to validate the designed
commercially available 5-DOF robotic arm is modeled in the ROS simulators Gazebo and
Rviz. The path and motion planning are performed using the MoveIt-ROS interface, and
i
are also implemented on a physical small-scale robotic arm. A Matlab-ROS framework for
execution of different controllers on the physical robot is described. Finally, the results of
ii
ACKNOWLEDGMENTS
I would like to thank my advisor, Dr. Spring Berman for believing in me, and for giving
me this wonderful opportunity to work in her lab. I have been extremely lucky to have an
advisor who motivated me to learn and work harder. I will forever be grateful to her
I would like to thank Dr. Marvi for showing me the field of robotics and teaching me
the modeling strategies for manipulation. I will miss his lectures and interesting videos of
I would also like to thank Dr. Yong for introducing me to concepts of controls, which
helped me throughout my thesis work. I hope the long discussions on control with Dr. Yong
I would like to thank all my ACS lab members and specially Hamed Farivarnejad for
Finally, I would like to express profound gratitude to my family and friends for
providing me with support and encouragement throughout the process of researching and
iii
TABLE OF CONTENTS
Page
CHAPTER
1 INTRODUCTION ................................................................................................ 1
3.2 Singularity........................................................................................................ 12
iv
CHAPTER Page
CONSUMPTION ................................................................................................. 21
REFERENCES ...................................................................................................................... 56
v
CHAPTER Page
APPENDIX
vi
LIST OF TABLES
Table Page
2. DH Parameters ......................................................................................................... 9
vii
LIST OF FIGURES
Figure Page
viii
Figure Page
4.21 Comparison of End-Eff. Trajectories for Same Initial and Final Position ........ 33
6.12 Pick and Place Action and Gazebo Model of PhantomX Robot ....................... 49
ix
CHAPTER 1
1.1 Introduction
Over the past decade, a major focus in technological innovations has been to make
industrial processes autonomous. In recent years, there has been a tremendous increase in
demand and use of robots to replace humans for performing mundane and tiring jobs. As
the construction industry has been booming over the last few years, the labor shortage is a
major concern for efficient productivity. According to a survey by the National Association
difficult to recruit skilled laborers for their projects. As trained labors are aging out of the
productivity and efficiency. Currently, extensive research is being conducted to make the
bricklaying process independent of humans. Robots like Hadrian X (Pivac 2016) and
SAM100 (PODKAMINER 2016) have been demonstrated to be five times faster than
human workers. According to (PODKAMINER 2016), SAM100 can lay 300-400 bricks
per hour compared to a human bricklayer’s 60-75 bricks. There are currently different types
of robots producing houses and industrial structures. Hadrian X uses pre-fabricated walls
to construct a house in 3 days (Quirke 2018), and SAM100 uses bricks and mortar for
the construction sites. Describing the scenario of automation in bricklaying, one of the
participants of the Las Vegas Bricklaying competition said that it is difficult for a robot to
judge how much mortar is enough for particular brick or how to build a round wall with
square bricks (QUOCTRUNG BUI 2018). The current robots are also not flexible and
1
mobile enough to build walls higher than 2 meters. These issues are preventing robots from
This thesis aims to achieve better movement of robotic arms that are used in bricklaying
operations by designing a model-based controller for such robots and considering the
nonlinearity of the robot dynamics. It is useful to have a software framework that can be
used to simulate the robot operating with different controllers before implementing them
on a real robot.
This thesis describes the controller design, simulation and software implementation for
Solidworks design, the link and joint properties were considered for the controller design.
The required design concepts are discussed in Chapter 2. The computed torque controller
design and simulation are described in Chapter 3. In industry, when the robot is used for
mass production, it is important to minimize the energy consumption of the robot along its
software requirements and software setup for path planning and controller implementation.
The simulation results, experimental setup and results are illustrated in Chapter 6. The
2
1.3 Contributions of the thesis
In this thesis, a computed torque controller has been designed for a nonlinear 5 degree-
of-freedom robotic arm to perform movements that are useful for bricklaying operations.
controller implementation and simulation of the robotic arm. This setup can be
implemented on any robotic arm by just changing its Unified Robot Description Format
(URDF) files.
3
CHAPTER 2
The rotation matrix R is very important in modeling a robotic arm. It transforms the
current coordinate frame to a reference frame and vice-versa. The column vectors of the
rotation matrix are orthogonal to each other, as they are unit vectors of an orthonormal
frame. The rotation matrix is in the Special Orthonormal group SO(n) for m × m real
The rotation matrix for rotating a coordinate frame about its z-axis by angle φ is:
𝑐𝑜𝑠φ −𝑠𝑖𝑛φ 0
𝑅𝑧(φ) = [ 𝑠𝑖𝑛φ 𝑐𝑜𝑠φ 0]
0 0 1
4
Figure 2.2 Rotation of frame about x-axis and y-axis, respectively
The rotation matrix for rotating a frame about its x-axis by angle ψ and y-axis by angle ϕ,
respectively, is:
1 0 0
𝑅𝑥(ψ) = [0 𝑐𝑜𝑠ψ −𝑠𝑖𝑛ψ]
0 𝑠𝑖𝑛ψ 𝑐𝑜𝑠ψ
𝑐𝑜𝑠ϕ 0 𝑠𝑖𝑛ϕ
𝑅𝑦(ϕ) = [ 0 1 0 ]
−𝑠𝑖𝑛ϕ 0 𝑐𝑜𝑠ϕ
These matrices are useful to describe rotation about any arbitrary axis.
The configuration of a rigid body is expressed by the translation of the body from a
5
Figure 2.3 Representation of a point P in two different frames
the vector coordinates of point P with respect to the origin of reference frame B. The vector
from the origin of frame B to the origin of frame A is represented by pAB. Let BrA be the
pB = pAB + BrApA
The rigid transformation (pAB, BrA) is in the special Euclidean group SE(3) and can be
A robotic arm consists of a series of links which are connected by joints. The joints
are usually of two types: revolute and prismatic. The whole setup is called a kinematic
chain, where one end of the robotic arm is attached to a fixed base and the other end is
attached to an end-effector.
6
The structure of a robotic arm can be described by the number of degrees-of-freedom
(DOFs) associated with the arm. The configuration space of the arm is comprised of all
possible values of the joint variables, which are angles for revolute joints and distances for
prismatic joints. The configuration space of an arm with r revolute joints and p prismatic
joints has (r + p) DOFs. The forward kinematics can be used to compute the pose of the
end-effector with respect to base of the robot. This computation is done using particular
The most commonly used method to calculate forward kinematics for an open-chain
robotic arm is the Denavit-Hartenberg (D-H) method. The D-H method derives the position
and orientation of a link with respect to an adjacent link. The DH parameters of the
manipulator denote the geometric relations between its joints and links. These parameters
7
There are specific rules for the D-H convention (Siciliano et al. 2009, p.62), outlined
• Find the common normal to the Zi-1 and Zi axes and intersect it with axis Zi. The
• Select axis Xi with the same direction as the common normal to the axes Zi-1 and
• For the frame at joint 1, the Z0 axis direction is specified by the joint orientation.
The X0 axis and the origin of the frame are defined arbitrarily.
• If two continuous frames are parallel, then the common normal between them is
• When two Z axes intersect each other, then the X axis direction can be chosen
arbitrarily.
After establishing these frame conventions, the DH parameters can be used to find the
positions and orientations of the robotic arm frames. The DH parameters are defined as:
If a joint is revolute, then its joint variable is 𝜃𝑖 , and if a joint is prismatic, then its
homogeneous transformation matrix. For example, translate the frame with origin Oi-1 by
distance di along axis Zi-1 and rotate is about Zi-1 by an angle 𝜃𝑖 . The associated
𝑐𝜃𝑖 −𝑠𝜃𝑖 0 0
𝑠𝜃 𝑐𝜃𝑖 0 0
Ai’ = [ 𝑖 ]
0 0 1 𝑑𝑖
0 0 0 1
Now translate the frame by distance ai along axis Xi’ and rotate it about Xi’ by an
1 0 0 𝑎𝑖
0 𝑐𝛼𝑖 −𝑠𝛼𝑖 0
Ai = [ ]
0 𝑠𝛼𝑖 𝑐𝛼𝑖 0
0 0 0 1
Following this method, it is possible to find the position and orientation of the end-
effector with respect to the base of the robotic arm. For a 5-DOF robotic arm, this
9
2.5 PhantomX Reactor Robotic Arm
In this section, the DH parameters of a PhantomX Reactor robotic arm (Figure 2.5) are
computed, and the kinematics of the robot are modeled. The robot has 5 DOFs, and all five
𝑎0 = 0 𝑐𝑚 𝑑0 = 0 𝑐𝑚
𝑎1 = 0 𝑐𝑚 𝑑1 = 4 𝑐𝑚
𝑎2 = 14.611 𝑐𝑚 𝑑2 = 3.97 𝑐𝑚
𝑎3 = 14.551 𝑐𝑚 𝑑3 = 0 𝑐𝑚
𝑎4 = 0 𝑐𝑚 𝑑4 = 0 𝑐𝑚
𝑎5 = 0 𝑐𝑚 𝑑5 = 4.6 𝑐𝑚
Figure 2.5 PhantomX Reactor robotic arm (Rick 2017) with axes superimposed.
10
Table 2. Robot DH Parameters
Link 𝑎 𝑑 𝛼 𝜃
1 0 𝑑1 90 𝑞1
2 𝑎2 𝑑2 0 𝑞2
3 𝑎3 0 0 𝑞3
4 0 0 90 𝑞4
5 0 𝑑5 0 𝑞5
Let Aji represent the transformation of frame i to frame j, and define c1 = cos 𝜃1 , c1c2
c1 0 s1 0
s1 0 −c1 0
A01 = [ ]
0 1 0 𝑑1
0 0 0 1
11
s1s5 + c1c5c234 c5s1 − c234c1s5 c1s234 Px
c234s1 −c1 s234 ∗ s1 Py
A05 = [ ];
s234 0 −c234 Pz
0 0 0 1
where,
12
CHAPTER 3
3.1 Jacobian
Differential kinematics are used to find the relationships between the robotic arm’s
joint velocities and its end-effector linear and angular velocities. Defining the end-effector
linear velocity as 𝑝̇ e, the end-effector angular velocity as we, and the vector of joint
velocities as 𝑞̇ , then
𝑝̇ e = Jp(q) 𝑞̇ (3.1)
we = Jo(q) 𝑞̇ (3.2)
Here Jp is a (3 × n) matrix that relates the end-effector linear velocity to the joint velocities.
Jo is a (3 × n) matrix that relates the end-effector angular velocity to the joint velocities.
𝑝𝑒̇
ve = [ ] = J(q)𝑞̇ (3.3)
𝑤𝑒
of the manipulator’s joint variables. The Geometric Jacobian is a very useful property for
the robotic arm, as it is used to its find singularities, inverse kinematics and dynamics.
3.2 Singularities
During the motion of the robotic arm, there are some configurations at which the
instantaneous Jacobian matrix is not a full rank matrix. Those configurations of the
13
At singular configurations, the robotic arm loses its one degree of freedom , which
shows that it cannot achieve any arbitrary motion. The Jacobian matrix is used to find the
inverse kinematics, and if a singularity exists, then there will be infinite possible
velocities in the joints of the arm, making the motion jerky and hazardous for motors.
1) Boundary singularities: This singularity arises when the robotic arm is fully
stretched or retracted; i.e., when the arm reaches the boundaries of its workspace.
It can be avoided by assigning minimum and maximum values for each joint angle.
2) Internal singularities: This singularity arises during particular motions of the end-
effector in its workspace. This can be hazardous for joint motors, as it can occur
3.3 Dynamics
In the manipulator design, the major concept is its dynamic modeling. The dynamic
modeling reduces the costs of actual experiments, as simulations are possible if the
dynamic model is accurate. Dynamic models are often derived using the Lagrange method,
which takes into account the kinetic energy and potential energy of the robot.
The equation of motion of a manipulator can be derived using the Lagrange method.
14
L(𝑞, 𝑞̇ ) = K(𝑞, 𝑞̇ ) – U(𝑞) , (3.4)
where K is kinetic energy and U is total potential energy of the robotic arm. From the given
∂ ∂L ∂L
− = f𝑖 , (3.5)
∂t ∂𝑞̇ 𝑖 ∂𝑞𝑖
i = 1,…,n, where f[n×1] is a vector of forces associated with the joint angles qi and n is the
number of joints.
As Lagrange equations are combination of kinetic energy and potential energy, the
Here the linear and angular velocities can be written in generalized form, which is a
𝑙 𝑙 𝑙
𝑝̇ 𝑙𝑖 = 𝐽𝑃𝑖1 𝑞̇ 1 + ⋯ + 𝐽𝑃𝑖𝑖 𝑞̇ 𝑖 = 𝐽𝑃𝑖 𝑞̇ (3.7)
𝑙 𝑙 𝑙
𝑤𝑖 = 𝐽𝑂𝑖1 𝑞̇ 1 + ⋯ + 𝐽𝑂𝑖𝑖 𝑞̇ 𝑖 = 𝐽𝑂𝑖 𝑞̇ (3.8)
𝑙 𝑙 𝑙
𝐽𝑃𝑖 = [ 𝐽𝑃𝑖1 … 𝐽𝑃𝑖𝑖 0] (3.9)
15
𝑙 𝑙 𝑙
𝐽𝑂𝑖 = [ 𝐽𝑂𝑖1 … 𝐽𝑂𝑖𝑖 0] (3.10)
𝑙
𝑍𝑗−1 𝑝𝑟𝑖𝑠𝑚𝑎𝑡𝑖𝑐 𝑗𝑜𝑖𝑛𝑡
𝐽𝑃𝑖𝑗 = {
𝑍𝑗−1 × (𝑝𝑙𝑖 − 𝑝𝑗−1 ) 𝑟𝑒𝑣𝑜𝑙𝑢𝑡𝑒 𝑗𝑜𝑖𝑛𝑡
𝑙 𝑂 𝑝𝑟𝑖𝑠𝑚𝑎𝑡𝑖𝑐 𝑗𝑜𝑖𝑛𝑡
𝐽𝑂𝑖𝑗 = { 𝑍
𝑗−1 𝑟𝑒𝑣𝑜𝑙𝑢𝑡𝑒 𝑗𝑜𝑖𝑛𝑡
Then the kinetic energy formula can be written in terms of the Jacobian matrices:
1 𝑙𝑇 𝑙 1 𝑙𝑇 𝑙
𝐾𝑙𝑖 = 𝑚 𝑞̇ 𝑇 𝐽𝑃𝑖 𝐽𝑃𝑖 𝑞̇ + 𝑞̇ 𝑇 𝐽𝑂𝑖 𝑅𝑖 𝐼𝑙𝑖𝑖 𝑅𝑖𝑇 𝐽𝑂𝑖 𝑞̇ (3.11)
2 𝑙𝑖 2
The motor is also considered in dynamics modelling when the motors are very heavy
Here the linear and angular velocities can be written in generalized form, which is a
𝑚
𝑤𝑚𝑖 = 𝐽𝑂 𝑖 𝑞̇
𝑚 𝑚 𝑚
𝐽𝑂 𝑖 = [ 𝐽𝑂1𝑖 … 𝐽𝑂𝑖𝑖 0] (3.14)
16
The Jacobian matrices in these definitions can be calculated as,
𝑚
𝑍𝑗−1 𝑝𝑟𝑖𝑠𝑚𝑎𝑡𝑖𝑐 𝑗𝑜𝑖𝑛𝑡
𝐽𝑃𝑗𝑖 = {
𝑍𝑗−1 × (𝑝𝑚𝑖 − 𝑝𝑗−1 ) 𝑟𝑒𝑣𝑜𝑙𝑢𝑡𝑒 𝑗𝑜𝑖𝑛𝑡
𝑙
𝑚 𝐽𝑂𝑖𝑗 𝑝𝑟𝑖𝑠𝑚𝑎𝑡𝑖𝑐 𝑗𝑜𝑖𝑛𝑡
𝐽𝑂𝑗𝑖 = {
𝑘𝑟𝑖 𝑍𝑚𝑖 𝑟𝑒𝑣𝑜𝑙𝑢𝑡𝑒 𝑗𝑜𝑖𝑛𝑡
Then the kinetic energy formula for motors can written in terms of the Jacobian matrices:
1 𝑚𝑇 𝑚 1 𝑚𝑇 𝑚 𝑚
𝐾𝑚𝑖 = 𝑚 𝑞̇ 𝑇 𝐽𝑃 𝑖 𝐽𝑃 𝑖 𝑞̇ + 𝑞̇ 𝑇 𝐽𝑂 𝑖 𝑅𝑖 𝐼𝑚𝑖𝑖 𝑅𝑚
𝑇
𝐽 𝑖 𝑞̇ (3.15)
2 𝑚𝑖 2 𝑖 𝑂
The total kinetic energy is calculated by adding the kinetic energy of the links and the
motors, which is
1
K = 𝑞̇ 𝑇 𝑀(𝑞)𝑞̇ (3.16)
2
where,
𝑛
𝑙𝑇 𝑙 𝑙𝑇 𝑙 𝑚𝑇 𝑚 𝑚𝑇 𝑚 𝑚
𝑀(𝑞) = ∑( 𝑚𝑙𝑖 𝐽𝑃𝑖 𝐽𝑃𝑖 + 𝐽𝑂𝑖 𝑅𝑖 𝐼𝑙𝑖𝑖 𝑅𝑖𝑇 𝐽𝑂𝑖 + 𝑚𝑚𝑖 𝐽𝑃 𝑖 𝐽𝑃 𝑖 + 𝐽𝑂 𝑖 𝑅𝑖 𝐼𝑚𝑖𝑖 𝑅𝑚
𝑇
𝐽 𝑖)
𝑖 𝑂
𝑖=1
Here, M is an 𝑛 × 𝑛 matrix called the Inertia matrix and is symmetric and positive definite.
This method is also used for finding the total potential energy. The total potential energy
where g0 [3×1] is gravitational acceleration with respect to the base frame and total potential
17
After calculating the elements of the Lagrangian, it is written in the form of an inertia
matrix and gravity matrix g(q). Finally, the equations of motion can be derived from the
where C is an 𝑛 × 𝑛 matrix called the Coriolis matrix. Every element cij at row i and
𝜕𝑀𝑖𝑗 1 𝜕𝑀𝑗𝑘
ℎ𝑖𝑗𝑘 = −
𝜕𝑞𝑘 2 𝜕𝑞𝑖
In this way, equations of motion are derived for a 5-DOF robotic arm.
Robotic arms have nonlinear behavior, since the dynamic equations of the arms contain
nonlinear functions of the joint positions and velocities. When a controller is included, the
resulting closed-loop equation of the system is therefore nonlinear. So, usually motion
controllers for robotic arms are nonlinear controllers. However, the computed torque
control equations linear because of its selection of input and output signals. The computed
torque control, torque is considered as an input and it is a function of nonlinear terms that
18
The computed torque control law is as follows,
Here 𝑞̃ is the joint angular position error, which is the difference between the desired
joint angles 𝑞𝑑 and the actual joint angles 𝑞 , and Kd and Kp are symmetric positive definite
matrices. The computed torque controller is a model-based controller, since it contains the
desired joint angular acceleration 𝑞̈ 𝑑 and errors in joint angular velocity and angular
Figure 3.1 shows the block diagram of a computed torque controller for a robotic arm.
g(q)
𝑞̈ 𝑑 M(q) Robotic
arm
C(𝑞, 𝑞̇ )
Kd
V Kp
𝑞̇ 𝑑
𝑞𝑑
The dynamic equation of a robotic arm is given by equation (3.18). In this equation, 𝜏 can
that:
This equation is linear and autonomous. Lyapunov candidate functions exist for this
equation, which means that the closed-loop system is asymptotically stable, i.e.
20
CHAPTER 4
equation. The equation of motion of the robot is modelled from its dynamics, as described
in Chapter 3. The objective is for the manipulator to reach a target position from an initial
position, which are both user-defined, in a specified amount of time. Physical constraints
like joint angle limits and joint velocity limits of the manipulator are implemented. The
energy optimization method outputs a set of joint angles over a sequence of time steps,
which yields an energy-optimized trajectory for the manipulator to follow over the defined
time interval.
The power Pi consumed by a servo motor i is the product of the torque 𝜏𝑖 produced by
𝑃𝑖 = 𝜏𝑖 𝑞̇ 𝑖 (4.1)
where 𝜏 = [ 𝜏1 𝜏2 𝜏3 𝜏4 𝜏5 ]′, M is the mass matrix, C is the Coriolis matrix, g is the gravity
matrix, and 𝑞, 𝑞̇, 𝑞̈ are the vectors of the 5 joint angular positions, velocities, and
accelerations, respectively.
21
Since the torques are derived from the mass matrix, Coriolis matrix, and gravity matrix,
which are functions of the joint positions and velocities, the torques are also functions of
The path of the robotic manipulator is the locus of joint angles in the joint space that
the manipulator must follow for the execution of an assigned path. A path that is
to define the trajectory of the end-effector. To ensure smooth movement of the end-
22
Similar velocity and acceleration equations can be written for the remaining 4 joints. We
substitute in the initial and final conditions of position, velocity and acceleration for the
At time t = 0 At time t = 𝑡𝑓
𝑞 = 𝑞0,𝑖 where 𝑞0,𝑖 is initial position of joint i 𝑞 = 𝑞𝑓,𝑖 where 𝑞𝑓,𝑖 is final position of joint i
q1 = x1 t 7 + x2 t 6 + c1 t 5 + d1 t 4 + e1 t 3 + q 0,1
Equations for q2, q3, q4 and q5 are developed in a similar manner. By applying the initial and
final conditions to these equations, the corresponding values of ci, di, ei, fi, gi and hi are
found.
Nonlinear constraints on q1 through q5 are imposed as follows. The units are radians.
−3.14 ≤ 𝑞1 ≤ 3.14
−1.57 ≤ 𝑞2 ≤ 1.57
−1.57 ≤ 𝑞3 ≤ 1.57
−1.57 ≤ 𝑞4 ≤ 1.57
−3.14 ≤ 𝑞5 ≤ 3.14
23
Nonlinear constraints on q̇ 1 through q̇ 5 are imposed as follows. The units are radians/sec.
−2.26 ≤ q̇ 1 ≤ 2.26
−2.26 ≤ q̇ 2 ≤ 2.26
−2.26 ≤ q̇ 3 ≤ 2.26
−2.26 ≤ q̇ 4 ≤ 2.26
−2.26 ≤ q̇ 5 ≤ 2.26
In this formulation, we use time as a parameter and not as a variable. The variables x1
through x10 are optimized and the above constraints are imposed on the qi and q̇ 𝑖. The
values of x1 through x10 obtained from the optimization procedure are substituted into the
path equation and are checked to confirm that the constraints are satisfied.
In the table below, 𝑞0,𝑖 is the user-defined initial position of the joint angle 𝑞𝑖 and 𝑞𝑓,𝑖 is
q1 q2 q3 q4 q5
‘fmincon’ optimization function in MATLAB is used with the ‘SQP’ (Ren 2018)
algorithm. To initiate the optimization, the initial guesses of the variables used are:
24
Table 5. Initial guesses of the variables
The optimization was performed for 7 different final times tf. The optimized values for x1
through x10 and the power consumption calculated from these variables are shown for each
final time in Table 6. It is evident from the table that the minimum value of power
consumption is achieved for tf = 2.5 s. Figure 4.22 plots the values of power versus the
Visually, the trajectory of the end-effector over a time span of 1 s looks straight.
However, in that case the power consumption is higher compared to the power for a time
span of 2.5 s. This could be due to the fact that the joint velocities for the case where tf =
➢ For tf = 5 seconds
25
Figure 4.1 Joint Position for t = 5 seconds
26
Figure 4.3 Joint Acceleration for t = 5 seconds
27
➢ For t = 3 seconds
28
Figure 4.7 Joint acceleration for t = 3 seconds
29
➢ For t = 2 seconds
31
➢ For t = 1 second
33
➢ For t = 2.5 seconds
35
Figure 4.21 Comparison of End-effector Trajectories for the same Initial and Final
Positions
Power (Watts)
3
2.5
Power (Watts)
1.5
0.5
0
0 1 2 3 4 5 6
Time (seconds)
36
CHAPTER 5
huge user community, which makes ROS a preferred platform for roboticists. It has users
from all over the world and because of that, robotics companies are inclining towards using
ROS. Due to the following properties, many users prefer ROS over other robotics
platforms:
planning of robotic arms. These features and packages have numerous applications,
• Various functions: ROS has many functionalities for visualization, debugging and
simulation. Rviz and Gazebo are widely used simulators in the ROS community. The
rqt tool is used for visualization of control outputs, joint behaviors and feedback
properties of systems.
• Compatible with sensors and actuators: ROS is compatible with various sensors and
actuators. It is easy to communicate with these components via ROS. The Dynamixel
servos used in the PhantomX Robotic Arm are also compatible with ROS.
• Different coding languages: ROS operations are based on nodes. The nodes can be
programmed in many languages like Python, Matlab, C and C++. Just because of that
ROS platform is conceptualized based on node coding for different activities; if one
node crashes, then other nodes and other activities can still work.
• Dynamic community: The ROS community is developing very rapidly, and is very
active and helpful to new ROS users. The innovative applications are shared
throughout the community by users. Problems regarding ROS are solved on a ROS
wiki page.
ROS is a highly structured platform, like other operating systems. ROS has 3 main
levels: file system, computational graph and community level. The ROS file system has
Here, packages are the most basic element of the ROS platform. ROS packages have
configuration files, launch files, scripts, package manifest files and a CMake build file.
The package folder is very important for ROS setup, and some of package sub-folders
• Config: All configuration files are stored in this folder. Users can assign parameters
• Launch: All launch files are stored in this folder. The nodes for different applications
• Scripts: The users can store Python scripts in this folder. These executable scripts
• Src: All source files are stored in this file. The file must be written in C++.
38
• Msg: All message definitions are stored in this folder.
modeling of robots saves a great deal of time and money that would be spent on physical
robot experiments. There are some packages in ROS which assist in modeling of robots.
In this work, modeling of the PhantomX robotic arm is done using a URDF (Unified Robot
Description Format) package, a joint state publisher and a robot state publisher. The URDF
The joint state publisher package is very important for modeling the robot. The joint
state publisher node publishes joint values to nonfixed joints from reading URDF files.
This way, it makes it easy for users to understand URDF files. The robot state publisher is
also a useful package for publishing 3D poses of the robot. It publishes each robot link in
a 3D world using kinematics described in the URDF files. The TF nodes represents
The URDF file of any robot contains joint and link information. The link tag contains
properties like size, shape, and geometry, and it can also include mesh properties of the
link. The link also has some dynamic properties like inertia and collision of links.
The different types of joints, such as revolute, prismatic, and fixed, are defined under
joint tags. The joint limits, velocity limits, and effort limits are also defined under joint
39
tags. The URDF file creates a 3D model from declarations of joint and link tags. The
interface of the hardware with ROS is also defined in URDF files. Simulators like Gazebo
and Rviz read URDF files and create 3D models for users.
In this work, a 3D model of the 5-DOF PhantomX Reactor robotic arm was created in
the Gazebo and Rviz simulators. The files are on the GitHub page of the Autonomous
MoveIt has different packages for manipulation of a robotic arm. It is possible to solve
problems of motion planning, pick and place, grasping, and so on with different plugins
provided by MoveIt APIs. It has library plugins for manipulation, collision checking,
motion planning, control and perception. The customized robots are also compatible with
services and actions of different applications with robot. The move-group node subscribes
to the joint state and the TF topic of the robot. It gathers information about the robot from
The user can work with MoveIt in 3 different ways. The user can command the move-
group node via C++ APIs, Python APIs or the GUI of MoveIt. The GUI is compatible with
the Rviz simulator, in which the user can add plugins associated with their requirements.
It is also possible to interlink MoveIt-Rviz with a real robot or Gazebo for experiments.
40
Below, the MoveIt architecture diagram is shown to illustrate Moveit programming.
As shown in Figure 5.1, the move-group node collects values from robot sensors and
controllers. It processes path planning, collision checking, scene planning and grasping. It
operates those functionalities when an action or service is called by the user in the form of
MoveIt uses the Open Motion Planning Library (OMPL) for path planning of robotic
arms. The OMPL has several algorithmic plugins for motion planning, so users can change
41
algorithms in the MoveIt GUI as per their applications. By default, MoveIt uses RRT
(Rapidly-exploring Random Trees) and RRT* (optimized RRT) plugins for manipulation.
In this work, the PhantomX Reactor Robotic Arm (Phantomx) was made compatible
with MoveIt with the use of the setup assistant and the URDF file of the robot. Motion
planning was also performed to obtain the desired trajectories of the robotic arm that were
computed using the optimization procedure described in Chapter 4. The PhantomX robot
was also inter-linked with Gazebo and physical hardware to test MoveIt package. The files
for MoveIt and Gazebo simulations are on the GitHub page of the Autonomous Collective
42
CHAPTER 6
mentioned in Chapter 3, the control law for the CTC is given by:
This controller makes the nonlinear robot dynamics into a second-order linear system:
𝑞̃̈ + 𝐾𝑑 𝑞̃̇ + 𝐾𝑝 𝑞̃ = 0
Here, this second-order system is solved using the ODE45 command in Matlab
software. To make the system solvable using ODE45, the second-order system can be
converted into two first-order differential equations, written in state-space form as follows:
𝑑 𝑞̃ 𝑞̃̇
[ ]= [ ]
𝑑𝑡 𝑞̃̇ −𝐾𝑑 𝑞̃̇ − 𝐾𝑝 𝑞̃
0 𝐼
𝑑 𝑞̃ 𝑞̃
[ ]= [ ] [ ̇]
𝑑𝑡 𝑞̃̇ −𝐾𝑝 −𝐾𝑑 𝑞̃
The joint positions and velocities are unknown in these equations, and because of that
they are considered as symbolic variables in Matlab. The Matlab code for the computed
torque controller is on the GitHub page of the Autonomous Collective Systems (ACS)
Laboratory (Lab 2019). The proportional and velocity gain matrices are defined as diagonal
After trial and error we set Kp = Kp1 = diag {1.8, 0.65, 2, 0.7, 2.5} and Kd = Kd1 =
diag {10, 2, 10, 2, 10}. Figures 6.1, 6.2, and 6.3 show the joint positions, velocities, and
43
error values over time, respectively. These are the outputs from the integration of the robot
dynamics with the computed torque controller in Matlab. It is seen in Figure 6.3 that the
error values all converge to zero for the given Kp1 and Kd1 matrices.
Next, we set Kp = Kp2 = diag {14.8, 7.65, 15, 6.7, 20.5} and Kd = Kd2 = diag {10, 2,
10, 2, 10}; i.e., the gains in the Kp matrix are increased. As Figures 6.4-6.6 show, the
44
Figure 6.2 Velocity-Time graph for Kp1 and Kd1(radian/sec-second)
45
Figure 6.4 Position-Time graph for Kp2 and Kd2(radian-second)
46
Figure 6.6 Error-Time graph for Kp2 and Kd2(radian-second)
The commercially available 5-DOF PhantomX Reactor Robotic Arm was used here
for experiments. It has a static base, and it is possible to make it mobile by attaching it to
a mobile robotic platform. The Dynamixel AX-12a servo motors are used in the PhantomX
Robotic Arm. These servos have position and velocity feedback, while inputs are only
possible to achieve position control. These servos are compatible with ROS, so it is
possible to command them from an external computer. The PhantomX robot was modeled
in MoveIt using the setup assistant. The setup assistant software is shown in Figure 6.7.
47
Figure 6.7 MoveIt Setup Assistant (Moveit! n.d.)
After attaching the URDF files of the PhantomX robot, the end-effector configurations
and control methods are chosen as per the required applications. Then after setting up the
PhantomX robot in MoveIt, it is possible to plan its path with the RRT algorithm. This
planned trajectory is commanded to the physical hardware, and the Dynamixel servos
For the MoveIt and physical robot coordination, some files must be modified to achieve
similar controllers in MoveIt and Gazebo / the physical robot. The MoveIt simple manager
has to be called in a launch file for initiation of the MoveIt controllers. The configure file
is required to start controllers in Gazebo. Finally, launching Gazebo and MoveIt will
initiate controllers in the computer as well as on the real hardware. In this way, it is possible
to coordinate Gazebo and the physical robot with MoveIt. The required files are on the
48
GitHub page of the Autonomous Collective Systems (ACS) Laboratory (Lab 2019). The
Figure 6.8 MoveIt motion planning GUI in Rviz (Initial robot configuration in Orange
and final configuration in white)
Matlab has introduced a robotics toolbox, which can connect Matlab to ROS. The
benefit of the ROS-Matlab interface is that the user does not need to code complicated
controllers and perception algorithms in c++ coding language; they can directly use Matlab
49
Figure 6.9 Matlab-ROS workflow (Matlab-documentation)
The Matlab-ROS workflow is shown in Figure 6.9. ROS communicates with the robot
updated outcomes of joint values from Matlab. This interface allows the user to add new
functions to ROS libraries. The user just has to input sensor values from the robot to Matlab
code, and then Matlab performs the calculations and publishes the outcome of joint values
IP address of the robot to the Matlab node. As per the flowchart in Figure 6.10, Matlab will
connect with ROS using the assigned IP address. It will subscribe to ROS topics associated
with the physical robot’s position and velocity sensors. At every specified time instant,
Matlab will solve the ODEs that describe the robot’s dynamics to obtain the robot’s joint
position and velocity values and find the required motor torques needed for that motion. It
50
will publish the torque values to the robot motor controllers via ROS. The motor controllers
ROBOT
TTL
communication
ROS interface
Torque
Computed Torque
Controller (Matlab)
51
Figure 6.11 Setup of PhantomX Reactor robotic arm
Here, the PhantomX robotic arm was connected to a computer by TTL communication
and Dynamixel servo motors (Figure 6.11). The Matlab code for the Gazebo and Matlab
operations, was performed on the PhantomX Robot with position controller, and a similar
action was simulated in Gazebo. Figure 6.12 shows a time sequence of snapshots of a
successful pick-and-place action by the physical robot with a cardboard block, as well as a
52
Figure 6.12 Snapshots of pick-and-place action by the PhantomX robotic arm and
53
CHAPTER 7
7.1 CONCLUSION
controller for a robotic arm to perform movements that are useful for construction
activities. The thesis presents the kinematics and dynamics of a 5-DOF robotic
motions, controller design for improved performance, a software framework for controlling
In this thesis, a computed torque controller was designed for better trajectory
for the dynamics of the arm. Although a 5-DOF arm is a nonlinear dynamic system, the
results of the computed torque controller show that the arm with this controller is
The purpose of the designing the software framework was to make it easier for new
users to control a robotic arm. The 5-DOF robotic arm was also modeled in ROS to
visualize the actual behavior of the arm in the Gazebo or Rviz simulators. A Matlab-ROS
interface was developed so that the computed torque controller can be implemented easily
on the robot via Matlab. This Matlab-ROS interface allows users to implement different
controllers on this robot just by changing the controller source file. The Moveit-ROS
54
interface developed in this thesis empowers users to use different motion and path planning
algorithms for a robotic arm. The Matlab-ROS and Moveit interfaces were also used to
control an actual PhantomX Reactor robotic arm. The Dynamixel servos AX-12a and
USB2Dynamixel converter were used for implementing the controller on the hardware.
(1) The current robotic arm has a static base. It is possible to expand the workspace of the
PhantomX robotic arm by attaching it to a mobile robotic platform, such as the TurtleBot3
Waffle robot.
difficult to obtain satisfactory performance from PD and CTC controllers. As future work,
adaptive and robust controllers can be designed for loads with unknown parameters.
(3) The Dynamixel servos AX-12a have proportional controllers, and they can only sense
joint position and velocity. These servos could be replaced by MX-64 servos, which have
torque controllers that are possible to directly command using the CTC controller’s output.
55
REFERENCES
Anil Mahtani, Luis Sánchez, Enrique Fernández, Aaron Martinez. Effective Robotics
Programming with ROS. Packt Publishing, 2016.
Bruno Siciliano, Lorenzo Sciavicco, Luigi Villani, and Giuseppe Oriolo. Robotics-
Modelling, Planning and Control. Springer, 2009.
Carol Fairchild, Dr. Thomas L. Harman. ROS Robotics By Example. Packt Publishing,
2016.
Fenton, X. Shi and N.G. "A complete and general solution to the forward kinematics
problem of platform-type robotic manipulators." IEEE International Conference
on Robotics and Automation proceedings. 1994. pp. 3055-3062.
Joseph, Lentin. Learning Robotics Using Python. Packt Publishing Ltd., 2014.
56
Lab, ACS. ACS Lab GitHub Page. 03 28, 2019. https://github.com/ACSLaboratory
(accessed 3 28, 2019).
Marvi, Hamidreza. MAE-547 Modeling and Control of Robots Lecture Notes. 2018.
Morgan Quigley, Brian Gerkey, and William D. Smart. Programming Robots with ROS.
2016: O’Reilly Media, Inc., n.d.
QUOCTRUNG BUI, ROGER KISBY. Bricklayers Think They’re Safe From Robots.
New York, March 06, 2018.
57
Y. Antonio, S. Victor and M.V. Javier. "Global asymptotic stability of the classical PID
controller by considering saturation effects in industrial robots." International
Journal of Advanced Robotic Systems, Vol. 8,, 2011: pp. 34-42.
58
APPENDIX A
59
rosshutdown;
#connects with robot with following ip-address
rosinit('ip-address')
load('x_pid_2');
joint_send.Positions = zeros(5,1);
joint_send.Velocities = zeros(5,1);
pubMsg.Points = joint_send;
pubMsg.JointNames =
{'shoulder_yaw_joint','shoulder_pitch_joint','elbow_pit
ch_joint','wrist_pitch_joint','wrist_roll_joint','gripp
er_revolute_joint'}
i=1; j=1;
while(i<6)
pubMsg.Points.Positions =
[Q1(4*i,1);Q1(4*i,2);Q1(4*i,3);Q1(4*i,4);Q1(4*i,5)]
if i == 1
pubMsg.Points.TimeFromStart.Sec =
round((0.49*((i-1)/2)),0);
pubMsg.Points.TimeFromStart.Nsec = 240099009
elseif i == 2
pubMsg.Points.TimeFromStart.Sec =
round((0.49*((i-1)/2)),0);
pubMsg.Points.TimeFromStart.Nsec = 490099009
elseif i == 3
pubMsg.Points.TimeFromStart.Sec =
round((0.49*((i-1)/2)),0);
pubMsg.Points.TimeFromStart.Nsec = 740099009
else i == 4
pubMsg.Points.TimeFromStart.Sec =
round((0.49*((i-1)/2)),0);
pubMsg.Points.TimeFromStart.Nsec = 990099009
60
end
61