Modeling and Controlling the Actuator Joint Angle Position on the Robot Arm Base Using Discrete PID Algorithm

DC motor is a motor that is easy to apply. Its application in robotic DC motor control often occurs errors due to the existing load, so that the DC motor becomes inaccurate. The control used is PID (proportional integral differential). This PID control system works by processing calculations based on the control variables Kp, Ki, and Kd to achieve the conditions according to the expected setpoint. To make a DC motor position control device can be controlled with a PID controller. In practice, the variable to be controlled in this research is position control in the form of degrees. With the Arduino Mega controller, the motor driver as a DC motor rotation controller, the DC motor is given feedback in the form of an encoder sensor, the software used is the Arduino IDE. The results showed that PID control can correct errors and transient responses with a time constant value of 1.50 seconds, a rise time of 1.60 seconds, a settling time of 2.30 seconds and a delay time of 1.20 seconds and a peak time of 1.6 seconds and an error value of 0.33% through tuning parameter Kp = 16 Ki = 0.001


I. INTRODUCTION
DC motor is a type of drive that is often used in all fields, one of which is the field of robotics and control [1]. DC motors in the field of robotics can be controlled to regulate speed [2], position or a combination of them [3]. DC motor has a fast response, but still has a steady state error [4]. To reduce steady state error value of DC motor as position control, a controller is needed. The PID controller is the most widely used because it is simple and easy to learn and tuning its parameters. More than 95% of processes in the industry use these controllers. This controller is a combination of proportional (P), integral (I), and derivative (D) controllers [5], [6].
In most speed control systems, what is desired is to keep the rotational speed constant for all load conditions, not set the rotational speed to vary over time as the reference input changes. Not so with the positioning system. In these systems, system accuracy is usually measured not only by steady-state error for step inputs, but also by steady-state error for timevarying inputs. This is usually termed as following error. The addition of a PID controller can actually improve performance of positioning system in terms of magnitude of this following error [7].
As for some control positions for application of DC motors in the field of robotics, namely controlling position of motor on the goods moving robot with input in form of images that are read by camera [8]. Then, control the PID Training Kit ELABO TS 3400 Using a Position Sensor which is implemented on a DC motor whose control uses a potentiometer [9] Next, the use of a DC motor on an arm flip folding machine that uses PID control [10]. In this study, the application of a DC motor to the basic motion of the robot arm will be carried out to determine the position of the robotic base arm using the discrete PID method by providing input via a serial monitor.
The design of base arm robot is carried out by using actuator base arm robot in form of a brushed DC motor to achieve the angular position of encoder sensor [11] with motor control in form of the PID method [12]. There are several approaches that can be implemented, one of which is discrete PID [13]. The design of the PID controller in discrete domain is expected to approach the application of using a microcontroller and is expected to be able to increase transition response and reduce the value of base movement error with a predetermined constant on the PID controller. The determination of initial design carried out by transfer function modeling process using identification system of open loop and close loop approaches [14] with System Identification Matlab tools [15].

A. Movement Mechanism Design
At this point components that used in the robotic arm are computer controller which functions is to determine the input angle which inputted through the ISSN 2355-3286 serial monitor, then there is the Arduino Mega microcontroller which will give command, then DC motor functions as an actuator that will move the robot arm and the last is in the form of a controller. PID controller to determine the final position of the robot arm as shown in the open loop block diagram in Fig. 1. Then in Fig. 2. is a block diagram of a close loop system where the system has a hall sensor that functions as a feedback sensor that can make motor determine rotation direction and angle of the motor.  The schematic diagram of robotic arm shown in Fig.  3. consists of a robotic arm base, Arduino mega, encoded DC motor, L298N H-Bridge module driver, buck converter, and 12V power supply. The power supply is used as a voltage source for motor driver and buck converter. Buck converter convert 12V voltage source into 5V voltage. The 5V voltage source is used for the encoder voltage source from the encoder contained in the DC motor. The motor driver will provide a voltage source to DC motor and input pin of the motor driver will be connected to PWM pin on Arduino Mega, and output pin of the motor driver will be connected to DC motor. Furthermore, motor encoder contained in the DC motor will be connected to pins 2 and 3 of the Arduino as an interrupt pin. First base arm robot will initialize the DC motor, then angle value is entered on serial monitor. After angle value is entered, the robot is ready to use. Furthermore, the robot that has received angle input value, will be applied to the PID controller constant and the input will be calculated and adjusted to the input on serial monitor that has been inputted previously. Then the robot will move with a calculated angle and the movement process ends the flow process of the robotic arm system as shown in Fig. 4.

B. Software Design
The software design is carried out using a system identification toolbox to create a mathematical model in the form of a transfer function from designed base arm robot and simulink is used to simulate the control system with PID algorithm.

