Enhancing MG996R Servo Motor Performance Using PSO-Tuned PID and Feedforward Control

(1) Phichitphon Chotikunnan Mail (Rangsit University, Thailand)
(2) * Yutthana Pititheeraphab Mail (Rangsit University, Thailand)
(3) Thanate Angsuwatanakul Mail (Rangsit University, Thailand)
(4) Jaroonrut Prinyakupt Mail (Rangsit University, Thailand)
(5) Tasawan Puttasakul Mail (Rangsit University, Thailand)
(6) Rawiphon Chotikunnan Mail (Rangsit University, Thailand)
(7) Nuntachai Thongpance Mail (Rangsit University, Thailand)
*corresponding author

Abstract


The aim of this research is to improve the precision of factory-locked MG996R servo motors, which are frequently employed in biomedical and robotic applications. These motors are characterized by the absence of inherent feedback channels and adjustable internal settings. The proposed technique proposes a non-invasive control strategy that utilizes externally obtained feedback to enable closed-loop control without requiring any modifications to the interior circuitry. The scientific contribution consists of the development of an outer-loop PID control framework that has been optimized using Particle Swarm Optimization (PSO) and enhanced with feedforward compensation. By utilizing the inherent potentiometer, this method ensures the preservation of hardware integrity and enables real-time angle feedback. A model fit of 96.94% was achieved by establishing a second-order discrete-time model using MATLAB's System Identification Toolbox. Particle Swarm Optimization (PSO) was employed to optimize PID improvements offline by minimizing the Integral of Squared Error (ISE). In both experimental and simulated environments, the controller's effectiveness was assessed using 2 rad/s sine wave inputs and a 10° step. The PSO-PID with feedforward controller achieved optimal results, achieving an RMSE of 0.5313° and an MAE of 0.1630° in simulations, as well as an MAE of 0.8497° in hardware step response. The requirement for gain scaling in embedded systems was underscored by the instability of the standalone PSO-PID controller. This method offers a pragmatic, scalable solution for applications such as assistive robotics, prosthetic joints, and surgical instruments. In order to achieve sub-degree precision in safety-critical environments, future endeavors will entail the implementation of adaptive gain tuning and enhanced resolution sensing.

Keywords


MG996R Servo Motor; PSO-PID Optimization; Feedforward Control; Real-Time Position Tracking

   

DOI

https://doi.org/10.31763/ijrcs.v5i2.1854
      

Article metrics

10.31763/ijrcs.v5i2.1854 Abstract views : 28 | PDF views : 26

   

Cite

   

Full Text

Download

References


[1] A. Latif, A. Z. Arfianto, H. A. Widodo, R. Rahim, and E. T. Helmy, “Motor DC PID System Regulator for Mini Conveyor Drive Based on MATLAB,” Journal of Robotics and Control (JRC), vol. 1, no. 6, pp. 185-190, 2020, https://doi.org/10.18196/jrc.1636.

[2] S. Mahfoud, A. Derouich, N. El Ouanjli, M. El Mahfoud, and M. Taoussi, “A New Strategy-Based PID Controller Optimized by Genetic Algorithm for DTC of the Doubly Fed Induction Motor,” Systems, vol. 9, no. 2, p. 37, 2021, https://doi.org/10.3390/systems9020037.

[3] P. Chotikunnan and R. Chotikunnan, “Dual design PID controller for robotic manipulator application,” Journal of Robotics and Control (JRC), vol. 4, no. 1, pp. 23-34, 2023, https://doi.org/10.18196/jrc.v4i1.16990.

[4] F. N. Abdullah, G. A. Aziz, and S. W. Shneen, “GWO-PID of two-phase hybrid stepping motor for robotic grinding force,” Journal of Fuzzy Systems and Control, vol. 1, no. 3, pp. 71–79, 2023, https://doi.org/10.59247/jfsc.v1i3.91.

[5] K. Rahimunnisa, M. Atchaiya, B. Arunachalam, and V. Divyaa, “AI-based smart and intelligent wheelchair,” Journal of Applied Research and Technology, vol. 18, no. 6, pp. 362-367, 2020, https://doi.org/10.22201/icat.24486736e.2020.18.6.1351.

