Data-driven LSTM-based control to replace PID for unknown-model electric motor systems

User Rating:  / 0
PoorBest 

Authors:


Pham Thanh Loan, orcid.org/0000-0002-8933-5258, HaNoi University of Mining and Geology, HaNoi, Socialist Republic of Vietnam

Ba Hung Ngo, orcid.org/0000-0003-1818-9203, Thanh Dong University, Haiphong, Socialist Republic of Vietnam

Le Xuan Thanh*, orcid.org/0000-0001-5052-4484, HaNoi University of Mining and Geology, HaNoi, Socialist Republic of Vietnam, e-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.

* Corresponding author e-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.


повний текст / full article



Naukovyi Visnyk Natsionalnoho Hirnychoho Universytetu. 2026, (2): 150 - 157

https://doi.org/10.33271/nvngu/2026-2/150



Abstract:



Purpose.
To develop and validate a data-driven control strategy that replaces the conventional proportional–integral–derivative (PID) controller with a long short-term memory (LSTM) neural network for motor speed regulation in systems with unknown or complex dynamics.


Methodology.
The proposed approach consists of three main stages: 1) operating the motor under a baseline PID controller and collecting operational data (setpoints, measured speeds, and control signals); 2) training an LSTM network to learn the mapping between historical setpoints, measured outputs, and the corresponding control actions generated by the PID; 3) deploying the trained LSTM model in real time as a direct controller. The experimental validation was performed on an embedded testbed comprising a fan motor, a PWM driver, an encoder, and an Arduino Mega 2560, with the LSTM model trained in PyTorch and executed online.


Findings.
The LSTM-based controller successfully tracks changing setpoints and produces smoother control signals than the baseline PID. It achieves comparable or better steady-state error and a stronger correlation between control effort and motor velocity, while reducing oscillations in nonlinear operating regimes.


Originality.
Unlike most prior works, where neural networks assist in PID tuning or provide state estimation, this study demonstrates the direct substitution of PID with an LSTM controller trained solely on operational data, without the need for explicit system identification or physics-based modeling.


Practical value.
The proposed approach offers an effective solution for motor control in scenarios where system identification is infeasible, unreliable, or too costly. It is particularly relevant for low-cost embedded platforms and industrial applications that require adaptive, data-driven control strategies capable of handling nonlinearities and time delays.



Keywords:
LSTM, PID replacement, time-series modeling, motor speed control

References.


1. Shah, P., & Agashe, S. (2016). Review of fractional PID controller. Mechatronics, 38, 29-41. https://doi.org/10.1016/j.mechatronics.2016.06.005

2. Lu, Y., Huang, J., Jiang, Z., Tang, T., Tang, H., & Shi, L. (2024). PID adaptive feedback motor system based on neural network. IEEE Access, 12, 60149-60154. https://doi.org/10.1109/ACCESS.2024.3393029

3. Moulahcene, F., Khalef, R., Benacer, I., Merazga, A., Laib, H., & Hanfoug, S. (2024). Real-Time Speed Control of DC Gear-Motor Using PID Controller and Sliding Mode Control for Robotics. International Conference on Electrical, Computer, Telecommunication and Energy Technologies, 1-6. https://doi.org/10.1109/ECTE-Tech62477.2024.10851156

4. Fu, D., Zhao, X., & Zhu, J. (2024). Robust Tracking Control for Permanent Magnet Linear Synchronous Motors with Unknown Uncertainties via Sliding Mode Approach. International Journal of Control, Automation and Systems, 22(2), 503-516. https://doi.org/10.1007/s12555-022-0438-4

5. Pati, S., Panda, A., & Mohanty, S. (2014). A comparative performance study of scalar controlled induction motor using PID controller and fuzzy PID controller. International conference on circuits, power and computing technologies, 904-909. https://doi.org/10.1109/ICCPCT.2014.7054798

6. Freitas, J. B. S., Marquezan, L., de Oliveira Evald, P. J. D., Peñaloza, E. A. G., & Cely, M. M. H. (2024). A fuzzy-based predictive PID for DC motor speed control. International Journal of Dynamics and Control, 12(7), 2511-2521. https://doi.org/10.1007/s40435-023-01368-2

7. Anh, N. K., & Quang, N. K. (2024). FPGA-based adaptive pid controller using mlp neural network for tracking motion systems. IEEE Access, 12, 91568-91574. https://doi.org/10.1109/ACCESS.2024.3422015

8. Wang, H., Xu, S., & Hu, H. (2023). PID controller for PMSM speed control based on improved quantum genetic algorithm optimization. IEEE Access, 11, 61091-61102. https://doi.org/10.1109/ACCESS.2023.3284971

9. Jin, Y., Du, M., Han, J., & Liu, D. (2024). Research on Self-tuning Fractional Order PID Speed Control of Permanent Magnet Synchronous Motor Based on Torque Observer Compensation. International Conference on Smart Grid and Clean Energy Technologies, 8-13. https://doi.org/10.1109/ICSGCE63738.2024.10830597

10.      Krishnamoorthy, S. K., Das, N., Gudimetla, P., & Emami, K. (2024). Enhanced speed control for BLDC motors using WOA-integrated PID controller optimization. IEEE Access, 12, 162465-162475. https://doi.org/10.1109/ACCESS.2024.3480349

11.      Baidya, D., Dhopte, S., & Bhattacharjee, M. (2023). Sensing system assisted novel PID controller for efficient speed control of DC motors in electric vehicles. IEEE Sensors Letters, 7(1), 1-4.
https://doi.org/10.1109/LSENS.2023.3234400

