Published: 07 November 2020

The control of a five-axis robotic arm and its experimental application

Ozcan Cetinkaya1
Hilmi Kuscu2
Kenan Kilicaslan3
1Kesan Vocational School, Trakya University, Edirne, Turkey
2Faculty of Engineering, Department of Mechanical Engineering, Trakya University, Edirne, Turkey
3Giresun Governorship, Giresun, Turkey
Corresponding Author:
Ozcan Cetinkaya
Editor's Pick
Views 470
Reads 198
Downloads 1155

Abstract

The study discusses the control of a five-axis robotic arm, the orbit planning involved, and experimental applications that make use of the arm. A robotic arm unit located at the Trakya University has been used for the study; LabVIEW 2010 (student edition) and MATLAB 2010a (student edition) applications have been used for the orbit planning programs and the arm has been successfully operated. Using the program developed, the coordinates of the starting and ending positions for the robotic arm have been specified on a three-dimensional Cartesian coordinate system and inverse kinematics computations have been performed, resulting in the movement of the arm.

1. Introduction

In this study, the control of a five-axis robotic arm, including computation of its orbit, has been achieved. The MATLAB 2010a (student edition) and LabVIEW 2010 (student edition) applications have been used to perform the computations. A PC expansion card, manufactured by JS Automation (part number AIO-3320) and having LabVIEW support, has been used to communicate with the robotic arm through the PCI port. The values obtained through the inverse kinematics computations performed using the LabVIEW and MATLAB applications have been relayed to the robotic arm over the AIO-3320 expansion card, using LabVIEW [1].

2. Problem statement

The analytical calculation method has been chosen for use when performing forward and inverses kinematics computations. The robotic arm is rotated using servo motors. LabVIEW, a graphical programming environment, has been used as the programming language. The LabVIEW system was chosen for its capability for parallel computation. It has been possible to simultaneously operate more than one servo motor with this parallel operation capability. Additionally, LabVIEW provides support to run MATLAB scripts and functions. (This requires MATLAB to be installed on the PC along with LabVIEW.)

MATLAB has been used for analytical calculations, for matrix operations (e.g. matrix multiplication, finding inverses), and for solving non-linear equations.

2.1. Forward kinematics computations for the robotic arm

The Denavit-Hartenberg method has been used to obtain the forward kinematics models. As shown in Fig. 2, joint variables and constants are defined using the Denavit-Hartenberg method and the coordinate systems are placed over the joints. [2]

Fig. 1The robotic arm used in the study

The robotic arm used in the study

Fig. 2Coordinate frames of the robotic arm with four degrees of freedom

Coordinate frames of the robotic arm with four degrees of freedom

The Denavit-Hartenberg variables are shown in Table 1. The parameters which do not change as a result of the motion of the robot are the length of the arm ai-1, and the angles of the axis αi-1. The parameters that vary are the joint angle θi (in case of a rotating joint), and the joint offset di (in case of a prismatic joint) [3].

The homogenous conversion matrix for the arm is shown below, where i is the axis number.

Table 1D-H variables

Axis number
D-H variables
Joint variable
i
αi-1
ai-1
di
θi
di or θi
1
0
0
h
θ1
θ1
2
90
0
0
θ2
θ2
3
0
l
0
θ3
θ3
4
0
0
0
θ4
θ4
5
0
0
0
θ5
θ5

si=sinθi and ci=cosθi. θi is the rotation angle and:

1
T50=R05p0501=r11r12r13pxr21r22r23pyr31r32r33pz0001.

R05 is the rotation matrix and p05 is the position vector. The transformation matrices for the first and the second joint are:

2
T01=c1-s100s1c100001h0001, T12=c2-s20000-10s2c2000001.

The transformation matrix for the third, fourth, and fifth joints is:

3
Ti-1i=ci-si0lsici0000100001.

The five transformation matrices that have been computed are multiplied to obtain the rotational matrix for the arm:

4
T05=T01T12T23T34T45.

The transformation matrices obtained through Eq. (1) and (4) are equivalent.

3. Result and discussion