[6] E. S. Ghith and F. A. A. Tolba, “Design and optimization of PID controller using various algorithms for micro-robotics system,” Journal of Robotics and Control (JRC), vol. 3, no. 3, pp. 244-256, 2022, https://doi.org/10.18196/jrc.v3i3.14827.

[7] S. J. Hammoodi, K. S. Flayyih, and A. R. Hamad, “Design and Implementation of Speed Control System for DC Motor Based on PID Control and Matlab Simulink,” International Journal of Power Electronics and Drive Systems, vol. 11, no. 1, pp. 127-134, 2020, http://doi.org/10.11591/ijpeds.v11.i1.pp127-134.

[8] D. S. Febriyan and R. D. Puriyanto, “Implementation of DC motor PID control on conveyor for separating potato seeds by weight,” International Journal of Robotics and Control Systems, vol. 1, no. 1, pp. 15-26, 2021, https://doi.org/10.31763/ijrcs.v1i1.221.

[9] C. Wulandari and A. Fadlil, “Center of pressure control for balancing humanoid dance robot using load cell sensor, Kalman filter and PID controller,” Control Systems and Optimization Letters, vol. 1, no. 2, pp. 75-81, 2023, https://doi.org/10.59247/csol.v1i2.22.

[10] E. W. Suseno and A. Ma'arif, “Tuning of PID controller parameters with genetic algorithm method on DC motor,” International Journal of Robotics and Control Systems, vol. 1, no. 1, pp. 41-53, 2021, https://doi.org/10.31763/ijrcs.v1i1.249.

[11] R. P. Borase, D. K. Maghade, S. Y. Sondkar, and S. N. Pawar, “A review of PID control, tuning methods and applications,” International Journal of Dynamics and Control, vol. 9, no. 2, pp. 818-827, 2021, https://doi.org/10.1007/s40435-020-00665-4.

[12] R. R. Alla, N. Lekyasri, and K. Rajani, “PID Control Design for Second Order Systems,” International Journal of Engineering and Manufacturing, vol. 9, no. 4, pp. 45-56, 2019, https://doi.org/10.5815/ijem.2019.04.04.

[13] E. S. Rahayu, A. Ma'arif, and A. Çakan, “Particle swarm optimization (PSO) tuning of PID control on DC motor,” International Journal of Robotics and Control Systems, vol. 2, no. 2, pp. 435-447, 2022, https://doi.org/10.31763/ijrcs.v2i2.476.

[14] Z. Qi, Q. Shi and H. Zhang, "Tuning of Digital PID Controllers Using Particle Swarm Optimization Algorithm for a CAN-Based DC Motor Subject to Stochastic Delays," IEEE Transactions on Industrial Electronics, vol. 67, no. 7, pp. 5637-5646, 2020, https://doi.org/10.1109/TIE.2019.2934030.

[15] C. T. Chao, N. Sutarna, J. S. Chiou, and C. J. Wang, “An optimal fuzzy PID controller design based on conventional PID control and nonlinear factors,” Applied Sciences, vol. 9, no. 6, p. 1224, 2019, https://doi.org/10.3390/app9061224.

[16] H. Maghfiroh, A. Ramelan, and F. Adriyanto, “Fuzzy-PID in BLDC motor speed control using MATLAB/Simulink,” Journal of Robotics and Control (JRC), vol. 3, no. 1, pp. 8-13, 2022, https://doi.org/10.18196/jrc.v3i1.10964.

[17] N. Ramadhani, A. Ma'arif, and A. Çakan, “Implementation of PID control for angular position control of Dynamixel servo motor,” Control Systems and Optimization Letters, vol. 2, no. 1, pp. 8–14, 2024, https://doi.org/10.59247/csol.v2i1.40.

[18] O. T. Altinoz and A. E. Yilmaz, “Investigation of the Optimal PID-Like Fuzzy Logic Controller for Ball and Beam System with Improved Quantum Particle Swarm Optimization,” International Journal of Computational Intelligence and Applications, vol. 21, no. 04, p. 2250025, 2022, https://doi.org/10.1142/S1469026822500250.

[19] M. Jain, V. Saihjpal, N. Singh, and S. B. Singh, “An overview of variants and advancements of PSO algorithm,” Applied Sciences, vol. 12, no. 17, p. 8392, 2022, https://doi.org/10.3390/app12178392.