System identification toolbox (SIT)
SIT is used to determine a mathematical model in form of a transfer function of DC motor actuator contained in the robot's base arm. The transfer function equation will be used to simulate encoder position control system with PID algorithm on simulink. Fig. 5. shows the transfer function generated by SIT. (2)

Simulink
Simulation on the MATLAB simulink software is carried out to generate data that will be used as a comparison with implementation of the designed base arm robot. There are 4 simulations used, namely close loop control simulations in discrete and continuous domains and PID close loop control simulations in discrete and continuous domains as shown in Fig. 6 to Fig. 9. The robotic base arm is made as shown in Fig. 10. The manufacture of this robotic base arm is intended to run three main systems, namely the open loop control system for base arm robot, the close loop control system for base arm robot, and the close loop control system for PID base arm robot. In this process an effort is made to improve the system performance of the base arm robot. The following are results of trials and comparisons that have been carried out on each system.

A. Open Loop Control System Base Arm Robot
Testing response of open loop position control on the base arm robot is carried out to determine enhancement pulses response generated by encoder to be converted into angles when given a PWM signal as input. Data from sampling result of open loop control response test on base arm robot, is processed using system identification toolbox (SIT) and produces a mathematical model with transfer function in equation  Based on Fig. 11 and Fig. 12 test results, it was found that response of open loop position control base arm robot from increasing angle of encoder could not reach steady state. With these results, the plant model used is assumed to be changed to a close loop condition to achieve steady state conditions.

B. Close Loop Control System Base Arm Robot
Closed loop position control system is made after system response from open loop position control system cannot reach a steady state. Testing of close loop position control system is carried out with the aim of knowing the characteristics of close loop response, the test is carried out by comparing real system response with simulation response in continuous and discrete domains performed on Simulink. In close loop experiment, motor angle position was tested by setting a setpoint value of 90º. Sampling time used in simulation setpoint is 0.1 seconds as shown in Fig. 13,  Fig. 14, and Fig. 15. Responses that shown from continuous and discrete close loop simulation reaches desired setpoint. However, actual response of motor shows that rotation angle of the motor is in a steady state and cannot reach 90º setpoint

C. Close Loop PID Control System Base Arm Robot
Testing response of PID close loop position control is done by comparing data from simulation test results with data from implementation test results. As in close loop experiment, PID close loop experiment was carried out by setting motor angle position setpoint value of 90º. Sampling time used in simulation is 0.1 seconds. Responses that shown from Fig. 16 to Fig. 18 reaches a steady state at specified setpoint, which is an angle of 90°.

D. Comparison of system
Comparison of actual transient response, close loop and close loop PID at 90º angle from the system was carried out. Transient response of close loop control system shown in Fig. 19 has an error value between actual condition and setpoint of 33.5º and reaches a steady state condition at 1.90 seconds with a value of 56.5º. While transient response of close loop PID control system shown in Fig. 20. has an error value between actual condition and setpoint of 0.3º and reaches a steady state condition at 2.30 seconds with a value of 89.7º. Comparison error value response characteristics of close loop position control algorithm and PID close loop position control can be seen in Table 1 below.    Table 2. Then the last test was carried out in form of testing the response to difference setpoint value on PID close loop control with results that can be seen in Fig. 26. Angle control response in each setpoint increase experiment shown in Fig. 26, it can be seen that when the setpoint is at a value of 180°, 360° and 120° the response to an increase in angle tends to occur small and stable oscillations which are marked by an increase in the PWM value towards 255 but when the setpoint is at the value of 150° and 90°, the response to an increase in angle begins to slow down and oscillations tend to be large and are clearly visible when the setpoint is at 90°.

ISSN 2355-3286
The PWM output is able to adjust the value with a nominal value of 255 to -255 in order to maintain stability of output angle with the setpoint specified in PID close loop control.

IV. CONCLUSION
Based on design, measurement, and analysis. It can be concluded that the PID parameter implemented in the system transfer function has a Kp value of 16, a Ki of 0.001, and a Kd of 16 obtained through PID tuner in Matlab. The results of comparative analysis from close loop control and PID close loop control show that the PID close loop control is better than the close loop control, because it is able to optimally control the angle position which has an error value of 0.33% with a value of 0.3º. Close loop PID control has a transient response with a time constant of 1.50 seconds, a rise time of 1.60 seconds, a settling time of 2.3 seconds and a delay time of 1.2 seconds and a peak time of 1.6 seconds and for development of this research, it is recommended that the controller be developed by adding other controllers such as an antiwindup controller to reduce interference with the system. The use of Zigler-Nichole method in determining the PID parameters mathematically in future research. Addition of an upper arm robot that is integrated with the base arm robot.
ACKNOWLEDGEMENT Thanks to Mr. Dede Irawan Saputra, S.Pd., M.T. who has guided the process of carrying out this research.