SCARA Robot Links Length Optimization by Using MATLAB and Verification with SimMechanics and Solidworks

This paper aims for optimizing links length that consumed the minimum energy, for a customized SCARA robot. Nine link length combinations are tested and simulated. This research is a part of a project of designing a robotic arm for a packing task. Kinematic and dynamic studies are performed for a 2R robotic arm. The results of kinematic study which are angular displacement, angular velocity and angular acceleration for each joint are determined and exported to the dynamic study to obtain the torque and power consumed. The dynamic study is performed with the aid of MATLAB code, MATLAB/SimMechanics and Solidworks are used to simulate and analyze the dynamic of the robotic arm. The energy consumed for each link length combination using the three methods is calculated.


Introduction
In light of technological development and the increased demand for a huge amount of products of all kinds, it has become very important to increase reliance on robots in factories. This is because of their speed and accuracy that are essential in industrial sectors. Using robots can protect the laborers from multiple hazards such as toxic chemicals, high temperature and physical pollution. In addition, they lead to reduce the density of workers and maintain safe distances among the operators that can significantly mitigate the risk of spreading epidemics and infectious diseases such as the Corona pandemic . This research is a part of a project that aims of designing a robotic arm for packing Tuna-cans at Al-Wafa Tuna factory at Al-Khums Libya. This paper focuses on finding the optimal links length of robotic arm for packing process. Figure 1 shows the packing unit of Tuna-cans in the factory. The packing unit consists of a table with a conveyer belt and six workers at six substations. The robotic arm is attached to the one of the substations. The designed robotic arm is SCARA (Selective Compliant Assembly Robot Arm) configuration. That is because SCARA robot is characterized by speed and accuracy that are required for assembly and packing process [1].

Figure 1: SCARA robot in the packing process
This arm was designed by Japanize engineer Hiroshi Makino in 1979 [1,2]. A lots of studies has been carried out for this arm. A problem of verifying the kinematic model and the technical specifications of the four degrees of freedom SCARA robot by applying the D-H method was addressed by Fang et.al. The kinematic model was created in a MATLAB environment and simulated to monitor the movement of each joint in the robot to verify the validity of the model [3]. Alshamasin et.al presented the design and development of the four-axis SCARA robot system for drilling tasks. They worked on developing and simplifying the mathematical model. They developed it by deriving depending on the forward and inverse kinematic equations from the D-H (Denavit-Hartenber) model. The Solid Dynamic design program and the MATLAB Simulink program were used for mathematical analysis to confirm the results. The results are compatible with both programs [4]. AVCHAT et.al demonstrated the design of a SCARA three degree of freedom robot with working area dimensions of 1200 x 500mm. This arm can maintain torque of 60 N-m, at the end of the clutch. Ansys software was used in simulating the design [5]. Elaikh et.al presented the kinematic analysis by giving an angle at each joint and analyzing vibration using the Lagrange method. This is to obtain the frequency equation and analyze the effects of vibration loading on the dynamic stability of the robotic arm. The vibration analysis was for the possibility of improving the robotics system performance of the type of SCARA robots [6]. Mariappan et.al presented four-degree-freedom SCARA robot. It designed for drilling tasks and developed using Solidworks software. The CAD files were converted into a block diagram in a MATLAB/SimMechanics environment in the second generation technology. A simulation was contacted to monitor performance and dynamic variables. The results indicated that the structure variables affect the dynamic variables [7].

Substation
Third Conference for Engineering Sciences and Technology (CEST-2020) 01-03 December 2020 /Alkhoms -Libya Fernini presented the design and development of the robot system using Solidworks and modeling using MATLAB/Simulink. Analysis was also performed for this robot to study the dynamic behavior when moving in a straight line by comparing the elbow movement up or down, which showed in the results that there is no difference in the energy exerted [8].
Gouasmi.et.al presented two degrees of freedom robot design for pick and place tasks. Solidworks software was used to design and develop the robot. MATLAB/Simulink software was used to simulate and verify the results. This was done by giving an arc path for movement, and testing the movement of the elbow up and down. By reviewing the results, it was found that the movement of the elbow down requires the least torque for the robot joints [9]. Subhashini presented method to find the optimal link lengths of SCARA robot while moving in a rectangular path to remove the edges of the rectangular pieces. He also addressed the topic of finding the optimal link lengths of the robot when using the circular path by setting different lengths and analyzing the energy used in each case. The lengths that give the least energy possible were determined [10,11].
In this paper, the problem of choosing the optimal links length for straight line trajectory is presented. This problem is for a modified SCARA robot arm. The joint configuration of the robot is (R-R-P) where R is a revolute joint and P is a prismatic joint. Solidworks motion and MATLAB/SimMechanics software is used for dynamic study. The straight-line path is generated. Torque, power and energy consumption are measured and analyzed at each joint to obtain the optimal links length in which the overall energy consumption is minimized.

