RoboticArm Denis

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

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/369548976

Design of a 3-DOF Robotic Arm and Implementation of D-H Forward


Kinematics

Chapter · March 2023


DOI: 10.1007/978-981-19-9225-4_42

CITATION READS

1 266

2 authors:

Denis Manolescu Emanuele Lindo Secco


Liverpool Hope University Liverpool Hope University
7 PUBLICATIONS 13 CITATIONS 170 PUBLICATIONS 1,998 CITATIONS

SEE PROFILE SEE PROFILE

All content following this page was uploaded by Emanuele Lindo Secco on 31 August 2023.

The user has requested enhancement of the downloaded file.


Design of a 3-DOF Robotic Arm and implementation of
D-H Forward Kinematics

Denis Manolescu1 and Emanuele Lindo Secco1


1 Robotics Lab, School of Mathematics, Computer Science and Engineering, Liverpool Hope
University, UK
[email protected], [email protected]

Abstract. Robotic prototypes are gaining gradually more academic and research
traction, while robots are becoming a more common encounter within the human
social trusted cycles. Generally, in the fields of Robotics - besides the mandatory
high standards of safety - engineers are keen to build their concepts with an intu-
itive, natural-like motion and characteristics. This project will go through the
process of building a novel 3-degrees of freedom robotic arm. The study will also
aim at introducing and demonstrating the importance of a proper kinematics: an
analysis on how geometry computations are used to improve the control and mo-
tion of a robot is performed. Finally, Pros and cons as well as the constraints of
the proposed system are discussed together with a set of approach and solutions.

Keywords: Robotic Arm, Forward Kinematics, Denavit-Hartenberg.

1 Introduction

Robotic arms, suitably named because they generally resemble the human arm and
mimic their functionality, were mainly introduced into the heavy industries in the
1960s. The automotive industry was the first to adopt the technology; shortly after,
other assembly-line factories followed (Moran, 2007). Even from the early stages, hav-
ing a machine that can continuously do repetitive tasks with speed and precision, lift
loads greater than a person's capacity and endure harsh environmental conditions – Ro-
bots seemed to be the logical future. They became attractive by offering efficiency and
cost-effective advantages through automation (Smith, 2018).
Throughout time, robotic arms were an evolutionary direction that built and guided
the Robotics industry and determined its existence today.
With greater sensory awareness and novel programming algorithms like artificial intel-
ligence, deep learning or machine learning, the robotic arms can now interact and fulfil
tasks side-by-side with humans.
Typically, from an engineering perspective, a robotic arm consists of a steady base
that anchors a multi-segmented structure and forms the robot body. The connections
between segments are called joints, and individually they determine an axis of motion,
also known as the degree of freedom. The last link of the arm is the end-effector which
is a specialised device designed to interact with the environment. The end-effector can
2

take many shapes and forms, like gripper, vacuum head, magnets, soft-manipulation
grabber, wielding tip, drilling or cutting tool, painting spray or camera module (Ernest
L. Hall, 2015).
In essence, most joints are built using actuators that are capable of initiating move-
ments depending on their control signal feedback. In tandem with the linear or rota-
tional motion of an actuator, joints can mostly be classified as prismatic or sliding,
revolute or rotary, spherical or socket and helical or screw-based (Fig. 1). A higher
number of joints enables more freedom of movement, and the majority of the robotic
arms available have four to six joints (Intel.inc, 2016).
Coordinating the entire movement of a robotic arm while determining its position,
orientation and velocity is a fundamental task in robotics.
Kinematics is the main mathematical option capable of accurately describing the
relationship between the joint coordinates, the end-effector and their spatial layout (Il-
linois, 2015).

Figure 1 - Robotic joint types (image source: medium.com)

There are two ways to use kinematics equations in the context of a robotic arm:

1. Forward kinematics – uses the kinematics equations to calculate the position,


orientation and velocity of the end-effector while knowing the joints angle.

In practice, the forward kinematics process uses the kinematic structure of the ro-
bot and the spatial configuration of the links to calculate the rotation and displace-
ment of each frame. The result of forwarding kinematics is a single possible solu-
tion chain-linked to the entire structure of the robotic arm, no matter its movement.

