Adaptive P Control and Adaptive Fuzzy Logic Controller with Expert System Implementation for Robotic Manipulator Application

— This study aims to develop an expert system implementation of P controller and fuzzy logic controller to address issues related to improper control input estimation, which can arise from incorrect gain values or unsuitable rule-based designs. The research focuses on improving the control input adaptation by using an expert system to resolve the adjustment issues of the P controller and fuzzy logic controller. The methodology involves designing an expert system that captures error signals within the system and adjusts the gain to enhance the control input estimation from the main controller. In this study, the P controller and fuzzy logic controller were regulated, and the system was tested using step input signals with small values and larger than the saturation limit defined in the design. The PID controller used CHR tuning to least overshoot, determining the system's gain. The tests were conducted using different step input values and saturation limits, providing a comprehensive analysis of the controller's performance. The results demonstrated that the adaptive fuzzy logic controller performed well in terms of %OS and settling time values in system control, followed by the fuzzy logic controller, adaptive P controller, and P controller. The adaptive P controller showed similar control capabilities during input saturation, as long as it did not exceed 100% of the designed rule base. The study emphasizes the importance of incorporating expert systems into control input estimation in the main controller to enhance the system efficiency compared to the original system, and further improvements can be achieved if the main processing system already possesses adequate control ability. This research contributes to the development of more intelligent control systems by integrating expert systems with P controllers and fuzzy logic controllers, addressing the limitations of traditional control systems and improving their overall performance.


INTRODUCTION
Robotic arms are widely utilized in various fields such as industrial applications, hospitals, and clinics. They are becoming increasingly popular due to their ability to assist in a wide range of tasks. However, precise control of robotic arms to minimize errors is a challenge that requires a theoretical approach. For instance, controlling the movements of a robotic arm to reach a desired point requires precision in the system. However, repetitive movements often result in errors, which may have a range of values. These errors can occur in each cycle of the system, leading to a repetitive pattern of errors.
Motor control systems can be designed using various techniques such as the popular Proportional-Integral-Derivative (PID) controller system and fuzzy logic system. A comparative study [55] was conducted between the fuzzy logic control and PID controller, revealing that the adaptive fuzzy system [56], [57] used in fuzzy logic control showed higher precision and stronger robustness. Other studies proposed the use of the fuzzy neural network algorithm [58] to design the gain of PID control [59], or the development of fuzzy PID controller systems [60], [61], [62], [63], [64] to improve the stability of motor control systems.
Expert systems [65] have been applied in robotics, where they are used in conjunction with other control systems such as expert PID intelligent control [67], neural network-based expert system [68], and fuzzy expert systems [69], [70], [71], [72], [73]. The expert system not only aids in system control Achieving precise movement with minimal error in robotic systems has been the focus of continuous research. The Seiko D-Tran RT3200 robotic manipulator has been extensively studied [74], [75], [76], [77], [78], and researchers have developed iterative learning control (ILC) [79], [80], [81], and repetitive control systems (RC) to reduce the value of root mean square error (RMSE) within the system. In this research, the system equation of the Seiko D-Tran RT3200 robotic manipulator was used to develop the control system. This study aimed to develop a controller design for robotic manipulator applications using an expert system that creates adaptive P and fuzzy logic controllers. The effectiveness of the system was evaluated by testing it with both small and large step input signals, and a case study was conducted to assess its performance. The results showed that using an expert system with a P controller and fuzzy logic controller can provide promising solutions for achieving more precise and robust control in robotic systems. This study aims to address the need for improved control methods by exploring the application of expert systems in enhancing system performance in robotic manipulator applications.

II. METHOD
In this paper, the focus is on studying the implementation of an expert system in the P control and fuzzy logic controller for robotic manipulator applications. This requires scaling the saturation of input signals in the premise universe, which affects the linearity of the expert system controller. The study involves designing a control system using a suitable PID controller and optimizing the membership function tuning for fuzzy logic control, as described in reference [82]. This process helps determine the appropriate membership function values for the fuzzy logic control application. Subsequently, the expert system is designed and tested within the system. A flowchart illustrating this process is shown in Fig. 1, while the details of the equipment and system design will be discussed in the following section.

