Small-scale Robot Arm Design with Pick and Place Mission Based on Inverse Kinematics

— Robot arm is often used in industry with various tasks, one of which is a pick and place. Rapid prototyping of robot arms is needed to facilitate the development of many industrial tasks, especially on a laboratory scale. This study aims to design a small-scale three degree of freedom (3-DoF) robot arm for pick and place mission using the inverse kinematics method. The mechanical robotic arm system is designed using Solidworks with four servo motors as the actuator. Arduino Mega 2560 is used as a microcontroller in which the inverse kinematic method is embedded. This method is used to move the robot based on the coordinates of the destination pick and place. The test results show that the robot arm can carry out the pick and place mission according to the target coordinates given with the largest average error of about 5 cm. While the error generated between the calculation and computation results is around 3%.


INTRODUCTION
The robot arm is a type of robot that is used for various industrial processes. The robot can move the position from one point to another by determining the position of the coordinates. This robot control configuration can be done manually or automatically and can be used statically or mobile [1]. Inverse kinematic is an algorithm that is often used in the operation of a robot arm. This method allows the conversion of coordinates into the angular motion of each joint robot. In solving the inverse kinematic problem, several methods can be used such as Denavit-Hartenberg (D-H) [2], screw theory, and iterative method [3]. Besides, soft computing methods can also be used to solve inverse kinematic equations [4], [5]. In essence, some of these methods are used to find the best solution for calculating joint angles based on target coordinates. Several researchers have discussed the application of inverse kinematic in the robot arm. One of them is research [6] which uses this method to control the position of the robot arm movement when carrying out a pick and place mission. Besides, other researchers also use this method for conveyor systems [7], sorting objects by shape [8], integration with computer vision [9], and rapid prototyping [10]. However, to facilitate the development of robot arms, especially in studying the kinematics of their movements, a small-scale prototype of a robot arm is needed.
Several researchers have also developed a low-cost and small-scale prototype robot arm. Research [11] discussed the fabrication of light robot arm parts which was carried out for 6 to 10 hours. Each part of the robot is designed using 3D simulation and realized in hardware using 3D printing. The result is that the robot arm has the criteria for raw material, metallic reinforcements, accessibility, and flexible couplings. In the study [12], a low-cost robot arm with a counterbalance mechanism was developed that can balance the robot while performing services. The proposed mechanism can effectively reduce the movement torque of the robot so that a relatively cheap price motor part can be used. Reference [13] proposes a flexible robot arm for pick and place that uses two DC motors and a silicon bar as a flexible link. The test results show that the robot can hold more than two times its weight. Several studies have also designed a low-cost robot arm with recognition features. As in research [14] which applies the voice recognition method to control the robot arm. Also, other recognition methods such as visual tracking [15]- [18] and gesture control [19]- [22] have been integrated into the robot arm. Currently, robot arm research has developed along with the emergence of the Internet of Things (IoT) technology. As in research [23]- [25] that have developed an internet robot arm that allows robot operation through internet connectivity. This system is very much needed considering the development of IoT technology, especially in the industrial sector. Finally, the robot arm has also been integrated with Unmanned Aerial Vehicle (UAV) technology known as Unmanned Aerial Manipulator (UAM), as has been developed in research [26].
The purpose of this research is to design a small-scale robot arm for learning needs in the laboratory. The main contribution of this paper is to provide a simple design for a robot arm that can be used to study the behavior and tasks of a robot on a small scale. The robot arm was designed using Solidworks software and then realized using 3D printing. The robot is designed using low-cost parts, such as MG servo motors and Arduino microcontrollers [27]. In this study, the robot is then given an automatic pick and place mission based on inverse kinematics [28]- [30]. This research is a continuation of the paper [31] which discusses the design of robotic mechanical and electrical systems. In this paper, the inverse kinematics method is applied to the robot and tested for automatic pick and place missions.

A. System Design
The block diagram of the system design can be seen in Fig. 1. This system consists of an input section, a control section, and an output section. In the input section, there is the MATLAB GUI and Arduino IDE which functions to determine the coordinates of the robot arm movement. The coordinates used are picked coordinates and place coordinates. The robot arm control part is Arduino Mega 2560 with an inverse kinematic method embedded in it. At the output, there is a 180-degree servo motor as an actuator. Table 1 shows the technical specifications of the designed robot arm.

