Design Of 4DOF 3D Robotic Arm to Separate the Objects Using a Camera

Robots are said to be automatic equipment made to replace human functions. Robots are referred to as programmable multifunctional manipulators intended to perform certain tasks [1]. With the increasing activity of the manufacturing industry, robotic arms were created to help various industries to perform tasks or jobs rather than using human labor. Robots are generally used to perform unsafe, dangerous, highly repetitive, and unpleasant tasks [2]. Robots can be performed as material handling, assembly, arc welding, resistance welding, tool loading and unloading tools, painting and spraying, and others [3] [4]. For example, robotic arms are widely used in assembly or packing lines by lifting small objects in a repetitive motion that humans cannot do for long periods. Seeing the ability of an arm robot that is better than humans, the Arm Robot is made with three joints and a gripper to clamp the objects. . In previous researchers, the inverse kinematic in the robot arm has been discussed, but the operator still inputs more on the theory or mathematical approach, the accuracy of the joint robot movement [5][6][7], and the input coordinates on the xyz axis. In this study, the robot arm, which is made on a prototype scale, has the task of being able to move objects based on their red and green colors to a certain place. The robot uses four servo motors as an arm robot actuator and a gripper as a clamp or object gripper. So that the robot can distinguish the color of the object and know the coordinates of the object on the xyz axis automatically, a camera is added in this research. The camera is installed right above the robot's work area, which is positioned unchanged. Objects that have red or green color will be captured by the camera and then processed by the computer with a visual basic program. Search for object coordinates, and kinematic inverse calculations are done on a computer through a visual basic program then the results will be sent via serial to the Arduino Uno Microcontroller. Arduino Microcontroller will control the servo motor on each joint of the robot arm with the angle value according to the calculation of the inverse kinematic.


I. INTRODUCTION
Robots are said to be automatic equipment made to replace human functions. Robots are referred to as programmable multifunctional manipulators intended to perform certain tasks [1]. With the increasing activity of the manufacturing industry, robotic arms were created to help various industries to perform tasks or jobs rather than using human labor. Robots are generally used to perform unsafe, dangerous, highly repetitive, and unpleasant tasks [2]. Robots can be performed as material handling, assembly, arc welding, resistance welding, tool loading and unloading tools, painting and spraying, and others [3] [4]. For example, robotic arms are widely used in assembly or packing lines by lifting small objects in a repetitive motion that humans cannot do for long periods. Seeing the ability of an arm robot that is better than humans, the Arm Robot is made with three joints and a gripper to clamp the objects.
. In previous researchers, the inverse kinematic in the robot arm has been discussed, but the operator still inputs more on the theory or mathematical approach, the accuracy of the joint robot movement [5][6] [7], and the input coordinates on the xyz axis. In this study, the robot arm, which is made on a prototype scale, has the task of being able to move objects based on their red and green colors to a certain place. The robot uses four servo motors as an arm robot actuator and a gripper as a clamp or object gripper. So that the robot can distinguish the color of the object and know the coordinates of the object on the xyz axis automatically, a camera is added in this research. The camera is installed right above the robot's work area, which is positioned unchanged. Objects that have red or green color will be captured by the camera and then processed by the computer with a visual basic program. Search for object coordinates, and kinematic inverse calculations are done on a computer through a visual basic program then the results will be sent via serial to the Arduino Uno Microcontroller. Arduino Microcontroller will control the servo motor on each joint of the robot arm with the angle value according to the calculation of the inverse kinematic.

A. Robotic Arm Model Design
For making the robotic arm, the critical thing to be searched is the angles of each joint. The robotic arm prototype made in this study has three links, as seen in Fig. 1, with the length of each link arm respectively 10,10,16 cm.

A B S T R A C T
Nowadays robotic arm is widely used in various industries, especially those engaged in manufacturing. Robotic arms are usually used to perform jobs such as picking up and moving goods from their place of origin to the location desired by the operator. In this study, a 3d 4 DOF (Degree of Freedom) robotic arm. The prototype was made to move goods with random coordinates to places or boxes whose coordinates were determined in advance. The robot can know the coordinates of the object to be taken or moved. The arm robot prototype design is completed with a camera connected to a computer, where the camera is installed statically (fixed position) above the robot's work area. The camera functions like image processing to detect the object's position by taking the coordinates of the object. Then the object coordinates will be input into inverse kinematics that will produce an angle in every point of the servo arm so that the position of the end effector on the robot arm can be founded and reach the intended object. From the results of testing and analysis, it was found that the error in the webcam test to detect object coordinates was 2.58%, the error in the servo motion test was 12.68%, and the error in the inverse kinematics test was 7.85% on the x-axis, the error was 6.31% on the y-axis and an error of 12.77% on the z-axis. The reliability of the whole system is 66.66%.
This is an open-access article under the CC-BY-SA license.

B. Inverse Kinematic
Based on the elbow manipulator diagram in Fig. 2, the target was located at the coordinates (xc, yc, zc) while the angles we're searching for are θ1, θ2 and θ3.