Kinematic and Dynamic Model
As it can be seen from Figure 1, the designed robotic arm has a complicted gometry. The aim of this research is to determine the optimal length for the first and second links that can be carried out without using the actual geometry. Therefore, a simple arm of 2R is enough for performing the expriments. Figure 2 shows 3D model of the simple arm created in Solidworks. Kinematic model gives a considration to the motion of the arm neglecting forces that cause this motion. The kinematic model can be determined using D-Hmethod. To define the D-H parameters for the simple arm, first, the frames have to be attached to the arm as shown in Figure 2A. Second, The D-H parameters can be determined according to the methdology explined in [12]. D-H parameters are illustrated in Table 1.

Forward Kinematic Model
The forward kinematic model calculates the end-effector position and orientation of a robot from joint angles and link lengths. Equation (1) where % ( % ) , % ( % ) , %* ( % + * ) , %* ( % + * ), % is the length of the first link, * is the length of the second link.

Jacobian Matrix
The Jacobian matrix ( ( )) expresses the relationship between joints velocity () relative to linear velocity ( ) and angular velocity ( ) of end-effector. In the case of simple arm, there is no orientation so the equation will be as follow: The Jacobian matrix in simple arm case is as follow:

Dynamic Model
The dynamic model studies the behaviour of moving objects and the forces acting on them.
The equations of motion are derived using Newton Euler's method as it is explained in [12].
This is to determine the torque at each joint ( % , * ).
where X is the moment of inertia for the link , X is the mass of the link ( ), is the density of the material ( / _ ).The power consumed by the joint motors is determined as follow: where: a is power consumed in the joint , = k lk ; is the complete period of time, : is the time interval, is the energy consumption which is calculated using numerical integration (trapezoidal method) of the power versus time curve.

Problem formulation
To minimize the energy consumed, the robot`s end-effector has to move in a straight line trajectory to pick and place Tuna cans. As shown in Figure 3, the robot moves from picking position, in which the robot arm is shown in red color, to the placing position in which the robot arm are shown in blue color. The picking position is fixed by cans' guides. This is to eliminate the cost of vision system for detecting the cans position. So in order to design the robot to do this type of tasks, you have to give a consideration in some of the robot`s mechanical properties, and one of them is links length. Selecting the appropriate links length leads to the minimum energy consumption due to motors motion. This also leads to smooth motion of the end-effector.

Data Used in Analysis
As mentioned before, the end-effector travels from the picking to the placing position in a straight line trajectory. As shown in Figure 4, the picking position is at a distance of 570 mm along X-axis and a distance of 200 mm along Y-axis. The placing positions are varying relative to the carton box. Therefore, the center of the carton box is chosen as the placing position which is at a distance of -130 mm along X-axis -minus sign indicates the opposite directionand a distance of 600 mm along Y-axis. The travelling distance of the end-effector is 807 mm.
The time in which the end-effector finishes the path is = 5 seconds. The path is divided to points every = 0.1 second. Therefore, the path has 50 points equally spaced. The Cartesian velocities of the end effector ( o , p ) can be calculated as follows:  where is the point number. Table 2 displays the Cartesian velocities of the end-effector throughout the entire path. Using Jacobian matrix ( ( )) and Cartesian velocity ( / ) the joint velocity ( ̇/ ) can be determined using Equation (3). As the joint velocity is evaluated, the joint displacement ( ) and joint acceleration ̈ /second * can be calculated as follow: where is the point number.
Third Conference for Engineering Sciences and Technology (CEST-2020) 01-03 December 2020 /Alkhoms -Libya The links in the simple arm has square cross section area with 20mm for each side. These dimensions are determined according to the maximum bending moment in the stress equation using Solidworks. Links lengths vary from (200mm to 600mm) with a step of 50 mm. The total link lengths are % + * = 800mm. There are 9 links length combinations. The total link length is chosen in the way to prevent the arm from getting into a singularity configuration or near it. If the arm is in singularity or near it, the Jacobian matrix has no inverse which makes the arm to move with a high velocity.

