Metaheuristic Parameter Identification of Motors Using Dynamic Response Relations

This article presents the use of the equations of the dynamic response to a step input in metaheuristic algorithm for the parametric estimation of a motor model. The model equations are analyzed, and the relations in steady-state and transient-state are used as delimiters in the search. These relations reduce the number of random parameters in algorithm search and reduce the iterations to find an acceptable result. The tests were implemented in two motors of known parameters to estimate the performance of the modifications in the algorithms. Tests were carried out with three algorithms (Gray Wolf Optimizer, Jaya Algorithm, and Cuckoo Search Algorithm) to prove that the benefits can be extended to various metaheuristics. The search parameters were also varied, and tests were developed with different iterations and populations. The results show an improvement for all the algorithms used, achieving the same error as the original method but with 10 to 50% fewer iterations.


Introduction
Parameter identification is a highly studied problem due to its multiple fields of application. For example, Hammerstein controlled auto-regressive moving average systems and autonomous robot navigation in the state of charge estimation of lithium-ion batteries [1][2][3]. One of the studied systems for their parametric identification is the direct current motors due to their increasing use in high-demand applications [4].
The parametric identification techniques are diverse. Some authors opt for using intelligent methods, as in [5], where a backpropagation network is used for parametric identification. The disadvantage is that a large amount of data is required to train accurately the network, which is a weakness of all ANNs of this type. Another intelligent technique was used in [6], where the authors estimate the parameters with fuzzy techniques. In [7], a Sparse estimation is developed by combining SPARSEVA and the Steiglitz-McBride method. Methods such as least squares and Steiglitz-McBride are heuristic methods that generally provide adequate results. However, metaheuristic algorithms represent a more straightforward option in complex problems [8]. This optimization algorithm is biologically inspired, and its use is widespread in multiple areas [9].
Metaheuristic algorithms have been widely developed and implemented in multiple areas. These algorithms are iterative which complicates their implementation in realtime [10]. However, its complexity is reduced with respect to other heuristic methods [8]. Some examples of applications are found in works such as [11,12], where authors use metaheuristics algorithms to tune controllers. In [13], a GA with a neural network convolutional is proposed to successfully indicate the likelihood of microscopy images belonging to different classes. In the estimation of parameters, the metaheuristic algorithms have an application such as that shown in [14].
In [15], the authors use a metaheuristic algorithm improved for parameter estimation in permanent magnet synchronous motor. This methodology is similar; however, the dynamic response of the system is not considered. The work contribution is that using existing relationships both in the transient and the steady-state of the motor response. These relations make it possible to reduce an estimation problem of five random variables (model parameters) to use two and calculate the remaining ones. Reducing random variables allows this type of algorithm to improve since the method must comply with these relationships, taken as restrictions. The use of restrictions in the search improves the performance of this type of algorithm [15]. However, no previous work has used the relations of the transient-state and the steady-state as constraints to improve the parameter search process.
The relevance of this work lies in the fact that the engine is a system of second-order differential equations. Therefore, the method can be extended to systems that are modeled in the same way. Second-order systems represent a high percentage of physical systems in engineering systems [16]. Few systems are of one-order, and higher-order systems are usually reduced to second-order for their analysis [16]. Consequently, the method can be adapted by changing the fitness/cost function and the relations between the equations.
The second contribution is improving the three metaheuristic algorithms (the Cuckoo Search, the Gray Wolf Optimizer, and the Jaya algorithm) with dynamic response relations.
The tests in the three algorithms are intended to reveal that these relations can be extended to other algorithms of this type and are not only applied in a particular case. Each of the algorithms were tested in their original version and the version proposed in this research.
The standard procedure to develop the parametric estimation was used, where the motor step response is taken as input data. The tests were carried out with two motors of known nominal parameters to compare the error of the improved algorithms. Tests were executed first with simulated signals and later with experimental signals to observe the performance of the algorithms against signals with the typical noise associated with the acquisition of signals.
Finally, the processing time, the accuracy, and the number of necessary iterations of each algorithm are compared. The results indicate a substantial improvement in each algorithm, ranging between 3% and 5% reduction in magnitude error compared to the original algorithm until 50% faster. Additionally, the result indicates that the CS P proposed algorithm is the one that converges in the fewest iterations.
The rest of the work is divided as follows. In Section 2, a literature review is presented to provide an introspective of the proposed work. In Section 3, the motor model and the dynamic response relationships, both in their transient and steady-steady parts. Section 3 described the proposed improvement in each algorithm to include the relations described in part 2. In Section 5, the results at the simulation level and using experimental signals are exhibited. Finally, in Section 6, the conclusions remarking on parameter identification are made.