B. Hardware Design
The hardware design of this robot arm includes mechanical and electronic parts. The mechanical robotic arm system is designed with three degrees of freedom. The robot arm configuration used is articulated with three joint revolute and one end-effector. The mechanical system of the robot arm is very influential and dominates the system because the shape and movement of the mechanics will affect the mission being carried out. The material used in the manufacture of this robot is a 3D printing PLA (Polylactic Acid) filament which is made from corn starch essence. The material used has an Infill Density of 5%, meaning that the fill thickness of the manufacturing material is bigger and will be lighter than 100% Infill Density which has a very tight fill thickness or no holes at all. By using a lower infill, the joint motion system on the servo motor actuators will be lighter and will not work stronger because the difference in weight of the part link affects the motion performance of the servo motor. Fig. 2 presents the overall shape of the threedimensional model designed using Solidworks 3D modeling software. There are four joint and link structures of the 3 DOF robot arm, namely the base, waist, elbow, and gripper. Each joint movement is controlled by a servo motor. The MG996R type servo motor is placed on the joint base and waist, while the SG90 type is placed on the elbow and gripper joint. Figure 3 shows the schematic of the robot arm being designed. Four servo motor units are connected to the microcontroller, where three motors act as driving the joint and one servo drives the gripper. The four servo motors are controlled using the servo.write(degrees) command, where degrees are the angular data generated by inverse kinematics calculations. The circuit also adds a 9 V power supply for the servo motor, a 5 V voltage regulator for the microcontroller, and several LEDs as indicators.

C. Software Design
The designed system is equipped with software as an interface using the MATLAB GUI. The interface is designed to function as a place to provide the pick and place coordinates of the work piece. The designed interface is shown in Fig. 4. The coordinates given on the interface will be sent via serial communication to the Arduino Mega 2560. These coordinates are then processed using the inverse kinematic method so that the angle value for each servo motor is generated. The angle value is then sent to each motor so that it can move the robot to the pick and place coordinates. The flowchart of the robot arm during the operation can be seen in Fig. 5. Generally, the way this system works starts from the input of the pick and place coordinates given through the MATLAB GUI. The coordinates are then sent to Arduino Mega 2560 and then processed with inverse kinematics calculations. The result of the calculation is the value of the degree of angle for the joint base, shoulder, and elbow on the robot. After the angle degree value is obtained, the value is sent to each servo motor at each joint of the robot arm. Thus, the robot arm end effector can go to the target point and the robot arm gripper can pick up and place objects at the intended coordinates.

D. Inverse Kinematics
Inverse kinematics is a method used to find corner variables for joint robots based on the robot's position coordinates. The inverse kinematics method will look for the parameter values that must be given to each actuator to achieve the final destination coordinates. The block diagram of inverse kinematics is shown in Fig. 6. In determining the final coordinates of the end-effector, inverse kinematics must be adjusted to the workspace boundary of the robot's reach. Solving the inverse kinematics can be done using Pythagoras law and trigonometric rules. Inverse kinematics can be solved by looking at the two sides of the robot, namely the top view and the side view. The top side is used to find the degree angle θ1 of the base joint and the joint with the vertical rotating axis. The sides are used to find the degrees of angle θ2 of the joint shoulder and the degrees of angle θ3 of the joint elbow. For the degree of angle on the gripper, it is enough to use the ON-OFF algorithm. The illustration of the top and side diagram of the robot can be seen in Fig. 7 and Fig. 8.  To determine the degree of the axis of the joint base, the following tangent equation can be used where is the position of the end-effector coordinates on the X-axis, is the position of the end-effector coordinates on the Y-axis, and 1 is the degree of the angle of the joint base.
To find the degree of angle 2 , a triangle guideline is needed which describes the lengths 1 , 2 , and 3 as shown on the dashed green line in Fig. 7. Thus, 1 , 2 , and 3 can be calculated based on the following equation.
where is the position of the end-effector coordinates on the Z-axis and 1 is the link length between base and shoulder.
Furthermore, by looking at the side of the 3-DOF robot arm structure, it can be found the value of the angle degrees 2 and 3 . From the side, several variables can be defined including 1, 2, 3, , 2 , and 3 . 2 is the link length between the shoulder and elbow. 3 is the link length between the elbow and the end-effector. 2 is formed from the horizontal line axis of the joint shoulder and the link between the shoulder and elbow. 3 is formed from the horizontal line axis of the joint shoulder and elbow.
Referring to Fig. 7, 2 can be calculated by the following equation. where Meanwhile, 3 can be calculated using the following equation.

III.
RESULT AND DISCUSSION The overall system design is then implemented according to the system block diagram as shown in Fig. 9. The system that has been created is then tested to determine its performance. Tests were carried out on servo motors and pick and place missions based on inverse kinematics.

