Cascade Control of a 2R Planar Robot for Trajectory Tracking Using an Ensemble MLP-Based Inverse Kinematics

Angie Paola Mancipe García, Nicolás David Barrera Fonseca, Jorge E Cote-Ballesteros, Jhon Edisson Rodríguez Castellanos, Fabián Barrera Prieto

Abstract

This article presents the design and implementation of a cascade control scheme applied to a two degree of freedom (2R) planar robot, focused on trajectory tracking. The system architecture integrates three hierarchical loops: current, speed, and position. The current loop was characterized using the Smith two-point method, while the speed and position loops were tuned using the relay method of Åström and Hägglund, thus enabling the tuning of PI controllers. The actuators are DC motors equipped with incremental encoders for position and speed measurement, along with INA219 sensors for current measurement, programmed through the NUCLEO STM32F746ZG board. In addition, the Raspberry Pi 4 was responsible for supervision, trajectory processing, graphical interface, and neural network execution. Inverse kinematics was solved using an ensemble model of Multilayer Perceptrons (MLP) trained with synthetic data, achieving an RMSE of 0,1046° in θ_1 and 0,0533° in θ_2, outperforming individual models. The motors achieved settling times close to 1 s, overshoots below 3%, and steady-state errors under ±0,12°. The system demonstrated precision in contour tracing, obtained through real-time image processing (e.g., the Windows logo), highlighting the feasibility of integrating cascade control and neural networks into low-cost embedded systems, with applications in education, automation, and robotic prototypes.

 

Keywords: Artificial intelligence, MLP Neural Network, Robotics, Inverse kinematics, Hierarchical control, Cascade control, Trajectory tracking, Raspberry Pi 4, STM32F746ZG.

 

DOI https://doi.org/10.55463/issn.1674-2974.53.8.2


Full Text:

PDF


References


T. N. GÜCIN, M. BIBEROGLU, B. FINCAN, and M. O. GÜLBAHÇE, “Tuning Cascade PI(D) Controllers in PMDC Motor Drives: A Performance Comparison for Different Types of Tuning Methods,” in 2015 9th International Conference on Electrical and Electronics Engineering (ELECO), Bursa, Turkey: IEEE, Feb. 2016, pp. 1061–1066. doi: 10.1109/ELECO.2015.7394556.

M. VEDADI, A. I. SOLIMAN, and R. KENNEL, “Optimized Angular Position Control of Brushless DC Motor Using Imperialist Competitive Algorithm Based on FOC and Trapezoidal Control,” in 2021 23rd European Conference on Power Electronics and Applications (EPE’21 ECCE Europe), Ghent, Belgium: IEEE, Oct. 2021, p. P.1-P.10. doi: 10.23919/EPE21ECCEEurope50061.2021.9570609.

M. AFKAR, R. GAVAGSAZ-GHOACHANI, M. PHATTANASAK, S. PIERFEDERICI, and W. SAKSIRI, “Local-Stability Analysis of Cascaded Control for a Switching Power Converter,” Journal of Robotics and Control (JRC), vol. 5, no. 1, pp. 160–172, 2024, doi: 10.18196/jrc.v5i1.20302.

C. BUDAI, T. TÓTH-KATONA, and P. STUMPF, “Novel design method for cascade control structure of electric drives: Closed-form expressions for control gains via pole placement,” IET Control Theory and Applications, vol. 18, no. 17, pp. 2448–2467, Nov. 2024, doi: 10.1049/cth2.12747.

M. F. CANKURTARAN and A. E. KOCAMIS, “Sensorless Speed Control of PMDC Motor with Cascade PI Controller,” in 2019 International Symposium ELMAR, Zadar, Croatia: IEEE, Dec. 2019. doi: 10.1109/ELMAR.2019.8918654.

A. MERABET, “Cascade second order sliding mode control for permanent magnet synchronous motor drive,” Electronics (Switzerland), vol. 8, no. 12, pp. 1–13, Dec. 2019, doi: 10.3390/electronics8121508.

