0% found this document useful (0 votes)
132 views16 pages

Robotics Project

The document describes a robotics project involving the ROT3U robot. It provides details on the ROT3U specifications and link lengths. It then discusses developing the forward and inverse kinematics models of the robot. For forward kinematics, it defines the transformation matrices and uses MATLAB to calculate the end effector position. For inverse kinematics, it uses MATLAB functions to solve for the joint angles given an end effector position. It also outlines deriving the inverse kinematic equations directly from the transformation matrix. The goal is to control the ROT3U using an Arduino application to perform tasks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views16 pages

Robotics Project

The document describes a robotics project involving the ROT3U robot. It provides details on the ROT3U specifications and link lengths. It then discusses developing the forward and inverse kinematics models of the robot. For forward kinematics, it defines the transformation matrices and uses MATLAB to calculate the end effector position. For inverse kinematics, it uses MATLAB functions to solve for the joint angles given an end effector position. It also outlines deriving the inverse kinematic equations directly from the transformation matrix. The goal is to control the ROT3U using an Arduino application to perform tasks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Robotics Project

2D Lineart using ROT3U

Submitted to

Dr. Khawaja Fahad

Submitted by

Muhammad Abdullah Younas (267123)

Muhammad Ammar (266446)

Muhammad Moeed Ahmed (266438)

Khezar Qayyuum (244604)

18 Jan 2022

1
Table of Contents
Introduction .................................................................................................................................................. 3
ROT3U.......................................................................................................................................................... 3
Link Lengths .................................................................................................................................................. 3
DH Table ........................................................................................................................................................ 3
Forward Kinematics ...................................................................................................................................... 4
Transformation Matrices .......................................................................................................................... 4
End effector coordinates .......................................................................................................................... 5
Inverse Kinematics ........................................................................................................................................ 5
MATLAB Method ....................................................................................................................................... 5
MATLAB code ........................................................................................................................................ 6
Results ................................................................................................................................................... 6
Inverse Kinematic Equations ..................................................................................................................... 7
Transformation Matrix .......................................................................................................................... 7
Inverse kinematic equations ................................................................................................................. 8
Developing Application for ROT3U ............................................................................................................... 8
Code .......................................................................................................................................................... 9
Comments and Results ............................................................................................................................... 15
References .................................................................................................................................................. 16

2
Introduction
The aim of the project is to find the forward and inverse kinematics of the robotics manipulator
ROT3U. The we develop an application by controlling the ROT3U using an Arduino and
perform a certain task.

ROT3U
ROT3U is a 6DOF robot with the following specifications

• Radius of gyration: 355mm.


• Rotation angle of 180 degrees.
• Height: 460mm (holder closed).
• Holder of the widest distance: 98mm.

Figure 1 ROT3U

Link Lengths
Link lengths of the robot were measured to be:

𝐿1 = 46𝑚𝑚

𝐿2 = 104𝑐𝑚

𝐿3 = 100𝑚

𝐿4 = 20𝑚𝑚

DH Table
i ai−1 𝛼i−1 di 𝜃i
1 0 0 0 𝜃1
2 46 90° 35 𝜃2
3 104 0 0 𝜃3
4 100 0 0 𝜃4
[5 20 90° 40 𝜃5 ]

3
Forward Kinematics
Forward kinematics refers to the use of the kinematic equations of a robot to compute the
position of the end-effector from specified values for the joint parameters.

Transformation Matrices
We compute each of the link transformations:

𝑐𝑖 −𝑠𝑖 0 𝛼𝑖−1
𝑖−1 𝑠𝑖 𝑐𝛼 𝑖−1 𝑐𝑖 𝑐𝛼𝑖−1 −𝑠𝛼𝑖−1 −𝑠𝛼𝑖−1 𝑑𝑖
𝑖𝑇 = [ ]
𝑠𝑖 𝑠𝛼𝑖−1 𝑐𝑖 𝑠𝛼𝑖−1 𝑐𝛼𝑖−1 𝑐𝛼𝑖−1 𝑑𝑖
0 0 0 1

𝑐1 −𝑠1 0 0
0 𝑠1 𝑐1 0 0
1𝑇 = [ ]
0 0 1 0
0 0 0 1