We will use forward kinematics Eqs. (1) and (4) for computations Eq. (1) and (4) are equal to each other. By multiplying each side of the Eq. (4) with the inverse of T01, we obtain the Eq. (5).

Since T01-1T05=T01-1T01T12T23T34T45 and Ti-1i-1. Tii-1=I, it follows that:

5
T01-1T05=T12T23T34T45.

Let’s find the inverse matrices for all transformational matrices in Eq. (2) and Eq. (3), using the inv() function in MATLAB [4]:

6
Ti-1i-1=invTi-1i.

The position vectors located within Eq. (5) are mutually equalized and the following equations are then obtained:

7
pxc1+pys1l=c2c3 s2s3+c2+ c4c2c3 s2s3s4c2s3+c3s2,
8
θ1=atanpypx,
9
pz-hl=c2s3+ c3s2+ s2+ c4c2s3 + c3s2+ s4c2c3 - s2s3.

Let’s label the left-hand side of Eq. (7) as A:

10
pxc1+pys1l=A.

Similarly, let’s label the left-hand side of Eq. (9) as B:

11
pz-hl=B.

Each side of Eq. (5) is multiplied with T12-1:

12
T12-1T01-1T05=T12-1T12T23T34T45,
T12-1T01-1T05=T23T34T45.

In Eq. (12), the position vectors are equalized and the equations below are obtained:

13
s2B+c2A=1+c3c4 s3s4+c3,
14
c2B-s2A=c3s4 + c4s3+ s3.

Each side of Eq. (12) is multiplied with T23-1:

15
T23-1T12-1T01-1T05=T23-1T23T34T45,
T23-1T12-1T01-1T05=T34T45.

The position vectors in Eq. (15) are equalized, and the following equations are obtained:

16
c2s3+c3s2B-c3+c2c3 s2s3A=1+c4,
17
c2c3 s2s3B+ s3-c2s3 + c3s2A=s4.

In the inverse kinematics solution, the angle θ1 is solved from Eq. (8). The angles θ2, θ3 and θ4, on the other hand, are obtained through iterations. For the three unknowns, Eqs. (13, 14, 17) have been selected. The θ5 the angle indicates the open and close states of the end effector. This angle does not affect the position vector but affects only the rotation matrix.

3.1. Using Matlab to calculate the inverse kinematics

The fsolve() function of MATLAB was employed for the solution. This function solves non-linear equations through iteration. We had solved for angle θ1 using Eq. (8). To find the angles θ2, θ3 and θ4, we need three equations, for which Eqs. (13, 14, 17) have been chosen. The starting matrix for the iteration is x0= [0 0 0].

In the MATLAB function shown below, x1, x2, and x3 designate the unknown angles, corresponding to θ2, θ3 and θ4, respectively. The equations have been implemented as the MATLAB function below:

[x, fval, exitflag]=fsolve(@(x)[cos(x(1))*A+sin(x(1))*B-cos(x(2))* cos(x(3)) +sin(x(2))* sin(x(3)) - cos(x(2))-1; -sin(x(1))*A+cos(x(1))*B-sin(x(2))* cos(x(3))- cos(x(2))* sin(x(3)) - sin(x(2));-cos(x(1))*sin(x(2))*A-sin(x(1))* cos(x(2))*A + cos(x(1))* cos(x(2)) * B-sin(x(1))* sin(x(2))*B +sin(x(2))-sin(x(3))], x0);

In the function above, x designates the unknown vector, the FIDELITY VALUE FACTOR ETF (Fval) is an error, and the exit flag indicates whether or not a result has been obtained [5, 6].

3.2. Programming code

The student edition of LabVIEW has been used for programming. LabVIEW is a graphical programming environment. The program code below shows the inverse kinematics computations for orbit planning.

3.3. 3.2.1. Orbit planning using LabVIEW

The code moves the robotic arm from its starting position coordinate of (X1, Y1, Z1) to its ending position coordinate of (X2, Y2, Z2). Fig. 3 shows the corresponding user interface.

3.3.1. Outline for the orbit computation algorithm

1) Using the inverse-kinematic.vi function, compute the angles necessary for the starting position coordinate (Fig. 4).

2) Using inverse-kinematic3.vi, correct the computed angles.