D. HANDAYA and R. FAUZIAH, “Proportional-integral-derivative and linear quadratic regulator control of direct current motor position using multi-turn based on LabView,” Journal of Robotics and Control (JRC), vol. 2, no. 4, pp. 332–336, Jul. 2021, doi: 10.18196/jrc.24102.

JAROSLAV. DUDRIK, “Brushless DC Motor Controller Optimization Using Simulated Annealing,” in 2019 International Conference on Electrical Drives & Power Electronics (EDPE), The High Tatras, Slovakia: IEEE, Oct. 2019, pp. 292–297. doi: 10.1109/EDPE.2019.8883924.

K. SOZAŃSKI, “Low Cost PID Controller for Student Digital Control Laboratory Based on Arduino or STM32 Modules,” Electronics (Switzerland), vol. 12, no. 15, pp. 1–23, Aug. 2023, doi: 10.3390/electronics12153235.

I. SHAMTA and M. ZEYVELI, “Real-Time Implementation and Performance Evaluation of a PID-Controlled DC Motor System Using STM32,” Authorea, pp. 1–7, May 2025, doi: 10.22541/au.174705847.75205805/v1.

W. LU, “A Kind of PWM DC Motor Speed Regulation System Based on STM32 with Fuzzy-PID Dual Closed-Loop Control,” in Intelligent Computing Methodologies, vol. 13395, Xian, China: Springer, Cham, 2022, pp. 106–113. doi: 10.1007/978-3-031-13832-4_9.

D. T. TRAN, N. M. HOANG, N. H. LOC, Q. T. TRUONG, and N. T. NHA, “A Fuzzy LQR PID Control for a Two-Legged Wheel Robot with Uncertainties and Variant Height,” Journal of Robotics and Control (JRC), vol. 4, no. 5, pp. 612–620, Sep. 2023, doi: 10.18196/jrc.v4i5.19448.

Y. K. YASEEN, A. H. MHMOOD, M. R. SUBHI, A. B. RAKAN, and H. A. MOHAMMED, “Advanced Flowrate Control of Petroleum Products in Transportation: An Optimized Modified Model Reference PID Approach,” Journal of Robotics and Control (JRC), vol. 4, no. 5, pp. 591–599, Sep. 2023, doi: 10.18196/jrc.v4i5.19177.

N. NURNUANSUWAN, A. LONKLANG, and K. CHAMNIPRASART, “A Prototyping of 2-DOF Robot Arm Using Feedback Control System,” in 2019 5th International Conference on Control, Automation and Robotics (ICCAR), Beijing, China: IEEE Press, Aug. 2019, pp. 368–372. doi: 10.1109/ICCAR.2019.8813726.

F. J. TRIVENO VARGAS and C. ARROYO, “Modelamiento y simulación de un robot SCARA de tres grados de libertad empleando SolidWorks y Matlab/Simulink®,” Acta Nova revista de Ciencias y Tecnología, vol. 10, no. 3, pp. 318–344, Jun. 2025, doi: 10.35319/acta-nova/202254.

R. LIU, F. NAGEOTTE, P. ZANNE, M. DE MATHELIN, and B. DRESP-LANGLEY, “Deep reinforcement learning for the control of robotic manipulation: A focussed mini-review,” Robotics, vol. 10, no. 1, pp. 1–13, Mar. 2021, doi: 10.3390/robotics10010022.

W. CHOU and Y. LIU, “An Analytical Inverse Kinematics Solution with the Avoidance of Joint Limits, Singularity and the Simulation of 7-DOF Anthropomorphic Manipulators,” Transactions of FAMENA, vol. 48, no. 1, pp. 117–132, Jan. 2024, doi: 10.21278/TOF.481055523.

M. VEDADI, “Optimized Cascaded Position Control of BLDC Motors Considering Torque Ripple,” in 2025 International Conference on Emerging Technologies in Electronics, Computing, and Communication (ICETECC), Jamshoro, Pakistan: IEEE, Apr. 2025, pp. 1–6. doi: 10.1109/ICETECC65365.2025.11071137.

