Simulation of robot arm system control using fuzzy logic

ABSTRACT


INTRODUCTION
The robot arm is the prevalent choice in industrial settings, often employed as a straightforward and easily adaptable solution to replace human labor in manufacturing lines.This type of robot can be tailored to replicate the movements of the human arm and fingers (end-effector), enabling it to perform tasks like pick-and-place operations and welding [1]- [4].
One of the important parts of designing a robot arm is knowing the mathematical model of the robot arm system.Mathematical models for linear systems can still be obtained, but for non-linear systems, it is not easy to derive a mathematical model from the system.Fuzzy logic control provides another alternative in control systems [5].Fuzzy logic control works based on rules that are extracted according to human thinking and knowledge, either as operators or experts.One method used to design a robot arm is with a fuzzy logic controller.Fuzzy logic is a methodology used to express the operational laws of a system with linguistic expressions, not with mathematical equations.
This controlling algorithm is derived from verbal knowledge, experience, and intuition.Thus the performance depends on a person's expertise and experience to determine the rules and functions of its membership.For this reason, in this final project, a robot arm control simulation was created using the visual studio C# language based on fuzzy logic.

Mathematical Robot Arm Design
In this robot arm theory, a voltage signal is given to the system, which is called the input variable, which is transferred to the DC motor, gears, encoder, and finally the robot arm.The encoder signal is called the output sensor and the angle of the robot arm is called the controlled variable (Figs. 1 and 2) [6].The system uses the following mathematical model: Mathematical models consist of symbols and mathematical equations to describe the system (Eq.( 1) -( 10)) .To obtain a mathematical model of the robot arm system, Newton's equation is used as follows: ∑  =  (1) because it uses rotational dynamics thus the equation becomes: where: (6) ∑  is the amount of torque = resulting torquefriction torque (7) If we plug (5), ( 6) and ( 7) into (2), we get: where :  Matrix: Or Equations ( 11) to (15) are called the state equation.The output of the system is y(t), which is the angle of the robot arm.Output y(t) is shown by the equation: input vector : u(t) =   u , output vector : y(t) =  

Fuzzy Logic controller theory
Membership function is a curve that shows the mapping of data input points into their membership values (often also called membership degrees) which have an interval between 0 and 1.One way that can be used to get membership values is by going through membership function approach [7].Membership function is a curve that shows the mapping of input data points into their membership values (degree of membership) which has an interval between 0 and 1. a) Triangular Curve Representation [7].
A triangular curve is basically a combination of 2 lines (linear) (Fig. 3).A trapezoidal curve is basically like a triangle shape, only there are several points that have a membership value of 1 (Fig. 4).To represent fuzzy logic numbers , a bell-shaped curve is usually used .The difference between the three curves lies in their gradients (Fig. 5).To represent fuzzy logic numbers , you can also use a Gaussian curve (Fig. 6).Corner represents the angle between the x-axis and the robot's axis.

The angular velocity(𝜃 ̇)
Angular velocity states the angular velocity at the initial time when input is given which will determine the movement of the robot arm.
Meanwhile, this fuzzy logic control system only has 1 output, namely torque which then determines the direction of rotation.This torque is a signal of the direction angle, namely the angle between the axis and the direction of the robot arm.The purpose of this control system is how to move the robot arm to get the desired position of the robot arm.

Fig. 7. Fuzzy logic control block diagram
Fuzzy logic control is used to control the torque of the robot arm so that it is in the desired position (according to the reference angle).The input for this fuzzy logic control is the arm angle () and the arm angular velocity ( ̇) (Fig. 7) This arm angle is the angle used as input when the angle is given, the angle to the robot arm which is expressed in degrees (deg).Angular speed is the angular speed of the robot arm to arrive at the desired corner point, angular speed is the speed of change in the angle per unit time, angular speed is expressed in degrees/seconds (deg/s).The output of this fuzzy logic control is the torque that will move the robot arm according to the input given.