3) Using the inverse-kinematic.vi function, compute the angles necessary for the ending position coordinate.

4) Using inverse-kinematic3.vi, correct the computed angles.

5) If steps 1, 2, 3 and 4 produce a solution and if the “Move arm along the orbit” box has been clicked:

a) Find the difference between t1A and t1B, convert it into the digital value required by the robotic arm, and bind the value to the “Difference of t1A and t1B” indicator.

b) Bind the state where t1A is larger than t1B to the “t1A > t1B” indicator.

c) Repeat steps a and b for remaining angles.

6) Illustrate a for loop running from 0 to 16384.

7) Within the for loop:

a) Use i, the loop variable, as the numeric value for the angle of the robotic arm.

b) Determine angle value as i_say = i_say + “rate of change of the angle”.

c) If the “t1A>t1B” indicator value is “true”, increment the numerical value of the t1A angle by the value of i_say; if “false”, decrement it by the value of i_say.

d) Convert the value in step c into degrees and bind it to the t1Y control.

e) Repeat steps a, b, c ,and d for remaining angles.

f) When the “t1A t1B” value and the corresponding values for the remaining angles are less than the value of i_say, or when the “arm is moving” indicator light is off, exit the loop.

g) Move the arm to the position indicated by t1Y and the remaining angles.

Table 2Functions used in orbit planning [6]

Name of function
Symbol
Description
T01.vi
Functions used in orbit planning [6]
Creates transformation matrix using height (-h), arm length (-L), and angle values.
forward-kinematic.vi
Functions used in orbit planning [6]
Creates transformation matrixes from the start to the end positions, and vectors PX, PY and PZ, based on the transformation matrix.
inverse-kinematic.vi
Functions used in orbit planning [6]
Computes the angles t2, t3 and t4 as well as other items from coordinates X, Y, and Z.
inverse-kinematic3.vi
Functions used in orbit planning [6]
Moves angles computed by the inverse-kinematic.vi function into arm boundaries.
aio3320_signal_transformation.vi
Functions used in orbit planning [6]
Converts an angle value in degrees to analog/digital signals or converts analog/digital signals into an angle value in degrees.

Fig. 3The user interface showing the “Orbit” tab

The user interface showing the “Orbit” tab

3.3.2. LabVIEW diagrams for the “Orbit” tab

Fig. 5 shows the calculation of the starting and ending angles using the “inversekinematic.vi” function. The output contains indicators t1A, t1B, t2A1, t2B1, t3A1, t3B1, t4A1, and t4B1.

Fig. 4The LabVIEW code for “inversekinematic.vi” making use of MATLAB

The LabVIEW code for “inversekinematic.vi” making use of MATLAB

Fig. 5Calculation of the starting and ending angles using the inversekinematic.vi function

Calculation of the starting and ending angles using the inversekinematic.vi function

Fig. 6Correction of the starting and ending angles

Correction of the starting and ending angles

Figs. 6 show corrections applied to the angles computed in Fig. 5, using the inversekinematic3.vi function. Angle t2A1 is transformed to t2A, angle t3A1 to t3A, and angle t4A1 to t4A; the same applies to t2B, t3B, and t4B. For the computation of the orbit, the angle θ1 of the robotic arm will change from t1A to t1B, the angle θ2 from t2A to t2B, the angle θ3 from t3A to t3B, and angle θ4 from t4A to t4B. The change of the angles from A to B is accomplished using a for loop shown in Fig. 7.

Fig. 7The program for-loop [7, 8]

The program for-loop [7, 8]

The for-loop shown in Fig. 7 is located in a case structure having the conditions shown in Fig. 8. To move the arm, the angles of the positions A and B must be calculated, the “No Solution” indicator light must be off, and the “Move arm along the orbit” button must be clicked.

Fig. 8Condition for the robotic arm movement within the “Orbit” tab

Condition for the robotic arm movement within the “Orbit” tab

Fig. 9Determining the differences of the angles for positions A and B, and whether they are large or small

Determining the differences of the angles for positions A and B, and whether they are large or small
Determining the differences of the angles for positions A and B, and whether they are large or small
Determining the differences of the angles for positions A and B, and whether they are large or small
Determining the differences of the angles for positions A and B, and whether they are large or small