D. O. SANTOS, L. MOLINA, J. G. N. CARVALHO, E. A. N. CARVALHO, and E. O. FREIRE, “Modifications of Fully Resampled PSO in the Inverse Kinematics of Robot Manipulators,” IEEE Robot. Autom. Lett., vol. 9, no. 2, pp. 1923–1928, Feb. 2024, doi: 10.1109/LRA.2024.3349927.

Y. V. THI, N. W. YAO, H. N. HUU, C. P. VAN, and T. N. MANH, “Neural Network-Based Adaptive Robust Fractional PID Control for Robotic Systems,” Journal of Robotics and Control (JRC), vol. 6, no. 4, pp. 1790–1801, Jul. 2025, doi: 10.18196/jrc.v6i4.26460.

S. B. ŠEGOTA, N. ANĐELIĆ, V. MRZLJAK, I. LORENCIN, I. KURIC, and Z. CAR, “Utilization of multilayer perceptron for determining the inverse kinematics of an industrial robotic manipulator,” Int. J. Adv. Robot. Syst., vol. 18, no. 4, pp. 1–11, Jul. 2021, doi: 10.1177/1729881420925283.

M. N. VU, F. BECK, M. SCHWEGEL, C. HARTL-NESIC, A. NGUYEN, and A. KUGI, “Machine learning-based framework for optimally solving the analytical inverse kinematics for redundant manipulators,” Mechatronics, vol. 91, p. 102970, May 2023, doi: 10.1016/j.mechatronics.2023.102970.

V. HLAVÁČ, “Accuracy of the Inverse Kinematics of a Planar Redundant Manipulator Solved by an MLP Neural Network,” in Advances in Mechanism Design IV, Springer, Cham, Aug. 2024, pp. 202–211. doi: 10.1007/978-3-031-70251-8_22.

A. GHOLAMI, T. HOMAYOUNI, R. EHSANI, and J. Q. SUN, “Inverse kinematic control of a delta robot using neural networks in real-time,” Robotics, vol. 10, no. 4, pp. 1–12, Dec. 2021, doi: 10.3390/robotics10040115.

F. E. AYSAL, İ. ÇELİK, E. CENGİZ, and Y. OĞUZ, “A Comparison of Multi-Layer Perceptron and Inverse Kinematic for RRR Robotic Arm,” Politeknik Dergisi, vol. 27, no. 1, pp. 121–131, Feb. 2024, doi: 10.2339/politeknik.1092642.

A. CALZADA-GARCIA, J. G. VICTORES, F. J. NARANJO-CAMPOS, and C. BALAGUER, “A Review on Inverse Kinematics, Control and Planning for Robotic Manipulators With and Without Obstacles via Deep Neural Networks,” Algorithms, vol. 18, no. 1, pp. 1–19, Jan. 2025, doi: 10.3390/a18010023.

J. HERNÁNDEZ DÍAZ, M. IPARRAGUIRRE MONZÓN, C. MONTENEGRO CASTRO, J. ALVA ALCÁNTARA, and E. MANZANO RAMOS, “Modelado no paramétrico de robot SCARA 3-GDL utilizando redes neuronales recurrentes,” Revista de Investigaciones, vol. 10, no. 4, pp. 379–390, Dec. 2021, doi: 10.26788/riepg.v10i4.3502.

R. BOUZID, H. GRITLI, and J. NARAYAN, “ANN Approach for SCARA Robot Inverse Kinematics Solutions with Diverse Datasets and Optimisers,” Applied Computer Systems, vol. 29, no. 1, pp. 24–34, Jun. 2024, doi: 10.2478/acss-2024-0004.