[20] B. Song, R. Wang, and L. Xu, “Design of PMSM Dual-Loop Control Systems Integrating LADRC and PI Controllers via an Improved PSO Algorithm,” International Transactions on Electrical Energy Systems, 2024, https://doi.org/10.1155/2024/9378284.

[21] D. S. Febriyan and R. D. Puriyanto, “Implementation of DC motor PID control on conveyor for separating potato seeds by weight,” International Journal of Robotics and Control Systems, vol. 1, no. 1, pp. 15–26, 2021, https://doi.org/10.31763/ijrcs.v1i1.221.

[22] M. M. Nishat, F. Faisal, A. J. Evan, M. M. Rahaman, M. S. Sifat, and H. F. Rabbi, “Development of Genetic Algorithm (GA) Based Optimized PID Controller for Stability Analysis of DC-DC Buck Converter,” Journal of Power and Energy Engineering, vol. 8, no. 09, pp. 8-19, 2020, https://doi.org/10.4236/jpee.2020.89002.

[23] K. Vanchinathan and N. Selvaganesan, “Adaptive Fractional Order PID Controller Tuning for Brushless DC Motor Using Artificial Bee Colony Algorithm,” Results in Control and Optimization, vol. 4, p. 100032, 2021, https://doi.org/10.1016/j.rico.2021.100032.

[24] D. D. Ramírez-Ochoa, L. A. Pérez-Domínguez, E. A. Martínez-Gómez, and D. Luviano-Cruz, “PSO, a swarm intelligence-based evolutionary algorithm as a decision-making strategy: A review,” Symmetry, vol. 14, no. 3, p. 455, 2022, https://doi.org/10.3390/sym14030455.

[25] M. G. Abdolrasol, A. Ayob, A. H. Mutlag, and T. S. Ustun, “Optimal fuzzy logic controller based PSO for photovoltaic system,” Energy Reports, vol. 9, pp. 427–434, 2023, https://doi.org/10.1016/j.egyr.2022.11.039.

[26] V. Velmurugan, M. Venkatesan, and N. Praboo, “Analysis and performance validation of CRONE controllers for speed control of a DC motor,” International Journal of Robotics and Control Systems, vol. 4, no. 2, pp. 558–580, 2024, https://doi.org/10.31763/ijrcs.v4i2.1343.

[27] P. Mohindru, “Review on PID, fuzzy and hybrid fuzzy PID controllers for controlling non-linear dynamic behaviour of chemical plants,” Artificial Intelligence Review, vol. 57, p. 97, 2024, https://doi.org/10.1007/s10462-024-10743-0.

[28] S. Gobinath and M. Madheswaran, “Deep Perceptron Neural Network with Fuzzy PID Controller for Speed Control and Stability Analysis of BLDC Motor,” Soft Computing, vol. 24, no. 13, pp. 10161-10180, 2020, https://doi.org/10.1007/s00500-019-04532-z.

[29] P. Chotikunnan, R. Chotikunnan, A. Nirapai, A. Wongkamhang, P. Imura, and M. Sangworasil, “Optimizing Membership Function Tuning for Fuzzy Control of Robotic Manipulators Using PID-Driven Data Techniques,” Journal of Robotics and Control (JRC), vol. 4, no. 2, pp. 128-140, 2023, https://doi.org/10.18196/jrc.v4i2.18108.

[30] J. S. Wang and C. G. Lee, “Self-adaptive neuro-fuzzy inference systems for classification applications,” IEEE Transactions on Fuzzy systems, vol. 10, no. 6, pp. 790-802, 2002, https://doi.org/10.1109/TFUZZ.2002.805880.

[31] M. Kiew-ong-art, P. Chotikunnan, A. Wongkamhang, R. Chotikunnan, A. Nirapai, P. Imura, M. Sangworasil, N. Thongpance, and A. Srisiriwat, “Comparative Study of Takagi-Sugeno-Kang and Madani Algorithms in Type-1 and Interval Type-2 Fuzzy Control for Self-Balancing Wheelchairs,” International Journal of Robotics and Control Systems, vol. 3, no. 4, pp. 643-657, 2023, https://doi.org/10.31763/ijrcs.v3i4.1154.