Fig. 9 shows the differences between the angles for position A and the angles for position B having been converted into the digital values required by the arm. Additionally, for each angle, a boolean indicator has been used to indicate whether the movement from A to B will be in increasing or decreasing terms. If angle A is larger than angle B, this indicator is set to true; otherwise, the indicator is set to false.

3.3.2.1. Diagrams within the for loop

The transition of the arm from position A to position B is accomplished using for a loop.

For the angles to get closer to position B from position A, on each iteration through the loop, the angles are adjusted by the value contained in i_say. The for loop variable i is at value zero at the start of the for a loop. For each iteration of the loop, its value is incremented by 1. It runs if the condition of the case structure shown in Fig. 10 is “true”. It sets the i_say indicator value to zero. In Fig. 10, the value contained within “The angle rate of change” control is added to the value of i_say, and its output is assigned to i_say.

Fig. 10Definition of angle increment and decrement values within the for loop

Definition of angle increment and decrement values within the for loop

Fig. 11Conditions for an early exit from the for loop

Conditions for an early exit from the for loop

In the program code shown in Fig. 11, the value of the i_say indicator is continuously incremented. When the value of i_say is larger than the difference of the angles for position A and position B, the loop is exited. This means that the arm has arrived at position B.

We will now describe the block diagrams shown in Fig. 12. The condition for the case structure shown in (1) is the “t1A > t1B” indicator. If this value is “true”, the approach from the t1A value to t1B value is in increments of i_say; otherwise, if the value is “false”, the approach is in decrements. The values are converted to degrees using mathematical processing at the output the of case (1). This value goes to t1Y value until it arrives at t1B value. When it reaches t1B, it goes to the value of t1Y. Fig. 12(a) and 12(b), and Fig. 12(c) and 12(d) are sequential. A Similar method is applied for angles t2, t3, and t4.

Fig. 12Code that moves angle t1 from position t1A to position t1B

Code that moves angle t1 from position t1A to position t1B

4. Conclusions

Forward and inverse kinematics computations have been performed using LabVIEW and MATLAB. Transformation matrices and their multiplication have been employed in the computations. Using the software developed, the required end coordinate (X, Y, Z) for the robotic arm is provided. The study has been implemented on a robotic arm, and it has been observed that the arm has moved to the position indicated by the x, y, and z values entered. Following the entry of two coordinates into the system, the arm has first located to the starting position and then moved to the ending position. Throughout the movement of the arm along the orbit, the current coordinate computed by the software is displayed by the user interface.

The study has met its objective. Using the software, the movement of the end effector between two positions has been accomplished. With minor modifications in the software, the arm can be made to visit more than one position along the orbit.

During orbit planning, it has been assumed that no obstacles exist which would affect the orbit.

References

  • JS Automation, ftp://automation.com.tw/download/Manual_Driver/AioCard/AIO3320_1A/manual /aio3320ae.pdf.
  • Rocha C. R., Tonetto C. P., Dias A. A comparison between the Denavit–Hartenberg and the screw-based methods used in kinematic modeling of robot manipulators, Robotics and Computer-Integrated Manufacturing, 2010.
  • Çetinkaya Ö. Design of Robot Arm with Four Rotary Joints Tracing Movement of One Arm and Experimental Research. Trakya University, Edirne, 2009, (in Turkish).
  • Matlab, https://www.mathworks.com/help/matlab/ref/inv.html;jsessionid=1472af4d759e6358471f61 a0b797.
  • Matlab, https://www.mathworks.com/help/optim/ug/fsolve.html.
  • Kılıçaslan K. Orbit planning of 5 axis robotic arm and experimental application (in Turkish), Trakya University PhD Seminar, p.50-52, 60-66 2011
  • LabVIEW, http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/for_loop_and_while_ loop_structures/.
  • LabVIEW, http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/case_and_sequence _structures/.

About this article

Received
10 September 2020
Accepted
09 October 2020
Published
07 November 2020
Keywords
robotic arm
orbit planning
inverse kinematics computation