12.      Turan, A. (2024). Improved PID Control Design for Electric Power Steering DC Motor. IEEE Access, 13, 6080-6088. https://doi.org/10.1109/ACCESS.2024.3524303

13.      Kosten, M. M., Emlek, A., Yildiz, R., & Barut, M. (2023). Rotor speed and load torque estimations of induction motors via LSTM network. Power Electronics and Drives, 8, 310-324. https://doi.org/10.2478/pead-2023-0021

14.      Wang, X., Wei, C., Chen, Y., & Ma, Q. (2024). Improved model-free synergetic control of permanent magnet synchronous motor using unknown input observer. Measurement and Control, 57(8), 1112-1122. https://doi.org/10.1177/00202940241229927

15.      Teler, K., & Orlowska-Kowalska, T. (2023). Analysis of the stator current prediction capabilities in induction motor drive using the LSTM network. Power Electronics and Drives, 8, 31-52. https://doi.org/10.2478/pead-2023-0003

16.      Rakotomalala, T., Perrier, P., & Baraduc, P. (2022). Trajectories predicted by optimal speech motor control using LSTM networks. Annual Conference of the International Speech Communication Association, 630-634. https://doi.org/10.21437/Interspeech.2022-10604

17.      Hammoud, I., Hentzelt, S., Oehlschlaegel, T., & Kennel, R. (2022). Learning-based model predictive current control for synchronous machines: An LSTM approach. European Journal of Control, 68, 100663. https://doi.org/10.1016/j.ejcon.2022.100663

18.      Chen, Z., Liu, Y., & Liu, S. (2017). Mechanical state prediction based on LSTM neural netwok. Chinese control conference, 3876-3881. https://doi.org/10.23919/ChiCC.2017.8027963

19.      Xie, J., Yang, R., Gooi, H. B., & Nguyen, H. D. (2023). PID-based CNN-LSTM for accuracy-boosted virtual sensor in battery thermal management system. Applied Energy, 331, 120424.
https://doi.org/10.1016/j.apenergy.2022.120424

20.      Kim, J. S., Seo, J., Jang, M., & Choi, Y. H. (2025, March). A2SC: Adaptive Speed and Sensorless Control System for Motor Controllers based on Deep-RL. Proceedings of the 40 th ACM/SIGAPP Symposium on Applied Computing, 288-291. https://doi.org/10.1145/3672608.3707767

21.      Hou, S., Li, W., & Huo, T. (2024). Simulated experiments on diesel engine speed control based on LSTM-PID control. Proceedings of the 2024 5 th International Conference on Computing, Networks and Internet of Things, 241-245. https://doi.org/10.1145/3670105.3670145

22.      Adil, M., & Vilanova, R. (2025). LSTM-Based Neural Network Controllers as Drop-In Replacements for PI Controllers in a Wastewater Treatment Plant. Applied Sciences, 15(22), 12046.
https://doi.org/10.3390/app152212046

23.      He, W., Zhang, H., Zhang, H., Zou, J., & Sun, H. (2025, July). Improved LSTM Neural Network-Based PID Control for Automotive Active Suspension Systems. Chinese Control Conference, 2749-2754. https://doi.org/110.23919/CCC64809.2025.11179538

24.      Atim, O. E., & Shukri, M. I. (2025). Application of Long Short-Term Memory (LSTM) Networks for Adaptive PID Parameter Prediction in Dynamic DC Motor Speed Control. International Journal of Advances in Engineering and Management, 7(6), 360-368. https://doi.org/10.35629/5252-0706360368

25.      Le, T. T. H., Oktian, Y. E., Jo, U., & Kim, H. (2023). Time series electrical motor drives forecasting based on simulation modeling and bidirectional long-short term memory. Sensors, 23(17), 7647. https://doi.org/10.3390/s23177647

26.      Inanc, E., Habboush, A., Gurses, Y., Yildiz, Y., & Annaswamy, A. M. (2025). Neural Network Adaptive Control With Long Short-Term Memory. International Journal of Adaptive Control and Signal Processing, 39(9), 1870-1885. https://doi.org/10.1002/acs.4029

27.      Ping, B., Zeng, D., Hu, Y., & Xie, Y. (2024). Neural network predictive controller based on the improved TPA-LSTM model for ultra-supercritical units. Heliyon, 10(12), e31997. https://doi.org/10.1016/j.heliyon.2024.e31997

28.      Ademir Morales Perez, E., & Iba, H. (2021). LSTM neural network-based predictive control for a robotic manipulator. International Symposium on Electrical, Electronics and Information Engineering, 128-135. https://doi.org/10.1145/3459104.3459127

29.      Patil, M. S., Charuku, B., & Ren, J. (2021). Long short-term memory neural network-based system identification and augmented predictive control of piezoelectric actuators for precise trajectory tracking. IFAC-PapersOnLine, 54(20), 38-45. https://doi.org/10.1016/j.ifacol.2021.11.150

 

Guest Book

If you have questions, comments or suggestions, you can write them in our "Guest Book"

Registration data

ISSN (print) 2071-2227,
ISSN (online) 2223-2362.
Journal was registered by Ministry of Justice of Ukraine.
Registration number КВ No.17742-6592PR dated April 27, 2011.

Contacts

D.Yavornytskyi ave.,19, pavilion 3, room 24-а, Dnipro, 49005
Tel.: +38 (066) 379 72 44.
e-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
You are here: Home Home EngCat Archive 2026 Content №2 2026 Data-driven LSTM-based control to replace PID for unknown-model electric motor systems