2. Inverse kinematics – uses kinematics equations to compute a configuration of


the joints position or angle that is necessary to place the end-effector in a given or
desired location and orientation. Inverse kinematics is a more complex mathemati-
cal calculus than forward kinematics and usually produces multiple solutions (V.
Kumar, 2016).

Once deployed into the robotic arm control algorithm, kinematics calculations can
also be used to improve precision motion and prediction or objects collision detection.
This study will analyze the designing and building process of a 3-Degrees of Free-
dom robotic arm with revolute joints and will go through the process of calculating and
applying Forward Kinematics.
3

The paper is organized as it follows: the Materials sand Methods section will talk
about the characteristics of the robotic arm built in this project and the main compo-
nents. The Forward Kinematics chapter will present the in-depth process of how kine-
matics work and how forward kinematics is calculated and integrated into the robot
system. The Algorithm section will complete the Forward Kinematics chapter by going
through the code developed to operate the robotic arm and the integration of forward
kinematics. The Results section will point out the issues encountered and the solutions
adopted. It will also present the final view of the robotic arm and prove its functionality
with a video demonstration. The last section, namely the Conclusion – reports an ob-
jective overview of the entire project and reflect on the results achieved.

Figure 2 - Robotic Arm 3D Design made in Autodesk Fusion 360

2 Materials and Methods


The 3-degrees of freedom robotic arm built in this study has a vertical length of 26cm
and a working envelope of 18.3cm radius (Fig. 2A).
The project uses three servo actuators connected by nine enforced plastic frames and
three reinforced plastic brackets (Fig. 2B). The base is anchored with screws by a dense
polyamide board, and the entire structure is kept in place by two gripping clamps.
The arm is controlled by an Arduino Mega 2560 Rev.3, which holds on top a servo
driver shield connected to a 9.6V DC power supply (Fig. 3B).
The first join within the base rotates 295° left-right on the Z-axis, forming a dis-
placement of 13cm from the ground to the next frame. The second joint rotates 190°
up-down, constrained only by the position of the holding bracket. Between the first and
second frame, there is a displacement of 11.75cm. The third joint is identical to the
previous one, while the distance between the second and third frame is 6.55cm. There
is also an additional 5cm distance from the servo rotation axis to the end-effector tip
(the pencil) (Fig. 3).
4

2.1 The Arduino Mega & Arduino Uno microcontrollers

The central computing power of the robot is generated by an Arduino Mega Rev3
board which is based on the 8-bit ATmega2560 microcontroller produced by Micro-
chip. The board operates on 5V and has a clock speed of 16Mhz while offering a con-
venient 54 digital connection pins and 16 analog pins (Fig. 4C).
Although the microcontroller is not used for complicated computations, it holds
enough processing power to perform decently real-time kinematics calculations.

Figure 3 - Robotic Arm. All components overview (final version)

Additionally, in the early stage of development, an Arduino Uno had to be used in


parallel with Mega, and its purpose was to capture the UART data pocket coming from
the servo motor via the shield drive. More about this issue in the Challenges section
below.
5

Figure 4 - Dynamixel servo driver shield layout, AX12A Dynamixel servo motor, Arduino
Mega & Servo shield attached

2.2 Dynamixel Servo Shield


The servo shield used in the study is created by Dynamixel for their own servo motor
series, and it is built to fit on top of Arduino Mega or Uno (Fig. 4C). The shield operates
on 5-24V, and one of its best features is to allow the export of the data packets coming
from the servo motors via its UART pins (Robotis, 2021).
An inconvenient flaw of the shield is the manual switch between the communication
with the Arduino serial port and the servo motor control channel (Fig. 4A – UART
SW). When uploading commands to the microcontroller, the UART needs to be set to
Upload mode. For the servo motors to start reacting to the commands uploaded, the
UART needs to be turned to Dynamixel mode. This manual switch becomes a real issue
in the repetitive debugging stage of the servo motors and the robotic arm movements
tests.
Software-wise, the producer and the community offer a wide range of support for
testing and further development through C++ libraries - all fully compatible with the
Arduino environment.

2.3 Dynamixel Servo Motors

