Optimal parameter estimation for a DC motor using genetic algorithm

Received Oct 1, 2019 Revised Dec 20, 2019 Accepted Jan 3, 2020 Estimating the parameters of a geared DC motor is crucial in terms of its non-linear features. In this paper, parameters of a geared DC motor are estimated genetically. Mathematical model of the DC motor is determined by Kirchhoff’s law and dynamic model of its shafts and gearbox. Parameters of the geared DC motor are initially estimated by MATLAB/Simulink. The estimated parameters are defined as initial values for Genetic Algorithm (GA) to minimize the error of the simulated and actual angular trajectory captured by an encoder. The optimal estimated model of the geared DC motor is validated by different voltages as the input of the actual DC motor and its mathematical model. The results and numerical analysis illustrate it can be ascertained that GA is appropriate to estimate the parameters of platforms with non linear characteristics.


INTRODUCTION
DC motors are used in the majority of applications around us, because of their easy operation, simple structure, and low cost [1]. For instance, a brushless DC motor has been used as an actuator for an Unmanned Aerial Vehicles (UAV) [2,3]. In another work, Yusof et al. [4] employed a brushless DC motor in Powered Knee Orthosis (PKO) for rehabilitation purpose. Therefore, many works have been studied about various applications and different aspects of the DC motor [5][6][7]. Akbar et al adopted a model reference adaptive control and MIT-rule for simulating DC motor kinematic in Simscape package of MATLAB/Simulink [8]. Similarly, oy et al presented an adaptive control method based on Lyapunov function for a DC motor [9]. Furthermore, they estimated the parameters of DC motor using the adaptation law. Their proposed method was validated on simulation and compared with a conventional back stepping controller. Kumar et al. [10] implemented fuzzy logic controller for controlling speed of a Brushless DC (BLDC) motor. In another study, Somwanshi et al. [11] used fuzzy logic to tune a Proportional-Integral-Derivative (PID) controller for a DC motor. They confirmed the efficiency of the performance of their proposed controller by comparison with PID controller with a conventional tuning method. Sangsefidi et al. [12] used a four-leg converter for direct torque control (DTC) of a two-phase induction motor and hysteresisbased current control of a permanent magnet DC motor. Hoo et al. [13] presented integral anti-windup strategies of the Proportional-Integral (PI) controller for simulation of a DC motor in MATLAB/Simulink.
The controller was a built-in closed-loop with single-output and multi-output, which are external torque and desired trajectory. They tested their proposed control system on load and unload condition for first  [14] used the combination of Artificial Neural Networks (ANN) and dynamical tracking error compensator to dependency to the detail mathematical model of shunt DC motor and improve the robustness and efficiency of an adaptive control scheme for velocity trajectory tracking.
Estimating the parameters of different subjects are critical due to their non-linear characteristics. Therefore, in some researches, determining the parameters of various platforms has been defined as an optimization problem [15][16][17]. Nayak et al estimated the unknown parameters a DC motor by model adaptive control and whale optimization algorithm [18]. Pillai et al used Reverse Motion Acceleration (RMA) test to identify frictional components and moment of inertia of a small size DC motor [19]. Noshadi et al developed Genetic Algorithm (GA) for system identification of Active Magnetic Bearing (AMB) systems [20]. Based on the identified system, they developed a robust controller a multi-input multi-output AMB system. Sun et al used multi-parents GA for parameter identification of an adaptive infinite response to improve convergence rate of the conventional GA [21]. Mohammadi et al implemented hybrid of GA and Particle Swarm Optimization (PSO) for estimation the parameters of three-phase induction motor [22].
The motivation of this paper is to define parameter estimation of a geared DC motor that has the non-linear characteristic, as an optimization problem. The mathematical model of the geared DC motor has been determined by using Kirchhoffs law and dynamic equation. By obtaining with the mathematical model, its parameters have been identified by using the parameter estimation package of MATLAB/Simulink. The estimated parameters are defined as initial values for the GA. The optimal parameters are verified by comparing of the simulated and actual angular trajectory captured by the encoder.

