Inverse Kinematics (IK) Solution of a Robotic Manipulator using PYTHON

: Present global engineering professionals feels that, robotics is a somewhat young field with extremely ruthless target, the crucial one being the making of machinery/equipment that can perform and feel like human beings. Robot kinematics deals with the study of motion of linkages which includes displacement, velocities and accelerations of a robot manipulator analytically. Deriving the proper kinematic models for an open chain mechanism of a robot is essential for analyzing the performance of industrial robotic manipulators. In this study, first scrutinize a popular class of two and three degrees of freedom open chain mechanism whose inverse kinematics admits a closed-form analytic solution. A simple coding was developed in python in an easy way. In this connection a two link planer manipulator was considered to get inverse kinematic solution developed in python environment. For this task, we present a solution for obtaining the joint variables of linkages to reach the position in a work space with the corresponding input values such as link lengths and position of end effector.


Introduction
Robot kinematics deals with the study of motion of linkages which includes displacement, velocities and accelerations of a robot manipulator analytically. Deriving the proper kinematic models for an open chain mechanism of a robot is essential for analyzing the performance of industrial robotic manipulators. The task related to robot trajectory path planning control can be split into two types, one is the coordination of the links of kinematics chain to produce desired motions of the robot and the other is dynamic control i.e., linkage driving mechanism using actuators technology by providing position and velocity sensors. In the elementary level, the robot manipulator design concentrate on physical arrangement of linkages and mechanisms, includes development of forward and inverse kinematic equations with standard existing methods.

Literature Review
In the field of robotic engineering, researchers such as Kircanski and Vukobratovic (1985;, Morris (1987), Hussain and Nobie (1985) and Tsai and Chiou (1989) were used MACSYMA, REDUCE, SMP and SEGM methods, these methods requires typical mathematical concepts to achieve forward and inverse solutions. Khatib (1987) worked in this area and gave solution to prevent singular positions obtained during the control of path planning within the work volume. Lloyd and Hayward (1993) developed a new design of multi-RCCL motion generator which is operated by a programming with 'C' language in a UNIX environment. Mandava and Vundavilli (2016) proposed a closed form solution for 18 DOF biped robot based on inverse kinematics and concept of Zero Moment Point (ZMP) method. Sreenivasulu (2012) attempted an inverse solution for a two degree freedom robotic manipulator using geometric approach. Nugroho et al. (2014) designed and implemented to develop a NAO humanoid robot using kinematic approach. Sadiq et al. (2017) applied to obtain exact solutions to found optimal path using particle swarm optimization (PSO) algorithm in Cartesian space map for two degrees of freedom robotic manipulator. Chaitanyaa and Reddy (2016) developed a model for optimization of path planning of two degree of freedom robotic manipulator 543 using genetic algorithm approach. Kanayama et al. (1990) proposed a stable tracking control rule for nonholomonic vehicles to found reasonable target adapted to autonomous mobile robots. Mohamed and Duffy (1985) studied the instantaneous kinematics of end effector platform of fully parallel robot type devices using screw theory concept. Jones and Walker (2006) introduced a modular approach method to get solution for inverse kinematics for multisection continuum robots. Radavelli et al. (2012) presented a comparative study of kinematics of robot manipulators between DH convention and Dual Quaternion approach. Chen et al. (2015) developed an improved algorithm from screw theory to estimate inverse kinematic solution for a robotic manipulator. Chirikjian (1994) also studied on kinematics of a robotic system by considering metamorphic levels. Robot kinematics and inverse solution methods for different robotic linkages described by various authors of text books like Craig (1989), Malley (2011) and Murray (2017). Raheem et al. (2019) presented in their work, how to enhance the work space followed by robot end effector in the space using metaheuristic methods. Hudgens and Tesar (1988) concentrate their study on kinematic studies on micromanipulators especially for parallel linkages. Sun et al. (2017) proposed analytical inverse kinematic solution using DH notations. Tsai and Morgan (1985), Zhuang et al. (1992) developed a solution for general six and five degrees of freedom manipulators by continuation methods. Veitschegger and Wu (1986) studied on measurement methods in the analysis of robot kinematics to achieve accurate end effector positions. Webster and Jones (2010) designed a kinematic model for continuum robots with constant curvature. Yang et al. (2016) discussed in their book on utilization of automation techniques in the field of applied robotics.
Literature depicts that previous investigators focused on various aspects of methods involved in design and development of inverse kinematics solutions for a different configurations of roboytic manipulators. Compared to geometric approaches, programmable studies on inverse kinematic solutions have been found to be a limited extent. Also found that nobody applied PYTHON software to get inverse solution of robotic linkages with multi degrees of freedom problems especially in robotic field.

Inverse Kinematics
The robot inverse kinematics task is concerned with the recognition of the whole feasible and proper sets of joint variables that would understand the solution to find out the positions and orientations of the end effector. In the inverse kinematics problem would not specify constantly a unique solution compared with forward solution i.e., number of solutions to be obtained for one end effector position to reach the specified position and orientation.

Case I. Two Link Planar Manipulator Manipulator
Consider a two link planer manipulator having link lengths l1, l2 and joint angles 1 and 2 to reach a desired position (Px, Py) as shown in Fig The simplified equation obtained as follows: Using Equations 5 and 10 joint variables are found by substituting the given input values. In this method laborious calculations involved and it increases by increasing the series of linkages. So it is necessary to develop some programming codes. Till now the researchers utilized Artificial Neural Networks (ANN), MATLAB, C&C++, Fuzzy Logics and some statistical techniques. In this study a programmable code developed for Inverse Kinematics (IK) of a robotic manipulator in simple manner to understand by the young people. Python is an efficient and easy to learn programming language. One of the most popular applications of Python is in numerical analysis. Solving problems related to numerical analysis using programming languages makes the task easier. It takes less effort to code using Python compared to other programming languages like C/C++/Java. Within a shorter period of time, one can do more with relatively less code. Also, unlike C, Python has a large library of built-in functions and the programming syntax is much simpler. It could save a great deal of time since it allows one to focus on actual research rather than tool being used.

Results and Discussion
In the inverse kinematics, geometric approach contains lot of mathematical expressions. These are increased by increasing number of linkages causes more complexity to solve manually but it is little bit easy in MATLAB. In this study a simplified code generated in PYTHON environment in easy way with fast generation of output results. In the present discussion two and three link planer manipulators were selected and the same procedure can also be applied to complex robotic linkages. For this case selected a linkages of length 10 cm and 5 cm to reach a position (12.99 cm, 2.5 cm) as x, y positions of end effector or tip of the manipulator. To found the joint variables of manipulator linkages, Equation 5 and 10 are applied and obtained the values. Then these values are compared with PYTHON outputs.

Conclusion
The proposed approach has been demonstrated for a two and three link planer manipulators, it should be examined for a few more intricate arrangements of robotic linkages such as greater than two degrees of freedom manipulators and parallel linkages. This can be possibly implemented for different model cases in which the solution for the mathematical expression of the inverse kinematics is using PYTHON software code.