Dynamic Model Analysis Methods
In this paper, three methods are used to solve the dynamic model. These methods are: MATLAB program, MATLAB/SimMechanics and Solidworks motion. Determine the Energy consumed in each joint using energy equation ( ); End loop Check for link length combination that consumes less Energy. End program

MATLAB/SimMechanics Model
As it was mentioned before, the actual designed robotic arm is simplified to a simple 2R robotic arm. The simple robotic arm is designed in Solidworks software. In order to get the MATLAB/SimMechanics model, the CAD model is imported from Solidworks software as an (xml) file to MATLAB/ SimMechanics. This generated a block diagram and 3D model in Simulink environment as shown in Figure 5. All 9 link length combinations are designed in Solidworks and imported to MATLAB/ SimMechanics.

Solidworks motion study
Solidwork motion is an addons to the solidworks software. Solidworks motion is used to study and analyze the simple arm motion. Motion study for the 9 simple arm CAD models are carried out. These studies are generated by attaching a rotary motor for each joint. Data point file of joint displacement and time was imported to the joints motors. The outputs of the motion study are kinematic and dynamics results such as: Displacement, velocity, acceleration, forces, and power. Also, it provides animation for the motion study as shown in Figure 6. The results were exported from graphs as a (CSV) file for the 9 links length combinations.

Results and Discussion
In this work, three methods of solving the Kinematics and dynamic models are presented: MATLAB, MATLAB/SimMechanics and Solidworks motion. These three methods were used to calculate joint velocity , torque and power consumption for each joint. It means that, 18 different result have been analyzed for each links length combination. Using MATLAB program, the joint angular velocity ̇ was calculated for each joint. Then Joint displacement was determined by multiplying ̇ with time. Figure 7 shows the simple robotic arm movements from the picking position at = 0 second to the placing position at = 5 seconds  Figure 8 shows the joint velocity for both of the simple arm joints at the sixth links length combination. It shows that, there is a very small difference between the two joint velocities. For joint one the difference disappears as time progress. The MATLAB/SimMechanics joint angular velocity is the same as MATLAB program. Figure 9 shows the total power consumed by the two simple arm joints' motors in the sixth links length combination. The total power consumed in the two joints was computed by integrating the joint torque with the joint angular velocity as it was stated in equation (8). Figure 10 demonstrates the total power consumed in each link length combination for whole period of time. To obtain the total power for each link length combination, the power consumed was numerically integrated for each method results. Three power consumed values corresponding to the three methods were obtained for each link length combination. It shows clearly that the sixth link length combination has the minimum power consumption. It means that the optimal links length are % = 450 and * = 350 .

Conclusion
In this paper, the optimal links length that give a minimum power consumption are determined for customized SCARA robot. Nine link length combinations are tested and simulated. This research is a part of a project of designing a robotic arm for packing task in tuna factory. The robotic arm end effector has to travel mainly in straight line for about 800 mm to pick up and Third Conference for Engineering Sciences and Technology (CEST-2020) 01-03 December 2020 /Alkhoms -Libya place the Tuna-Cans. The kinematic and dynamic models are built for the 2R robotic arm. The results of kinematic model which are angular displacement and angular velocity ̇ and angular acceleration ̈ for each joint are determined and exported to the dynamic model to obtain the torque and power consumed. Three method which are MATLAB program, and MATLAB/SimMechanics and Solidworks are used to simulate and analyze the dynamic of the robotic arm. The power consumed for each link length combination using the three methods is calculated. From the results, it can be concluded that the sixth link length combination has the minimum power consumption.