A. Servo Motor Testing
Servo motor testing is carried out to determine whether the motor is functioning properly or not. The test is carried out on each servo motor at each joint. Servo motor testing is done by measuring the voltage when the servo motor is given a PWM signal and when the servo motor is not given a PWM signal. No-load voltage (VNL) is the voltage when the servo motor is not given a PWM signal. Full load voltage (VFL) is the voltage when the servo motor is given a PWM signal which will make the servo motor have a load. The servo motor test results can be seen in Table 2.  From the results, it can be seen that the VNL and the VFL have an average difference of 0.08 V. This is because there is power dissipation when the servo motor operates. The existence of power dissipation will affect the position of the end-effector inaccurately.

B. Pick and Place Coordinate Testing
This test is carried out to determine the coordinates of the end-effector of the robot arm to reach the destination coordinates. The test is done by dividing the workspace into quadrant 1 for the negative end-effector X position and quadrant 2 for the positive end-effector X position. Measurements are made using a coordinate board and the aid of a ruler to find out the difference between the targets and the results achieved. The results of the pick coordinate test can be seen in Fig. 10, while the place coordinate test can be seen in Fig. 11.
Based on the results of the pick coordinate test, it can be seen that the robot managed to get to the coordinates according to the given target even though there was an error. The largest error average value occurs on the Y-axis, which is 3.5 cm, while the smallest error value is obtained on the X-axis, which is 1.74 cm. When viewed from the test, the largest average error occurs in the third test with a coordinate error of 5.4 cm, while the smallest average error occurs in the fifth test with a value of 1.27 cm.
In testing the place coordinates, it can also be seen that the robot managed to get to the coordinates according to the target even though there was an error. The largest error average value occurs on the X-axis, which is 2.68 cm, while the smallest error value is obtained on the Z-axis, which is 1.78 cm. When viewed from the test, the largest average error occurs in the first test with a coordinate error of 2.87 cm, while the smallest average error occurs in the third test with a value of 1.93 cm.

C. Servo Angle Testing Based Inverse Kinematics
Servo angle testing aims to determine the angle value generated by the results of microcontroller computation. The resulting value is then compared with the results of calculations manually using Ms. Excel. The test is carried out by providing five test coordinates for the position (x, y, z) in the pick and place conditions. The test coordinates in the pick condition are (-8,20,10), (-20,20,10), (8,16,10), (12,24,4), and (-4,24,8). The test coordinates in place conditions are (16,24,7), (-20,20,10), (-12,28,8), (-20,24,15), and (20,20,15). Then the results of the computation of 1 , 2 , and 3 angles are displayed on the Arduino IDE Serial Monitor. We also compare the servo angles resulting by computational with Arduino microcontroller and the calculation based on inverse kinematics equations. The error is calculated using the error equation as follows.   Table 3 and Table 4 show the angles generated by the inverse kinematic for each servo under pick and place conditions. Based on the test data, it is found that there are two angles generated that exceed the maximum limit of 180 degrees, namely the first test of the θ3 angle of the pick condition and the third test of the θ3 angle of the pick condition. Each of these conditions results in an angle of 192.02° and 209.61°. When this condition occurs, the servo movement will saturate at 180°, which can cause an error in the pick coordinates.
The results show that there is an error between the angle generated by the computation and the calculation of about 3% on θ2 and θ3 both when making a pick and place. The θ1 angle yields the same value between the computation and calculation results. This happens because the θ1 equation is not that complicated when compared to the θ2 and θ3 equations. The error value may be caused by differences in the resolution of the data types processed in the computation process.
This study designed a small-scale robot arm by applying the inverse kinematic method for the pick and place mission. Solving the inverse kinematic solution in this study still uses generic equations. Several methods of solving the inverse kinematic have been developed, such as Denavit-Hartenberg (D-H), Screw Theory, and Iterative Method. Each of these three methods has advantages and disadvantages. As in terms of computation time, the D-H method has the fastest computation time and the Iterative method has the longest computation time [3]. However, the use of this inverse kinematic solving method can be adapted to the specifications and tasks of the robot to be designed.

IV. CONCLUSION
A small-scale robot arm with a pick and place mission based on inverse kinematics has been designed, implemented, and tested successfully. The inverse kinematics method that is applied can make the robot perform a pick and place mission for several coordinate targets. The test results show that the robot has the largest average coordinate error as far as 5.4 cm in the third pick test. The largest average error servo angle between computational and calculation is 3.7%. This happens because of the saturation in the servo motor and the differences in the resolution data type. The next research is to design a closed-loop control algorithm by considering the saturation condition of the actuator.