III. ROBOTIC MANIPULATOR
In industrial applications, robotic manipulators are commonly employed for various tasks, such as welding, assembly, and painting. The different types of industrial robots utilized for these purposes include scara robots, cartesian robots, cylindrical robots, spherical robots, and delta robots. As shown in Fig. 2, there is a sample robotic manipulator.
An application example of the Seiko D-Tran RT3200 robotic manipulator will be presented, which belongs to the category of cylindrical robots.

A. Robotic manipulator Seiko D-Tran RT3200
The research utilized a Seiko D-Tran RT3200 robot controller, a cartesian robot arm equipped with 4 joints for movement in the X-axis plane (joint R), rotation in X-Y plane (joints T and A), and lifting/lowering in Z-axis (joint Z). The control unit was developed using a cRIO-9075 and programmed with LabVIEW to control the rotation of the 4 motors. The design of the control unit is illustrated in Fig. 3 and Fig. 4.

B. Dynamic model of the robotic manipulator system
The Seiko D-Tran RT3200 robot used in this research, depicted in Fig. 3, has its system equation designed as a discrete time with a sampling rate of 0.055 s. Several studies have been conducted on the control of this robot, including works by P. Chotikunnan and B. Panomruttanarug [75], P. Chotikunnan et al. [74], and P. Chotikunnan and R. Chotikunnan [78]. These studies present a model of the system equation, denoted as (1), where the coefficients are listed in Table I. The data in the table represents the variables of the robotic arm.

IV. PID CONTROLLER DESIGN
The PID control system is a type of feedback control system that utilizes a controller called Proportional-Integral-Derivative (PID) [82], [83], [84], [85], [86], [87], [88], [89]. This type of control system is commonly used in the basic design of motor control systems [90], [91], [92], [93], [94], [95]. Its structure is simple, and it provides effective performance in various control applications. The PID control system has three subcontrollers, which are the Proportional (P) controller, the Integral (I) controller, and the Derivative (D) controller. In theory, the PID control system is a continuous-time controller, but when used in microcontroller systems, it must be adapted to a discrete-time controller. The equation shown in (2) represents the estimate of the control input for the system.
where, the control inputs, , in this study, consist of the proportional gain ( ), integral gain ( ), and derivative gain ( ), as shown in the basic structure of feedback control in Fig. 6. The control input is limited to the range of -100 to 100, and the discrete transfer function equation is used to determine the system. The saturation of the control input is also considered. In this study, a PID controller was designed to control the motor system in joints R, T, and Z using CHR tuning to least overshoot. The system design was studied by P. Chotikunnan and R. Chotikunnan [78]. The R value or R condition was found to be 12.75 for joint R, 21.33 for joint T, and 20.11 for joint Z, suggesting that the P controller system should be used for control because the R value is greater than 10. The gain for each axis of the PID system as a P controller system is displayed in Table II for joint R, joint T, and joint Z. V. ADAPTIVE P CONTROLLER WISH EXPERT SYSTEM An expert system is a computer program that employs artificial intelligence (AI) to mimic human judgment using specialized knowledge. It is designed to solve problems using if-then rules and includes a knowledge base, inference tools, and user interface. In this research example, the expert system adjusts the adjustable gain on the control input of the P controller. The design of the expert system for the adjusted gain of the control input is depicted in Fig. 8 as the pseudo code of the joint R, Fig. 9 as the pseudo code of the joint T, and Fig. 10 as the pseudo code of the joint Z, with f(e) as the input to the algorithm and output_for_adjust as the output to adjust the control input of the P controller. The system control program in Fig. 7 utilizes both P Control and an expert system to adjust the control input of the P controller. The control input values are limited to a range of -100 to 100 as a result of the control input saturation in the Simulink design.