Related Work
Parameter estimation has already been studied from a different point of view. For example, the parameters of the motors when controlling in the open and closed-loop have been proposed not only for AC electrical machines [17], but also for DC motors [18,19]. Knowing the parameters of the dynamic model helps to perform multiple control and automation tasks. For example, to improve the machining performance of the toolset when speaking in a mechatronic process [20].
Some authors focus their investigations with heuristic methods, such as the works sent in [21,22]. Another option highly used in parametric estimation is metaheuristic algorithms. They are widely used for their versatility and adaptability to multiple problems [8]. Works such as [23][24][25] have explored the analysis of parametric studies of motors with metaheuristic algorithms.
There are a large number of population-based metaheuristic algorithms that can be adapted to parametric estimation. The most extensive metaheuristic algorithm is the genetic algorithms that can be observed as parametric estimators of motors in works such as [26,27]. However, several algorithms were adapted to this aim; for example, the research [28][29][30] uses the dynamic encoding algorithm for searches (DEAS) for parametric estimation of a motor. In the research [31], a search for harmony (HS) is carried out to obtain the inductance model of an electrical machine. Another example is investigation [32], where a PSO approach is applied to have the parameters of an induction motor. In works [33,34], algorithms such as the whale and the bat are used. Some authors explore the advantages of combining two different metaheuristics algorithms [30]. Finally, some authors such as [29] analyze the online implementation of these algorithms as estimators through parallel processing.
Despite the wide variety of similar works for parameter estimation in motors with metaheuristic algorithms, no work has analyzed the use of dynamic motor relationships as search constraints in both the steady-state and the transient-state. This work aims to analyze the effect of its use in the search with different algorithms, which must be fulfilled. In the Table 1 is shown a comparison between several similar works and the present investigation.

Metaheuristic algorithm Improvement
Our work Cuckoo Search Algorithm, Gray Wolf Optimizer, Jaya Dynamic relations used as search limiter [15] Cuckoo Search Pa adjustment based on fuzzy logic [23] Cuckoo Search Use of steady-state [26] Genetic Algorithms Geared DC motor optimal estimation [24] Smart Collaborative Performance Quantify the contribution of the solutions [25] Gray Wolf Optimizer Torque estimation [26] Genetic Algorithms Optimal estimation [28] Dynamic Encoding Algorithm for Searches Control and fault detection [33] Whale Optimization Algorithm Use of WOA as parameter estimator The table above shows that the research presented here differs from the related works that use dynamic relationships to search for the parameters. Therefore, this approach can be implemented as an additional improvement in the works mentioned and can be extended to any stable open-loop system.

Background
This section briefly explains the D.C. motor equations and their dynamic relations, and describes the three metaheuristic algorithms used in this work. The variables involved in the mathematical model of the DC motor are described in Table 2.

DC Motor and Its Dynamic Response
The electric motor is a hybrid system composed of an electrical part and a mechanical part. Its dynamic behavior is observed through the electrical and mechanical equations in Equation (1).
The set of equations above is related to the two connection equations depicted in Equation (2).
Substituting Equation (2) in Equation (1) and considering a motor without load (T L = 0), Equation (3) is obtained, and its representation is observed in Figure 1.
The previous differential equation system is the model of a DC motor with six unknown parameters. In addition, if null initial conditions are considered, the system can be rewritten in a second-order transfer function. The second-order transfer functions have a well-known typical dynamic step response, as displayed in Figure 2. The dynamic response is divided into two phases, the transient and the steady-state stage.  The steady-state is when the output of the system has stabilized, and its response varies less than 2% with respect to time. In this sense, the current and the speed remain constant. Therefore, the derivative of current and the derivative of velocity becomes zero. A fact well-known is that the magnitude of both electrical and mechanical constants is similar.
Therefore the same K value is used for both. Using these considerations, Equation (3) can be rewritten as: v ss = Ri ss + Kω ss Ki ss = Bω ss (4) Equation (4) represents the equations of the motor in steady-state of the six initial parameters, the only parameter that remains in both equations is K. Therefore, the system is rewritten, leaving the value of the other parameters as a function of K:

