1. Introduction
Finite Control Set Model Predictive Control (FCS-MPC) calculates and predicts each type of system dynamic behavior under the actions of all inverter switching states based on a predictive model of the motor and selects the optimal state through the minimization of the cost function, which makes full use of the discrete characteristics of the inverter and the feature of limited switching states. Recently, FCS-MPC has attracted wide attention in the field of motor control because it can explicitly handle complex multi-variable and multi-constrained problems [
1,
2,
3,
4,
5,
6].
The conventional FCS-MPC needs to enumerate all candidate voltage vectors and then calculate each of their cost function values. This results in a heavy calculation burden and is difficult to apply in practical engineering. In recent years, more and more research has been devoted to reducing the heavy computational burden of conventional FCS-MPC. The number of candidate switching states can be reduced after discarding the suboptimal ones by using a branch-and-bound algorithm, which was used in references [
7,
8]. Utilizing the sector information of the reference voltage space vector, only a subset of all possible voltage vectors is needed for prediction, which greatly decreases the computational effort proposed in [
9]. Similarly, only a subset of adjacent voltage vectors has to be calculated, irrespective of the number of levels of the inverter, because the algorithm proposed in [
10] requires only the same number of calculations as that of any two-level inverter. This contributes to a fast calculation with reduced common-mode voltage vectors. In [
11], Habibullah et al. came up with the idea of a lookup table to reduce the number of candidate switching states needing to be predicted and objectives to be controlled, which can help to reduce the average switching frequency and variation range. The authors of reference [
12] proposed a simplified FCS-MPC with a single prediction method and a sector distribution method. These can, respectively, help skip the current prediction and calculation and greatly reduce the running time with respect to cost function. Reducing the number of candidate voltage vectors can improve the real-time performance of the system, but it comes at the expense of system control performance. The advantage of FCS-MPC is that it traverses all possible solutions to select a global optimal solution; the reduced candidate sets can only provide a local optimal solution. Therefore, the aim of this paper is to improve the real-time performance of the algorithm while ensuring the advantages of the global optimization of FCS-MPC.
This paper proposes the data-driven MPTC process for selecting the optimal voltage vector. We regard this process as a multi-classification task under a nonlinear mapping relationship. The operation data for MPTC selecting the optimal voltage vector are collected to train a DNN (deep neural network) offline [
13,
14] so that the DNN can fully approximate the selection law of MPTC, thus replacing the MPTC to select the optimal voltage vector with its rapid inference online to meet the real-time requirements [
15,
16]. The rapid dynamic response of the torque control makes it difficult to collect the dynamic data for training the DNN, which creates an asymmetry between the dynamic and static training data, therefore leading to the system taking the risk of being out-of-control for data-driven MPTC. In this paper, the solution to the above problem is presented by adopting a hybrid decision based on DNN and DTC. The simulation results show the feasibility and superiority of the hybrid decision control strategy proposed in this paper.
3. Data-Driven MPTC Using DNN
MPTC selects the optimal solution from the 7 candidate voltage vectors on the grounds of the cost function. This process can be treated as a multi-classification problem. Hence, the neural network, as one of the data-driven approaches, can be trained to learn and approximate the control laws of the selection process, thereby replacing MPTC to work online.
According to the predictive model and cost function as shown in Equations (3)–(5), this article selects four key features as the network’s inputs: the reference torque, the stator flux amplitude, the stator flux angular position, and the torque angle at the current moment
k; the output of the neural network is one of the 7 basic voltage vectors. Based on MATLAB/Simulink, the MPTC simulation model for SPMSM is established and the dataset is collected. The simulation model is a discrete model with the sampling period of
s. The DC bus voltage is 312 V; the parameters of the speed PI regulator are Kp = 5, KI = 100; and the upper and lower limits of the PI regulator output are [−35 N·m, 35 N·m]. The reference stator flux amplitude is 0.3 Wb. Other parameters are shown in
Table 1.
The above simulation model was used to create and collect training samples with the conditions as follows: The reference speed was set to −500 rpm, −300 rpm, −100 rpm, 100 rpm, 300 rpm, and 500 rpm, and then the ramp function was used to set the load torque to range from −30 N·m to −10 N·m within 1 s and with a range from 10 N·m to 30 N·m within 1 s; the load torque was set to −34 N·m, −30 N·m, −25 N·m, −20 N·m, −15 N·m, −10 N·m, 10 N·m, 15 N·m, 20 N·m, 25 N·m, 30 N·m, and 34 N·m (this is shown in
Table 2), and then the ramp function was used to set the reference speed to range from −500 rpm to 500 rpm within 2 s and range from 500 rpm to −500 rpm within 2 s.
The above 36 sets of simulation experiments were carried out to collect training datasets for neural networks, and then a total of 1,200,000 sets of training samples with 4 inputs and 1 output were obtained. The training samples were then standardized to satisfy a normal distribution with a mean of 0 and a variance of 1, as presented Equation (7). The training set and test set were divided according to the ratio of 9:1, in which the former is used for training and the latter is used to test the performance of the network.
The deeper the network, the stronger the learning capacity but the more complex the structure. Through repeated experiments, it was determined that the DNN with 1 input layer, 3 hidden layers, and 1 output layer was to be adopted, as presented in
Figure 3a. The detailed topology is (4, 30, 50, 30, 7), and the transfer relationship between the hidden layers is shown in Equation (8). In Equation (8),
and
are the outputs of layer
h and
h − 1,
and
are the weight matrix and the bias matrix, and ReLU (Rectified Linear Unit) is adopted as the activation function of each layer.
This article adopted cross entropy [
17] as the loss function and used the Adam Optimizer [
18] to minimize the loss function and update the parameters to be trained. The training consisted of two processes. The first one was the forward propagation, as shown in Equation (8). The 7 prediction scores were then obtained and passed through the softmax function to be converted into a probability distribution, as shown in Equation (9). In Equation (9),
and
denote the class score and converted probability for class
k and
n is the number of total classes. The prediction result of the forward propagation process is then compared with the real label value to calculate the cross-entropy error using Equation (10), in which
denotes the real label value.
The second training process is the back-propagation, consisting of calculating the gradient of the loss function over each training parameter then updating them using the Adam Optimizer to solve the minimizing problem of the loss function with the learning rate (set 0.001) as update ratio. The above two processes are repeated (for 5000 epochs), and as the gradient gradually decreases and training parameters such as the weight and offset are gradually updated, the neural network gradually approaches MPTC control law for selecting the optimal voltage vector.
The consistent rate of the voltage vectors selected by the DNN and the ones by MPTC are defined as the accuracy, which is used to evaluate the DNN’s classification performance.
Figure 3b shows that the accuracy increases with the number of epochs and tends to be stable, and there is neither overfitting nor underfitting. The final DNN’s accuracy on the test set can reach about 82%, indicating a good classification performance.
The trained DNN was embedded into the PMSM system in order to realize the data-driven MPTC by changing the conventional MPTC to work online, as shown in
Figure 4. When the training is over, the weights and biases will be tuned. While working online, DNN only needs to perform the forward propagation to obtain the classification result according to the maximum score without softmax conversion and loss function calculation, thereby improving the real-time performance of the system. The control strategy verification is achieved through MATLAB/Simulink and Python/Pytorch co-simulation, and the DNN classifier is embedded by writing the S function to call the Python script.
A simulation comparison between conventional MPTC and the data-driven MPTC of the PMSM system was carried out. The initial value of the reference speed was set to 10 rpm, and was stepped to −10 rpm in 1 s. The load torque was initially 15 N·m, and this was stepped to −15 N·m in 0.5 s, then to 15 N·m in 1.5 s. The total simulation time was 2 s, thus establishing a composite condition with the four-quadrant operation of the motor. In order to quantitatively evaluate the control effect, the root mean square error (RMSE) of torque ripple
and the root mean square error of stator flux ripple
were defined, as shown in Equation (11), in which
n denotes the number of samples. The motor speed, torque, and stator flux amplitude under conventional MPTC are shown in
Figure 5.
The simulation results show that MPTC has a small torque ripple and stator flux ripple, which reflects the superiority of MPTC in selecting voltage vectors. The RMSE of torque ripple and stator flux ripple in the four steady-state periods of 0.2–0.4 s, 0.6–0.8 s, 1.2–1.4 s, and 1.6–1.8 s. Their average values are presented in
Table 3.
It can be seen from
Table 3 that MPTC has a good control effect with small torque ripple and stator flux ripple. However, it needs to traverse and calculate 7 basic voltage vectors, which greatly increases the system’s computational burden. The simulation model and conditions are the same as above, and the simulation results under the data-driven MPTC are shown as
Figure 6 and
Table 4, from which we can see that the data-driven MPTC has certain feasibility for four-quadrant operation and the superiority of steady-state control performance of torque and stator flux is basically equivalent to MPTC; however, it produces large stator flux ripple when its speed steps are at 1 s. We used 0.02 s as the unit to calculate the consistent rate of selected voltage vectors that was the accuracy for each unit in the whole simulation time; the results are plotted in
Figure 7. Further research found that MPTC based on a suboptimal voltage vector can also achieve the correct control of a motor but that using any voltage vector that is worse than the suboptimal voltage vector will cause the system to lose control. Hence, a feasible solution for MPTC is an optimal voltage vector and a suboptimal voltage vector.
Figure 6d shows that DNN has a high accuracy in selecting the optimal voltage vector and selecting feasible solutions, which is also the core reason why DNN can correctly control the motor with a control effect close to that of MPTC.
Table 4 also shows the accuracy of DNN in selecting the optimal voltage vector in the corresponding steady-state phase and the overall accuracy of selection, which can verify the above conclusion with regard to its control level.
Under the above simulation conditions, the DNN control was run while the conventional MPTC was run in parallel; however, its output was not used as an output voltage vector for the inverter—it was only used for comparison with DNN’s outputs; the 7 voltage vectors were then sorted in ascending order according to their cost function. The position of the voltage vector output was counted by the DNN in the cost function; the ranking of the 7 basic voltage vectors was sorted by MPTC, which reflects the pros and cons of the solution of the DNN’s output voltage vector. The results are summarized and shown in
Table 5, where 1 represents the optimal voltage vector, 2 represents the sub-optimal voltage vector, and so on.
It can be seen from
Table 5 that most of the outputs by DNN are optimal solutions, with a percentage of up to about 84%, while the percentage of the voltage vector outputs by the DNN classifiable as feasible solutions is 96.96%, covering most of the control periods. This shows that the neural network—a data-driven method—captures the essence of the data and fully approximates the selection law of MPTC. At the same time, DNN has a strong robustness and fault tolerance on the basis of sufficient training [
19]. Therefore, even if the output solutions are not optimal or sub-optimal in a small amount of control periods, the DNN can correct it rapidly and robustly. This also explains why the DNN’s accuracy on the test set is only 82% but it can ensure that the system runs correctly without losing control.
4. Runaway Problem
Further research shows that the above DNN can only work under the condition of a small speed step. Once the speed step is large, the DNN will lose control at the speed step. We kept the load torque unchanged; we set the initial value of the reference speed to 60 rpm and the step to −60 rpm in 1 s. Under the above simulation conditions, the runaway waveforms created by data-driven MPTC were obtained. These are shown in
Figure 7.
When the speed step occurs in 1 s, the voltage vector selected by DNN cannot meet the control requirements of the stator flux linkage, resulting in the distortion or the loss of control of the stator flux linkage, and, ultimately, the failure of the whole control system.
Figure 7d also shows that when the speed step occurs in 1 s, the accuracy of DNN selecting the optimal voltage vectors and feasible solutions plummets, which is the direct cause of the system becoming out of control. Further research found that DTC was used in the speed step phase of the above simulation conditions to help DNN get through the risky period, which can solve the above problem. The switch table used here is shown in
Table 6. In
Table 6,
Φ and
τ denote the output signal of the hysteresis comparator of the stator flux amplitude and torque, in which 1 means need to increase and 0 means need to decrease. The values
θ1–
θ6 are the stator flux sector signals and
V1–V6 are the output voltage vectors. In addition, the hysteresis width of the stator flux amplitude and the torque are 0.001 Wb and 0.01 N·m, respectively. DTC is only used in this stage between 1 s and 1.1 s; the research results are shown in
Figure 8, which indicates that DNN can control the motor correctly in other stages but is not competent in the speed step stage.
The fundamental reason for the obvious difference in dynamic and static performance under DNN control is that the MPTC's cost function shows a major difference in the tendency to select the voltage vector under dynamic and static conditions. Under the two dynamic behaviors of the startup and the large speed step, the reference torque in the speed loop remains at the upper and lower limits of the PI regulator output for a long time, resulting in a large torque error; the cost function often sacrifices stator flux control performance and also tends to sacrifice torque control. However, the establishment of the above dataset did not consider the dynamic behavior mode of the speed step, resulting in a lack of reference torque data in the dataset that remained at the upper and lower limits of the PI regulator output for a long time, resulting in asymmetry [
20] between the dynamic and static data in the training set. The distribution makes the network more inclined to the selection law in the steady-state, resulting in lower accuracy under dynamic behaviors such as large speed steps, which brings the risk of loss of control to the data-driven MPTC control.
5. Hybrid Decision Control (HDC)
To solve the above problems, the most direct solution is to supplement insufficient dynamic behavior data to achieve symmetry. However, due to the MPTC’s rapid dynamic response, few dynamic data can be collected, and the operating cost and time cost of dynamic data collection in actual engineering applications are both high, which creates certain difficulties in data collection.
In order to improve the dynamic control performance and robustness of DNN, this paper proposes a hybrid decision control (HDC) strategy based on DNN and DTC. The MPTC candidate voltage vector set is composed of the classification result output by DNN and the switch table voltage vector selected by DTC. The two are substituted into the prediction model to calculate and compare the cost function value, and the voltage vector corresponding to the smaller cost function is taken as the final output voltage. If the two options are the same, the voltage vector is directly output without model prediction, calculation, and cost function comparison. The block diagram of the abovementioned hybrid decision control strategy is shown in
Figure 9.
Under the above out-of-control simulation conditions by DNN control, the simulation results and statistical results of a consistent rate of hybrid decision control, based on DNN and DTC, are shown in
Figure 10, which indicates that the proposed hybrid decision control improve and guarantee the selection accuracy in the speed step stage and can solve the above out-of-control problem.
Table 7 shows the statistical results of the voltage vector solutions output by the hybrid decision control, which reveal that the strategy guarantees the optimality and feasibility of the output solutions.
The steady-state control effect of hybrid decision control was quantitatively evaluated and compared with MPTC and the results are shown in
Table 8, which shows that both are basically equivalent.
Table 9 shows the accuracy of the optimal voltage vector selection in the four steady-state stages and in the entire simulation phase, as well as the proportion of DNN actually participating in the hybrid decision control’s output in the corresponding stages. The data show that the proportion of DTC’s actual participation in HDC’s output is relatively small—basically, DNN is at work almost all of the time. On the other hand, it also shows that the good control performance is due to DNN; DTC mainly plays the role of auxiliary error correction under dynamic conditions.
The proposed HDC control strategy has a wide usable range and strong robustness. It is still effective when the speed step amplitude is 800 rpm. The selection accuracy of the optimal solutions and the feasible solutions still has a reliable guarantee, as shown in
Figure 11.
Statistics found that in 14,240 of the cases selected, DNN and DTC choose the same voltage vectors as in the above simulation, which accounted for 35.6% of the cases. No model prediction calculation and comparison are required at this time. In the remaining 64.4% cases, model prediction calculations and comparisons are needed, but at this time there are only two candidate voltage vectors, which does not increase the computational burden too much.