Sensorless speed control of DC motor using EKF estimator and TSK fuzzy logic controller

In this article, sensorless speed control of DC motor has been proposed using the extended Kalman filter (EKF) estimator and Takagi–Sugeno-Kang (TSK) fuzzy logic controller (FLC). In the industry, high-cost measurement systems/sensors are necessary for better controlling and monitoring, which can be replaced by a sensorless control technique to reduce the cost, size and increase system reliability and robustness. EKF has been used to perform the sensorless speed control by estimating the speed of the DC motor using the armature current only and TSK-FLC is used to reduce the effect of motor parameter variation and load torque nonlinearity in close loop speed control for various speed references. The performance of EKF-based TSK-FLC is compared with EKF-based PID controller. The time-domain specification and absolute error performance indices indicate that EKF-based TSK-FLC is superior to the EKF-based PID under similar conditions. The proposed system is executed in the MATLAB/Simulink environment, and sensorless speed control of DC motor prototype model has been developed for validating the proposed technique with the help of a micro-controller.


Introduction
DC motor drives are widely used electrical machines in many applications, including rolling factories, paper mills, robots, electrical vehicles and others for which adjustable speed and constant or low-speed torque are required. Nowadays, there exist a wide variety of schemes to control the speed of electrical machines [1]. A PID controller has been implemented on Lab-VIEW and motor speed is measured by a sensor [2], whereas various optimization algorithms to tune the PID parameters have been discussed in [3]. The PW (pulse width modulation) controlled BLDC motor drives have been discussed in [4,5]. Shanmugasundram et al. [6] investigated the performance of fuzzy and PID controller for BLDC servomotor; however, the speed of the motor was regulated by a PWM-controlled chopper driver. In the above techniques, researchers used a speed sensor or tachogenerator to measure the speed, which increases the hardware complexity and cost along with reduced reliability. To achieve effective speed control, a closed-loop speed control system with known or feedbacked motor state variables has been required. Therefore, to measure all the state variables of the system, various mechanical sensors are required which will not only increases the system size, complexity and overall cost but also minimize the robustness and reliability. To minimize the number of sensors and system complexity, the researchers focused on sensor-less control strategy along with intelligent control for optimum response [7].
In sensorless control techniques, the speed of motor is estimated by an observer/estimator with the use of relevant electrical signals [8]. Sliding mode observer [9][10][11], model reference adaptive system [12][13][14], Luenberger observer [15], Kalman filter (KF) [16] and extended Kalman filter (EKF) [17][18][19][20] are widely used state estimation techniques. The observer uses some mathematical equation with some measured states (current, voltage) of a motor to estimate the speed/position. An ANN-based sensorless speed control technique of DC motor has been discussed [21]. In [22], improved speed estimation performance of PMSM drive has been obtained by replacing the saliency back EMF estimator using the PID to a PID neural network torque observer. Cao et al. [23] implemented a low-speed control strategy of PMSM drive, using an adaptive Kalman filter (AKF), incremental encoder and PI control. Some sensorless speed estimation techniques have been discussed with the fuzzy logic controller (FLC) for the BLDC motor [24][25][26][27]. The speed of the induction motor is controlled by a Luenberger observer with Fuzzy-PID [28,29]. Al Maliki and Iqbal [30] implemented an FLC-based sensorless speed control technique for DC motor utilizing KF observer. KF is a linear time state estimator which is widely used for linear and known system parameters, but in practical application, the system is nonlinear. So the performance of KF starts degrading. To overcome the nonlinearity problem, EKF is a widely used state estimator.
The performance of sensorless speed control directly depends on the performance of the estimation algori thm. To design a good sensorless speed controller, it is essential to know the exact mathematical model of motor and environmental disturbance; but in practical applications, generally, systems are found nonlinear, complex, environmental disturbances are uncertain and it is generally assumed that motor parameters never change. However, in practical application load parameters, inertia, friction, temperature and reference speed change create problems for optimum response.
In this paper, TSK-FLC with an EKF has been used to achieve optimum response and better speed tracking irrespective of change in reference speed, motor parameter variation and load torque (constant or nonlinear). In this technique, DC motor shaft speed has been estimated by EKF observer with the help of sensed armature current only. The estimated shaft speed is feedbacked to the TSK-FLC for generating a control signal to perform the closed-loop speed sensorless control of the DC motor. The organization of the paper is: In Section 2, a DC motor mathematical model has been presented. EKF state estimation algorithm is presented in Section 3, while the implementation of EKF with TSK-FLC is discussed in Section 4. Results and concluding remarks are presented in Sections 5 and 6, respectively.