Transient-State Equations of the Motor
The transient part is when the output of the system has variations with respect to time. However, the relationships in this phase are not obvious if it is known that the current has a directly proportional influence on the derivative of the speed. This relation causes the maximum value of the current to cause the maximum value in the derivative of the current, that is: From Equation (6), it can be seen that the parameter J can be a function of B and K, since B is already defined as a function of K, if J is cleared, it is only defined as a function of K: Equations (5) and (7) are the relationships of the dynamic response.

Metaheuristics Algorithms
The use of metaheuristic algorithms has spread in the past few years. This is mainly due to the ease of implementation and adaptation to various problems [8]. This work decided to verify the effect of using dynamic relationships in populated-based metaheuristic algorithms. Although multiple tasks can be solved with heuristic methods, the similarity and adaptability to numerous problems and restrictions make metaheuristic algorithms ideal for this study. This work compares three algorithms to determine the effect of dynamic response relations on them.
There are a large number of population-based metaheuristic algorithms in the literature. However, the Cuckoo Search algorithm, the Gray Wolf Optimizer, and the Jaya algorithm were chosen because the first contains an explicit, specific parameter, the GWO has an implicit specific parameter. The Jaya algorithm does not have any specific parameters. Algorithms with two or more specific parameters were avoided because it is required to adjust them. Nevertheless, it should be considered that recent adjustment techniques can solve the problem, such as the hyperparameters adjustment technique, as shown in [35]. The tuning of hyperparameters is another way of improvement for metaheuristics. However, to see only the improvement of the algorithms with the use of dynamic relationships, they were not considered in this work.

Grey Wolf Optimizer
The GWO O is inspired by how the wolf hunts its prey. The herd is organized by leading wolves (α) that coordinate the hunt in the space and subordinate wolves (β,δ and ω wol f ). The GWO O is fully described in [36], and its process is displayed in Figure 3a. On the other hand, Figure 3b has displayed the GWO P with the dynamic response relations. The GWO O was chosen among the metaheuristic algorithms since it has a similar performance to the most well-known algorithms in the area, such as Genetic algorithms. It has a simple structure, which allows for fewer computational requirements. It also reduces its search space increasing its convergence speed compared to other algorithms [37].

Algorithm of Jaya
Jaya is a relatively new algorithm. However, like GWO O , it has similar results to the more popular search methods like GA. Its main feature is simplicity since it has only general parameters and no specific parameters. It is only based on the best and worst solution, looking for values close to the best solution and moving away from the worst [38].
The complete method can be studied in detail in [38]. Figure 4a displays the Jaya O while in Figure 4b, the Jaya P with the dynamic relationships of the motor is depicted. Is the solution corresponding to A(i*1,j,k) better than that corresponding to A(i,j,k)

No Yes
Accept and replace the previous solution END Modify the solutions based on best and worst solutions Is the solution corresponding to A(i*1,j,k) better than that corresponding to A(i,j,k)

No Yes
Accept and replace the previous solution END Modify the solutions based on best and worst solutions  The Jaya algorithm was chosen for reasons similar to the GWO O . The algorithm exhibits a fast convergence rate and is among the simplest metaheuristic algorithms to implement.

The Cuckoo Search Algorithm
The CS O is not found among the simplest algorithms unlike the other two algorithms Unlike the other two algorithms. However, like the previous ones, it has shown similar results to the GA, but the convergence is observed in a smaller number of iterations. Like GWO O , it is a bioinspired algorithm based on the peculiar way Cuckoo birds reproduce by pinning their eggs in other nests for different birds to raise. Unlike the other two algorithms, the CS O has a specific parameter. Determining the value of any particular parameter is a complex subject of study. However, in the literature, a value of 25% is recommended [39]. The complete method is described in [39] where the author of the algorithm tests the algorithm in problems of a different nature. The differences between the CS O and the CS P can be observed in the flow diagram of both procedures in Figure 5. The methods used were the Cuckoo Search, the Gray Wolf Optimizer, and the Jaya algorithm was chosen to contrast with the other two algorithms as it has a specific parameter and uses the levy flight hence implementation complexity is greater. However, its performance and application have been tested in multiple areas. Therefore, it is presented as a logical option since, in contrast, the most used metaheuristic (GA) has multiple specific parameters, making a comparison complicated since they must be justified in selecting each parameter.