[32] F. Umam, A. Dafid, and A. D. Cahyani, “Implementation of Fuzzy Logic Control Method on Chilli Cultivation Technology Based Smart Drip Irrigation System,” Jurnal Ilmiah Teknik Elektro Komputer dan Informatika, vol. 9, no. 1, pp. 132-141, 2023, https://doi.org/10.26555/jiteki.v9i1.25878.

[33] A. M. Lopes and L. Chen, “Fractional order systems and their applications,” Fractal and Fractional, vol. 6, no. 7, p. 389, 2022, https://doi.org/10.3390/fractalfract6070389.

[34] D. Li and J. Dong, "Fractional-Order Systems Optimal Control via Actor-Critic Reinforcement Learning and Its Validation for Chaotic MFET," IEEE Transactions on Automation Science and Engineering, vol. 22, pp. 1173-1182, 2025, https://doi.org/10.1109/TASE.2024.3361213.

[35] K. Sayed, H. H. El-Zohri, A. Ahmed, and M. Khamies, “Application of Tilt Integral Derivative for Efficient Speed Control and Operation of BLDC Motor Drive for Electric Vehicles,” Fractal and Fractional, vol. 8, no. 1, p. 61, 2024, https://doi.org/10.3390/fractalfract8010061.

[36] V. Kumarasamy, V. KarumanchettyThottam Ramasamy, G. Chandrasekaran, et al., “A review of integer order PID and fractional order PID controllers using optimization techniques for speed control of brushless DC motor drive,” International Journal of System Assurance Engineering and Management, vol. 14, pp. 1139–1150, 2023, https://doi.org/10.1007/s13198-023-01952-x.

[37] Z. U. A. Zafar, N. Ali, and C. Tunç, “Mathematical modeling and analysis of fractional-order brushless DC motor,” Advances in Difference Equations, vol. 2021, no. 433, 2021, https://doi.org/10.1186/s13662-021-03587-3.

[38] T.-B. Tran et al., “Trajectory tracking using LQR control for Pendubot: Simulation and experiment,” Journal of Fuzzy Systems and Control, vol. 2, no. 1, pp. 18–21, 2024, https://doi.org/10.59247/jfsc.v2i1.163.

[39] P. Dutta and S. K. Nayak, “Grey Wolf Optimizer Based PID Controller for Speed Control of BLDC Motor,” Journal of Electrical Engineering & Technology, vol. 16, no. 2, pp. 955-961, 2021, https://doi.org/10.1007/s42835-021-00660-5.

[40] S. Wang, X. Zhao, and Q. Yu, “Vehicle stability control strategy based on recognition of driver turning intention for dual-motor drive electric vehicle,” Mathematical Problems in Engineering, 2020, https://doi.org/10.1155/2020/3143620.

[41] V. Shukla, B. Singh and S. Patil, "The Development of Bio-Inspired Snake Robot," 2023 IEEE Engineering Informatics, pp. 1-7, 2023, https://doi.org/10.1109/IEEECONF58110.2023.10520602.

[42] C. -T. Hsieh, "Joystick-based Motion Control for 6-Axis Low Cost Robot Arm," 2023 International Conference on Fuzzy Theory and Its Applications (iFUZZY), pp. 1-4, 2023, https://doi.org/10.1109/iFUZZY60076.2023.10324130.

[43] A. Ma'arif and N. R. Setiawan, “Control of DC motor using integral state feedback and comparison with PID: simulation and Arduino implementation,” Journal of Robotics and Control (JRC), vol. 2, no. 5, pp. 456-461, 2021, https://doi.org/10.18196/jrc.25122.

[44] T. Y. Wu, Y. Z. Jiang, Y. Z. Su, and W. C. Yeh, “Using Simplified Swarm Optimization on Multiloop Fuzzy PID Controller Tuning Design for Flow and Temperature Control System,” Applied Sciences, vol. 10, no. 23, p. 8472, 2020, https://doi.org/10.3390/app10238472.

[45] H. Torres-Salinas, J. Rodríguez-Reséndiz, E. E. Cruz-Miguel, and L. A. Ángeles-Hurtado, “Fuzzy logic and genetic-based algorithm for a servo control system,” Micromachines, vol. 13, no. 4, p. 586, 2022, https://doi.org/10.3390/mi13040586.