DC motor mathematical model
State estimation algorithm for a DC motor requires a mathematical model in the time domain. The mathematical model of the DC motor has two main equations, one is electrical and the other one is mechanical [31]. By applying Kirchhoff 's second law in armature circuit presented in Figure 1, the electrical equation is given as where i a is armature current, R a is the armature resistance, L a is the armature self-inductance caused by armature flux, v t is armature supply voltage and e a (t) is back emf. A separately excited DC motor presented in Figure 1 requires an extra DC voltage (u f ) to produce the magnetic field. L f and R f represent the inductance and resistance of the field winding, respectively. It is well known that when the field voltage constant and steady-state exists in the field circuit, then i f is constant therefore Equation (1) can be written as  For motoring operation, the dynamic equation for the mechanical system is where ω m is the motor speed, J moment of inertia of motor and load, D is viscous damping coefficient, T f (t) is coulomb friction torque and T L is load torque as shown in Figure 2, can be expressed as where m represents the mass of load, L is arm's length, g is gravitational constant and θ is angular displacement, integral of ω m . The details of motor parameters are given in Appendix. The Simulink model of the load model is given in Figure 3.
As i f is constant then Equation (3) can be written as With the help of Equations (2) and (5), the state-space model can be implemented. The model comprises two state variables i.e. armature current (i a ) and motor speed (ω m ). The state-space model in the time domain is given as From the state-space model, it is clear that θ produces nonlinearity in the system. For digital implementation, Equation (6) must be discretized. The discretetime model of the system can be represented in the form of the following equations: v and w is the process noise and measurement noise with covariance Q and R, respectively, at mean zero. At sampling interval T s , the discretized matrix coefficients A d , B d and C d can be written as With the help of Kalman controllability and observability test, we find that the above system is controllable and observable, which implies that we can design a controller and observer. The detail of the EKF estimator/observer and their performance has been presented in the next section.

EKF observer
The observer uses the state-space model generated in Section 2 to estimate the motor speed (ω m ) based on i a measurements. KF is a state observer that computes the best feasible state from a noisy state using iterative mathematical equations. For nonlinear systems, the KF is not relevant in the presented system as the load torque is nonlinear (in the calculation of θ using ω m leads the DC motor model to nonlinear). Therefore, EKF is used to overcome the nonlinear difficulty of KF. EKF is the extended version of KF which uses first-order Taylor series approximation of nonlinear dynamical function to estimate the state by noisy measured data. The EKF has two main steps: one is state prediction and the other is state correction. In the prediction step, a dynamical model of the system with process noise covariance Q is used. In the correction step, the predicted state is corrected with the help of measured data and Kalman gain (K). However, in the application of EKF, initial values of all the covariance matrices Q, R and P must be tuned correctly otherwise the system may become unstable and can diverge. The covariance can be achieved by analyzing the stochastic characteristics of the corresponding noise. Here, these are obtained intuitively and with the help of [17]. The EKF mathematical steps are presented below.
The prediction step iŝ wherex k represents the estimated state of x k . The correction step is where K k+1 is Kalman gain at k+1 time indices and I is the identity matrix. From Equations (12)-(16) is one complete cycle of the EKF algorithm.

Design and implementation of proposed model
The block diagram and MATLAB/Simulink model of the proposed system are shown in Figures 4 and 5, respectively. It consists of two blocks, one is the controller block and the other one is the DC motor block. In the controller block, TSK-FLC, EKF observer and PWM generators are present. In the EKF estimator block, EKF code has been written using the MATLAB code generator block to estimate the states (speed and current) of the DC motor. The difference between reference speed and estimated speed generates the error signal. The generated error and change in error are applied as an input to the fuzzy controller, which generates the duty cycle to produce the pulse width to control the speed of the DC motor. The TSK-FLC as represented in Figure 6 is an intelligent controller   to control complex and nonlinear systems. The FLC seems an ultimate solution in terms of high dynamic response and best disturbance rejection. The special merit of this controller is that it does not require the knowledge of a mathematical model of the plant for the adaptation mechanism, and it can be easily implemented. It allows the designer to present the overall system behaviour linguistically by establishing rules in the form of IF-THEN statements. The general FLC structure has four parts: fuzzification, fuzzy rule base, fuzzy In the proposed technique, triangular membership function has been used and fuzzy inference system rules are given in Table 1. Each rule takes two inputs, errors and changes in error to produce a corresponding change in duty cycle ( D). So the new duty cycle To implement the EKF with FLC-based sensorless speed control, the following steps are involved: (1) Assign the initial values of states (motor speed, armature current) and the values of error covariance P, Q and R. (2) Predict the next states (motor speed) with the help of Equations (12) and (13).  (14) and (15). This corrected state is used as the previous state for state prediction in the next iteration.    (7) Repeat step-2 to step-6 for closed-loop speed control of the DC motor.