Methodology
The methods used were the Cuckoo Search, the Gray Wolf Optimizer, and the Jaya algorithm. All techniques started from original random populations and generated optimal solutions for a fitness/cost function.
The proposal of the present investigation lies in the use of Equation (5) and (7) to reduce the search for random parameters. Instead of searching five parameters simultaneously, only K and L are randomly generated. For this, the dynamic relations are implemented as search restrictions. In this way, the parameters J, B, and R can be determined by the dynamic equations and as a function of the value proposed by K and L. Thanks to this, the algorithm focuses only on finding these last two parameters.
In this work, the fitness/cost function is the Euclidean distance between the sum of error in current and the sum of error in velocity, that is: The goal of metaheuristic algorithms is to reduce the value of the Equation (8). The three methods are population-based and have several candidate solutions that report data about the search, causing abrupt jumps in the direction of the hopeful solution. In addition, having an initial population with a high number of individuals generates a greater diversity which helps to avoid a local optimum [40].
All metaheuristic algorithms contain parameters that modify their performance. Some parameters are similar or even equivalent. On the other hand, some parameters are specific for each type of method. Table 3 shows the parameters used for each algorithm with the original names given by the respective author and the similar or equivalent parameters. The three algorithms have the distinction of having a reduced number of parameters, and most of these have their equivalence in other algorithms (see Table 3). This characteristic is one of the reasons for which they were chosen.
The tests of the original and modified algorithms with the dynamic relationships are developed (a total of six algorithms). In addition, two different DC motors will be used to analyze the performance. As a performance measure of each algorithm, the value of the cost function that it reaches was taken, with a cost of 0 being the maximum possible performance. Another factor measured in the tests is the time it takes for the algorithm to complete the search task. The population parameters and maximum iterations were varied by performing the following tests:  Table 3, the cost function was in common for the six algorithms, which is determined by Equation (8). The number of variables to be proposed randomly is two (K and L), and the number of variables to be calculated is three (R, B, and J). The initial search limits will also be the same for all algorithms. The tests are are performed with step response signals obtained with simulation and measured by sensors and a data acquisition system. The signals obtained by simulation are called simulated signals and those obtained by measurements are called experimental signals. For the simulation tests, the motor model described by Equation (3) is simulated by Simulink, while the metaheuristic algorithms are developed using Matlab. Thus Matlab obtains a random combination of each method and sends the data to Simulink, which returns a current and velocity signal to Matlab. The software calculates the dynamic relationships and estimates a cost according to each algorithm with these signals. In the case of the experimental signals, only measured data were used.

Results
In this section, the results obtained for both tests carried out with simulated signals, and those with experimental signals. The following results were found: • the use of dynamic relationships and the estimation of parameters through metaheuristic algorithms improve the search speed of the parameters; • this limits the number of results to valid combinations for all parameters.

Results with Simulation Signals
The results of the tests performed with original and proposed algorithms are seen in Table 4. The performance of each algorithm in the different tests was represented in the following graphs. Figure 6 displays the performance of GWO O against the GWO P for the M1. Both Figures 6 and 7 present an improvement for the GWO O , achieving a noticeable initial reduction in cost. The GWO P shows a cost reduction below the original in the following iterations. On the other hand, Figure 8 exhibits the results of the algorithm of Jaya in tests carried out in M1.
The Jaya algorithm results have a similar effect as the GWO, which significantly improves the initial iterations. For tests 1 and 2, the cost reduces similarly in both cases as the iterations increase. However, in cases 3 and 4, the original algorithm does not have proper convergence, unlike the proposed one. Similarly, Figure 9 displays the results obtained by Jaya for M2.
Considering the results of Jaya in motor 2, a similar behavior to motor 1 is observed, suggesting that the motor used does not affect the algorithm. Finally, the results of the Cuckoo search algorithm are shown in Figure 10.
In the same way, the results of the tests on the M2 are depicted in Figure 11.    The absolute percentage error was calculated in each test with respect to the nominal parameters to observe the performance of the algorithm in terms of precision. The results were summarized in Table 5 and Table 6 for M1 and M2, respectively.
Both numerical and tabular improvements are observed in the modified algorithms compared to the originals. Therefore, subsequent results will focus on the modified algorithms. According to the observed results, the modified algorithm convergence is faster, adjusting the cost curves in the first iterations. Considering the adjustment speed was programmed, a condition for when the cost function obtains a value less than 0.1, the search stopped. The next test was executed in this way for the algorithm convergence speed comparison and was developed with 30 individuals for all algorithms. The results are displayed in Figure 12. Figure 12a shows the convergence speed in iterations for Motor 1, and Figure 12b depicted the convergence speed in iterations for Motor 2.
It can be observed that convergence in the least number of iterations occurs in the Cuckoo search algorithm.