VI. FUZZY LOGIC CONTROL SYSTEM
The fuzzy logic control system is a control system that utilizes ambiguous reasoning to control operations and infer solutions in the system. It has been widely studied and used in controlling various systems and controllers [96], [97], [98], [99], [100], [101]. In the context of robotic arm motor control, the Mamdani method is commonly used to estimate the ambiguous control input, as shown in Fig. 11. The system control program uses fuzzy control in Simulink, as depicted in Fig. 17, to simulate the control. Input signal 1 represents the system error signal and is accompanied by five rules, illustrated in Fig. 12. Input signal 2 represents the difference value of the error signal and is accompanied by five rules, shown in Fig. 13. Both inputs have a range from -1 to 1 unit, while the output has nine rules defining its range from -1 to 1 units, as seen in Fig. 14. The membership function of the fuzzy logic system is displayed in Table III. To provide a visual representation of the ambiguities of the fuzzy logic system, the FLC-Pseudo-Color viewer and FLC-Surface viewer of input and output are shown in Fig. 15 and Fig. 16, respectively, displaying 2D and 3D images.      The input values for the joints R, T, and Z are limited by the saturation of the input in Fig. 16 to -40 to 40, -15 to 15, and -20 to 20, respectively. The error range is represented by the parameter KFI. The control input saturation also sets the inputs for the fuzzy logic system for each joint to 1/40 for R, 1/15 for T, and 1/20 for Z. The control input saturation limit for all 3 joints is -100 to 100, with a value of 100 for KFO.

VII. ADAPTIVE FUZZY LOGIC WISH EXPERT SYSTEM
Traditional fuzzy logic control systems have limitations in the input and output range. To address these, an expert control system is designed to adjust the gain of the fuzzy logic control input. The expert system's gain adjustment pseudo code for the fuzzy logic controller is displayed in Fig. 17 and consists of 5 rules. It counts the manifold of the error value, enters the system, and adjusts the answer value for a more accurate approximation of the control input through the design output_for_adjust. Fig. 19 shows the control simulation program which employs the fuzzy logic system modified with expert system tuning in the Simulink program.
The saturation of inputs in Fig. 17 sets limits on the input values for the joint R, joint T, and joint Z are constrained by the saturation of inputs in Fig. 19, with limits set at -40 to 40, -15 to 15, and -20 to 20, respectively. The error range is represented by KFI, and the control input saturation sets the fuzzy logic system input to 1/40 in the R axis, 1/15 in the T axis, and 1/20 in the Z axis. The KFO value is set to 100 for all 3 joints, as a result of the control input saturation limit of -100 to 100.