Fig. 2. Elbow Manipulator
To determine the angle ( 1, 2, 3) as shown in Fig. 2, a method is needed, called kinematic inverse. Inverse kinematics is a method for determining the angular variables in each joint of the robotic arm. The robot's movement on the "end effector" can reach the object targeted at the coordinates (x,y,z). From Figure 2, the value of θ1 can be Equation (1) Where tan -1 (x c , y c ) denotes the function of the two arctangent arguments. The variable r in Fig. 3 represents the range of link length 1 and link length 2 in accordance with the angles θ2 and θ3 , so that the value of r is Equation (2), While s is Equation (3), To get the completes calculation of θ2 and θ3 using Equation (4).  Because cos 2 θ + sin 2 θ = 1, then sin 2 θ 3 = 1cos 2 θ 3 sin θ 3 = √1 − 2 3 Meanwhile, to find θ2 based on Equation (5).

C. Forward kinematics
Before determining the kinematics of the robotic arm, the first thing that must be considered was the manufacture of Denavit-Hartenberg Parameters [9]. The D-H parameter is used to analyze the robot's movement through each link and the direction of movement of the joint on the robotic arm, as seen in Table I.   TABLE I Referring to Table I, the transformation of the matrix on each arm can be founded based on calculations using Equation (6).

D. Block Diagram
A system block diagram in Fig. 4 will be created using predetermined components. The webcam or camera in Fig. 4 is used to recognize objects that were taken, which are green and red. The computer thought a visual basic program, and the object will be searching for coordinate point value on the variable x,y, z-axis. The coordinate point date is used as an input parameter for finding the angles of the robot arm through the inverse kinematic method, and the value of these angles will be sent via serial communication to Arduino UNO. Arduino will control or move the servo motor based on predetermined angles.

E. Hardware Design
Hardware design in Figure 5, the camera was placed in the upper position to detect objects and determine the objects' coordinates. At the backside, there is a box that contains a microcontroller and a 5 volt 6 Ampere power supply as the power supply for each servo motor on the robot arm. There is a container used to put objects after the robot's arm takes them in the system.

F. Software Design
The flowchart was used to coordinate point values on the x and y axes or (cx, cy) as shown in Fig. 6. The method used to recognize objects or objects that have green and red colors is the threshold method. Meanwhile, to find the coordinate position of the object, a mapping is carried out based on the coordinate value in pixels which is converted into cm units.

III. RESULT AND DISCUSSION
Based on the mechanical and hardware design, the results of making the robotic arm in this study are shown in Fig.7. The performance of the arm robot has been made several tests, namely testing the reading of coordinates in Table II, servo motor  Table III to Table IV, kinematic return in Table VI, and the overall result in Table VII.

A. Coordinate Reading Testing
The camera that was placed above in Fig. 7 is used to recognize green and red objects and determine the coordinates of these objects with the result in Fig. 8.  Table I calculates the error while reading the coordinates carried out by the camera on the x and y axes. The test results obtained an average error of 2.58%, which can still be included in the tolerance limit. Several factors cause camera reading errors. Namely, the camera's position must not be allowed to move because when the camera moves, the coordinate points in the work area will also move so that the test results in a large error value.

B. Servo Motor Testing
In this test on Table III, Table IV, and Table V, four servo motors consist of three servo motors: one 6221MG-20Kg / cm servo, two MG995-10Kg / cm servo, and SG90-2.5Kg / cm. In the overall test, the servo angle obtained an average error of 12.68%. The servo caused this error with a significant difference between the input angle and the robot's angle. That way, making programs for inverse kinematics must adjust the angular error of each servo.   Table VI, the robot moves based on the inverse kinematics method, namely the position of the end effector to the coordinates given, but the coordinates that the robot is aiming at are still experiencing errors (errors). The average error in the inverse kinematics system is 7.85% on the x-axis, the error is 6.30% on the y-axis, and the error is 12.77% on the z-axis. This error was caused by the magnitude of the servo angle error with the input angle error that has been observed in the previous test, namely the base servo, arm servo 1, and arm servo 2. The average error of the three servos is 12.68% so that when the robot arm performs the movement at each of the given angles, the movement of the robot arm becomes less than perfect.

D. Overalls Testing
The overall test is the merger of the coordinate reading program with the robotic arm reverse kinematic program. This test was conducted to determine the success rate of the robot arm when picking up and placing the objects based on the coordinates automatically, with the test results in Table VII. The success rate in the system work is 66.67%. This was caused by various factors like camera readings that still have errors. The determination of the center point on the arm robot adjusts the condition of the camera reading. The camera's condition should not be shifted because it can be caused the result while changing the location of the work area, which results in a shift in the coordinates of the object being read. The back kinematics calculation has a slight error. The angle takes is disturbed, and the data sent to the servo motor is in the form of integer data that ignores the number behind the comma. The error rate of the servo motor from corner to corner is very large, resulting in the angle being deviated from the movement of the servo motor, which results in the displacement of the robot arm motion less effective. The robot can move well if it can minimize the errors and use a good quality servo motor to reduce the angle reading error on the servo motor with the sent data.

IV. CONCLUSION
The results and analysis of the back kinematic system have been running, but there are still getting errors. This is due to the large errors of the servo base, arm servo 1 and 2. Arm 2 servo with an average error of the three servos, which is equal to 12.68%, so that when the robot arm moves at each given angle, the movement of the robot arm becomes less perfect. Testing and analysis of the back kinematic system have an error of 7.85% on the x-axis, an error of 6.31% on the y-axis, and 12.77% on the z-axis. Results and analysis of the object coordinate reading system using the camera are already running. Objects can be detected as objects that are red and green on a black background. From testing and analysis, the error that occurred in the program was 2.58%.