1. Introduction
IoT is highlighting the huge current interest in the development of autonomous driving to organize traffic in future smart cities. In this context,
automated machine learning (AML) methods [
1,
2] are useful to apply machine learning end-to-end to find a consistent implementation of electric vehicles (EVs) [
3] and other cyber-physical systems (CPS) [
4,
5,
6,
7]. However, they present serious application problems regarding fitness calculation, overfitting, lack of scalability, and need a huge amount of time to compute hyperparameters on which CPS are dependable. The problem is worsened if we choose an artificial neural network (ANN), and to calculate the hyperparameters [
8], we follow an optimization method such as gradient descent [
9,
10].
Therefore, we propose in this paper to complement the computationally expensive training phase of ANNs with hyperparameter updates carried out manually, as in [
11], with the help of efficient cyber-physical models’ simulation tools.
The optimization algorithm normally used to train ANNs for industrial control is called gradient descent [
12]. The optimization computation based on gradient descent acts as a measurement device to gauge the accuracy of the cost function calculation, which each step or iteration of the ANN parameters updates. Following this approach, evaluations of the target function results in a hyper-gradient vector, i.e., one which learns various optimized parameters to combine different levels of adaptations [
13], instead of single values that are usually obtained by other methods such as the called Bayesian hyperparameter optimization (HPO) [
14].
Using HPO, when the number of derivatives is large, e.g., for a deep-learning ANN with n layers, the gradient will increase exponentially by backpropagation until it finally
explodes. We can overcome the complexity of gradient descent and backpropagation applied to CPS hyperparameters optimization by model transformation, such as the distributed optimal coordination (DOC) approach for heterogeneous linear multi-agent systems proposed in [
15].
Nowadays, we can obtain the model selection gradient in a reasonable time thanks to modern parallel computers and GPU graphics cards, which are crucial to tuning hyperparameters of cyber-physical models [
8]. Thanks to parallel computing recent advances, we can now handle many hyperparameters of a model by deploying gradient descent-based methods efficiently [
9]; more specifically, our method for ANN applied to high-dimensional HPO problems can perform the following tasks:
Separately optimize the learning rate of an ANN for each iteration and layer;
Calculate optimal weights for the synaptic connections between neurons of different layers in the ANN;
Reduce the likelihood of overfitting by L2 regularization, a strategy that establishes the decay of peaky weights for each individual parameter.
Therefore, it is possible to perform the complete training procedure of an optimized cyber-physical model with an ANN, either by adaptive and offline updating of the hyperparameters: through measurements on a model of the studied CPS or after performing, interspersed with the training of the network, a manual validation from a software simulation of the cyber-physical model. This second alternative is the one we have finally adopted here.
This method is very model-specific but, in return, allows tuning of many hyperparameters of the cyber-physical model, which lays the ground for obtaining a great improvement with respect to the HPO performed so far in other papers [
8,
14,
16], e.g., by Bayesian optimization.
Overfitting is an open problem when we try to apply ANN with a finite validation set, and the calculation of the model’s hyperparameters suffers from this drawback. One possibility would be to use a different shuffling for each function we need to evaluate thus reducing the amount of overfitting. This approach has been shown to improve the generalization accuracy and recall by deploying a cross-validation strategy of the cyber-physical models. We can also use the strategy of finding stable optima instead only optima in the objective function, as noted in [
16].
There are currently many machine learning problems that cannot be solved directly due to the magnitude of their scale. We will understand the term scale, in this context, as the size of the configuration space and the high computational cost of carrying out the individual evaluations of the models involved. There are currently some successes in training the neural network with small datasets and setting hyperparameter values by hand during model training [
10,
17]. Our approach with respect to coping with the scalability problem is to take advantage of massive parallel computing and try to fully exploit large-scale computer clusters or the thousands of SMs of GPU/CUDA multiprocessors.
In hybrid systems, the continuous behavior described by a system of differential equations associated must change as a result of the occurrence of discrete events too. Our approach gives very compact and flexible specifications for complex hybrid systems. However, there are very few tools that support this class of tools now. In our case, we hypothesize that there is no major problem in building a trained ANN, which can substitute the PID [
18,
19] controller of a closed loop control system, capable of reacting and producing a correct response even in the case of discrete events, i.e., messages or signals that may modify the values of the cyber-physical model’s hyperparameters.
For implementation, CPS usually resorts to excellent tools such as MATLAB/Simulink © that are widely used in industry today to successfully complement machine learning methods mentioned above in IoT or Big Data applications. Currently, the use of tools that speed up the determination of the hyperparameters of ANNs is being considered a firm basis for the development of AML methods in an industrial environment and could certainly be considered a sound and less complex alternative to the development of new algorithms by only using metaheuristics that present a high complexity both in their design and in the execution time they need.
In this work, through a case study design, two research questions are answered: (1) whether an ANN model could be used to replace a PID controller for open and closed loop control systems, and (2) whether this model could be generated in a short time. To obtain the objectives, two ANN models (ff and narx) are used to generate four estimators of 2 physical variables (speed and torque) of an AC motor. Hyperparameter optimization is used with the approximate gradient method from the literature [
8], which makes the gradient descent process much faster.
1.1. Real-Time Speed Regulation of an Induction Motor
As a case study, an induction motor (IM) has been modeled and controlled using simulation data and neural networks as an application of the proposed method for derivation of control applications with hybrid systems with real-time characteristics.
We can control the IM rotation speed by an open loop control system with real-time requirements,
Figure 1a. The IM rotor speed is controlled by cutting the sine wave of the input voltage using a TriaC device,
Figure 1b, whose operation is like a very fast switch. The control line of the TriaC is commanded by a synchronization signal (
synch). This signal is
high when the input wave passes through a zero value, resulting in the TriaC immediately stopping conducting electricity. If, after stopping conducting, the TriaC is fed with a current for several milliseconds, it will go to the saturation state by the
texct signal. It will drive current until the input voltage passes through a zero value again. The maximum time (
timeval) to re-excitation of the TriaC device must be calculated in real-time and at each cycle of the voltage with which it is fed. If after passing a full cycle of the input voltage, the signal
synch is lost, i.e., the
texct signal fails, then the
synchf failure signal goes
high to prevent the motor may rotate too fast. The combination of both devices, an IM and the TriaC, can serve as the basis of an industrial prototype to control or keep constant the speed of a vehicle in an automatic driving system or to maintain a constant airflow through a filter in HVAC systems, etc.
To solve such a problem that often occurs in the manufacturing industry, we can produce a closed loop feedback system with real-time requirements by implementing a PID, necessary to maintain constant the rotor speed of an induction motor driven by a TriaC device,
Figure 2a. A Simulink block can be used to implement a hybrid system that also contains discrete components, such as the TriaC driver component shown in
Figure 2b.
The proposal of this paper applies, according to the approach we will detail, to the implementation of an ANN-based controller instead of a PID-based one. The case study shows how the proposed method can be applied to derive ANN estimators of rotor speed and torque of an IM that provide improved control performance of this system. We have performed a double validation of the response of the developed ANN-based estimators for speed and electromagnetic torque, considering a time interval of 50 s. of the training time. Deep Learning Toolbox (DLT) is used to transform the trained ANNs into blocks that can be directly used in cyber-physical models designed with Simulink. We can observe that the measured and estimated speed and electromagnetic motor torque have a very close trajectory in the graphs shown (performance, error histogram), as well as we can also verify that the regression study yields a good accuracy for the mentioned both engine variables estimated in the study.
1.2. Article Structure
The following sections are structured as described below. First, we present the mathematical modeling of the induction motor. In
Section 3, we describe our proposed modeling approach for the design of a class of CPS, i.e., hybrid real-time systems with continuous and discrete components. We algorithmically define a new method to deploy the model, such as closed-loop control of the IM case study based on neural networks, in which we define training, testing, and validation. A reference Simulink model of the IM is used, which provides insight into the functional and dynamic aspects and the necessary training data for the ANN-based controller models proposed in this paper. In
Section 4, two motor speed and torque estimators are obtained, each with two classes of ANNs (ff and narx), which are applied to solve a problem consisting of reliably maintaining a constant speed and electromagnetic torque of the IM of the case study. Conclusions and current lines of work are presented in the last section.
3. Modeling Method
In the proposed method, we will use different ANN classes [
22,
23] to design a hybrid real-time system with continuous and discrete components. We use a typical design of a neural network, in which we define training, testing, and validation (
Figure 10). The output generated or “measured” from the IM Simulink model, which represents the functional and dynamic aspects of the model, are the training data.
During the execution of the IM drive implemented with Simulink, the main variables of the CPS acquire values that are used to train the ANN. The MATLAB Deep Learning Toolbox (DLT) allows us to generate Simulink blocks that implement different types of neural networks (feed-forward, narx, …).
A Simulink block implementing a trained ANN can replace any PID controller in a closed-loop control system, such as those typically used in industrial systems to keep the output signal constant and produce a predictable system response, even in the case of disturbances in the input signals or noise. We can see the advantages of the mentioned substitution in [
18].
3.1. Registry
The training data were obtained by simulation using the Simulink model of the IM drive. The problem of data logging, although facilitated by the assistance offered by the Simulink software, requires the application of algorithms such as the classical ICP or some of its adaptations [
24].
The proposed method starts from N sets of
point clouds:
, whose points have information of a 3D static property, i.e., the voltages:
va,
vb,
vc and currents:
ia,
ib,
ic of the stator, and of two dynamic properties, which have been chosen to be the load torque
Ml and the
ωe synchronous angular speed of
B in the stator (see
Table 2).
The point clouds for ANN training can be obtained in several ways: by direct measurement of the physical device (IM) using a rotating torque-meter or obtained directly (off-line) from an experimental database for three-phase induction motor rotor fault detection and diagnosis [
25], or they can be obtained by simulating the IM drive with Simulink, which is the option chosen in this study. The acquisition of the training data must be repeated several times, and outliers must be eliminated. In the end, the objective of the first stage of the proposed method is to obtain a realistic point cloud in which the evolution of the rotor’s angular speed
ωr and the rotor’s electromagnetic torque
Me in the real physical system can be visualized. On the other hand, the objective model sought by the method, to accurately predict the values of the above variables, must be able to react and self-stabilize against variations of input voltages, or changes of the load torque
Ml and synchronous speed
ωe, to achieve this the IM drive Simulink model proves to be of great help.
The training data have been collected assuming initially a synchronous reference speed
ωe = 2
π ×
fb, where
fb is the frequency of the feeding voltage (=100 s
−1.) in the stator winding.
Ml is the load torque, whose values are in the range [0.0…330.0] Nm during the simulation. The collected data from the Simulink model are the voltages and currents in the three phases of the named
abc reference system.
Figure 11 shows the reference rotor speed
ωr, which is assumed to change over the simulation time. The simulation time was 50 s. The simulation was done with a sample time of 0.0005 s and the size of data points is 250,000. The rotor speed
ωr has been stored in the MATLAB workspace as a time series represented by a table with the same time step as the simulation sampling time.
3.2. Design of the ANN and Selected Hyperparameters
The type of ANN is very important to get an accurate estimation of the electromagnetic torque and speed of the IM. The DLT toolbox of MATLAB has been used to implement the ANN deployed in the study. The ANN hyperparameters related to the structure (number of neurons and hidden layers…) have been chosen by trial and error; those related to how the network is trained (backpropagation step, activation function, epochs…) are given by the selected training function and, usually, can be adjusted manually. A shallow multilayer neural network with two hidden layers has been initially defined,
Figure 12a. The training function of both ANN has been chosen as the Levenberg-Marquardt (‘trainlm’) one, but any other could have been chosen instead.
The objective function selected was the mean squared error (MSE). Of course, the number of hidden layers and the number of neurons in each layer can be tuned to obtain, with the maximum possible performance, the estimated speed within a time window (50 s). We have selected here 20 and 10 neurons for the first and second hidden layers, respectively.
In the second part of the study, a non-linear autoregressive with exogenous input neural network has been used,
Figure 12b, i.e., a two-layer feed-forward narx, with ten neurons and a sigmoid transfer function (depicted as one Simulink block with curved line), which takes an input data matrix and returns another one where each column vector contains a single value ‘1’, with all other elements equal to ‘0’. In the output layer, one linear transfer function (Simulink block with an oblique straight line) has been defined.
3.3. Training of the ANN
The main objective of ANN training is to minimize the objective function
iteratively by fitting a set
Πi = {
α,
β,
γ,…} of hyperparameters with respect to K training samples, which have been initially chosen to be a subset of the point clouds yielded by the prior registry stage, i.e.,
where
vx,
ix,
Ml,
ωe are the input voltages and currents in the three-phase reference system, the load torque, and the synchronous speed, respectively.
This process can be expressed by the following equation,
such that
where
F is the objective function,
l.r. represents a linear relationship between each set of training samples and the hyperparameters
Πi, and the function
r(·)represents the penalties that the application of each set of hyperparameter values may incur.
The optimization of the objective function F can be performed by several techniques: reinforcement learning, heuristics, and gradient descent, … In our method, we have chosen the latter one because the functions describing the cyber-physical model are all differentiable. F maintains the same properties, so that the calculation of does not usually diverge if gradient descent application is chosen.
The training of each of the ANNs used in the study has been performed offline, using the recorded currents and voltage data during a representative run of the IM drive model to save implementation time. The rotor speed ωr was then predicted (‘estimated speed’) by training first the ff ANN and then the narx ANN. The same process has been carried out for the estimation of the electromagnetic torque Me.
3.4. Validation of the ANN
In order to obtain a useful objective function adapted to our case study, we will define a cost function to be optimized and build the complete performance evaluation model, for which we have selected the MSE based on four key factors:
vx,
ix,
ωr and the
Me, (see definitions in
Table 2) affecting the reliability and efficiency of the IM model.
Therefore, we can interleave the dimensions of the model (
,
Me,
ωr) to obtain a multidimensional evaluation of performance, such that the MSE can guide the iterations during the application of the gradient descent technique,
The reference values of the four key factors for MSE calculation are the measured values of currents, voltages, torque, and synchronous speed in each one of the
K training samples. We can find the optimal model by minimization of
We consider that the natural logarithm can substitute the square root. In the latter equation α, β, γ, and δ denote the weight hyperparameters, and Ekx, Ikx, Mek, Wrk represent the performance factors of input voltages, currents, torque, and motor speed, respectively.
First, we create the network by executing ‘
name = feedforwardnet ([ 10, 20 ])’ of DLT; i.e., we create a two-layer feed-forward network with 10 and 5 hidden neurons, respectively. In the second part of the study, we repeated the process by creating a narx network by issuing the command
name = narxnet(10). By executing the command ‘view (
net_name)’, for each of the two networks created we can visualize the images (a) and (b) in (
Figure 12).
We have validated and tested both ANNs to prove the performance and accuracy of the feed-forward and narx networks. Tests have been performed by calculating the MSE of the estimated values of
ωr and
Me by applying regression. The estimated values should be tested with all the data available (training, validation, and test) up to that point. If the accuracy of the results is not satisfactory, the previous steps should be repeated, as shown in the diagram in
Figure 10.
3.5. Exporting the Simulink Block
At this stage, after checking the efficiency and accuracy of the ANN generated in the previous phase of the method, the neural network can be exported as a Simulink block using the command ‘gensim(net_name)’ of the DLT application. The steps to obtain an accurate estimate of the ωr and Me can be carried out as in the listing below. This code shows that the ff ANN has been selected to obtain these predictions and that it has two hidden layers of 10 and 5 neurons, respectively,
Implement a Simulink model of the IM;
Simulation running of the Simulink model;
Collect the input signals (currents, voltages, load torque, stator synchronous speed)
Collect the output signals, i.e., values of rotor speed and electromagnetic torque for training the ANN;
Design the ANN as a result of issuing similar commands as the next ones: ff_net = feedforwardnet ([ 20, 10 ]);
ff_net.trainFcn = ’trainlm’;
ff_net.trainFcn = ’trainlm’;
ff_net.divideFcn =’dividetrain’;
ff_net.divideMode =’sample’;
ff_net.trainParam.Epochs = 1000;
Configure and train the ANN as a result of the commands:
ff_net = configure(ff_net, input_signals, output_signals); [ff_net,tr] = train(ff_net, input_signals, output_signals).
3.6. ANN Parallelization Assessment
A fully connected network that contains two hidden layers of size 2K has been defined, and one of them is constituted as a 50% dropout layer between them to avoid overfitting. Each of the K-sub-networks is susceptible to be run in parallel. The optimal value of K will depend on the number of CPU/GPU cores available on the machine and all K models are started in parallel to follow a process that interchanges training and model validation by coding the algorithm to operate on separate data partitions, according to the SPMD parallel data execution paradigm. The assessment, which is carried out during the execution of the application, consists of the comparison and fitting of the hyperparameters of the cyber-physical model by using for this purpose the Simulink model of the IM drive, see (
Figure 7). In this way, it is possible to accelerate the convergence of the optimal values with respect to the application of the approximate gradient descent only.
4. ANN-Based Speed Estimator
The input and output signals of
ωr and
Me estimators can be obtained during the training phase by simulation of the IM drive, shown in (
Figure 7 and
Figure 8). ff ANN rotor speed estimator is exported as a Simulink block with the input
x1 (
time,
currents,
voltages) and the output
y1 (
rotor_
speed) signals, as they are shown in (
Figure 13).
4.1. FF Network Based Rotor Speed Estimator
The MATLAB DLT application has been used to train, validate, and test the ANN (created as ‘ff_net’).
Figure 14 shows the architecture of the ff ANN, information about the algorithm selected for training and the objective function deployed in the validation phase, as well as other characteristics of ‘ff_net’ and the total execution time spent training this network.
The performance of the ANN-based rotor speed
ωr estimator of the IM has been obtained by the MSE calculated during 1000 epochs of training, and it is shown in
Figure 15a. The error histogram is shown in
Figure 15b.
As can be seen, the figures show a linear regression between the estimated (predicted by ‘ff_net’) and the measured (in the IM drive) rotor speed values. The regression calculation between the estimated and measured rotor speed
ωr has been displayed in
Figure 15c.
4.2. NARX Network Based Rotor Speed Estimator
In addition to the above speed estimator, obtained from an ff ANN, another narx ANN has also been trained to predict a time series
y(t) from the past values of the feedback signal
y(t) and the values of the exogenous input series
x(t). The time series
y(t) contains values of
ωr, and the series
x(t), the vectors of the motor input currents and voltages in the ‘abc’ phase-normal reference system, as
Table 3 shows.
Narx neural networks can be applied in three different forms for making predictions,
In general, with the next value of the dependent output signal y(t), a regression is performed on previous values of this output signal and the previous values of the exogenous independent input signal x(t).
A series-parallel architecture based on an ff network can be efficiently used for training a narx neural network when modeling dynamic systems since doing so is faster than training the parallel configuration directly. We are going to apply the created narx for an open/closed multi-step prediction, i.e., the so-called ‘narx_net’ can initially be implemented using an
ff ANN to approximate the following function,
Figure 16a shows the series-parallel architecture that has been used for training the ‘narx_net.’ Subsequently, the feedback loop is closed to convert such architecture into its parallel configuration as shown in
Figure 16b for performing predictions of values in the series
y(t). This technique is very useful for performing multi-step forward prediction in modeling nonlinear dynamic systems such as the IM drive we are concerned with in this study.
The protocol to be followed to obtain an accurate estimate of ωr and Me is given in the following list of actions and commands of the DLT. The following code shows that the ‘narx_net’ has been selected to obtain the above predictions (estimates) and that it has one hidden layer of 10 neurons,
Implement a Simulink model of the IM;
Simulation running of the Simulink model;
Collect the input signals (currents, voltages, load torque, stator synchronous speed)
Collect the output signals, i.e., values of rotor velocity and electric torque for training the ANN;
Design the NARX ANN as a result of issuing similar commands as the next ones: delay1 = [ 1:2 ]; delay2 = [ 1:2 ];
narx_net = narxnet(delay1,delay2,10); narx_net.trainFcn = ’trainlm’;
narx_net.trainParam.min_grad = 1 × 10−10; narx_net.trainParam.Epochs = 1000;
Configure and train the NARX ANN as a result of the commands:
[p,Pi,Ai,t]= preparets(narx_net,X,{},Y);
narx_net=train(narx_net,p,t,Pi);
Close narx_net for obtaining multi-step predictions of target values:
narx_net_closed= closeloop(narx_net);
The training data must be used with a tapped delay with respect to the inputs of both signals. The above code listing has defined two identical delays ([1:2]) for both predictors and responses so that the training of the network begins with the third data point in the input(X) and output(Y) to the series-parallel network ‘narx_net.’ Using the ‘preparets’ configuration command means that a lot of data preparation is required before training the network’s tapped delay lines, which must be filled with initial conditions. Finally, the ‘narx_net_closed’ network is prepared to make predictions after the execution of the ‘closedloop’ command converts the trained network into its parallel configuration.
Since with narx neural networks, it is more frequent to get into overfitting situations, in this part of the study, it was decided to manually divide the dataset into 70% for training, 15% to validate that the ANN is generalizing correctly, and stop it before overfitting, and 15% to test the generalization performed by the ANN. Therefore, the histogram of errors and the regression between estimated data and actual data must be displayed for each of the mentioned subsets (training, validation, testing), as shown by the different graphs in
Figure 17.
4.3. Results and Discussion
The DLT MATLAB application was used to validate the complete target system associated with the ANNs for motor speed and electromagnetic torque estimation.
We have carried out a double validation of the ANN-based estimator response for rotor speed
ωr in this section considering a time span of 50 s from the training speed and the load torque
Ml has been maintained constant. The measured speed with the IM driver model and the estimated speed based on the ff ANN is shown in
Figure 18. The actual reference speed of the IM driver and the speed estimated by the narx ANN-based estimator can be seen in
Figure 19. We can see in both figures that the measured and estimated rotor speeds have the same trajectory, so we can conclude that the accuracy of the two-speed estimators based on two different types of ANN has been correctly validated.
However, in
Figure 19, we can observe that perturbations in the response (
ωr) of the narx-based estimator are evident up to 8 s of run time, although the output signal tends to stabilize soon after. In general, we can observe that the rotor speed
ωr follows the changes produced in the synchronous
ωe angular speed in the stator. Since any change in the value of
ωe causes rapid oscillations around the new value in the rotor speed
ωr, such oscillations are more dramatic at the beginning in the narx-based estimator; this is probably caused by the closed loop of the feedback signal that brings the output values of the speed back to the input of the estimator. Therefore, we could state in view of the
ωr response plots that the narx-based estimator performs worse and takes longer to self-stabilize than the ff-based estimator. The plots in
Figure 18b and
Figure 19b, which show the error between the measured and estimated values of the rotor speed, also agree that the error shown by the ff-based open-loop estimator is smaller than the error produced by the closed-loop narx-based implementation. In addition, a perturbation of the rotor speed at 31 s is shown in
Figure 18a that has no effect on the estimated output speed, which confirms the self-establishing capability of the ff-based estimator.
5. ANN-Based Electromagnetic Torque Estimator
We have carried out a double validation of the response of the ANN-based estimator for the electromagnetic torque Me in this section, considering a time span of 50 s of the training speed ωe, and the load torque Ml has been maintained constant.
Feed-forward and narx ANN rotor speed estimators are exported as DLT-generated blocks for their use in the target Simulink model with the input
x1 (time, currents, voltages) and the output
y1 (electromagnetic_torque) signals. The load torque
Ml, which has been applied to obtain the training data, and the electrical torque
Me measured with the IM drive have been shown in
Figure 20.
5.1. FF Network Based Electromagnetic Torque Estimator
The input data to the ff ANN estimator are based on the measured currents and voltages in the IM drive model with respect to the abc phase-standard reference system. The output data are the electromagnetic torque Me and the speed ωr in the rotor over time.
The DLT of MATLAB has been used to train, validate, and test the ff ANN Me estimator. The input and output data have been collected during the training by simulation with the Simulink IM drive system. The generation of the ff ANN block in Simulink is performed with the DLT commands,
TqTT = timeseries2timetable(Torque);
TqT1 = [seconds(TqTT.Time), TqTT.Data];
Tq = tonndata(TqT1,false,false);
W = [XT1(:,1:4),ZT1(:,2:4)];%(time, currents, voltages)
[ff_net, tr] = train(ff_net, W, Tq);
gensim(ff_net); %Simulink- FF ANN block generated
The performance of the ff ANN-based electromagnetic torque
Me estimator has been obtained by calculating the MSE for 1000 epochs of training, as shown in
Figure 21a. The error histogram in
Figure 21b shows that more than 99% of all the instances exhibit almost negligible errors. (<0.020).
It can be seen that there is a linear regression between the estimated electromagnetic torque and the one measured with the IM driver, such regression has been calculated directly from the 50 s time series obtained from the Simulink model, and the results are presented in
Figure 21c.
5.2. FF Network Based Electromagnetic Torque Estimator
A second narx ANN-based (
Table 4) estimator of electromagnetic torque
Me for the rotor has been generated with the DLT commands,
narx_net = narxnet(narx_net, delay1, delay2,10);
[x,xi,ai,t] = preparets(narx_net, W,{}, Tq);
narx_net = train(narx_net, x, t, xi, ai);
narx_net_closed = closeloop(narx_net);
%Simulink-NARX ANN block generated
gensim(narx_net);
The time series y(t) contains now values of Me and the series x(t) the vectors of the motor input currents and voltages in theabc phase-normal reference system.
As we did for the speed estimator, the dataset has been manually divided into 70% for training, 15% for validation, and 15% for testing. Therefore, the histogram of errors and the regression between estimated data and actual data must be displayed for each of the mentioned subsets (training, validation, testing), as shown by the different graphs in
Figure 22a–c.
5.3. Obtained Results and Discussion
The DLT of MATLAB has been used to train, validate, and test the ff ANN and narx electromagnetic torque estimator considering a time span of 50 s from the training speed. The load torque has been maintained constant and equal to 145 Nm in the plots.
Figure 23a shows the zoomed capture of the measured data (used for training) and the estimated electromagnetic torque values after training the ff ANN estimator. The input data of the ff ANN are based on the measured voltages and currents in the
abc-phases representation and the electromagnetic torque of the rotor. The output and input data can be obtained during the training stage by simulation of the IM drive with Simulink.
The errors, scaled to 1.0, obtained between the estimated and measured
Me for the rotor are shown in
Figure 23b and the results shown validate accuracy and effectiveness of the ff ANN estimator implemented as a Simulink block by using DLT.
Figure 24a shows the actual reference torque
Me produced by the IM drive and the output of the narx ANN-based estimator. We can see that the measured and estimated electromagnetic torques have the same trajectory, so we can conclude that the accuracy of the two torque estimators based on two different types of ANN has been correctly validated.
On the other hand, if we perform a closed loop-based estimation with the electromagnetic torque
Me controlled by the narx, exported as a Simulink block, we are apparently obtaining worse results than with the ff ANN estimator, as can be seen in the error plot between the measured and estimated values in
Figure 24b. However, we can observe that the error plot of the electromagnetic torque
Me produced by the induction motor with respect to a constant load torque
Ml of 145 Nm will only have significant oscillations at the beginning of the simulation, i.e., while the system is trying to reach a stabilization point. The oscillations shown represent approximately 50% of the target torque value
Me (200 Nm.), but these oscillations are caused by dynamic conditions during motor operation, which subsequently attenuates and is probably an unwanted side effect of the closed loop of the feedback signal. The initial output values of the electromagnetic torque for the rotor are not accurate. However, the estimator input is also fed with these values.
6. Conclusions and Future Work
We have presented one method and application derivation scheme to obtain a correct control system with real-time features. Automated Machine Learning methods, together with a certain class of ANN, will allow us to model continuous and discrete dynamic systems, such as the induction motor (IM) drive that is the case study.
Four estimators, based on a feed-forward (ff) and a narx ANNs, have been used for estimating two output signals: the rotor speed ωr and electromagnetic torque Me of an IM drive. Simulink blocks have been implemented and analyzed for the ANN-based estimators in this article. The validation of the estimators has been performed using MATLAB and Simulink, as well as the Deep Learning Toolbox (DLT), which provides a specific command for transforming certain types of ANNs into blocks that can be directly used in cyber-physical models designed with Simulink. The training, validation, and testing of the ff and narx-based estimators have been detailed as a useful reference for engineers and researchers. The estimated rotor speed and electromagnetic torque follow the same track as the measured ones from the IM drive.
Therefore, we have shown that PID (proportional integrative differential) controllers can be substituted by trained ANN of different classes. The ff and narx have been used here to integrate continuous components in a hybrid real/time system design without any accuracy or timeliness losses. However, unlike other proposals that attempted to overcome the same problem, our methodological scheme also includes a set of guidelines as a method, which have proved to be of use for deriving a verifiable model of a cyber-physical complex system.
A possible objection to the work carried out in this paper has to do with the basic classes of ANN deployed (ff and narx), which is due to hyperparameter optimization only performed in the case study with an approximate gradient method that may not be used with Recurrent Neural Networks (RNN), which seem to be more appropriate for obtaining accurate and performant estimators of relevant cyber-physical variables in industrial systems as the induction motor drives. In future work, other classes of ANN, such as RNN, must be used and tested, which may produce an improvement in the effectiveness and estimation accuracy with respect to the ANN deployed in this paper. The case study carried out here can be continued with the detection and isolation of incipient faults to improve the safety and reliability of the induction motor with squirrel cage winding in the future.
Finally, the proposed method has been defined for its easy integration in industrial environments for simulation (Simulink). It can also be used with standard libraries for neural networks development, such as SkLearn [
14] in order to interoperate with the Python NumPy and SciPy numerical and scientific libraries, and PySpark, which has been launched to support collaboration between Apache Spark and Python, is actually a Python API for Spark. PySpark allows us to use a GPU cluster architecture and SparkGPU data transfer. In future work, we plan to develop a tool capable of automated code generation of real-time and embedded system software for several computing platforms.