[46] M. Luo, J. A. Duan, and Z. Yi, “Speed tracking performance for a coreless linear motor servo system based on a fitted adaptive fuzzy controller,” Energies, vol. 16, no. 3, p. 1259, 2023, https://doi.org/10.3390/en16031259.

[47] E. H. Kadhim and A. T. Abdulsadda, “Mini drone linear and nonlinear controller system design and analyzing,” Journal of Robotics and Control (JRC), vol. 3, no. 2, pp. 212-218, 2022, https://doi.org/10.18196/jrc.v3i2.14180.

[48] A. K. Hado, B. S. Bashar, M. M. A. Zahra, R. Alayi, Y. Ebazadeh, and I. Suwarno, “Investigating and optimizing the operation of microgrids with intelligent algorithms,” Journal of Robotics and Control (JRC), vol. 3, no. 3, pp. 279-288, 2022, https://doi.org/10.18196/jrc.v3i3.14772.

[49] D. Kumar, R. Malhotra, and S. R. Sharma, “Design and construction of a smart wheelchair,” Procedia Computer Science, vol. 172, pp. 302-307, 2020, https://doi.org/10.1016/j.procs.2020.05.048.

[50] M. R. Islam, M. R. T. Hossain, and S. C. Banik, “Synchronizing of stabilizing platform mounted on a two-wheeled robot,” Journal of Robotics and Control (JRC), vol. 2, no. 6, pp. 552-558, 2021, https://doi.org/10.18196/26136.

[51] A. O. Amole, O. E. Olabode, D. O. Akinyele, and S. G. Akinjobi, “Optimal Temperature Control Scheme for Milk Pasteurization Process Using Different Tuning Techniques for a Proportional Integral Derivative Controller,” Iranian Journal of Electrical and Electronic Engineering, vol. 18, no. 3, pp. 1-16, 2022, https://ijeee.iust.ac.ir/article-1-2170-en.pdf.

[52] P. Saini and C. Sharma, “Comparative Analysis of Controller Tuning Techniques for Dead Time Processes,” International Journal of Mathematical, Engineering and Management Sciences, vol. 4, no. 3, p. 803, 2019, https://doi.org/10.33889/IJMEMS.2019.4.3-063.

[53] S. W. Shneen, H. S. Dakheel, and Z. B. Abdullah, “Design and implementation of no load, constant and variable load for DC servo motor,” Journal of Robotics and Control (JRC), vol. 4, no. 3, pp. 323–329, 2023, https://doi.org/10.18196/jrc.v4i3.17387.

[54] M. A. Abdelghany, A. O. Elnady, and S. O. Ibrahim, “Optimum PID controller with fuzzy self-tuning for DC servo motor,” Journal of Robotics and Control (JRC), vol. 4, no. 4, pp. 500–508, 2023, https://doi.org/10.18196/jrc.v4i4.18676.

[55] A. Sharkawy and J. Nazzal, “Design and manufacturing using 3D printing technology of a 5-DOF manipulator for industrial tasks,” International Journal of Robotics and Control Systems, vol. 4, no. 2, pp. 893–909, 2024, https://doi.org/10.31763/ijrcs.v4i2.1456.

[56] A. W. Hidayat, I. Sulistiyowati, A. Wicaksono, and S. Syahrorini, “Hybrid system prototype for dam water level control system to irrigating rice fields,” Buletin Ilmiah Sarjana Teknik Elektro, vol. 6, no. 1, pp. 25–33, 2024, https://doi.org/10.12928/biste.v6i1.10016.

[57] K. Kunal, A. Z. Arfianto, J. E. Poetro, F. Waseel, and R. A. Atmoko, “Accelerometer implementation as feedback on 5 degree of freedom arm robot,” Journal of Robotics and Control (JRC), vol. 1, no. 1, pp. 31–34, 2020, https://doi.org/10.18196/jrc.1107.

[58] F. Ahmmed, A. Rahman, A. Islam, A. Alaly, S. Mehnaj, P. Saha, and T. Hossain, “Arduino-controlled multi-function robot with Bluetooth and nRF24L01+ communication,” International Journal of Robotics and Control Systems, vol. 4, no. 3, pp. 1353–1381, 2024, https://doi.org/10.31763/ijrcs.v4i3.1517.

