Design and Digital Implementation of Controller for Pmsm Using Extended Kalman Filter

A novel digital implementation of speed controller for a Permanent Magnet Synchronous Motor (PMSM) with disturbance rejection using conventional observer combined with Extended Kalman Filter (EKF) is proposed. First, the EKF is constructed to achieve a precise estimation of the speed and current from the noisy measurement. Second, a proportional integral derivative (PID) controller is developed based on Linear Quadratic Regulator (LQR) to achieve speed command tracking performance. Then, an observer is designed and its error is utilized to provide load disturbance compensation. The proposed method greatly enhances the PMSM performance by reducing the control signal variation as well as the disturbance. The speed control performance is significantly improved compared to the case when we have an observer acting alone. The simulation results for the speed response and variation of the states when the PMSM is subjected to the load disturbance are presented. The results verify the effectiveness of the proposed method.


Introduction
Permanent Magnet synchronous Motor (PMSM) has a high torque/inertia ratio, high speed, high efficiency as well as high reliability and is of compact size.These qualities render PMSM as one of the most applicable AC machines for servo control applications and PMSM is therefore gaining extensive research attention in recent years [1][2][3].PMSM weighs less and is of low maintenance; it offers many advantages in the high performance application areas such as in robotics, aerospace, navigation and many more.The modeling and control of the PMSM is complex because of two main reasons: 1) the multi-input nature of the motor, 2) the coupling between the stator current and rotor speed are non-linear.For high performance of PMSM that drives the vector control theory is applied, in which 3-ф stationary frame transforms into 2-ф synchronously rotating rotor reference frame; thus the flux and torque can be controlled independently, similar to the DC motor [4][5][6].Though, the vector control is a complex control technique, the progress in the development of fast semiconductors switches and cost efficiency micro-controller has made the vector control fea-sible.PMSM uses known rotor shaft position as well as the inverter to control the armature currents, and is usually employed in direct drive system.The direct drive systems are more prone to load variations and these variations directly impact the motor shaft; this deteriorates the performance of the system.In order to mitigate these defects, the disturbance rejection control technique is used.
In this paper a vector control method is developed and implemented by means of a conventional observer combined with Extended Kalman Filter algorithm to provide the speed control and disturbance rejection.In the vector control method, to achieve better control performance, it is important to know the information of the rotor speed and position.Here, state space representation of the model and observer is obtained.Utilizing the state space model, a PID controller is designed using Linear Quadratic Regulator (LQR) approach [7].Commonly, the aim of the observer design is to reduce the observation error, but it is used to serve as feed forward compensation for the load disturbance in the proposed method [8].
Many research works have been done in speed and position estimation of PMSM using sliding mode, high frequency signal injection method, adaptive control theory, fuzzy control, state observer, EKF [9][10][11][12][13][14][15][16].In all, EKF is more attractive as well as popular and is continuously being used in research and applications because it delivers rapid, precise, and accurate estimation.In many applications EKF is implemented because of its low-pass filter characteristics [17,18].The feedback gain used in EKF achieves quick convergence and provides stability for the observer.
In this article, the conventional observer combined with the Extended Kalman Filter is presented.The accurate estimation of states is very essential to achieve better control and performance of the PMSM drives.Here the EKF is utilized for the precise estimation of the rotor speed and stator q-axis current.Since the drive speed and drive current are measured directly from the machine terminals contain noise, they are not precise for speed control.In the proposed approach, the speed and q-axis current are estimated accurately by introducing EKF algorithm theory.The estimated current acts as an input to the state observer while the estimated speed is compared with the reference speed.The proposed method yields a smooth and quick speed tracking, reduction in the disturbance applied to the system, and better control of the control signal variation.The overall system performance is greatly enhanced with the proposed method.

Model of PMSM
The stator voltage and stator flux linkages equations in the rotor references frame are [4]: where The electromagnetic torque generated and the acceleration is given by: where mech  is the speed of the motor and p is the number of poles.
Since the torque developed by the motor is directly proportional to the motor drive current, it is difficult to control the drive current directly.Therefore the drive current is indirectly controlled through the input voltage.The simplified model of the PMSM q-axis subsystem is shown in Figure 1.
In vector control, assuming i ds = 0, the state-space model of the PMSM q-axis subsystem is derived as [8]: For the speed controller design, the system output is If the motor output is considered as the drive current, then the motor output is given by:

PID Parameters Tuning with State-Feedback and State-Feed forward LQR
The controller is designed as a single-input-single-output (SISO) system.The following discussion is based on the q-axis controller/observer design [8].
The state space model of the simplified PMSM, , with reference to the q-axis is: where, , and A 1 , B 1 and C 1 are constant matrices.

 
The entire system output is the sum of the motor output and load disturbance and is given by: where , The state space model of the speed controller,   2 G s , can be written as: In order to convert the PID tuning problem to an optimal design, we modify the closed loop cascade system into an augmented system with .The result is the following equation: where .
The resulting state-feedback LQR for the augmented system is: where . The quadratic cost function for the system J, is given as: where , , which represent the states variation and control energy consumption, respectively.
The optimal state-feedback control gain which minimizes the performance index is given by: The solution of the revised Riccati equation is given by: where , .0 P  0 h  The motor states feedback actually act as the proportional and derivative controller respectively and the controller act as an integral only.Then 2 K is a gain for the integral controller.Hence, the total control law is equivalent to a PID controller.By choosing the desired values of h and the weighting matrices Q and R, the control gain can be determined.The block diagram of the designed augmented system including the controller is shown in the Figure 2.
The calculated control gains are given by:

Design of Observer
A state observer is constructed mainly to achieve the speed control and disturbance rejection.The observation error and properly adjusted observer gain can provide feed-forward compensation for the output disturbance.
Suppose the state space model of the PMSM    with the entire system output being the sum of the motor output and load disturbance as : The design of an observer, whose dynamic function is the same as that of the motor is as follows (see Equation ( 22)): The observation error is expressed as: The observation error dynamic f by: unction is then given Applying the Laplace transform, we above equation it is clear that the o e evitably exist due to the load di an   From the bservation rror will in sturbance, d then the observed-state feedback can be regarded as: where, the term   The speed signal differentiated through the position output of the encoder is very noisy.Thus sd i instead of mech  can be regarded as the system output in the following observer design.Selecting appropri values for and R, the revised Riccati equation is solved as follows [8]: where

Sta r ed d te Obse ver Bas Exten ed Kalman Filter
al eq hich produces the optimal estimation of the "(11b)" is the non-linear system.To appl The Extended Kalman Filter is a set of mathematic uations w state system based on least square method.The EKF estimates the process by using a feedback control.The EKF provides considerable good tolerance for the mathematical model error and noises in the measurement inaccuracy [19].
The state space model of the simplified PMSM given by "(11a)" and y the EKF algorithm, the system needs be discretized and linearized [20].
The discrete approximated equation is given by: The nonlinear stochastic equation is: The Jacobian matrices of the partial derivative of f and h with respect to x are: yields the desired optimal observer gain given as:

Open Access
The motor nonlinear state equations given in the discretized form is as follows: where and are zero-mean White Gaussian noise process and m ent noise with covariance Q and R. Mainly, there are two states in the Extended Kalman Filter, namely the prediction state and the correction state.
In the prediction state also called the time p   In th correction state also called the measurement update, the predicted state estimate ê x and covariance matrix P are corrected as follows: The important and difficult part in th EKF is choosing the proper values for the covariance m variance matrices affects both the dynamic and steadystate.By using trial and error method, a suitable set of values of Q and R are selected to insure better stability and convergence time.
The chosen values of Q, R and P are: e design of the atrices Q and R [21,22].The change of values of co-

Simulation Results
The PMSM model is constructed to verify he speed condisturbance rejection using the conventional nd K2 and optim d the filter gain is obtained using EKF algorithm.The output d rent and speed are estimated through the obser and EKF algorithm is implemented using S-Function nction block is taken directly .The noise-free, accurately t trol and load observer combined with EKF.The simulation is implemented using MAT Lab/Simulink.The parameter of the motor model is given in Table 1.Based on optimal control theory, the desired control gain K1 a al observer gain (Jo) are determined an rive curver theory block.The input to the S-Fu from the machine terminals estimated output current is fed to the observer as input while the estimated speed is compared with reference speed.At the output, the motor response is checked and the disturbance rejection is observed.The block diagram used in the simulation is as shown in the below Fi- gure 4 and the simulation results are shown in Figures 5-10.
With the reference speed of 200 rad/s, the simulation   the load disturbance is applied at t = 2 s.The simulation results are shown in Figures 7 and 8 ad.Figures 9 and 10 shows the situation for the decreasing load.
From the obtained result, it is evident that the speed is combined with e EKF as compared with the case where the observer is uction in the transient input signal variatio variation caused by the load disturbance is significantly reduced in the case where the observer th acting alone.Also, as the simulations show, the input signal variation is reduced.The proposed approach mitigates speed deviation caused by the load disturbance variations.Red n, reduces the risk of potential input signal saturation, and prevents the deterioration of the system performance.
The simulation results are confirms the effectiveness of the proposed method.

Conclusion
A novel digital implementation of speed controller for a alman Filter (EKF) is proposed.bined with EKF algorithm method atdeviation caused by the load distur-Permanent Magnet Synchronous Motor (PMSM) with disturbance rejection using conventional observer combined with Extended K The observer com tenuates the speed bance.In addition, the magnitude of the variation in the control signal is much less compared to the situation with an observer alone.The saturation of input and state is reduced effectively and the system performance is enhanced significantly.

3 .
The feedback of the observation error actually acts as feed forward compensation for the load distur ID cont e proper adjustment of the observer gain makes sure that the system is less affected by the load disturbance and provides additional feed forward compensation.
o timal state estimate x and state covariance P are predicted.

Figure 4 .
Figure 4. Block diagram of PMSM drive with observer combined with EKF.

Figure 6 .Figure 5 .Figure 7 .
Figure 6.(a) Speed response; (b) control signal response for observer combined with EKF (no load).resultswith observer acting alone and observer com ined with EKF are shown in Figures5 and 6, under no load oothly.To account for the speed estimation performance of the observer acting alone and observer combined with EKF for a step change in steady state operation of PMSM,

Figure 8 .
Figure 8.(a) Speed response; (b) Control signal response for observer combined with EKF (increase load).
Figure 10.(a) Speed response; (b) Control signal response or observer combined with EKF(decrease f load).