Runge-Kutta Method
The method used to simulate the robot arm system in this final project is the fourth order Runge-Kutta method because the Runge-Kutta method is the most popular and most frequently used for simulating differential equations.The following is a form of the classical fourth order Runge-Kutta method: with : ̇ from (12) and (13) for rotational motion is required which will be entered into equation (8), provided that only first order variables appear on the right side of the equation  From ( 8), (12), and (13), we get: Equations.( 31) to (32), there is still a derivative form, for that it must be changed to ( 33) and (34), thus the equation is obtained:

RESULTS AND DISCUSSION
In this section, the results of the research are explained of the project uses a robot arm simulation application with a fuzzy logic controller .This simulation uses different inputs for each membership function used since the membership function that has been created through MATLAB which is used to determine the fuzzy set variables has the same value.This simulation was carried out using 3 test responses.

Response 1
This first robot arm system response calculates the input input with an initial angle of 0 degrees (0 0 ) and an initial angular velocity of 2 degrees/second (2 0 /s), while the desired angle is 4 degrees (4 0 ).

Fig. 8. Response simulation 1 for angular input
From Figs. 8 and 9, it can be seen that the final angle achieved is 3.4 degrees (3.4 0 ), and the final angular velocity that can be achieved is 4.914 degrees/second (4.914 0 /s) since the initial angle is made at 0 degrees therefore this does not happen error in the robot arm system.

Response 4
In response 4, the desired response results do not meet the desired angle thus the system simulation is unstable.The initial angle given in this system is 1 degree (1 0 ) and the angular velocity is 2 degrees/second (2 0 /s) for the desired angle is 4 degrees (4 0 ), but in the simulation results it is found that the final angle obtained is -2.545 degrees (-2.545) and the final angular speed is -11.908degrees/second (-11.9080 /s) with a torque of 0.505Nm (Fig. 14).The simulation results obtained: In this simulation, there is also an excess of values (overflow) in the angle and angular velocity if the given input values are not in accordance with the system and fuzzy control thus the error that occurs exceeds the limits permitted for fuzzy simulation, as can be seen in the Fig. 15.

Fig. 15. Response error display 3
Based on the simulation results data, it is known that fuzzy logic is used using 3 robot arm system responses.The response uses 4 membership functions.The results obtained from the variation graph.Response 1 The graphic results obtained are quite stable since there are no errors.Response 2 for the 4 membership functions varies according to the input given, the input given also varies for each membership function used.This simulation is carried out 100 times in repetition where the robot arm will be moved by torque according to the last output for 1 second.Based on the results, the robot arm system that uses fuzzy logic obtains system output results that are quite good/stable and some are not yet stable.The torque which is a fairly good/stable output is the torque which has a value of 0.380 Nm.
The results are quite stable, namely for the triangular membership function and trapezoidal membership function since the input data entered is good enough for this system.Meanwhile, the results that are not yet stable are for generalized bell and Gaussian membership functions since the input data entered does not meet the desired system value.For the last response, namely response 4, is a display of simulation results that occur that exceed the system limit (overflow) thus the system cannot to process the output.Based on the results of testing the robot arm system with fuzzy logic control , it produces quite stable values since it depends on the input value when entered into the fuzzy logic and robot arm system.

CONCLUSION
In this paper, determining fuzzy rules greatly influences system stability.The simulation investigation was performed by used runge-kutta method.The best output results found on the triangular curve at response

Fig. 6 . 2 . 4
Fig. 6.Representation of Gaussian curve (  + ℎ,   + ℎ 3 ) changing the angle to a change in angle and the angular velocity to a change in angular velocity as below: ̇=  (28)  ̈=  (29)From (27) above, it cannot be used to use the Runge-kutta method, since there is a 2nd derivative in the equation.Therefore, the equation will be changed to change in angular velocity.By substituting (29) into (27), we get:

Table 1 .
[6] parameters used for the robot arm system are shown in the Table 1[6]System Parameters Robotic arm