VIII. SIMULATION RESULTS
The performance of a control system is evaluated by testing its operation using step inputs below and above 100% saturation of the controller's inputs. Four tests are carried out with inputs of 25%, 75%, 125%, and 175% saturation to demonstrate the effectiveness of the control system. The input saturation represents the maximum range defined by the fuzzy logic control system and expert system for each axis. Tests are conducted on joint R, joint T, and joint Z with different step input values for each joint. The results are presented in Fig. 20, Fig. 21, Fig. 22, and Fig. 23.
In Test 1, with the step input set to 25% of the controller's defined input saturation, the system exhibits good performance using P, adaptive P, fuzzy logic, and adaptive fuzzy logic controllers. The percentage overshoot (%OS) and settling time for each joint are displayed in Fig. 20.
In Test 2, when the step input is set to 75% of the input saturation defined in the controller, the system functions effectively with P, adaptive P, fuzzy logic, and adaptive fuzzy logic controllers. The %OS and settling time for each joint are displayed in Fig. 21.
In Test 3, as the step input is set to 125%, the system operates efficiently using P, adaptive P, fuzzy logic, and adaptive fuzzy logic controllers. The %OS and settling time for each joint are illustrated in Fig. 22. In Test 4, when the step input is set to 175%, the system functions smoothly using P, adaptive P, fuzzy logic, and adaptive fuzzy logic controllers. The %OS and settling time for each joint are depicted in Fig. 23. Fig. 20. Results of the step input value system simulation in Test 1. Fig. 21. Results of the step input value system simulation in Test 2.  Tables IV, V, VI, VII, and VIII summarize the results of the four simulations, presenting the %OS and settling times for joints R, T, and Z. The adaptive fuzzy logic controller consistently outperforms the other controllers with the lowest %OS values. The adaptive P controller ranks second in Test 1 and third in Tests 2, 3, and 4. The fuzzy logic controller ranks third in Test 1 and second in Tests 2, 3, and 4, while the P controller ranks fourth overall. Although joint T exhibits For Tests 1 and 2, with step inputs below 100% of the controller's input saturation, the adaptive fuzzy logic and adaptive P controllers generally have low %OS values, while the fuzzy logic and P controllers tend to have high %OS values. In Tests 3 and 4, with the step input exceeding 100% of the input saturation, the adaptive fuzzy logic and fuzzy logic controllers usually have low %OS values, and the adaptive P and P controllers often have high %OS values when going beyond the defined range.  The main findings of this study show that the adaptive fuzzy logic controller consistently outperforms other controllers in terms of %OS and settling time across all tests. The adaptive P controller demonstrates good performance when the step input is below 100% saturation of input. However, its performance declines when the step input exceeds 100% saturation. The fuzzy logic and P controllers display relatively high %OS values in every test.
This study's results suggest that incorporating expert systems into P controllers and fuzzy logic controllers can improve a system's performance when controlling non-linear systems. In contrast, systems that do not utilize expert systems are crucial for applications requiring precise control and rapid response times. The adaptive fuzzy logic controller, in particular, demonstrates exceptional performance in both undersaturated and oversaturated conditions, highlighting its resilience and adaptability.
The strength of this study lies in its comprehensive evaluation of the system's performance using step inputs with varying saturation levels. This approach allows for a deeper understanding of the controller's behavior under different conditions. However, a limitation of the study is the absence of comparisons with other intelligent control methodologies.
In the conclusion of the simulation results, the simulation results and discussion showcase the effectiveness of integrating expert systems with P controller and fuzzy logic controllers for enhanced system performance. The adaptive fuzzy logic controller consistently outperforms other controllers in terms of %OS and settling time, while the adaptive P controller operates well when the step input is below 100% saturation of input. Future research could investigate alternative intelligent control methodologies and perform more extensive comparisons with previous studies, offering a more comprehensive understanding of the benefits and limitations of expert system implementation in various control systems.

IX. CONCLUSION
In conclusion, this study suggests incorporating expert systems into P controllers, which results in adaptive P controllers and adaptive fuzzy logic controllers, in order to enhance the control of systems. The expert system refines the control inputs of the P controller and fuzzy logic controller, leading to improved performance. Fuzzy logic controllers are especially well suited for controlling systems, and their adaptability is increased when combined with an expert system. This study's findings indicate considerable enhancements in control performance metrics, such as decreased percentage overshoot (%OS) and settling time Journal of Robotics and Control (JRC) ISSN: 2715-5072 224 Phichitphon Chotikunnan, Adaptive P Control and Adaptive Fuzzy Logic Controller with Expert System Implementation for Robotic Manipulator Application when utilizing adaptive P controllers and adaptive fuzzy logic controllers. These improvements have potential applications in real-world industries that demand precise control and rapid response times. However, there are some limitations to the study, including the absence of comparisons with other intelligent control methodologies and a lack of real-world implementation data. Future research should investigate these aspects, address potential challenges in integrating expert systems into control system design, and explore other areas of control system design that could benefit from using expert systems or other intelligent systems. In order to further advance control system development, it is essential to consider more sophisticated strategies for gain adjustment or control input optimization. Examining the potential of neural networks and other intelligent systems may result in even more efficient controller operation and reduced %OS error values. In summary, this study contributes new insights to the field by showcasing the effectiveness of integrating expert systems with P controllers and fuzzy logic controllers for improved system performance. The adaptive fuzzy logic controller consistently outperforms other controllers in terms of %OS and settling time, while the adaptive P controller demonstrates promising performance when the step input is below 100% saturation of input. These findings emphasize the potential benefits of expert system integration in various control systems and set the stage for future research and practical applications.

ACKNOWLEDGMENT
The researcher would like to thank the Research Institute, Academic Services Center, and College of Biomedical Engineering, Rangsit University for the grant of research funding to the research team.