[59] A. Prasetyo, J. Jamaaluddin, and I. Anshory, “PCB (Printed Circuit Board) etching machine using ESP32-Camera based Internet of Things,” Buletin Ilmiah Sarjana Teknik Elektro, vol. 5, no. 2, pp. 260–268, 2023, https://doi.org/10.12928/biste.v5i2.8132.

[60] Y. Irawan, M. Muhardi, R. Ordila, and R. Diandra, “Automatic floor cleaning robot using Arduino and ultrasonic sensor,” Journal of Robotics and Control (JRC), vol. 2, no. 4, pp. 240–243, 2021, https://doi.org/10.18196/jrc.2485.

[61] Y. Irawan, R. Wahyuni, and H. Fonda, “Folding clothes tool using Arduino Uno microcontroller and gear servo,” Journal of Robotics and Control (JRC), vol. 2, no. 3, pp. 170–174, 2021, https://doi.org/10.18196/jrc.2373.

[62] M. H. Zulwidad and I. Sulistiyowati, “Efficiency through automation: A single system for multiple railway guard posts,” Buletin Ilmiah Sarjana Teknik Elektro, vol. 5, no. 3, pp. 407–416, 2023, https://doi.org/10.12928/biste.v5i3.9001.

[63] T. Triwiyanto, W. Caesarendra, V. Abdullayev, A. A. Ahmed, and H. Herianto, “Single lead EMG signal to control an upper limb exoskeleton using embedded machine learning on Raspberry Pi,” Journal of Robotics and Control (JRC), vol. 4, no. 1, pp. 35–45, 2023, https://doi.org/10.18196/jrc.v4i1.17364.

[64] A. Juliano, A. H. Hendrawan, and R. Ritzkal, “Information system prototyping of strawberry maturity stages using Arduino Uno and TCS3200,” Journal of Robotics and Control (JRC), vol. 1, no. 3, pp. 86–91, 2020, https://doi.org/10.18196/jrc.1319.

[65] A. Muqaffi Siswanto and M. Muchlas, “Prototype of automatic sorting of goods in cosmetics warehouse,” Buletin Ilmiah Sarjana Teknik Elektro, vol. 4, no. 3, pp. 142–151, 2023, https://doi.org/10.12928/biste.v4i3.6919.

[66] K. Khairunisa, M. Mardeni, and Y. Irawan, “Smart aquarium design using Raspberry Pi and Android based,” Journal of Robotics and Control (JRC), vol. 2, no. 5, pp. 368–372, 2021, https://doi.org/10.18196/jrc.25109.

[67] A. A. Sahrab and H. M. Marhoon, “Design and fabrication of a low-cost system for smart home applications,” Journal of Robotics and Control (JRC), vol. 3, no. 4, pp. 409–414, 2022, https://doi.org/10.18196/jrc.v3i4.15413.

[68] F. N. Abdullah, G. A. Aziz, and S. W. Shneen, “Simulation model of servo motor by using MATLAB,” Journal of Robotics and Control (JRC), vol. 3, no. 2, pp. 176–179, 2022, https://doi.org/10.18196/jrc.v3i2.13959.


Refbacks

  • There are currently no refbacks.


Copyright (c) 2025 Assoc. Prof. Dr. Phichitphon Chotikunnan, Yutthana Pititheeraphab, Thanate Angsuwatanakul, Jaroonrut Prinyakupt, Tasawan Puttasakul, Rawiphon Chotikunnan, Nuntachai Thongpance

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

 


About the JournalJournal PoliciesAuthor Information

International Journal of Robotics and Control Systems
e-ISSN: 2775-2658
Website: https://pubs2.ascee.org/index.php/IJRCS
Email: ijrcs@ascee.org
Organized by: Association for Scientific Computing Electronics and Engineering (ASCEE)Peneliti Teknologi Teknik IndonesiaDepartment of Electrical Engineering, Universitas Ahmad Dahlan and Kuliah Teknik Elektro
Published by: Association for Scientific Computing Electronics and Engineering (ASCEE)
Office: Jalan Janti, Karangjambe 130B, Banguntapan, Bantul, Daerah Istimewa Yogyakarta, Indonesia