Simulated result
Sensorless closed-loop speed control of the DC motor is presented using an EKF with FLC. The closed-loop speed control performance of the EKF with PID and EKF with TSK-FLC at nonlinear load is shown in Figure  7(a). In Figure 7(b), the DC motor armature current of EKF with PID and EKF with TSK-FLC has shown. The absolute speed errors of EKF with PID and EKF with FLC, and speed estimation error are shown in Figure 7(c). The absolute speed errors are defined as the Euclidean distance between reference speed and the corresponding real speed obtained by the corresponding controller. In Figure 7, the motor reference speed and load torque both are variable with time. From Figure 7(a), it can be analyzed that EKF estimates the motor speed very quickly without using any speed sensor. It also concludes that the EKF with FLC controller has better reference speed tracking capability in comparison with the EKF with PID controller. The timedomain specifications comparisons for both controllers are shown in Table 2.
To check the robustness of the EKF-based sensorless TSK fuzzy controller, a constant load of 20 Nm is applied at a constant reference speed of 50 rad/sec. The performance results at constant load are shown in Figure 8. In Figure 8(a), sensorless closed-loop speed  control performance using EKF with PID and EKF with TSK-FLC is shown. In the perusal of the figure, it can be observed that EKF with TSK-FLC has better reference speed tracking capability at constant load also. Figure  8(b, c) shows the comparison of armature current and absolute speed error performance at a constant speed and constant load, respectively.
In practical applications, the system parameters are not known accurately. Therefore, 5% differences are considered in the real system model and filter parameter respectively. In Figures 7 and 8, the effect of change in load torque at various reference speeds is presented. In Figure 9 the effect of motor parameter variation is presented. It is well known, the resistance of motor armature depends on the temperature of the motor coil. The resistance of armature is increased by approximately 16% on increasing the coil temperature by 40°C. The resistance of motor armature is manually increased in the simulation model of motor to exhibit the effect of temperature. In this study, the parameters of FLC and EKF algorithm are not changed. The result presented in Figure 9 shows that EKF estimated speed changes slightly on changing the armature resistance but the closed-loop speed response remains the same, i.e. the closed-loop speed response using EKF with Fuzzy is not truly dependent on the armature resistance which is raised by the temperature of motor coil.
The closed-loop speed control performance of the EKF with PID and EKF with TSK-FLC at 450 rpm and constant load has been presented in Figure 10 without changing the controller and EKF parameters. The result shows that the EKF estimator tracks the reference speed with ±3% error and the closed speed control performance using EKF with TSK-FLC is also good but the closed speed control performance using EKF with PID exhibit a permanent residual error. All the result studies show that closed-loop speed sensorless control performance of EKF with TSK-FLC is better than EKF with PID in all the cases. The analysis shows that the EKF estimator performance and EKF with TSK-FLC performances at high speed are poor in comparison with low-speed applications. One can get better performance by adjusting the observer covariance matrix and optimizing the TSK-FLC parameters or by changing and increasing the membership shape and value, respectively.

Experimental setup
To validate the proposed model, hardware in loop (HIL) simulation has been carried out. Figures 11 and 12 represents the schematic diagram of the HIL simulation and its experimental setup, respectively. The experimental setup involves four main components. The 12 V DC motor with a voltage and current sensor (L298N) motor driver module, Arduino board, and personal computer (PC). In PC, TSK-FLC and EKF estimator are present. The voltage across the motor winding and armature current is sensed by voltage and current sensor. This sensed value has been used to estimate the speed of the motor in the next iteration by the EKF estimator. The difference between reference speed and estimated speed generates the error signal for the controller block. The controller block generates the appropriate duty cycle. This duty cycle is applied to PWM inbuilt Arduino board which generates the PWM signals for the motor driver to control the speed of DC motor. To validate the proposed technique, the result of an experimental prototype has been presented in Figure 13. From Figure 13, it can be observed that the tracking of the reference speed is impressive. In light of the discussion of the above results, it can be concluded that EKF with TSK-FLC has better time-domain performance and good reference speed tracking ability in any conditions in comparison with EKF with PID.

Conclusion
In this paper, EKF with TSK-FLC and EKF with PID have been implemented for sensorless speed control of the DC motor. The EKF is used for speed estimation and later estimated speed is used by the TSK fuzzy controller for closed-loop speed control. The performance of both the controller with the EKF observer is compared in similar conditions. The MATLAB/Simulink and hardware prototype result of EKF with TSK-FLC shows satisfactory performance compared to EKF with PID over a wide range of speed and torque changes. An important component of the proposed technique is the adaptability of TSK-FLC with an EKF estimator for sensorless speed control. It shows high robustness toward parameter variation, improves tracking accuracy, reduces absolute error and improves the transient state performances.

Disclosure statement
No potential conflict of interest was reported by the author(s).