The entire robotic arm design has been built around three Dynamixel AX12-A servo
motors. These are advanced, high-performance robotics actuators designed to be mod-
ular and daisy chain connected (Fig. 4B).
Underneath the reinforced plastic housing, the actuator is composed of a 9-12V DC
motor with 1.5N/m stall torque, a 254:1 spur gearbox, a build-in microcontroller with
feedback, a driver and a half-duplex serial interface running at up to 1 Mbps through a
UART/TTL serial link. This network feature enhances the servo capabilities and offers
precise control and programmability of torque, speed, position, temperature and even
voltage (Adafruit, 2020).
A very interesting feature of these intelligent servo motors is their capacity to be
switched from a Joint mode – with a rotation capacity of 300°, to a Wheel mode –
giving them the ability to endlessly rotate without constraints.
6

Another helpful feature is the daisy chain connection – meaning the servos only need
to be connected to each other in a serial chain via a 3P cable with a Molex connector.
In the daisy chain setup, only a single servo needs to be directly plugged into the Ar-
duino shield. This setup is possible because of the asynchronous communication be-
tween devices and the use of unique IDs for each motor in the commands data package.

Figure 5 - Kinematics Diagram for Rotation Matrices & calculus. | Displacement layout be-
tween joint frames

3 Forward Kinematics Calculations

Forward kinematics is the mathematical process that uses the joint angles, in this
case, θ1, θ2, θ3 (theta values), to determine the exact position of the end-effector (Fig,
5A).
The study will go through two different ways to apply forward kinematics, namely:
1. Conventional way - using the rotation matrix and the displacement matrix to
calculate the homogeneous transformation matrix.
2. And the Denavit-Hartenberg method.
Both of these methods use the same rotation matrix calculus.

3.1 Rotation Matrices

Considering the robotic arm has three revolute joints, the rotation matrix formula for
the entire system is:
𝑅30 = 𝑅10 ∙ 𝑅21 ∙ 𝑅32

The first stage consists of calculating the projection matrices of each next frame onto
the previous frame, with the joints in their initial state or position. This process will
help determine the rotation of each joint in a frame space relationship.

1. Projection Matrix of Frame 1 to Frame 0:


7

2. The projection matrix of Frame 2 to Frame 1 and the projection matrix of


Frame 3 to Frame 2 are the same and equal to the Identity Matrix. That is be-
cause the orientation of their axes is identical.

Once the projections are defined, the rotation matrices are calculated:

Technically, there is no need to calculate the 𝑅30 matrix to determine the homogene-
ous transformation matrices. But the Python algorithm developed will compute it any-
way; more about that in the Code Section below.
8

3.2 Displacement Matrix

Displacement, in the context of the robotic arm, refers to the x, y, and z position of
frame n in frame m. The general formula is:

Using the Fig. 5B diagram, the displacement matrices are determined in the context of
θ1, θ2, θ3, as below:

3.3 Homogenous Transformation Matrix

In Robotics, the Homogeneous Transformation Matrix (HTM) is a tool that com-


bines the rotation matrix with the displacement matrix to generate the position and
orientation of the end-effector. The HTM of the robot structure is calculated the same
way as the rotation matrix by multiplying the HTM of all frames.
The HTM formula for the entire robotic arm is:

𝐻30 = 𝐻10 ∙ 𝐻21 ∙ 𝐻32

where it holds:

In this study, the final 𝐻30 of the robotic system is computed by a Python algorithm.
For testing purposes, the defined joint angles are θ1 = 75°, θ2 = 147°, θ3 = 147°, and
the result is:

Where the end-effector tip, according the all calculations so far, is placed at the
coordinate (17.93, 5.48, 0.05), in the 1st quadrant. Additional explanations of the result
are discussed in the Results section below.
9

3.4 The Denavit-Hartenberg Method

The second method studied in applying forward kinematics to the robotic arm is the
Denavit-Hartenberg (D-H) method. For this technique to work, four rules must be fol-
lowed in the frame assignment stage (Angela Sodemann, 2020):
1. In the case of a revolute joint, the Z-axis is considered the rotation axis;
2. The X-axis must be perpendicular to the Z-axis of the previous frame;
3. The X-axis must intersect the Z-axis of the previous frame; this rule does not apply
in the context of Frame 0;
4. The Y-axis must be determined from the X and Z axis by following the right-hand
rule.
Once these rules are in place as shown in Fig. 5A, the next step is to determine the
D-H Parameters table (Table 1).

