Neural network imitating an optimisation-based EMS: proof of concept on a PLC

Authors

  • Borja Monsalvez Pozo Universitat Politècnica de València
  • Xavier Blasco Universitat Politècnica de València
  • Alberto Pajares Ferrando Universitat Politècnica de València
  • Javier Sanchis Universitat Politècnica de València

DOI:

https://doi.org/10.17979/ja-cea.2026.47.13768

Keywords:

EMS, Smart grids, MPC, Neural network, Predictive control, CODESYS, PLC, Energy storage

Abstract

This paper presents a proof-of-concept of an artificial-intelligence-based energy management system (EMS) for smart grids with battery storage. A multilayer perceptron (MLP) is trained to approximate the optimal control decisions of a model predictive control (MPC) EMS that solves a mixed-integer linear programming (MILP) problem at each time step. The AI model, trained on 267,894 input-output pairs generated by the reference optimiser, replicates the optimal control policy with an RMSE of 0.073 and an inference time approximately 21 times lower than the optimiser. The network is fully implemented in CODESYS on a simulated PLC, demonstrating its operation on a standard IEC 61131-3 industrial controller. Results validate the feasibility of replacing a MILP optimiser with a neural network for real-time energy management under limited computational resources.

References

Bordons, C., Garcia-Torres, F., & Ridao, M. A. (2020). Model Predictive Control of Microgrids. https://doi.org/10.1007/978-3-030-24570-2

Garcia-Torres, F., & Bordons, C. (2015). Optimal Economical Schedule of Hydrogen-Based Microgrids With Hybrid Storage Using Model Predictive Control. IEEE Transactions on Industrial Electronics, 62(8), 5195–5207. https://doi.org/10.1109/TIE.2015.2412524

Hossain, M. S., Madlool, N. A., Rahim, N. A., Selvaraj, J., Pandey, A. K., & Khan, A. F. (2016). Role of smart grid in renewable energy: An overview. In Renewable and Sustainable Energy Reviews (Vol. 60, pp. 1168–1184). Elsevier Ltd. https://doi.org/10.1016/j.rser.2015.09.098

Liu, C., Shi, S., Alan, A., Venayagamoorthy, G. K., & De Schutter, B. (2025). Approximate Model Predictive Control for Microgrid Energy Management via Imitation Learning. https://doi.org/10.48550/arXiv.2510.20040

Matrone, S., Pozzi, A., Ogliari, E., & Leva, S. (2024). Deep Learning-Based Predictive Control for Optimal Battery Management in Microgrids. https://doi.org/10.1109/ACCESS.2024.3458435

Pajares, A., Vivas, F. J., Blasco, X., Herrero, J. M., Segura, F., & Andújar, J. M. (2023). Methodology for energy management strategies design based on predictive control techniques for smart grids. Applied Energy, 351. https://doi.org/10.1016/j.apenergy.2023.121809

Vivas, F. J., Pajares, A., Blasco, X., Herrero, J. M., Segura, F., & Andújar, J. M. (2025). A novel energy management system based on two-level hierarchical economic model predictive control for use in microgrid control. Energy Conversion and Management: X, 26. https://doi.org/10.1016/j.ecmx.2025.101027

Werner, B. (2009). Object-oriented extensions for IEC 61131-3. IEEE Industrial Electronics Magazine, 3(4), 36–39. https://doi.org/10.1109/MIE.2009.934795

Downloads

Published

2026-09-01

Issue

Section

Control Inteligente