M. X. GONZÁLEZ, A. M. BRUGIATI, D. H. CORNEJO, and C. I. PINZÓN, “Prototipo de mano robótica controlada mediante el procesamiento de señales cerebrales utilizando redes neuronales recurrentes,” Revista de Iniciación Científica, vol. 6, no. 4, pp. 54–59, Jul. 2021, doi: 10.33412/rev-ric.v6.0.3154.

W. GU, Z. CHANG, Q. WANG, and W. XU, “Design of intelligent robot based on Raspberry PI vision recognition,” in Ninth International Symposium on Sensors, Mechatronics, and Automation System (ISSMAS 2023), L. Pan and Z. Zhou, Eds., SPIE, Mar. 2024, p. 76. doi: 10.1117/12.3014817.

S. E. MATHE, A. C. PAMARTHY, H. K. KONDAVEETI, and S. VAPPANGI, “A Review on Raspberry Pi and its Robotic Applications,” in 2022 2nd International Conference on Artificial Intelligence and Signal Processing (AISP), Vijayawada, India: IEEE, Apr. 2022, pp. 1–6. doi: 10.1109/AISP53593.2022.9760590.

N. RUSSO, T. MADSEN, and K. NIKOLIC, “An Implementation of Communication, Computing and Control Tasks for Neuromorphic Robotics on Conventional Low-Power CPU Hardware,” Electronics (Switzerland), vol. 13, no. 17, pp. 1–21, Sep. 2024, doi: 10.3390/electronics13173448.

D. GRECO, M. FASIHIANY, A. V. RANJBAR, F. MASULLI, S. ROVETTA, and A. CABRI, “Computer Vision Algorithms on a Raspberry Pi 4 for Automated Depalletizing,” Algorithms, vol. 17, no. 8, pp. 1–15, Aug. 2024, doi: 10.3390/a17080363.

L. ZHENG, “Analytical Inverse Kinematics for a Prismatic-Revolute Hybrid Joints Radiography Robot Mounted on the Ambulance,” IEEE/ASME Transactions on Mechatronics, vol. 30, no. 2, pp. 1366–1376, Aug. 2024, doi: 10.1109/TMECH.2024.3442782.

M. N. HUYNH, H. N. DUONG, and V. H. NGUYEN, “A Comparative Study of Nonlinear Control and Passivity-Based Control using Neural Networks for A Bicycle Robot,” Journal of Robotics and Control (JRC), vol. 6, no. 2, pp. 594–604, Mar. 2025, doi: 10.18196/jrc.v6i2.26073.

W. ARIBOWO, B. SUPRIANTO, and U. T. KARTINI, “Cooperation search algorithm for tuning automatic voltage regulator system,” International Journal of Power Electronics and Drive Systems, vol. 13, no. 3, pp. 1761–1769, Jul. 2022, doi: 10.11591/ijpeds.v13.i3.pp1761-1769.

E. EKER, M. KAYRI, S. EKINCI, and D. IZCI, “A New Fusion of ASO with SA Algorithm and Its Applications to MLP Training and DC Motor Speed Control,” Arab. J. Sci. Eng., vol. 46, no. 4, pp. 3889–3911, Jul. 2021, doi: 10.1007/s13369-020-05228-5.

W. ZHAI and L. DONG, “Design and implementation of two-wheeled self-balancing mobile robot control system based on STM32-MAT and Android,” Journal of Measurements in Engineering, vol. 13, no. 3, pp. 596–616, Jul. 2025, doi: 10.21595/jme.2025.24881.

A. MAARIF 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, Jul. 2021, doi: 10.18196/jrc.25122.

M. RADONJIĆ, Ž. ZEČEVIĆ, and B. KRSTAJIĆ, “An IoT System for Real-Time Monitoring of DC Motor Overload,” Electronics (Switzerland), vol. 11, no. 10, pp. 1–14, Jul. 2022, doi: 10.3390/electronics11101555.

D. A. N. K. SUHERMANTO, “Monitoring DC Motor Based on LoRa and IOT,” Journal of Robotics and Control (JRC), vol. 5, no. 1, pp. 54–61, Jul. 2024, doi: 10.18196/jrc.v5i1.19642.