Table 1. The D-H parameters of the designed Robotic Arm

The final step of the D-H method is to use the parameters above to calculate the
homogeneous transformation matrices. In this case, the general formula is:

Each D-H homogeneous transformation matrix gets calculated in Python. The code
is shown and explained below.
10

4 Algorithm – C++ and Python

4.1 The Arduino IDE & C++ libraries

The setup to operate the joint movement of the robotic arm is defined in the Fig. 6
below: at first, the servo shield C++ library is included in the program, by calling the
DynamixelShield.h header file provided by the developer. Line 3-11 in the code repre-
sents an automation process, where if statement makes the shield recognise the type of
Arduino that will run the system.

Figure 6 - Arduino sketch - Setups

The servo motors ID variables are declared in lines 14-16, while the firmware used
to run the servo motors is defined on line 18. This PROTOCOL_VERSION is a default
variable specific for the series of actuators used. Line 20 represents the instance of the
library class DynamixelShield that gives access to all the motor functionalities, as they
are made available by the producer. Line 23 also creates general access to the global
variables used in the control of the servos, like ID, torque, temperature, position and
many more. From Line 25 in the code, it begins the setup of the connection between
Arduino and servo motors via the driving shield. The default baud rate to transmit the
commands to the servos is 1 Mbps, set by command dxl.begin(1000000).
11

Figure 7 - Arduino sketch to run the robotic arm. Main loop code.

In the main loop, in the code lines 40-42, the speed of each of the three servo motors
is set to a value of 70 (Fig. 7). The function used, setGoalVelocity(), can take raw data,
rpm or percentage values; in this case, it is set to a raw value, and it can go up to 450-
500.
The initial reading of the servo position is done using the getPresentPosition(),
which can also take the raw or degrees values as a variable. At the same time, the data
received is valuable feedback that can be used to drive the motor in the desired position
with high accuracy.
The setGoalPosition() function rotates the specific actuator at the requested angle.
This function is very powerful and useful in the kinematics and the motion of the ro-
botic arm.

4.2 PyCharm 2022 and Python

The robotic arm project used Python programming language and PyCharm IDE to
build two different algorithms:
1. One to execute the conventional forward kinematics calculus with Rotation ma-
trices, Displacement matrices and the Homogeneous Transformation matrices
(Fig. 9).
2. The other one applies the D-H method with the Rotation matrices, Parameters
table and DH Homogeneous Transformation matrices (Fig. 8).
12

Figure 8 - Python algorithm. D-H method in Forward Kinematics calculus

The results are compared and discussed in the Results section below. Both algo-
rithms are running on the same theta values representing the joint angles, θ1 = 75°, θ2 =
147°, and θ3 = 147°.

Figure 9 - Python algorithm for conventional Forward Kinematics calculus


13

Both, Arduino sketch and Python forward kinematics code are made available online
at github.com/deemano.
Essential aspects to consider in the forward kinematics calculus are the
transformation from degree into radians and the positioning of the joint axis, which
starts from the initial position of the actuator (i.e. 0°). The 3D axis of the joints can be
shifted conveniently to fit any desired layout without influencing the results.

5 Results

The only challenge this research faced was making the UART debugging process
work. Typically, capturing all the servo motors feedback requires a dedicated device
sold by the producer, which acts as a medium and can capture the half-duplex serial
data stream and decode it. But in this case, using a second Arduino proved to be a viable
solution in capturing the data stream. Solving this issue was important in changing the
default ID assigned to each servo motor or other personalized parameters like protocols,
which can be unknown.
In the final stage, the movement of the robotic arm is smooth and steady, without
any issues. This outstanding performance of the servo actuators allowed the study to
focus the entire efforts on implementing forward kinematics.
Although the conventional way to calculate forward kinematics seemed more
straightforward and modulated, both methods were generating identical results in de-
termining the tip of the robotic arm end-effector.
In the end, and consistently with the literature, the D-H method proved to be a sim-
pler way to emulate the robotic arm structure and motion, and faster to calculate.

6 Conclusion