DC MOTOR MATHEMATICAL MODEL
In this paper, the DC motor is a planetary DC geared motor with an encoder as shown in Figure 1. It consists of a quadrature encoder, a DC motor located in the middle of the structure, and a gearbox. The rotary shaft of the DC motor is connected to the encoder to measure its rotation as pulse per rotation. It is fixed to a gearbox to reduce its velocity and increase the torque produced by DC motor by converting the electrical to mechanical energy. The characteristics of DC motor consist of resistance, inductance and back electromotive-force voltage as shown in Figure 2.
According to the Kirchhoffs law, the mathematical model of the DC motor is given as follows, where, and are the electric inductance and resistance, respectively. and i represent input voltage and current of DC motor, respectively.
is the back electromotive-force voltage which is proportional to the motor velocity [23].
where, is the voltage constant of the motor and ˙ is angular velocity of the rotary shaft of the DC motor. The produced torque by DC motor is proportional to the current ( ) [24], where, is torque sensitivity and is given as follows, where, represents the gear ratio of the gearbox. and are torques applied to the rotary of the DC motor and shaft of the gearbox as shown as follows, respectively, where, and are the friction coefficient of the shafts, and and are the inertia of the rotary and gearbox shaft. By substitution of equations (2), (3), (4), (5) and (6) in equation (1), the mathematical model of the geared DC motor in Laplace is expressed as following equation, where,

OPTIMAL PARAMETER ESTIMATION
The parameters of the mathematical model of DC motors that need to be estimated are mentioned as follows, while in our geared DC motor, the ratio of the gearbox is 104 ( 104).
These parameters are estimated by parameter estimation package of MATLAB/Simulink the estimated parameters are set as initial values for GA. (13) where, the initial values of the GA are set as follows, , where, is a positive random value between zero and one [25].
GA finds the parameters to optimize the objective function that is Integral Absolute Error (IAE) of the error [26]. The objective function is shown by the following equation, where, is the elapsed time; is the error which is the difference between the actual and simulated angular trajectory as shown as follows, (17) where, is the simulated angular trajectory calculated from the mathematical model, and expresses actual angular trajectories measured by the encoder of the DC motor. The initial population of the GA, as shown in Figure 3 consist of 80 chromosomes that contains the parameters of the mathematical model of the DC motor as design variables.

Figure 3. Configuration of GA initial population
After setting the initial population of the GA, objective function is measured to evaluate each gene. The next stage is sorting the evaluated chromosomes from the minimum to the maximum. Next generations are created by crossover and mutation to increase the chance of finding the most optimum, in this case minimum value, solution and keeping the variety of GA [27].
Five percent of the most minimum chromosomes remain unchanged from each generation to the next generation. Therefore, the chromosomes are created by crossover and mutation that their probabilities are 0.8 and 0.2 respectively. The mutation of this paper is Gaussian function, in which the random values are selected and replaced by the previous one in the chromosomes. This loop continues until the number of the generation meet the maximum one. Algorithm 1 and Figure  The flow chart demonstrates the process of GA for finding the optimal parameters of DC motor mathematical. The algorithm starts with random initialization based on conventional estimation method. In the evaluation stage, the objective function is determined to chromosomes be sorted in the following stage from a minimum to the maximum value. If the generation reaches to the 800, the first gene is the result of the optimization algorithm. Otherwise, the loop will be continued by creating the next generation by crossover and mutation. Figure 5 shows the most minimum objective functions of population in each generation, which converge gradually to the global optima.  Table 1 demonstrates optimal parameters of geared DC motor that are the result of the optimization problem after 800 generations.

VALIDATION
In order to validate the estimated parameter of geared DC motor, the simulated angular trajectory from the mathematical model are compared with actual one captured by encoder. Figure 6 represents the open-loop diagram in which, is the mathematical model that determines the simulated angular trajectory. is expressed in equation (7), that its parameters are optimally estimated and are exhibits in Table 1. The simulated angular trajectory ( ) of the mathematical model estimated by GA and conventional methods with different voltage that are 3 0.5 , 5 0.5 , and 7 0.5 is shown in Figure 7, where t is time. In addition, the simulated trajectory is compared with the actual trajectory captured from encoder exhibits in Figure 1. The simulated angular trajectory by GA is following the actual captured by the encoder with three different voltage, while the estimated model by the conventional method follows the actual angular trajectory by grater error. This shows that GA is appropriate for non-linear mathematical model of the geared DC motor. Table 2 shows the numerical analysis of the error for GA and MATLAB/Simulink. AE and M E express the average and maximum error of the GA and conventional method for three different voltages. AE and M E of conventional method are greater than the GA method by 48, 8, and 5 times for 3 0.5 , 5 0.5 , and 7 0.5 , respectively. Table 2 illustrates the average and maximum error of the GA are less than the conventional method.

CONCLUSION
This paper presents parameter estimation of a geared DC motor by using GA. The mathematical model of the DC motor is calculated by Kirchhoffs law. Based on the mathematical model, an optimization problem was defined to estimate its parameters by measuring the simulated and actual trajectory captured by the encoder. The estimated model is validated by comparison of the simulated and actual angular trajectory. The results and numerical analysis expressed that genetically estimation of the geared DC motor is an appropriate approach to determine parameters of the non-linear geared DC motor model. This method can be developed for other non-linear characteristic platforms. However other optimization methods can be validated for this problem.