C. LOSADA-GUTIÉRREZ, F. ESPINOSA, C. CRUZ, and B. P. ALVARADO, “Electronic Control Unit and Digital Twin Based on Raspberry Pi 4 for Testing the Remote Nonlinear Trajectory Tracking of a P3-DX Robot,” Actuators, vol. 14, no. 8, pp. 1–16, Jul. 2025, doi: 10.3390/act14080376.

J. VEGA and J. M. CAÑAS, “Open vision system for low-cost robotics education,” Electronics (Switzerland), vol. 8, no. 11, pp. 1–20, Jul. 2019, doi: 10.3390/electronics8111295.

E. A. RUELAS, J. CRUZ, E. RUELAS. IEEE, “Statistical Control of Multivariant Processes Through the Artificial Neural Network Multilayer Perceptron and the MEWMA Graphic Analysis,” IEEE Latin America Transactions, vol. 18, no. 6, pp. 1041–1048, May 2020.

S. KUNINTI and S. ROOBAN, “Backpropagation Algorithm and its Hardware Implementations: A Review,” in Journal of Physics: Conference Series, IOP Publishing, Mar. 2021, pp. 1–10. doi: 10.1088/1742-6596/1804/1/012169.

A. P. M. GARCÍA, N. D. B. FONSECA, J. E. C. BALLESTEROS, J. E. R. CASTELLANOS, and F. B. PRIETO, “Cinemática inversa para un robot planar 2R basada en una red neuronal con datos sintéticos a través de un enfoque de ensamble de modelos,” Revista colombiana de tecnologias de avanzada (RCTA), vol. 2, no. 46, pp. 40–48, Jul. 2025, doi: 10.24054/rcta.v2i46.3583.

Y. SHAO, F. M. DIETRICH, C. NETTELBLAD, and C. ZHANG, “Training algorithm matters for the performance of neural network potential: A case study of Adam and the Kalman filter optimizers,” Journal of Chemical Physics, vol. 155, no. 20, pp. 1–9, Jul. 2021, doi: 10.1063/5.0070931.

K. J. . ÅSTRÖM and TORE. HÄGGLUND, PID Controllers : theory, design, and tuning. Wiley, 1995.

K. TONG, C. GRUSSLER, and M. S. CHONG, “Self-sustained oscillations in discrete-time relay feedback systems,” in 2025 IEEE 64th Conference on Decision and Control (CDC), Rio de Janeiro, Brazil: IEEE, Dec. 2025, pp. 4125–4130. doi: 10.1109/CDC57313.2025.11312346.

M. RABI, “Relay Self-Oscillations for Second Order, Stable, Nonminimum Phase Plants,” IEEE Trans. Automat. Contr., vol. 66, no. 9, pp. 4282–4288, Oct. 2020, doi: 10.1109/tac.2020.3030893.

A. REHAN, I. BOIKO, and Y. ZWEIRI, “Autotuning of PID controller using the modified relay feedback test and optimization under uncertainty principle for robotic manipulators,” IET Control Theory and Applications, vol. 18, no. 5, pp. 581–602, Mar. 2024, doi: 10.1049/cth2.12592.

D. PAVKOVIĆ, D. LISJAK, D. KOLAR, and M. CIPEK, “PI/PID Controller Relay Experiment Auto-Tuning with Extended Kalman Filter and Second-Order Generalized Integrator as Parameter Estimators,” Tehnicki Vjesnik, vol. 30, no. 3, pp. 715–723, Apr. 2023, doi: 10.17559/TV-20221003112627.

M. A. GANAIE, M. HU, A. K. MALIK, M. TANVEER, and P. N. SUGANTHAN, “Ensemble deep learning: A review,” Eng. Appl. Artif. Intell., vol. 115, p. 105151, Oct. 2022, doi: 10.1016/j.engappai.2022.105151.


Refbacks

  • There are currently no refbacks.