𝑐2 −𝑠2 0 0.035
1 0 0 −1 𝑑2
2𝑇 = [ ]
𝑠2 𝑐2 0 0
0 0 0 1

−𝑐3 𝑠3 0 0.105
2 −𝑠 −𝑐3 0 0
3𝑇 =[ 3 ]
0 0 1 0
0 0 0 1

−𝑐3 𝑠3 0 0.1
3 −𝑠3 −𝑐3 0 0
4𝑇 = [ ]
0 0 1 0
0 0 0 1

𝑐5 −𝑠5 0 0.025
4 0 0 −1 𝑑5
5𝑇 = [ ]
𝑠5 𝑐5 0 0
0 0 0 1

Now we find 05𝑇 by matrix multiplication of individual link matrices.

0
5𝑇 = 01𝑇 ∗ 12𝑇 ∗ 23𝑇 ∗ 34𝑇 ∗ 45𝑇

4
Finding the transformation matrix is a very tedious process, which can be made simple by using
the following MATLAB code:

syms c1 s1 c2 s2 c3 s3 c4 s4 c5 s5
t1 = [c1 -s1 0 0;s1 c1 0 0;0 0 1 0;0 0 0 1]
t2 = [c2 -s2 0 46;0 0 -1 35;s2 c2 0 0;0 0 0 1]
t3 = [c3 -s3 0 104;s3 c3 0 0;0 0 1 0;0 0 0 1
t4 = [c4 -s4 0 100;s4 c4 0 0;0 0 1 0;0 0 0 1
t4 = [c4 -s4 0 100;s4 c4 0 0;0 0 1 0;0 0 0 1
t5 = [c5 -s5 0 20;0 0 -1 40;s5 c5 0 0;0 0 0 1
A = t1*t2*t3*t4*t5
Where A represents 05𝑇

End effector coordinates


To find end effector coordinates, we only need to multiply the transformation matrices However,
it is inconvenient for this many transformation matrices due to its size. Therefore, we use a
MATLAB to make this calculation easier for us. The above code is written for the matrix
calculation and the can it gives us a 4x4 matrix. The first 3 values of the last column represent
the coordinates of the end effector in space.

The end effector coordinates using MATLAB turn out to be:

𝑝𝑥 = 46 ∗ 𝑐1 − 35 ∗ 𝑠1 + 104 ∗ 𝑐1 ∗ 𝑐2 − 40 ∗ 𝑐4 ∗ (𝑐1 ∗ 𝑐2 ∗ 𝑠3 + 𝑐1 ∗ 𝑐3 ∗ 𝑠2) + 20 ∗ 𝑐4 ∗ (𝑐1


∗ 𝑐2 ∗ 𝑐3 − 𝑐1 ∗ 𝑠2 ∗ 𝑠3) − 20 ∗ 𝑠4 ∗ (𝑐1 ∗ 𝑐2 ∗ 𝑠3 + 𝑐1 ∗ 𝑐3 ∗ 𝑠2) − 40 ∗ 𝑠4 ∗ (𝑐1
∗ 𝑐2 ∗ 𝑐3 − 𝑐1 ∗ 𝑠2 ∗ 𝑠3) + 100 ∗ 𝑐1 ∗ 𝑐2 ∗ 𝑐3 − 100 ∗ 𝑐1 ∗ 𝑠2 ∗ 𝑠3

𝑝𝑦 = 35 ∗ 𝑐1 + 46 ∗ 𝑠1 + 104 ∗ 𝑐2 ∗ 𝑠1 − 40 ∗ 𝑐4 ∗ (𝑐2 ∗ 𝑠1 ∗ 𝑠3 + 𝑐3 ∗ 𝑠1 ∗ 𝑠2) + 20 ∗ 𝑐4 ∗ (𝑐2


∗ 𝑐3 ∗ 𝑠1 − 𝑠1 ∗ 𝑠2 ∗ 𝑠3) − 20 ∗ 𝑠4 ∗ (𝑐2 ∗ 𝑠1 ∗ 𝑠3 + 𝑐3 ∗ 𝑠1 ∗ 𝑠2) − 40 ∗ 𝑠4 ∗ (𝑐2
∗ 𝑐3 ∗ 𝑠1 − 𝑠1 ∗ 𝑠2 ∗ 𝑠3) + 100 ∗ 𝑐2 ∗ 𝑐3 ∗ 𝑠1 − 100 ∗ 𝑠1 ∗ 𝑠2 ∗ 𝑠3

𝑝𝑧 = 104 ∗ 𝑠2 + 100 ∗ 𝑐2 ∗ 𝑠3 + 100 ∗ 𝑐3 ∗ 𝑠2 + 20 ∗ 𝑐4 ∗ (𝑐2 ∗ 𝑠3 + 𝑐3 ∗ 𝑠2) + 40 ∗ 𝑐4 ∗ (𝑐2


∗ 𝑐3 − 𝑠2 ∗ 𝑠3) − 40 ∗ 𝑠4 ∗ (𝑐2 ∗ 𝑠3 + 𝑐3 ∗ 𝑠2) + 20 ∗ 𝑠4 ∗ (𝑐2 ∗ 𝑐3 − 𝑠2 ∗ 𝑠3)

Inverse Kinematics
Inverse kinematics is the mathematical process of calculating the variable joint parameters
needed to place the end of a kinematic chain in each position and orientation relative to the start
of the chain.

MATLAB Method
Finding the inverse kinematics of a 5 DOF robot is a very computational method. Instead, of
solving it manually, we can make use of MATLAB. We use the robotics toolbox for this purpose

5
[1]. The ‘fkine()’ command calculates the forwards kinematics of the robot and thus finds the
end effector coordinates. The ‘ikine()’ command calculates the inverse kinematics of the robot
and calculates the joint angles using the end effector coordinates [2].

MATLAB code
close all
L(1) = Link([0 0 0 0], 'standard');
L(2) = Link([0 35 46 pi/2], 'standard');
L(3) = Link([0 0 104 0], 'standard');
L(4) = Link([0 0 100 0], 'standard');
L(5) = Link([0 40 20 pi/2], 'standard');
KR = SerialLink(L)
qf= [pi/6 -pi/8 -pi/4 pi/8 0];
Tf = KR.fkine(qf);
q0= [0 0 0 0 0];
q=KR.ikine(Tf, q0, 'mask', [1 1 1 1 1 0]);

Results

Figure 2 DH table generated in MATLAB

Figure 3 Results of solving inverse kinematics

6
Inverse Kinematic Equations
Even though the above MATLAB program solves the inverse kinematics for the robot, it does
not provide us with the inverse kinematic equations. To solve for the inverse kinematic
equations, we use the method represented in [3].

Transformation Matrix
Finding the transformation matrix is a very tedious process, which can be made simple by using
the following MATLAB code:

syms c1 s1 c2 s2 c3 s3 c4 s4 c5 s5
t1 = [c1 -s1 0 0;s1 c1 0 0;0 0 1 0;0 0 0 1]
t2 = [c2 -s2 0 46;0 0 -1 35;s2 c2 0 0;0 0 0 1]
t3 = [c3 -s3 0 104;s3 c3 0 0;0 0 1 0;0 0 0 1
t4 = [c4 -s4 0 100;s4 c4 0 0;0 0 1 0;0 0 0 1
t4 = [c4 -s4 0 100;s4 c4 0 0;0 0 1 0;0 0 0 1
t5 = [c5 -s5 0 20;0 0 -1 40;s5 c5 0 0;0 0 0 1
A = t1*t2*t3*t4*t5
Where A represents 05𝑇

Transformation matrix representation for equations


The transformation matrix is then represented in the following way
𝑛𝑥 𝑜𝑥 𝑎𝑥 𝑝𝑥
0
𝑛𝑦 𝑜𝑦 𝑎𝑦 𝑝𝑦
5𝑇 = [𝑛 𝑜𝑧 𝑎𝑧 𝑝𝑧
]
𝑧
0 0 0 1

Comparing the above notation with 05𝑇 calculated using MATLAB

𝑛𝑥 = 𝑠1 ∗ 𝑠5 + 𝑐5 ∗ (𝑐4 ∗ (𝑐1 ∗ 𝑐2 ∗ 𝑐3 − 𝑐1 ∗ 𝑠2 ∗ 𝑠3) − 𝑠4 ∗ (𝑐1 ∗ 𝑐2 ∗ 𝑠3 + 𝑐1 ∗ 𝑐3 ∗ 𝑠2))

𝑛𝑦 = 𝑐5 ∗ (𝑐4 ∗ (𝑐2 ∗ 𝑐3 ∗ 𝑠1 − 𝑠1 ∗ 𝑠2 ∗ 𝑠3) − 𝑠4 ∗ (𝑐2 ∗ 𝑠1 ∗ 𝑠3 + 𝑐3 ∗ 𝑠1 ∗ 𝑠2)) − 𝑐1 ∗ 𝑠5

𝑛𝑧 = 𝑐5 ∗ (𝑐4 ∗ (𝑐2 ∗ 𝑠3 + 𝑐3 ∗ 𝑠2) + 𝑠4 ∗ (𝑐2 ∗ 𝑐3 − 𝑠2 ∗ 𝑠3))

𝑜𝑥 = 𝑐5 ∗ 𝑠1 − 𝑠5 ∗ (𝑐4 ∗ (𝑐1 ∗ 𝑐2 ∗ 𝑐3 − 𝑐1 ∗ 𝑠2 ∗ 𝑠3) − 𝑠4 ∗ (𝑐1 ∗ 𝑐2 ∗ 𝑠3 + 𝑐1 ∗ 𝑐3 ∗ 𝑠2))\

𝑜𝑦 = − 𝑐1 ∗ 𝑐5 − 𝑠5 ∗ (𝑐4 ∗ (𝑐2 ∗ 𝑐3 ∗ 𝑠1 − 𝑠1 ∗ 𝑠2 ∗ 𝑠3) − 𝑠4 ∗ (𝑐2 ∗ 𝑠1 ∗ 𝑠3 + 𝑐3 ∗ 𝑠1 ∗ 𝑠2))

𝑜𝑧 = −𝑠5 ∗ (𝑐4 ∗ (𝑐2 ∗ 𝑠3 + 𝑐3 ∗ 𝑠2) + 𝑠4 ∗ (𝑐2 ∗ 𝑐3 − 𝑠2 ∗ 𝑠3))

𝑎𝑥 = 𝑐4 ∗ (𝑐1 ∗ 𝑐2 ∗ 𝑠3 + 𝑐1 ∗ 𝑐3 ∗ 𝑠2) + 𝑠4 ∗ (𝑐1 ∗ 𝑐2 ∗ 𝑐3 − 𝑐1 ∗ 𝑠2 ∗ 𝑠3)

𝑎𝑦 = 𝑐4 ∗ (𝑐2 ∗ 𝑠1 ∗ 𝑠3 + 𝑐3 ∗ 𝑠1 ∗ 𝑠2) + 𝑠4 ∗ (𝑐2 ∗ 𝑐3 ∗ 𝑠1 − 𝑠1 ∗ 𝑠2 ∗ 𝑠3)

𝑎𝑧 = 𝑠4 ∗ (𝑐2 ∗ 𝑠3 + 𝑐3 ∗ 𝑠2) − 𝑐4 ∗ (𝑐2 ∗ 𝑐3 − 𝑠2 ∗ 𝑠3)

7
𝑝𝑥 = 46 ∗ 𝑐1 − 35 ∗ 𝑠1 + 104 ∗ 𝑐1 ∗ 𝑐2 − 40 ∗ 𝑐4 ∗ (𝑐1 ∗ 𝑐2 ∗ 𝑠3 + 𝑐1 ∗ 𝑐3 ∗ 𝑠2) + 20 ∗ 𝑐4 ∗ (𝑐1
∗ 𝑐2 ∗ 𝑐3 − 𝑐1 ∗ 𝑠2 ∗ 𝑠3) − 20 ∗ 𝑠4 ∗ (𝑐1 ∗ 𝑐2 ∗ 𝑠3 + 𝑐1 ∗ 𝑐3 ∗ 𝑠2) − 40 ∗ 𝑠4 ∗ (𝑐1
∗ 𝑐2 ∗ 𝑐3 − 𝑐1 ∗ 𝑠2 ∗ 𝑠3) + 100 ∗ 𝑐1 ∗ 𝑐2 ∗ 𝑐3 − 100 ∗ 𝑐1 ∗ 𝑠2 ∗ 𝑠3

𝑝𝑦 = 35 ∗ 𝑐1 + 46 ∗ 𝑠1 + 104 ∗ 𝑐2 ∗ 𝑠1 − 40 ∗ 𝑐4 ∗ (𝑐2 ∗ 𝑠1 ∗ 𝑠3 + 𝑐3 ∗ 𝑠1 ∗ 𝑠2) + 20 ∗ 𝑐4 ∗ (𝑐2


∗ 𝑐3 ∗ 𝑠1 − 𝑠1 ∗ 𝑠2 ∗ 𝑠3) − 20 ∗ 𝑠4 ∗ (𝑐2 ∗ 𝑠1 ∗ 𝑠3 + 𝑐3 ∗ 𝑠1 ∗ 𝑠2) − 40 ∗ 𝑠4 ∗ (𝑐2
∗ 𝑐3 ∗ 𝑠1 − 𝑠1 ∗ 𝑠2 ∗ 𝑠3) + 100 ∗ 𝑐2 ∗ 𝑐3 ∗ 𝑠1 − 100 ∗ 𝑠1 ∗ 𝑠2 ∗ 𝑠3

𝑝𝑧 = 104 ∗ 𝑠2 + 100 ∗ 𝑐2 ∗ 𝑠3 + 100 ∗ 𝑐3 ∗ 𝑠2 + 20 ∗ 𝑐4 ∗ (𝑐2 ∗ 𝑠3 + 𝑐3 ∗ 𝑠2) + 40 ∗ 𝑐4 ∗ (𝑐2


∗ 𝑐3 − 𝑠2 ∗ 𝑠3) − 40 ∗ 𝑠4 ∗ (𝑐2 ∗ 𝑠3 + 𝑐3 ∗ 𝑠2) + 20 ∗ 𝑠4 ∗ (𝑐2 ∗ 𝑐3 − 𝑠2 ∗ 𝑠3)

Inverse kinematic equations


The inverse kinematics equations turn out to be:

θ2 = tan-1 (py/px)

θ1 = θ12 - θ2

θ3 = tan-1 (s3/c3)

θ4 = tan-1 (s4/c4) ±√(1 + 𝑐42 )

θ5 = θ345 - θ34,

where,

θ34 = - tan-1 {(c12*px+s12*py)/pz}

θ345 = tan-1 {(-az)/(c2*ax+s2*ay)}

Developing Application for ROT3U


The way ROT3U manipulator is controlled is that we input the x, y, and z axis coordinates of the
desired location within the workspace of the manipulator. The code calculates the joint angles
required for that purpose using inverse kinematics as calculated in the previous parts.

The proposed application is live sketching in the x, y plane. A drawing item will be placed at the
end of the manipulator. The manipulator only changes its position in the x, y plane since it is a
2D sketch. The way the input commands will work is that instead of typing the coordinates of the
end effector in code, a touch screen will be calibrated such that the transverse position of finger
on the screen will indicate x coordinate and lateral position of finger on the screen will indicate y
coordinate. These coordinates are to be within the workspace of the manipulator. With the x and
y coordinates of end effector provided via a live feed, the manipulator will follow the path drawn

8
on the screen. This way, live sketching can be done using the manipulator via providing inputs
through a touch screen.

Code
The code shown is used to control x, y, z position of the end effector of ROT3U [4]. The servo
speeds are also controlled in this code to control the speed of the robot. The code also includes
comments explaining each step of the process.
#include VarSpeedServo.h

#define BASE_HGT 46 //base height

#define HUMERUS 104 //shoulder-to-elbow "bone"

#define ULNA 100 //elbow-to-wrist "bone"

#define GRIPPER 20 //gripper (incl.heavy duty wrist rotate mechanism) length "

#define ftl(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) //float to long conversion/* Servo names/numbers *

* Base servo HS-485HB */

#define BAS_SERVO 4

/* Shoulder Servo HS-5745-MG */

#define SHL_SERVO 5

/* Elbow Servo HS-5745-MG */

#define ELB_SERVO 6

/* Wrist servo HS-645MG */

#define WRI_SERVO 7

/* Wrist rotate servo HS-485HB */

#define WRO_SERVO 8

/* Gripper servo HS-422 */

#define GRI_SERVO 9

/* pre-calculations */

float hum_sq = HUMERUS*HUMERUS;

float uln_sq = ULNA*ULNA;

9
int servoSPeed = 10;

//ServoShield servos; //ServoShield object

VarSpeedServo servo1,servo2,servo3,servo4,servo5,servo6;

int loopCounter=0;

int pulseWidth = 6.6;

int microsecondsToDegrees;

void setup()

servo1.attach( BAS_SERVO, 544, 2400 );

servo2.attach( SHL_SERVO, 544, 2400 );

servo3.attach( ELB_SERVO, 544, 2400 );

servo4.attach( WRI_SERVO, 544, 2400 );

servo5.attach( WRO_SERVO, 544, 2400 );

servo6.attach( GRI_SERVO, 544, 2400 );

delay( 5500 );

//servos.start(); //Start the servo shield

servo_park();

delay(4000);

Serial.begin( 9600 );

Serial.println("Start");

void loop()

loopCounter +=1;

//set_arm( -300, 0, 100, 0 ,10); //

//delay(7000);

10
//zero_x();

//line();

//circle();

delay(4000);

if (loopCounter > 1) {

servo_park();

//set_arm( 0, 0, 0, 0 ,10); // park

delay(5000);

exit(0); }//pause program - hit reset to continue

//exit(0);

/* arm positioning routine utilizing inverse kinematics */

/* z is height, y is distance from base center out, x is side to side. y,z can only be positive */

//void set_arm( uint16_t x, uint16_t y, uint16_t z, uint16_t grip_angle )

void set_arm( float x, float y, float z, float grip_angle_d, int servoSpeed )

float grip_angle_r = radians( grip_angle_d ); //grip angle in radians for use in calculations

/* Base angle and radial distance from x,y coordinates */

float bas_angle_r = atan2( x, y );

float rdist = sqrt(( x * x ) + ( y * y ));

/* rdist is y coordinate for the arm */

y = rdist;

/* Grip offsets calculated based on grip angle */

float grip_off_z = ( sin( grip_angle_r )) * GRIPPER;

float grip_off_y = ( cos( grip_angle_r )) * GRIPPER;

/* Wrist position */

11
float wrist_z = ( z - grip_off_z ) - BASE_HGT;

float wrist_y = y - grip_off_y;

/* Shoulder to wrist distance ( AKA sw ) */

float s_w = ( wrist_z * wrist_z ) + ( wrist_y * wrist_y );

float s_w_sqrt = sqrt( s_w );

/* s_w angle to ground */

float a1 = atan2( wrist_z, wrist_y );

/* s_w angle to humerus */

float a2 = acos((( hum_sq - uln_sq ) + s_w ) / ( 2 * HUMERUS * s_w_sqrt ));

/* shoulder angle */

float shl_angle_r = a1 + a2;

float shl_angle_d = degrees( shl_angle_r );

float elb_angle_r = acos(( hum_sq + uln_sq - s_w ) / ( 2 * HUMERUS * ULNA ));

float elb_angle_d = degrees( elb_angle_r );

float elb_angle_dn = -( 180.0 - elb_angle_d );

float wri_angle_d = ( grip_angle_d - elb_angle_dn ) - shl_angle_d;

float bas_servopulse = 1500.0 - (( degrees( bas_angle_r )) * pulseWidth );

float shl_servopulse = 1500.0 + (( shl_angle_d - 90.0 ) * pulseWidth );

float elb_servopulse = 1500.0 - (( elb_angle_d - 90.0 ) * pulseWidth );

//float wri_servopulse = 1500 + ( wri_angle_d * pulseWidth );

//float wri_servopulse = 1500 + ( wri_angle_d * pulseWidth );

float wri_servopulse = 1500 - ( wri_angle_d * pulseWidth );

//servos.setposition( BAS_SERVO, ftl( bas_servopulse ));

microsecondsToDegrees = map(ftl(bas_servopulse),544,2400,0,180);

servo1.write(microsecondsToDegrees,servoSpeed); // use this function so that you can set servo speed //

//servos.setposition( SHL_SERVO, ftl( shl_servopulse ));

12
microsecondsToDegrees = map(ftl(shl_servopulse),544,2400,0,180);

servo2.write(microsecondsToDegrees,servoSpeed);

//servos.setposition( ELB_SERVO, ftl( elb_servopulse ));

microsecondsToDegrees = map(ftl(elb_servopulse),544,2400,0,180);

servo3.write(microsecondsToDegrees,servoSpeed);

//servos.setposition( WRI_SERVO, ftl( wri_servopulse ));

microsecondsToDegrees = map(ftl(wri_servopulse),544,2400,0,180);

servo4.write(microsecondsToDegrees,servoSpeed);

/* move servos to parking position */

void servo_park()

//servos.setposition( BAS_SERVO, 1500 );

servo1.write(90,10);

//servos.setposition( SHL_SERVO, 2100 );

servo2.write(90,10);

//servos.setposition( ELB_SERVO, 2100 );

servo3.write(90,10);

//servos.setposition( WRI_SERVO, 1800 );

servo4.write(90,10);

//servos.setposition( WRO_SERVO, 600 );

servo5.write(90,10);

//servos.setposition( GRI_SERVO, 900 );

servo6.write(80,10);

return;

13
void zero_x()

for( double yaxis = 250.0; yaxis < 400.0; yaxis += 1 ) {

Serial.print(" yaxis= : ");Serial.println(yaxis);

set_arm( 0, yaxis, 200.0, 0 ,10);

delay( 10 );

for( double yaxis = 400.0; yaxis > 250.0; yaxis -= 1 ) {

set_arm( 0, yaxis, 200.0, 0 ,10);

delay( 10 );

/* moves arm in a straight line */

void line()

for( double xaxis = -100.0; xaxis < 100.0; xaxis += 0.5 ) {

set_arm( xaxis, 250, 120, 0 ,10);

delay( 10 );

for( float xaxis = 100.0; xaxis > -100.0; xaxis -= 0.5 ) {

set_arm( xaxis, 250, 120, 0 ,10);

delay( 10 );

void circle()

14
#define RADIUS 50.0

//float angle = 0;

float zaxis,yaxis;

for( float angle = 0.0; angle < 360.0; angle += 1.0 ) {

yaxis = RADIUS * sin( radians( angle )) + 300;

zaxis = RADIUS * cos( radians( angle )) + 200;

set_arm( 0, yaxis, zaxis, 0 ,50);

delay( 10 );

Comments and Results


The code has not yet been fully developed for the proposed application. The current code only
moves the end effector to the single x, y, and z position that is input in the code uploaded to the
Arduino. The first step is to calibrate a screen for x and y position of the robot. It is necessary
that the ranges of the coordinates on the screen are within the workspace of the manipulator.
After that is done, we need to establish a live connection between the Arduino and the screen so
input commands can be given as soon as they are input.

A problem that might occur is that the Arduino does not solve the code fast enough before the
next input comes. Thus, there might be a delay in the manipulator results compared to the input
speed of the sketch.

Even though this is a very limited application and seemingly impractical, it still is useful in the
engineering world as it brings forth avenue for further development. The code might be altered to
draw an engineering drawing that is input through a vector file. It might be programmed to write
signatures on documents. Therefore, it is not important of how useful an application is, as long as
it provides developments in the engineering world, it is enough to pursue it. A simple example of
this can be seen in mathematics in Fermat’s Last theorem which on itself, does not hold much
value, but the Mathematical advancements that occurred due to it do [5].

15
References
[1] petercorke ROBOTICS TOOLBOX. Available at:
https://petercorke.com/toolboxes/robotics-toolbox/ (Accessed 2 Jan 2020)

[2] petercorke SerialLink. Available at:


https://www.petercorke.com/RTB/r9/html/SerialLink.html (Accessed 2 Jan 2020)

[3] Deshpande, V, George, P (2014) ‘KINEMATIC MODELLING AND ANALYSIS OF 5 DOF ROBOTIC ARM’
International Journal of Robotics, Vol. 4, Issue 2, 17-24

[4] instructable circuits Using Arduino Uno for XYZ Positioning of 5 DOF Robotic arm

https://www.instructables.com/Using-Arduino-Uno-for-XYZ-Positioning-of-6-DOF-Rob/ (Accessed 18 Jan 2022)

[5] Qoura Why is Fermat’s Last Theorem Considered Beautiful

https://www.quora.com/Why-is-Fermats-Last-Theorem-considered-beautiful (Accessed 18 Jan 2022)

16

You might also like