Results with Experimental Signals
In this section were tested the proposed algorithms with experimental signals using an acquisition system of our design based in a simple PIC18F4550 with a sampling period of 0.001 s and implemented in M2. The algorithms work with experimental signals to verify the performance of the three modified algorithms under real conditions, unlike the previous section, the signals acquired from the real world usually have noise and a higher uncertainty which is a function of the measurement system and the conditions in which the measurement was taken. For this case, all algorithms were used with a population of 30 individuals and a maximum of 50 iterations. The sampling process was as follows: at 0.5 s, a voltage of 10.5 constant was applied, and the measured variables were voltage, current, and motor speed, for which a 12-bit ADC, the Hall effect sensor Acs712 and the encoder integrated to the motor are used. Figure 13 displays the setup of the acquisition system. Although signals can be acquired with such basic equipment, a faster acquisition card and better performing current sensor would help to obtain better quality signals. The results of the acquisition for the step signal used can be observed in Figure 14. Step voltage signal used. Figure 15 shows the current and velocity signals. Due to the acquisition conditions, the speed signal must be filtered. For this, the Chebyshev type 1 digital filter is used. Excessive noise is characteristic of the signal acquisition system and the sensor used. Improving the acquisition hardware would give better signals. However, this is not always possible. With these signals, the dynamic response relations are calculated. For estimating the final current and the final speed, the last 20 values are averaged since the signals preset minor variations, unlike the simulated signals. Again, these variations are attributed to the hardware. The performance of each algorithm can be seen in Figure 16.  The results of experimental signals acquired with noise suggest that the modified algorithms can correctly estimate the parameters to recreate the current and velocity signals.

Conclusions
This article presents the use of dynamic response relations as search constraints in metaheuristic algorithms used as parametric estimators. The three relationships were used, two in the steady-state and one in the transient-state. It was implemented in three different algorithms with two plants to test the validity of the use of relations. The three relationships founded were used, two in the steady-state and one in the transient state. The proposed method is adaptable to any system with a stable response to the step input, and has at least one relationship in dynamic response. Therefore, this method developed in DC motors can be extended to systems with similar models.
DC motor modeling is a widely studied topic. In particular, the parameter identification with metaheuristic algorithms has shown satisfactory results with multiple techniques. However, the study with the dynamic relationships used as search restrictions has not been studied and most of the improvement techniques are oriented to the optimization of hyperparameters (see Table 1). The relations were implemented in three different algorithms with two plants to test the validity of their implementation.
In general terms, the results and the improvement in each algorithm depend on the initial values that the algorithm takes. Being an algorithm that starts from random values, a precise improvement cannot be quantified. Nevertheless, the results show an evident improvement in each algorithm, especially in the first iterations, where the error is reduced in a smaller number of iterations due to the use of dynamic response relations. Therefore, a lower error and a faster convergence can be observed for all algorithms. The trend holds for different motors, although the performance of the GWO is higher with the M1 than with the M2.
Metaheuristic algorithms with similar or equivalent parameters and with no specific parameters were used to reduce the effect of selecting parameters in different algorithms, achieving a more fair comparison. Reducing iterations and initial errors can help in the implementation in multiple systems since the main problem with metaheuristic algorithms is their high iterative degree, which complicates their implementation.
Metaheuristic algorithms with similar or equivalent parameters and that did not have specific parameters were used to reduce the effect of selecting parameters in different algorithms, achieving a more fair comparison. Reducing iterations and initial errors can help its implementation in multiple systems since the main problem with metaheuristic algorithms is their high iterative degree, which complicates their implementation.
Finally, it should be noted that the metaheuristic algorithms start from random populations, thus the performance can vary according to the initial values that it takes. Four different tests were carried out in two motors to avoid this bias in the three original and modified algorithms. In total, forty-eight tests were developed to verify that cost reduction and iteration reduction are maintained despite the variation of the initial population and the search parameters. Future work should aim to make the tests with the adjustment of hyperparameters and measure execution times with the objective of parallel online implementations.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author.

Acknowledgments:
The authors would like to acknowledge the support of Universidad Politécnica de Querétaro in the production of this work. This research was done with the help from Universidad de Málaga and Autonomus University of Queretaro.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.