Introduction to
Robotics
Concepts and Programming
Dimitris Karampistis
D. Karampistis
Introduction to Robotics
Concepts and Programming
My name is Dimitrios Karampistis, and I am a senior
undergraduate student specializing in Electrical and Computer
Engineering. With a strong passion for Automation, Robotics,
and Machine Learning, I am excited to present my e-book,
Introduction to Robotics Concepts and Programming. This
book is a comprehensive guide designed to introduce readers
to the fundamental principles and programming techniques in
robotics. Drawing on my extensive experience with various
robotics projects, including the development of a robotic arm
with stereo vision and participation in the NASA Space Apps
Challenge, this e-book aims to equip readers with the
knowledge and skills needed to explore the fascinating world
of robotics.
Contents
1. Introduction 1
2. Transformation matrix 2
3. Forward kinematics 3
4. Inverse kinematics 4
4.1. Workspace 4
4.1.1. Defining the workspace 5
4.2. Testing different Inverse
Kinematics algorithms 6
4.2.1. Mathematical approach 6
4.2.2. Levenberg-Marquardt
method 7
4.2.3. Jacobian pseudo-inverse
method 8
5. Linear Segment with Parabolic
Blends (LSPB) 10
6. PID Controller 12
7. Conclusion 14
1. Introduction
In today's industrial environment, robots have become
crucial, transforming the processes of production,
assembly, and delivery of goods. Their remarkable accuracy
and productivity enable the manufacture of superior goods
at rates that are incomprehensible for workers. These
devices increase productivity while lowering human error
and danger. Some instances of their application are
automobile assembly lines, where robotic arms install parts
with millimeter accuracy, and warehouses, where
autonomous robots sort and dispatch products constantly.
In addition, because of their versatility, sectors are able to
quickly adapt to shifting consumer needs, maintaining a
competitive edge in a world that moves quickly. Robotics
integration in industry is a sign of an age where human
creativity and machine capabilities are working together to
reshape the industry as a whole, not only a testament to
advances in technology.
1
2. Transformation matrix
An essential tool in robotics to define the location and
rotation of one frame in relation to another is the
transformation matrix. A full three-dimensional
representation of a robot's joint or link is made possible by
the 4x4 matrix, which combines translational and rotational
components. The top right 3x1 column vector of this matrix
indicates the location of the origin of one frame in relation
to another, while the upper left 3x3 section uses a matrix of
rotation to encode the orientation of the frame. For matrix
compatibility in homogeneous coordinates, the lowest row
—typically [0, 0, 0, 1]—is utilized, making it easier to
compose numerous transformations.
The complete transformation matrix T for a 2R planar robot
can be written as:
2
3. Forward kinematics
The process of locating a robot's end-effector and aligning it
according to its joint parameters—such as angles for
rotating joints or displacements for linear joints—is known
as forward kinematics in robotics. Forward kinematics
determines the whole transformation from the base to the
end-effector by applying a sequence of transformation
matrices that describe the relationship between sequential
links in the robot's arm or structure.
Defining the 2R Planar Robot:
Performing the Forward kinematics:
Print the results:
3
4. Inverse kinematics
The technique of figuring out the joint parameters (such as
lengths for prismatic joints or angles for revolute joints)
required to get a robot's end-effector in the appropriate
position and orientation is known as inverse kinematics. In
robotics, this analysis is crucial for directing a robotic arm or
manipulator toward an exact location in space. Inverse
kinematics operates in reverse from forward kinematics,
calculating the end-effector's position based on known joint
angles. It does this by determining the joint angles or
positions that are required to position the end-effector at a
given location and orientation.
Inverse kinematics is a vast and comprehensive field of
study that deals with difficult mathematical problems that
may have one , several, or no solutions. Many robotic
setups, limits, and objectives result in a range of algorithms
and methods. For example, various sets of joint angles can
be used to place the end-effector at a single location in a
robotic arm that has multiple joints. Certain applications
also need to utilize other criteria, such as reducing energy
usage, avoiding obstacles or providing natural and smooth
movements.
4.1. Workspace
What I like to do when it comes to comparing inverse
kinematics methods is to create a common workspace for
each experiment that I'm going to perform. First we need to
generate n random position of the end effect in order to
have a common ground.
4
4.1.1. Defining the workspace
5
4.2. Testing different Inverse Kinematics
algorithms
4.2.1. Mathematical approach
The mathematical approach for the inverse kinematics of a
2R planar robotic arm involves using the law of cosines to
determine the angles of the joints given a target
end-effector position. First, the distance between the base
and the target position is calculated. The base angle, which
is the angle between the base and the target, is found using
the arctangent function. The angles within the triangle
formed by the links and the target position are determined
using the arccosine function applied to the cosine rule. This
approach ensures that the arm can reach the desired
position by calculating the necessary joint angles for both
"elbow up" and "elbow down" configurations, while also
checking if the target is within the reachable workspace.
6
4.2.2. Levenberg-Marquardt method
Robotics inverse kinematics can be effectively handled by
the Levenberg-Marquardt method, an effective
optimization tool that specializes at handling non-linear
least squares problems. Inverse kinematics in robotic
arms is the process of identifying the joint angles that
result in the desired end-effector position. In order to
reduce the error between the desired position and the
location found using forward kinematics, the
Levenberg-Marquardt approach iteratively changes the
solution. It does this by combining the gradient descent
and Gauss-Newton methods. This method effectively
handles the non-linear part of the kinematics equations
by striking a balance between robustness and
convergence speed. It is therefore frequently utilized in
robotics to accomplish accurate and reliable control of
robotic manipulators.
7
4.2.3. Jacobian pseudo-inverse method
The Jacobian pseudo-inverse for inverse kinematics is a
useful numerical method in robotics to obtain the joint
angles needed for a specific end-effector location. Using the
pseudo-inverse of the Jacobian matrix to connect joint and
end-effector velocities, this method iteratively reduces
positional inaccuracy. While analytical methods require
explicit answers, the Jacobian pseudo-inverse is adaptable
and suitable for complicated systems. For real-time
applications, it offers a simpler and more efficient way to
modify joint angles than optimization-based methods like
Levenberg-Marquardt. However, it may face convergence
issues in extremely non-linear or isolated circumstances.
8
9
5. Linear Segment with
Parabolic Blends (LSPB)
In order to guarantee smooth movement between specified
waypoints, the procedure involves creating a trajectory for
the 6-DOF robotic arm utilizing Linear Segment with
Parabolic Blends (LSPB). By using this strategy, the joints of
the robotic arm transition smoothly between positions,
preventing abrupt starts and stops. In order to enable a
combination of linear and parabolic segments to retain a
constant velocity in mid-segments while allowing for gentle
acceleration and deceleration at the ends, the trajectory is
precisely plotted to ensure that each joint experiences a
smooth transition. This technique improves the robotic
arm's control and precision, which makes it suitable for
applications requiring precise and smooth movements.
10
11
6. PID Controller
In robotics and industrial applications, a PID
(Proportional-Integral-Derivative) controller is a typical
feedback mechanism. An output can be adjusted using
three different factors: the projected future errors
(derivative), the total of the previous errors (integral), and
the current error (proportional). PID controllers are
necessary in robotics to precisely and reliably control
torques, velocities, and joint locations. They are essential to
the efficient operation of robotic arms and automated
systems because they guarantee precise movement and
performance in the face of uncertainties and disruptions.
12
13
7. Conclusion
We have looked at key ideas and robot programming
techniques in this book. Working our way up to more
complex subjects like the Levenberg-Marquardt and
Jacobian pseudo-inverse approaches in inverse kinematics,
we began with transformation matrices and kinematics. We
also covered the usage of PID controllers for precise control
of robotic systems and trajectory planning with Linear
Segment with Parabolic Blends (LSPB). This book combines
theoretical concepts with real-world examples to give
readers the knowledge and skills they need to address
robotics problems in the real world. As the area of robotics
advances, the fundamental knowledge presented here will
be crucial for both success and future innovation.
This book serves as the introduction of a series that covers
robotics concepts. More advanced robotic systems than the
2R planar robot will be covered in later chapters, including
modern manipulator designs and complex control
algorithms. Please check back with me as we continue to
learn more and develop our skills in the fascinating field of
robotics.
14