<4D6963726F736F667420576F7264202D20312D3130CACDD3EDE420E6DAE1ED20E6E3E5E4CF> Al-Khwarizmi Engineering Journal Al-Khwarizmi Engineering Journal, Vol. 16, No. 1, March, (2020) P. P. 1- 10 Inverse Kinematics Analysis and Simulation of a 5 DOF Robotic Arm using MATLAB Tahseen F. Abaas* Ali A. Khleif** Mohanad Q. Abbood*** *, **, *** Department of Production Engineering and Metallurgy/ University of Technology/ Baghdad/ Iraq *Email: 70047@uotechnology.edu.iq **Email: 70080@uotechnology.edu.iq ***Email: 70209@uotechnology.edu.iq (Received 19 September 2019; accepted 3 December 2019) https://doi.org/10.22153/kej.2020.12.001 Abstract Kinematics is the mechanics branch which deals with the movement of the bodies without taking the force into account. In robots, the forward kinematics and inverse kinematics are important in determining the position and orientation of the end-effector to perform multi-tasks. This paper presented the inverse kinematics analysis for a 5 DOF robotic arm using the robotics toolbox of MATLAB and the Denavit-Hartenberg (D-H) parameters were used to represent the links and joints of the robotic arm. A geometric approach was used in the inverse kinematics solution to determine the joints angles of the robotic arm and the path of the robotic arm was divided into successive lines to accomplish the required tasks of the robotic arm. Therefore, this method can be adopted for engineering applications. MATLAB (Graphical User Interface) program was used to simulate the movement of the robotic arm in 3D. Also, MATLAB (GUI) has been used to view the position of each joint. The results showed that the maximum error in the x, y, and z coordinates of the end-effector were 0.0251 %, 0.0239 %, and 0.1085 % respectively. Keywords: Robotics, forward kinematics, inverse kinematics, D-H parameters, MATLAB. 1. Introduction Recently, the demands to use robots are increasing in many fields such as space, medical, industrial application, etc.. But the real challenge is the kinematics analysis of robot with higher DOF [1]. The kinematic analysis contains two components: forward kinematics and inverse kinematics to study the movement of the robots. The forward kinematics is used to determine the position of the end-effector of a robot using the angles of the joints as inputs, while the position is used as input to determine the joint angles in inverse kinematics [2]. The simplest method to represent the robot links and joints to solve the forward kinematics is a Denavid-Hartenberg (D- H) method [3]. On the other hand, there are many methods that are being used with inverse kinematics such as geometric approach, algebraic solution, and iterative solution [4]. A MATLAB program is one of the most programs used in many applications such as image processing, optimization, matrices, technical computing, etc.. Robotic toolbox in MATLAB is used in determining the position of the end effector of the robotic arm and in simulating the movement of this robotic arm depending on the DH parameters [5, 6]. 2. Related literature Wathik I. M. AL-Tameemi and Wael M. H. Hadi [7] studied the forward and inverse Kinematic analysis of a 5 DOF robotic arm (Lab- Volt 5250); where the DH parameters were used Tahseen F. Abaas Al-Khwarizmi Engineering Journal, Vol. 16, No. 1, P.P. 1- 10 (2020) 2 to solve the forward kinematics and the analytical solution was used with inverse kinematics analysis. MATLAB was used in both forward and inverse kinematics. The results showed that the maximum error in position was (0.5 %). Tarun P. Singh et al [8] presented the kinematic analysis (forward and inverse) of 6 DOF manipulator arm. The Analysis was performed using MATLAB, the DH parameters were used with forward kinematics and an iterative solution was used with inverse kinematics. An acceptable error was obtained from the comparison between the analytical results and software results. Tahseen F. Abaas and Hind H. Abdulridha [9] presented a modeling of a 5 DOF robotic arm (Lab-Volt 5150) using the DH parameters and simulated the movement of the robotic arm using the MATLAB program. The comparison between MATLAB outputs and RoboCIM outputs was performed to know the acceptance of the modeling of the robotic arm. Alla N. Barakat et al [10] studied the 3D simulation of a robotic arm using a MATLAB program depending on DH parameters. The results explained the way of achieving the desired goal of the work which was drawing sinewave on board. 3. Kinematics Analysis kinematics analysis of robots has defined the relationship between the links and joints with the position and orientation of the robot. The kinematics analysis is divided into forward kinematics and inverse kinematics. 3.1 Forward Kinematics Forward kinematics is used to determine the position and orientation of the end-effector of the robotic arm from the specified joints angles. The DH method is one of the most methods used in forward kinematics which represents the relationship of the joint coordinate between two links as shown in figure (1). Fig. 1. The DH frame. Where: ai: Link length. αi: Link twist. di: Link offset. θi: Joint angle. The robotic arm used has 5 DOF and the DH parameters of this robotic are listed in Table (1). Table 1, DH parameters for the robotic arm. Link �� (mm) �� (degree) �� (mm) �� (degree) 1 0 90 105 �� 2 105 0 0 �� 3 100 0 0 � 4 0 90 0 � 5 0 0 150 �� Also, the transformation matrix between two successive links can be obtained using the DH frame as follow: � � ��,�� ��,�� ��,�� ��,�� � � � �� ��� �� �� 0 00 00 00 0 1 00 1� 1 00 1 0 00 00 00 0 1 ! 0 1 " 1 00 1 0 # 0 00 00 0 1 00 1 " � 1 00 �$ 0 0��$ 00 �$ 0 0 �$ 0 0 1� � � � �� ��� �$ �� �� �$ �� �$ # �� ��� �$ # �� 0 �$ 0 0 �$ ! 0 1 � …(1) Where: �� � �%�&� ' Tahseen F. Abaas Al-Khwarizmi Engineering Journal, Vol. 16, No. 1, P.P. 1- 10 (2020) 3 �� � �()&� ' �$ � �%�&$ ' �$ � �()&$ ' The individual matrices and the global matrix of the 5 DOF robotic arm can be obtained by substituting the DH parameters in Table (1) in the equation (1), as showed in figure (2): Fig. 2. The coordinate frame of the robotic arm. *�+ � ��,�, ��,�, ��,�, ��,�, *�+ � � �� 0�� 0 �� 0��� 00 10 0 0 !� 0 1 � …(2) *�� � � �� ����� �� 0 #���0 #���0 00 0 1 00 1 � …(3) * � � � � �� � � 0 # � 0 # � 0 00 0 1 00 1 � …(4) * � � � 0� 0 � 0�� 00 10 0 0 0 0 1 � …(5) *� � � �� ����� �� 0 00 00 00 0 1 !�0 1 � …(6) And the global matrix *�+: *50 � *10 *21 *32*43*54 *50 � 111 112121 122 113 114123 124131 1320 0 133 1340 1 " …(7) 1�� � ��� � + ��� 1�� � ������ + ���� 1� � ���� 1� � ��&!��� + # �� + #���' 1�� � ���� � � ���� 1�� � ������ � ��� 1� � ���� 1� � ��&!��� + # �� + #���' 1 � � ���� 1 � � ����� 1 � ��� 1 � �!��� + # �� + #��� + !� Where: ��� � � �%�&�� + �� + � + � + ��' ��� � �()&�� + ��' 3.2 Inverse Kinematics Inverse Kinematics (IK) is used to determine the required joints angles of the robotic arm to achieve the specified position and orientation of the end-effector of the robotic arm. In this work, the geometric approach was used to solve the inverse kinematics of the 5 DOF robotic arm: Tahseen F. Abaas Al-Khwarizmi Engineering Journal, Vol. 16, No. 1, P.P. 1- 10 (2020) 4 Fig. 3. The 4 link articulated robot [9]. From figure (3), the wrist angle relative to the reference coordinate (θ234) represents the relation between (θ2, θ3, and θ4): �� � �� + � + � …(8) where �� can be calculated based on pitch wrist orientation angle ∅ 90 � �� � ±∅ …(9) � � !� ∗ cos ∅ …(10) :�; � :� � � cos �� � <= …(11) :>; � :> � � sin �� � A= …(12) :�; � :� + !� sin ∅ � B= …(13) �= � C:�� + :>� � � � C:�;� + :>;� …(14) D � CE:�; � !�F� + �=� …(15) Fig. 4. Top View of the Robotic arm. • Solution for �G: base angle can be calculated from Figure 4 as follows: �� � tanJ� KLMLNO …(16) The other solution will be: ��P � �� + 180 …(17) • Solution for �R: by using the law of cosines: # � � D� + #�� � 2#� D cos&S' ⇒ S �cosJ� KUVW�VVJ�XV��V U O …(18) Y � tanJ� KLZ; J�,[; O ...(19) �� � Y ∓ S …(20) • Solution for �]: D � ^&#�� + # � � 2#�# cos&_ � � '' …(21) � � ± cosJ� KUVJ�VVJ�XV��V�X O …(22) • Solution for �`: � � �� � �� � � …(23) 4. Simulation MATLAB Graphical User Interface (GUI) was used in this work to perform many functions as shown in figure (5). It illustrated the inputs to the program was the position of the end-effector of the robotic arm while the outputs were the joints angles of the robotic arm and the position of each joint. Also, a 3D simulation of the robotic arm movement was presented in GUI as an output. The program was performed as in the following steps: • Setting the position (:� ‚ :> ‚ #)! :� ' of the goal relative to the base of the robotic arm as inputs. Tahseen F. Abaas Al-Khwarizmi Engineering Journal, Vol. 16, No. 1, P.P. 1- 10 (2020) 5 • A function used to determine the joints angles of the robotic arm using the equations (8) to (23). • A function used to determine the position of each joint of the robotic arm using the equations from (2) to (6). • 3D simulation to the movement of the robotic arm was applied using the Robotics toolbox in MATLAB depending on the DH parameters. Fig. 5. The window of the GUI program. 5. Results and Discussions To test the efficiency of the geometric approach in the inverse kinematics analysis, several cases were studied. The inputs to the GUI program, shown in figure (5), were the position of the goal (:� , :> , #)! :�) and the outputs were the joints angles of the robotic arm. The 3D representation of the robotic arm depending on the DH parameters is shown in figure (6) and figure (7). The 3D representation illustrates four cases. The extracted angles of joints were applied in equation (7) to determine the position of the end- effector and compare these results with the input results. The errors between them were obtained and listed in Table 2 to indicate the efficiency of the program used. The algorithm of the geometric approach was developed for the inverse kinematic analysis of the robotic arm and compared the results of this method with results extracted using an algebraic solution. There was a large match in these results, so the geometric approach method was applied. Tahseen F. Abaas Al-Khwarizmi Engineering Journal, Vol. 16, No. 1, P.P. 1- 10 (2020) 6 Case (1) Case (2) Tahseen F. Abaas Al-Khwarizmi Engineering Journal, Vol. 16, No. 1, P.P. 1- 10 (2020) 7 Case (3) Case (4) Fig. 6. GUI for four cases. Tahseen F. Abaas Al-Khwarizmi Engineering Journal, Vol. 16, No. 1, P.P. 1- 10 (2020) 8 Fig. 7. The movement of the robotic arm of four cases. Table 2, The error of the end-effector position Case No. End-Effector Position True (mm) Joint Angle Measured (degree) End-Effector Position Measured (mm) bcdefghi jkkek� lmkgi � ni�dgki�mkgi l o Gpp% 1 rs � RRp �G �36.1973 �R �69.9029 �] �-43.1499 �` �52.2469 �t �90 rs � RGu. uuwx 0.0006 ry � GxG ry � GxG. pG`x 0.009 rz � RRp rz � RGu. uu]` 0.003 2 rs � �R]p �G �165.1461 �R �89.9426 �] �-65.6204 �` �53.6778 �t � up rs � �R]p. pGp] 0.0045 ry � xG ry � xp. uwxG 0.023 rz � RRp rz � RGu. uux` 0.0016 3 rs � RRp �G �15.4972 �R �95.1123 �] �-70.5272 �` �53.4149 �t � up rs � RRp. ptt] 0.0251 ry � xG ry � xp. uwt` 0.0239 rz � RRp rz � RRp. R]wx 0.1085 4 rs � �R]p �G �154.2376 �R �81.8983 �] �-60.124 �` �58.2257 �t � up rs � �R]p. p`u] 0.0214 ry � GGG ry � GGG. pGRG 0.0109 rz � RRp rz � RRp. G{G] 0.0778 Case (1) Case (4) Case (3) Case (2) Tahseen F. Abaas Al-Khwarizmi Engineering Journal, Vol. 16, No. 1, P.P. 1- 10 (2020) 9 From the results of the error in Table (2), indicated the little small error occurred in the position of the end-effector of the robotic arm that confirms the effectiveness of the program used, where the maximum error in the x, y, and z coordinates of the end-effector were (0.0251 %, 0.0239 %, and 0.1085 %) respectively. 6. Conclusions In this work, the Inverse kinematics analysis of 5 DOF robotic arm was accomplished using the MATLAB GUI program. the results indicated the used of the geometric approach in inverse kinematics analysis to determine the joints angles of the robotic arm was effectively and the position of each joint was determined in the GUI program and show it. A 3D simulation for the movement of the robotic arm was performed depending on the DH parameters in representing the links and joints of the robotic arm to help in understanding and representing the movement of the robotic arm. The curve of the second, third, fourth, and etc. degree can be adopted as the path of the end- effector of the robotic arm by dividing this curve into many small lines to enable the end-effector to perform the required curve path. 7. References [1] S.S Kamlesh and R. Mishra, “Advanced path simulation of a 5R robotic arm for CT Guided Medical Procedures”, Materials Today: Proceedings 5, pp 6149-6156, 2018. [2] H. M. Al-Khafaji and M. J. Jweeg , “Solving the inverse kinematic equations of elastic robot arm utilizing neural network”, Al-Khwarizmi engineering journal, Vol. 13, No. 1, pp 13-25, 2017. [3] I. S. Karem , T. A.J. Wahab , and M. J. Yahyh, “Design and implementation for 3-DOF SCARA Robot based PLC”, Al-Khwarizmi engineering journal, Vol. 13, No. 1, pp 40-50, 2017. [4] S. Dereli and R. Köker , “Design and analysis of multi-layer artificial neural network used for training in inverse kinematic solution of 7- DOF serial robot”, Gaziosmanpasa Journal of scientific research, Vol. 6, pp 60-71, 2017. [5] D. L. Rajnor,and A. S. Bhide, “Automatic material handling system using pick & place robotic arm & image processing”, international journal for scientific research & Development, Vol. 2, Issue 5, pp 168-171, 2014. [6] D. Sivasamy, M. D. Anand , and K. A. Sheela , “Robot forward and inverse kinematics research using MATLAB”, International Journal of recent technology and engineering, Vol. 8, Issue 2S3, pp 29-35, 2019. [7] W. I. M. AL-Tameemi and W. M. H. Hadi , “Kinematics analysis of 5250 Lab-Volt 5-DOF Robot Arm”, Eng. & Tech. Journal, Vol. 32, Part A, No. 9, pp 2196-2204, 2014. [8] T. P. Singh, P. Suresh, and S. Chandan, “Forward and inverse kinematic analysis of robotic manipulators”, International research journal of engineering and technology, Vol. 4, Issue 2, pp 1459-1469, 2017. [9] T. F. Abaas, and H. H. Abdulridha, “Inverse kinematic analysis of Lab-Volt R5150 Robot System”, International journal of research, Vol. 4, Issue 13, pp 81-88, 2017. [10] A. N. Barakat, K. A. Gouda, and K. A. Bozed, “Kinematics analysis and simulation of a robotic arm using MATLAB”, 4th International conference on control engineering & information technology”, 16- 18 December, 2016, Hammamet, Tunisia. )2020( 1- 10، صفحة 1العدد ، 16دجلة الخوارزمي الهندسية المجلمتحسين فاضل عباس 10 التحليل الحركي العكسي والمحاكاة لذراع روبوت ذو خمس درجات لحرية الحركة بأستخدام MATLAB مهند قصي عبود*** علي عبار خليف** تحسين فاضل عباس* العراق /بغداد /الجامعة التكنولوجية /*، **، *** قسم هندسة االنتاج والمعادن uotechnology.edu.iq@70047االلكتروني: *البريد uotechnology.edu.iq@70080البريد االلكتروني: ** uotechnology.edu.iq@70209البريد االلكتروني: *** الخالصة التحليل الحركي االمامي والعكسي يعد الروبوتات، في. االعتبار في القوة أخذ دون األجسام حركة مع يتعامل الذي الميكانيكي الفرع هو التحليل الحركي لحرية الحركة روبوت ذو خمس درجات يستعرض هذا العمل التحليل الحركي العكسي لذراع. متعددة بمهام للقيام واتجاهه الماسك موضع تحديد مهم في استخدم. الروبوت ذراع أذرع ومفاصل لتمثيل) (Denavit-Hartenberg متغيرات واستخدمت MATLAB برنامج في robotics toolbox باستخدام المهام إلنجاز متتالية خطوط إلى اآللي الذراع مسار تقسيم لذراع الروبوت وتم المفاصل التحليل الحركي العكسي اليجاد زوايا حل في الهندسي النهج ثالثية لمحاكاة) الرسومية المستخدم واجهة( MATLAB برنامج يستخدم .الهندسية للتطبيقات الطريقة هذه اعتماد اآللية، وبالتالي، يمكن للذراع المطلوبة األقصى الحد أن النتائج أظهرت. لمفص كل موقع لعرض MATLABلحركة ذراع الروبوت .أيًضا، تم أستخدام واجهة الرسوم الحاسوبية ببرنامج األبعاد .التوالي على٪ ٠٫١٠٨٥ و ،٪ ٠٫٠٢٣٩ ،٪ ٠٫٠٢٥١ للماسك هي x ،y ،z إحداثيات في للخطأ