This work has been focused on creating a complete view of the process of building
an operational robotic arm. Additionally, the research elaborated a comprehension of
how forward kinematics algorithms can be achieved and integrated into the robot sys-
tem.
The 3D design of the robot was a laborious procedure with significant creative ef-
forts but of great contribution to understanding the kinematics relationships within the
robot structure.
The electronics part of the project has proven to be a relatively simple stage, primar-
ily because of the intuitive and accessible documentation and other resources related to
the hardware used.
Forward Kinematics, on the other hand, has been the most challenging part, demand-
ing significant amounts of research and raw pen-and-paper calculations. In its essence,
when building your own robotic arm, kinematics is a personal aspect of the structural
motion of the robot that can only work if it is understood correctly.
The industrial development of high-performance smart actuators is becoming acces-
sible and more affordable. Once algorithm concepts like Deep-learning and AI get to
14

be integrated into these devices by default, the Robotics field will be able to fully evolve
and expand into all the other industries and aspects of human life [12-13].

ACKNOWLEDGMENTS
This work was presented in coursework form in fulfilment of the requirements for the
BEng in Robotics Engineering for the student Denis Manolescu from the Robotics La-
boratory, School of Mathematics, Computer Science and Engineering, Liverpool Hope
University

References
1. Adafruit, 2020. DYNAMIXEL Motor - AX-12A. [Online] Available at:
https://www.adafruit.com/product/4768 [Accessed 2022].
2. Angela Sodemann, A. A., 2020. How to Assign Denavit-Hartenberg Frames to Ro-
botic Arms. [Online] Available at: https://automaticaddison.com/how-to-assign-de-
navit-hartenberg-frames-to-robotic-arms/ [Accessed 2022].
3. Association, R. I., 2015. The First Industrial Robot. [Online] Available at:
https://www.automate.org/a3-content/joseph-engelberger-unimate [Accessed 2022].
4. Ernest L. Hall, U. o. C., 2015. Introduction to Robotics - End Effectors. [Online]
Available at: https://www.researchgate.net/publication/282976515_Robotics_1_Lec-
ture_7_End_Effectors [Accessed 2022].
5. Illinois, U. o., 2015. Robot Kinematics. [Online] Available at: http://motion.cs.illi-
nois.edu/RoboticSystems/Kinematics.html [Accessed 2022].
6. Inc, I., 2021. Moore's Law and Intel Innovation. [Online] Available at:
https://www.intel.co.uk/content/www/uk/en/history/museum-gordon-moore-
law.html [Accessed 2022].
7. Intel.inc, 2016. Industrial Robotic Arms: Changing How Work Gets Done. [Online]
Available at: https://www.intel.com/content/www/us/en/robotics/robotic-arm.html
[Accessed 2022].
8. Moran, M. E., 2007. Evolution of robotic arms. [Online] Available at:
https://www.ncbi.nlm.nih.gov/pmc/arti-
cles/PMC4247431/#:~:text=Unimate%20introduced%20the%20first%20industrial,a
%20robotic%20arm%20in%201993. [Accessed 2022].
9. Robotics, 2021. DYNAMIXEL Shield. [Online] Available at: https://emanual.ro-
botis.com/docs/en/parts/interface/dynamixel_shield [Accessed 2022].
10. Smith, E., 2018. Going Through The Motions. [Online] Available at: https://te-
dium.co/2018/04/19/robotic-arm-history-unimate-versatran/ [Accessed 2022].
11. V. Kumar, P. E. U. o. P. S. o. E. a. A. S., 2016. Introduction to Robot Geometry and
Kinematics. [Online] Available at: https://www.seas.up-
enn.edu/~meam520/notes02/IntroRobotKinematics5.pdf [Accessed 2022].
12. VD Manolescu, EL Secco, Design of an Assistive Low-Cost 6 d.o.f. Robotic Arm
with Gripper, 7th International Congress on Information and Communication Tech-
nology (ICICT 2022), Lecture Notes in Networks and Systems (ISSN: 2367-3370)
13. S Procter, EL Secco, Design of a Biomimetic BLDC Driven Robotic Arm for Tele-
operation & Biomedical Applications, Journal of Human, Earth, and Future (ISSN:
2785-2997), 2022

View publication stats

You might also like