1. Introduction
Modern industrial production is undergoing rapid transformation under the influence of digitalization [
1,
2], the development of sensor technologies, and the integration of artificial intelligence methods [
3]. The reliability and efficiency of equipment remain key requirements, as even short-term downtime can lead to significant financial losses and disruption of technological processes. Electric motors, forming the basis of most electromechanical systems, are increasingly used in advanced applications such as electric vehicles [
4,
5,
6], robotics, and automated production lines, where their performance directly determines the overall system efficiency and reliability [
7,
8].
Traditional control and diagnostics approaches, while still widespread, often do not provide the necessary level of adaptability and early fault detection [
9], especially in the context of growing complexity and variability of operating conditions [
10,
11].
If the three-phase voltage is unbalanced, there will be reverse-sequence current and a reverse-sequence magnetic field in the motor, which will create more reverse-sequence torque, resulting in an unbalanced three-phase motor current distribution and increased phase winding current. When the three-phase voltage asymmetry reaches 5%, the motor phase current can exceed 20% of the normal value. Three-phase voltage asymmetry is mainly manifested as the following:
Anomalies occurring in one phase of a three-phase transformer winding transmitting an unbalanced supply voltage.
Long transmission lines, with an unequal wire cross-section size and different impedance voltage drop, resulting in unbalanced voltage in each phase.
When power supply and lighting have a common, mixed, single-phase load, such as for the following—household appliances, electric furnaces, welding machines, etc.—and are too concentrated in a single or two phases, this results in unequal load distribution of each phase, so that the supply voltage and current are imbalanced.
The emergence of predictive maintenance and model predictive control (MPC) technologies marks a new stage in the evolution of industrial automation. Predictive diagnostics, based on machine learning and artificial neural networks, enables the forecasting of equipment states, detection of anomalies [
1], and proactive intervention before critical failures occur [
8]. The integration of MPC with diagnostic systems allows for real-time consideration of operational constraints (such as current and voltage limits), which minimizes the risk of overheating, overloading, and extends the service life of electric motors [
12,
13]. Various control methods, including deadbeat predictive control, have been developed to enhance PMSM drive performance [
14,
15,
16,
17,
18].
Recent studies demonstrate the effectiveness of combining advanced sensor systems [
19], machine learning algorithms (including ARIMA, Random Forest, and LSTM), and data-driven approaches for monitoring and controlling electric motors in industrial environments [
8]. The use of bluetooth and high-speed data acquisition systems, as well as the implementation of hybrid control structures, are becoming industry standards in the context of Industry 4.0.
Moreover, the development and implementation of such hybrid solutions require in-depth modeling and tuning [
20], including the use of artificial neural networks to improve prediction accuracy and control quality [
21]. The relevance of this direction is confirmed by recent publications in leading scientific journals, which highlight the growing role of predictive models and digital technologies in ensuring the reliability and efficiency of modern control systems.
Thus, the creation of integrated systems that combine predictive diagnostics and model predictive control is a promising and urgent task, aimed at improving the quality of control [
22,
23,
24], reducing response time to deviations, and ensuring the reliable operation of equipment in modern industrial enterprises.
2. Materials and Methods
2.1. Predictive Control Method in Electric Motor Diagnostics
The MPC-based control system works efficiently due to regular input of measurements of object parameters such as current, voltage, speed and evaluation of their compliance with target values that consider the history of previous states (
Figure 1). The controlled parameters are calculated in such a way as to ensure minimal deviations from the target values while remaining within the set limits, which is particularly important for stable and safe operation of the motor (
Figure 2). In this case, a computer model developed in the Python 3.13 programming language is investigated.
The current voltage and shaft speed parameters can also be compared by the MRS controller in the process of evaluating the current state of the motor. If deviations from optimum operation are detected, the controller takes corrective action, preventing possible failures, reducing the risk of overloads, and extending the life of the equipment. This ensures higher reliability and efficiency of the equipment.
One of the key benefits of MPC is its ability to predict future system states, allowing potential faults to be detected early. By predicting potential abnormalities and automatically correcting them, the MPC controller minimizes risk and downtime, improving overall system performance and reliability. MPC also adapts to changes in system parameters and external conditions, making it a flexible and efficient tool for industrial applications [
1,
9,
20].
However, despite its high efficiency, MPC has its limitations. Complex mathematical models are required to achieve high prediction accuracy, and their implementation and tuning often require significant computational resources and time. Powerful hardware is often required to perform operational calculations, which can increase implementation costs. In addition, the development and calibration of such systems can be technically challenging, especially for applications with rapidly changing parameters or multi-tasking processes.
2.2. Modeling of Electric Motor Control System
In this paper, a permanent magnet synchronous motor is chosen as a test model. Since current control minimizes resistance losses and reduces drive heating, the observed parameters are the stator current and voltage, which determine the overall system efficiency. These parameters not only directly affect the energy efficiency of the motor, but also ensure optimal thermal behavior, prevent premature wear, and increase the long-term reliability of the equipment [
24].
To simplify the control, the separation of the current components into d (i_sd) and q (i_sq) axes is used (
Figure 3). The i_sd current controls the magnetic flux of the motor, which affects the induction of the windings, while the i_sq current is responsible for generating the electromagnetic torque, allowing more precise and flexible control of the drive operation. In three-phase electric motors, control is achieved by applying voltages to three stator windings, which are usually designated as phases a, b and c.
This separate control improves the dynamic response of the system, reduces power consumption and guarantees stable motor operation even under varying loads and operating conditions [
4,
25].
The Python 3.13 programming language was used to model the control system; ‘numpy’ and ‘matplotlib’ are libraries designed for mathematical calculations and visualization; ‘gym-electric-motor’ is a library for motor simulation and algorithm testing; ‘GEKKO’ is a module to increase the accuracy of calculations and optimize the process (
Figure 4).
In addition, the use of these tools accelerated prototyping and analysis of the system behavior in different operating scenarios, which greatly improved the efficiency of development.
Plotting the graphs showed how key parameters change during motor operation: the standard deviation function, the nominal and actual current value in each axis relative to the magnet rotor axis, and the voltage in both axes.
The negative standard deviation function (MSE) was chosen as the reward function:
where
n = 2,
Y1 and
Y2 are the axis current values, and
Ŷ1 and
Ŷ2 are the target axis current values.
Ua, Ub, and Uc are the voltages that are applied to the stator windings and control the motors. The controller must influence the motor by precisely adjusting these voltages to maintain stable operation and achieve the required performance. The simulation was carried out under uniform motor load conditions with angular velocity ω = 301,000/π radians/s for one second. The simulation analyzed the response of the system to changes in control parameters and determined the optimum settings to maximize the efficiency and stability of the motor operation [
26,
27,
28].
For the initial evaluation of the system, a test without a controller was run, which showed that the motor parameters quickly exceed the acceptable limits, leading to system failure (failures are marked by red vertical lines in the graph) (
Figure 5).
This confirms the need to control parameters using controllers to prevent failures.
Modeling using PID controllers: Three PID controllers were added to the model: two for each current axis and one for speed control.
Figure 6 shows the changes in key parameters of the engine control system over time. Analysis of the graph shows that the use of PID controllers has stabilized the engine operation, preventing sharp fluctuations in parameters. PID controllers successfully prevent parameters (such as current and voltage) from going beyond acceptable limits. The use of PID controllers has led to an improvement in the overall assessment of the system (which was −869 points), indicating an increase in the efficiency and reliability of the engine.
Modeling using FOC controller: Field-oriented controllers (FOCs) are designed to control the currents of synchronous motors. For continuous variables, the control is performed in rotary coordinates dq, and the two current components are handled separately by two independent controllers, one controlling the motor flux and the other the torque. For discrete controlled variables, control is performed in stator coordinates and the controlled variables are calculated separately for each current component [
29,
30].
In the simulation, the FOC controller is used in combination with vertical and horizontal PID controllers to maintain the current components at the required levels. As a result, the final score is −552.9, which is an improvement.
Figure 7 shows that oscillations occur only at transition points; the rest of the time the system is in a steady state.
Use of predictive controller (MPC): The predictions of the developed MPC controller are based on the history of changes in the system parameters. Constraint-based control is achieved using the controller, which in turn allows the controller to calculate the control for a given number of steps [
5,
14,
31].
The initial state of the controller is based on the boundary values of the motor parameters, and the main algorithm is realized in the ‘control’ function. In this function, the current state of the system is compared with the target values and the error function is optimized to minimize the deviation; using the Python library ‘GEKKO’, control variables (u_d, u_q) can be generated, converted into phase voltages, normalized and corrected according to the constraints.
A five-step prediction horizon was chosen to test the MPC controller. The results showed a final score of −626, which is lower than previous experiments (
Figure 8).
At the same time, MPC demonstrated faster system stability recovery and shorter transient time. This makes the predictive controller a promising solution for motor control under varying load conditions and the need for precise control [
15,
16].
2.3. Theoretical Basis for Predictive Control: MPC Mathematical Apparatus and Its Applications
Model Predictive Control (MPC) is a powerful control method based on mathematical prediction and optimization. This type of controller is used to control complex systems, such as electric motors, which require a high degree of accuracy and adaptability. The MPC controller concept uses a model of an object to predict its future behavior. Control actions are then optimized to minimize deviations from the target state, considering the system constraints.
Mathematical model of MPC controller. The application of MPC to an electric motor control system starts with the construction of a mathematical model. This model describes its dynamic behavior through a system of equations containing current, voltage, speed, and torque parameters. A linear model can be used as the simplest model. But to ensure higher accuracy, nonlinear models are often used because they allow the relationship between different motor parameters to be considered [
17,
18].
Suppose that the motor control system is described by a linear discrete equation:
where
χκ is the state vector at step
k,
uκ is the control action, [
A] and [
B] are matrices describing the dynamic behavior of the system.
The application of MPC will minimize the objective function and find the optimal values of u to keep the system within the given constraints.
Optimization methodology: To compute the control process in MPC and find the solution in real time, iterative optimization methods are widely used: the Lagrangian and gradient descent methods. Depending on the nature of the system and the complexity of the target, an optimization method is chosen [
6,
19]. The Lagrangian method can be used to solve optimization problems with constraints, in this case on voltage or current. Lagrange multipliers are calculated to determine the constraints on the variables and allow the MPC to calculate the control signals given the system constraints. The gradient descent method can be applied to the cost function minimization problem by iteratively adjusting the control parameters in the anti-gradient direction. This method is relevant when the model is nonlinear and more complex algorithms are difficult to use. Quadratic Programming (QP) methods contain QP algorithms that are often used in linear and quadratic systems. These algorithms provide efficient solution search by introducing quadratic target functions and linear constraints. QP can compute control actions with high speed, so its use is relevant in real-time applications.
When controlling an electric motor, the use of MPC controller is conditioned by the necessity to keep the current and speed parameters within the specified limits. This condition will reduce wear and tear and extend the life of the equipment. Under varying load conditions, MPC significantly improves the stability and efficiency of electric motor operation due to its predictive properties and correction of the system behavior [
32,
33]. The use of MPC in electric motor control provides fast response to parameter deviations, prevention of overloads and overheating, and an efficiency improvement due to dynamic adaptation of control actions in real time.
We have added an experimental flowchart (
Figure 9). for robustness analysis, introduced parameter uncertainty, determined stability using Lyapunov methods, and finally revised the parameters of the MPC algorithm.
3. Research and Discussion
Modeling an MPC controller based on a neural network: LSTM (Long Short-Term Memory) is a recurrent neural network architecture designed to efficiently capture and utilize long-term dependencies in data (
Figure 10 and
Figure 11).
First proposed in 1997, LSTM has subsequently been improved and adapted for various tasks where time sequences need to be considered [
34].
The main advantage of LSTMs over traditional recurrent neural networks is that they avoid the problems of fading and gradient discontinuity, which makes them ideal for dealing with time-dependent data. These elements allow LSTMs to efficiently store and update information over long time intervals, making them suitable for control tasks such as motor control, where it is important to consider the sequence of parameter measurements and their time dependence (
Figure 12). LSTMs are well suited for this control task. This is because motor control requires considering the sequence of measurements of different parameters over time, and LSTMs can store and utilize this information efficiently. In practical applications, the controller can be implemented using either the STM32H7 series or a DSP + FPGA combination. Both solutions offer excellent real-time performance and can support neural networks and time-sensitive control algorithms. For example, the STM32H743 model features 1 MB of Flash memory, 512 KB of RAM, and operates at a 480 MHz clock frequency.
The hybrid model used in this paper combines two layers: LSTM and a full-channel layer (
Figure 13). This type of architecture is used to build the controller interface. In this case, the current state of the motor and target parameters are taken as input, and control signals are output by the controller [
2,
35].
The gym-electric-motor library models electric motors with complex nonlinear dynamics, complicating direct fault backpropagation. To address this, we developed an integrated LSTM-based controller coupled with a motor behavior neural network. The LSTM structure of the controller allows for efficient handling of time dependencies and system dynamics, which is important for accurate control of nonlinear processes. On the other hand, the neural network learns from the engine performance data and simulates its behavior under different operating conditions. This combination allows for more accurate prediction and tuning of system performance, considering complex interactions and optimizing real-time control (
Figure 14).
The model, which is based on an LSTM controller and a neural network to simulate motor operation, defines the initial conditions. The neural network is pre-trained to accurately reproduce the characteristics of the real motor and to support the error back propagation process. The target value of the drive current is then determined [
3,
36,
37].
Model architecture: three hidden layers with 128 units each, trained for 1 k to 6 k iterations.
The neural network parameters are fine-tuned through backpropagation based on motor-model error minimization.
In the article, we employed a substantial amount of simulated data, as it serves as an excellent preliminary validation tool for algorithms before proceeding to actual testing on permanent magnet synchronous motors (PMSMs).
In practical systems, compensated Hall sensors or shunt resistors are typically used to measure the current in PMSMs. For the controller, options include the STM32H7 series or a DSP + FPGA combination. The STM32H7 series, with RAM ranging from 500 KB to 1 MB, is fully capable of meeting the computational demands of the neural networks discussed in the article.
On the other hand, FPGAs can directly implement hardware-level tasks such as PWM generation, encoder decoding, and ADC synchronization, achieving nanosecond-level latency. Meanwhile, the DSP can focus on high-level algorithms (e.g., FOC or neural networks) without being burdened by low-level timing tasks. This combination of DSP and FPGA can also effectively integrate neural networks as controllers for PMSMs.
The integrated model is trained in the specified order:
The parameters of the current state of the system in the form of current values from the modeled motor are transmitted to the controller.
In the process of comparing the received current values and target parameters, control signals are generated by the LSTM controller.
The signals are then applied to the modeled motor, allowing its operation to be adjusted to the target values.
The difference between the target and actual current values is calculated using the Mean Square Error (MSE) function:
To minimize the deviations, an error back propagation algorithm is used to adjust the parameters of the integrated model (
Figure 15). Training iterations: 3–5 k (3000 to 5000), with a training set size of 1.5 GB. It can be seen from the figure that the error decreases from 1.5 k iterations and becomes almost zero after 3 k iterations.
Next, the controller model is trained. The results of verification during the training process are shown in
Figure 16. On the validation set, the error decreased rapidly within the first 1000 iterations, then oscillated around 5% thereafter.
Figure 17 shows the simulation results of the MPC controller (
Table 1), which is based on a neural network. The total reward was −480.7. This value surpasses the performance achieved by other types of controllers that have been used to control this system. The developed controller allows to effectively predict and correct the behavior of the electric motor, maintain its operation within the set parameters and significantly reduce deviations compared to classical controllers. During neural network training, cross-validation was employed to effectively prevent model overfitting. The vertical axis of the graph represents the motor’s dq-axis voltage, dq-axis current, and the obtained score, while the horizontal axis denotes time (in seconds).
The scores in the table were updated by averaging the results from multiple experiments. Regarding load change conditions, our LSTM-enhanced model predictive control (MPC) achieved a settling time of 50 ms, which is 40% faster than traditional PID controllers. (When the controlled plant is a permanent magnet synchronous motor (PMSM), the neural network must be retrained to adapt to the motor parameters. Conversely, if the controlled plant is not a PMSM, both the control method and the neural network model architecture need to be modified accordingly.
4. Conclusions
This study analyzed existing predictive motor control systems including classical MPC controllers and neural network-based controllers. The process of motor design and modeling has been studied. The peculiarities of design of both a traditional controller and predictive controller based on trained elements of artificial neural network are considered. The article also presents the results of testing and comparative analysis of the effectiveness of the proposed controllers, which, in turn, allows us to objectively assess their advantages and disadvantages. A model that is too small may fail to converge, while an excessively large model can compromise real-time performance. Therefore, the model should be compact yet convergent to ensure fast response speeds and lower computational demands. Additionally, the controller’s processing speed significantly impacts overall responsiveness. Hence, during model training, we prioritize minimizing the model size while achieving optimal control performance.
The conducted tests showed that the predictive controller based on the neural network has 24% less control error compared to the traditional algorithmic controller and almost two times less error than the PID controller. In addition, the developed predictive controller showed faster response speed, which is an important advantage in situations requiring immediate intervention and fine tuning. The experimental results showed that the predictive controller provides more stable and reliable control, effectively preventing possible emergency situations and ensuring optimal motor operation within the specified parameters.
The obtained results confirm the high accuracy of the controller model and its ability to solve the predictive control problems. This makes the developed motor control and predictive diagnostics system based on neural network approach a valuable tool for improving safety and efficiency of industrial electric motors.
The present study makes a significant contribution to the field of predictive diagnostics and control by providing a promising solution for monitoring and predicting the condition of an electric motor. Improved performance can be achieved by applying more sophisticated multilayer LSTM models and other neural network architectures. These can be convolutional neural networks (CNNs) to extract spatial features and recurrent neural networks (RNNs) to better handle temporal dependencies. Future research is proposed to investigate the possibility of using these models to improve prediction accuracy and control robustness, as these types of networks allow the system to consider a wider range of factors and dynamic processes. It is also planned to integrate reinforcement learning techniques to provide adaptability and self-regulation of the system under changing external influences and uncertainty. This will allow optimization of the motor control process in more complex and unstable operating conditions.