Extended Kalman Filter Based Speed Sensorless PMSM Control with Load Reconstruction

This paper describes a study and experimental verification of sensorless control of permanent magnet synchronous motor. This structure bases on the extended Kalman filter theory using only the measurement of the motor current for on-line estimation of speed, rotor position and load torque reconstruction. Control structure such as Kalman filtering, in real time requires a very fast signal processor in special way, adapted to perform complex mathematical calculations. The digital signal processors have become cheaper and their performance greater. Without using position and torque sensors, it has become possible to apply described control structure as a cost-effective solution


Introduction
There is increasing demand for dynamical systems to become more realizable and more cost-effective. These requirements extend new method of control and operation. In the robotic world important is rapidity and precision as well. These two criteria can be connected in low-cost sensorless robot arm system. Permanent Magnet Synchronous Motors (PMSM) are used in the most modern motion control application. The PMSM products have been a new generation of electric motor of low energy, environmental protection, high efficiency that can be widely applied in many fields. The motor described simplicity of construction, high torque and small moment of inertia due motor size. One weakness can be noticed rotor position is necessary to full performance control. The Field Oriented Control (Vas, 1999) strategy permits one to fast response to load and speed changes. The purpose of this chapter is to obtain a fully PMSM drive control algorithm used for robot arm drive with load torque recognition without using any mechanical sensor. A few steps shows how to use an Extended Kalman Filter (EKF) instead of sensors for mechanical quantities. Standard approaches defined state vector of observer restricted to sensorless control for motor only, like speed and position (Bolognani et al., 2003;Dhaouadi et al., 1991). There are often situation in which we want to obtain other types of state estimates, which can be helpful to whole robot system controllers like load torque (Janiszewski, 2006;Terorde & Belmans, 2002;Zhu et al., 2000;). In the most practical tasks information about forces acted in particular arm axis should be necessary to know. The unavoidable environment, robot modelling errors and uncertainties may cause rising of contact forces ultimately leading to the unstable behaviour during the interaction. Managing the interaction of the robot with the environment can be motion strategy. The Kalman filter (Kalman, 1960;Gelb, 1974;Grewal & Andrews, 2001) is often applied during dissolving state estimation of dynamical system. Extended Kalman Filter is generalized algorithm, which can be used for non-linear systems such as PMSM. The estimation is done upon undisturbed input signals from overriding controller and disturbed output signals of a real non-linear plant, which are measured.

Permanent magnet synchronous motor drives 2.1 Permanent magnet synchronous motor
The Permanent Magnet Synchronous Motor is a rotating electric machine where the stator is a classic three phase coils like that of an induction motor and the permanent magnets are located on the rotor surface. A PMSM provides rotation at a fixed speed in synchronization with the frequency of the power source, regardless of the fluctuation of the load or line voltage. The motor runs at a fixed speed synchronous with mains frequency, at any torque up to the motor's operating limit. The PMSM consist stator windings and rotor permanent magnets sinusoidally distributed so Field Oriented Control can be used (Vas, 1990). From a control point of view, FOC is transfer and extension of DC motor control theory into PMSM. The basic concept is control by a excitation field and armature field-current (Vas, 1990). This type of machines are extensively used in servo drives for low power machine tool, e.g. robots, positioning devices etc. They are receiving increased attention by possibility to use in the region of larger power e.g. electricity generation. The following requirements for servo drives must be served: • high possible power to weight ratio, • large torque to inertia ratio -high acceleration possible, • smooth torque in wide speed -small pulsation of speed, • full torque at zero speed -stand still working, • high speed operation, • compact design and small size. New types of Permanent Magnet materials offer the ability to design electromagnetic energy converters with complicated shapes. Permanent magnets can be sticked or inserted to the small rotor. Rare-earth magnets are mostly used in modern drive. It can be obtained air-gap flux density in range of 1 T. PMSM are used in high-accuracy direct-drive applications mainly due to their advantages. Compared to conventional DC motors, they have no brushes or mechanical commutators, which eliminates the problems due to mechanical wear of the moving parts. In addition, the better heat dissipation characteristic and ability to operate at high speed render them superior to the PMSM drives.

Vector control scheme of PMSM
The control scheme of PMSM is relative simple, proposed scheme is presented on Figure 2. www.intechopen.com The field-oriented controller is based on a current-controlled voltage source inverter structure (Vas, 1990;Janiszewski 2004;Terorde, 2002). The current control loops are arranged in the 2-phase synchronously rotating rotor reference frame d-q aligned with rotor flux (also rotor position g), while the rotor position and speed detection operates in the 2phase stationary reference frame α . The dq-phase arrangement PMSM machine is similar to DC machine in operation. The excitation flux (Ψf) is frozen to the direct axis of the rotor and is associated with d axis. Equivalent of armature current in DC machine is associated with current in q axis. There is also assumed that the effect of any magnetic saturation is neglected during working and thus for modelling purposes the permanent magnets can be considered as constants. Based on above assumptions the control scheme is similar to cascaded DC motor control. The PI speed controller feeds the reference value for the torque -exciting current i q . Due to the permanent magnets at the rotor, the reference value for the field exciting current i d is kept to zero. Motor operating does not require the field weakening, as assumed. Current feedback is obtained by measuring the 3-phase currents and transformations to the stator components [ abc /ab] and next to the rotor components [ab/ dq ]. The rotor current dq-axis components are needed for current regulation. Standard PI controllers with anti windup limitation are used for all regulators. The output of the current controllers represents the reference voltages (u d and u q ) in the rotor coordinates. These values are transformed [dq/ab], knowing rotor position g, into the stator coordinates (uα and u ) in order to calculate the desired polar voltage vector. Using space vector Pulse Width Modulation (PWM), the polar voltage vector is converted to three phase currents by PWM inverter. Simplified electrical structure of inverter is presented on Figure 4. That is meaning when the upper one is turned on, the lower one must be turned off, and vice-versa. The output voltage is created by a PWM technique by modulating the high-side (T 1 , T 3 , T 5 on Fig. 4) and low-side (T 2 , T 4 , T 6 ) switches of the power inverter. (Vas, 1990) The power devices for this applications are IGBT (Insulated Gates Bipolar Transistor). The main advantages of IGBT are small conducting resistance, small voltage drop and it is designed to rapidly turn on and off switching, so it is suitable using for synthesize high frequency PWM switches. Mechanical part of the system (see Fig 1) consist only still shaft and dynamical load generator. To simplify considerations and laboratory tests to be make a assumption that shaft is extremely still, and only one parameter describable -concentrated moment of inertia J. This parameter is amount of all moments of inertia in mechanical system. Dynamical load T load is done by second similar motor (right side of Fig 1) which is supplied from independent converter and it is used only for generation variable load torque. In presented method position of rotor was measured. In fact most cases are used position encoder only, but speed is computed derivatively.

Sensorless control
The scheme of sensorless control of PMSM is very similar to sensor control (Barut, et al. 2005;Bolognani et al., 2003;Dhaouadi et al., 1991;Janiszewski, 2004Janiszewski, , 2005. Proposed scheme is presented on Figure 5. There are one significant different, system have no any mechanical sensors. It can be possibility to replaced physical sensors by mathematical algorithm. Sensorless control diagram consists of PI current controllers subordinated to speed controller and adequate frame coordinate transformations. There are no differences in this part. The main state of presented system is an estimator, realized by Kalman Filter theory operation. The PI speed controller feeds current i d * in q axis in order to keep Field Oriented Control (Vas, 1999). The demanded current is computing by using the difference between requested speed (ω r *) and speed (ˆr ω ) estimated by Kalman filter. Motor operating does not require the field weakening, as assumed. Therefore desired current i d * in d axis is maintained to zero. These signals are inputs of PI current controllers, which provides desired voltages in dq reference frame. Basing on estimating shaft position γ , voltages are converted into the stationary two axis frame (αβ) and send to control Pulse Width Modulation inverter.

Modelling of the system
As known, a motor model is required for the implementation of observer based on Kalman filter approach. There are no general methods that can be used to get a complete model. Each object has its own characteristics, several papers concerning modelling of PMSM (Bolognani et al., 2003;Janiszewski, 2004;Pillay & Krishnan, 1988;Vas, 1999). Some general guidelines can be given but mathematical model building often has to be combined with experiments. The mathematical model of object is a major task during building up an observer. The proper model can simplify a solution of estimation approach. Choosing a rotor reference dq frame causes simplification sinusoidally distributed inductances and causes model similar to the DC machines. As is well known, the transformation of the synchronous machine equations from the abc phase variables to the dq variables forces all sinusoidally varying inductances in the abc frame to become constant in the d, q.
The following assumptions are made in the derivation: • saturation is neglected although it can be taken into • the back emf is sinusoidal; www.intechopen.com • eddy currents and hysteresis losses are negligible. The electrical properties of the motor in continuous time are completely described by two voltage network equations of the stator in rotating quadrature dq frame, as follows: where: u d , u q are stator voltages, i d , i q -stator currents, R s is stator phase resistance, L d , L q -d q axis stator inductances, Ψ f -rotor flux, ω r -mechanical speed in electrical rad/s. The electromagnetic torque of the PMSM with surface mounted magnets and with symmetrical stator winding can be achieved very simply, and can be expressed similarly do the DC machine, as a product of i q axis current and magnetic field. In case of interior permanent magnets the additional reluctance torque can be exploited: where: p is a number of pair of poles. The simple mechanical system can be consider with one Inertia (J) and one acting load torque (T load ). Mechanical dynamics may be described as the acceleration equation: It is possible to define general movement equation as Many speed observers described in literature do not recognize load torque (Bolognani et al., 2003;Dhaouadi et al., 1991). It is assumed, the velocity is treated like constant in short period of time. These solutions avoid load torque which is treated like unknown disturbance. The derivative of angular shaft position is defined by: The state-space representation of the model is useful for observer construction. The main problem when making a mathematical model is to find the states of the system. The states variables definitively describe storage of energy and mass in the system. Typical variables that are chosen as states are voltages and currents for electrical systems, position, speed and torque for mechanical. Basing on described balanced equations (1,2,5,6), we can write down similar to (Barut, 2004;Janiszewski, 2005Janiszewski, , 2006Terorde & Belmans, 2002) as the state-space vector: www.intechopen.com .
Discrete-time of presented continuous system is described by the following state equations: Fig. 6. The PMSM discrete model In this case all variables are available. The system has a electrical input -stator voltages (αβ reference frame): and electrical output -stator currents: .
In the original abc reference frame the windings are displaced at 120 electrical degrees in space, and voltages and currents equations are dependent of each other and time. The transformation to two perpendicular phases (αβ ) can avoid this relation. The relation between the two-axis stator currents components and the corresponding three-phase measured current can be obtained by: .
The next very important step is avoid the rotating vector. It can be possible to observing the current in the reference frame rotation with the same speed as the current state vector. In this consideration d-axis of the rotating frame is aligned with the rotor flux (Ψ f ). The following transformation can change reference frame from αβ into dq: The inverse transformation is usually used for the calculation of the reference voltages being the input of the PWM module ( fig. 2, 5): .
The value of external torque T load is treated as state variable (8) and part of disturbance vector w k (9) (Barut et al., 2005;Janiszewski, 2005Janiszewski, , 2006Terorde & Belmans, 2002;Zhu et al., 2000). This operation allows to estimate parameters of differential equations of model. It is also assumed, that this estimated variable is treated like white noise and it is constant in small interval (sampling time T s ): It is noticed, that the state-space equations are non-linear. Some elements of the A k , B k , C k matrices depend on an instant x k vector (values of angular position , shaft velocity ω r and current i d ). In order to build estimator basing on EKF, the non-linear model of PMSM is a priority. There are matrices: , ,

EKF state estimation
The Kalman filter is often applied during dissolving state estimation of dynamical system, disturbed by the known signals (Gelb, 1974, Grewal & Andrews, 2001Kalman, 1960). Kalman filter algorithm is used for estimating the parameters of linear system, but the PMSM model is non-linear, so we can not use that filter in this case. Extended Kalman Filter is generalized algorithm, which can be used for non-linear systems (Gelb, 1974, Grewal & Andrews, 2001. The estimation is done upon undisturbed input signals (u α , u β for presented PMSM drive) and disturbed output signals (measured stator currents i α , i β ) of a real non-linear plant. As assumed, state space estimation is carried out in few steps at each computation cycle. The EKF is an optimal estimator in the least-square sense for estimating the states of dynamic non-linear system (Kalman, 1960). An linearisation is build on assuming, that the state variables (7) are constant in one step of computation. We obtain new linearised matrices , and valid only in one step. After this linearisation the inner equation (8) predicts k|k state for instant time t k . The correction proceeds on previous predicted state k|k-1 , using filter coefficient K k (gain matrix) from t k-1 state and measured actual output vector y k (currents). An error covariance is done by the following recursive relation: .
The object linearisation (19) is attached to this group as well.
The second step -time actualisation, is described as the prediction of previous k|k state into a new state k+1|k used (8) in the form: . (23) www.intechopen.com The filter gain matrix is defined by: . (24) The error covariance matrix is predicted by a relation: , where Q and R are respectively: the covariance matrices of the system and measurement. The whole algorithm is recursive by .
An open question, one critical step towards the implementation of EKF is the choice of the values of the matrices Q and R (Barut et al., 2004;Bolognani et al., 2003;Dhaouadi et al., 1991;Gelb, 1974, Grewal & Andrews, 2001Kalman, 1960;Janiszewski, 2005Janiszewski, , 2006Terorde & Belmans, 2002;Zhu et al., 2000). They have to be set based on stochastic properties of the corresponding noises (Kalman, 1960). The change of covariance matrices effects both the dynamic and steady-state. The discussed matrices are simplified to diagonal form in order to eliminate state vector elements co-disturbance. Increasing particular values of Q, it corresponds to stronger system noises and finally an instability in result of the strongest correction. Decreasing values of Q, it corresponds to weaker correction and estimation state errors. Matrix R matches measurement noises, can be measured easily in advance.
Measuring is generally possible because the current measurement is needed anyway while operating the filter. Some tests, sample measurements are taken in order to determine the variance of measurement error. Laboratory particular tuning EKF shows necessary to increase to large values near 10. It helps eliminate strong noises. In case of system covariance, the calculation is less deterministic. Considering system equation and one knowing inaccuracy (current measurements) it can be possible to estimate system noises in narrow range. The first step was appoint current measurement covariance Q(1,1), Q(2,2) in range 2.3·10 -8 , and next based on mathematical model of PMSM estimate other covariances. That theoretical analysis of this consideration expanded to real plant by introducing some scaling coefficients. Basing on described rules they were chosen and adjusted experimentally: , www.intechopen.com .
It should be noticed, that choosing of process covariances is proportional to the square of the sample time (T s ). The presented algorithm does not require a precise choice of the initial values for the state vector 0|0 and the error covariance P 0|0 matrix. It was proved during the experimental investigation, that P 0|0 did not have a significant influence in the behaviour of EKF. The algorithm does not need the initial rotor position (non zero part of real state values) but it is possible to start the motor from the standstill place even if initial state vector of estimator is null.
The entire control algorithm with EKF was implemented on a DSP. The implemented algorithm consist several states, one of them is EKF. The most of EKF algorithm was written in C language and it is presented in section Code 1.

Laboratory setup
For experimental verification of the proposed estimation method, a laboratory setup has been constructed (see figure 1). It consists of the surface mounted magnets synchronous motor, supplied from the three phase power IGBT inverter. This motor is coupled via stiff shaft with the second twin motor supplied from industrial controller (DIGITAX made by Control Techniques). During mechanical construction wont to avoid any complex mechanical solution. There was choose short stiff shaft between twin trade motors. This shaft assure small additional moment of inertia, any additional rotating masses. Every motor is equipped with position sensor, an 3600 pulses per revolution optical encoder. A practical compact Intelligent Power Module with Insulated Gate Bipolar Transistor, that aims to combine economic reasonable cost with a high level of functionality was used. Figure 4 shows a simplified block diagram of PWM converter. The IGBT, Insulated Gate Bipolar Transistor, is a switching transistor freely controlled by voltage applied to gate terminal. The experiments presented in this section have been carried out with DSP board that was developed in Institute of Automation and Information Engineering of Poznan University of Technology. This board was specially constructed to fit the needs and flexibility mainly for research projects. The mainboard consist powerful SHARC DSP from Analog Devices ADSP21060, set of memories: RAM, boot EPROM, pair of serial channel and parallel interface for extension boards. The flexibility is done by changing extension boards or mainboard freely. The extension board consists additional hardware. Motion coprocessor Analog Devices ADMC201 is used for PWM generator handling Eight channel 12-bit simultaneously sampled AD Converter is used: 3 channel feeds by LEM transducers for 3phase currents (i a, i b, i c ) measure, one channel feed by voltage LEM transducer for DC link (U dc ) measure. Altera FPGA Flex 6000 was used for incremental encoder counting. Precise measurement of position is obtained by optical encoder that is used for verify the estimated position and during identification process.

Code 1. Main code of EKF algorithm
The System contains also one four-channel DA Converter, that was built in for auxiliary outputs, helpful in state visualisation. The mainboard allows for high performance algorithm implementation. The architecture of board is specially optimized for motion control works in hard real-time single task system. After initial stage main loop is repeated recursively based on external low level interrupting each T s = 200 μs. Observer and control code has been mainly written in C language, however except low-level procedures written directly in Assembler.

Obtained results
Experiment were performed and examined with regards to the following tasks: possibility speed changing and torque acting. At the first part of investigation, it was focused on controlled system behaviour by reference speed (ω r *) excitation without additional load torque. This type of reference signal has such significant stages for estimator behaviour like: zero signal with no initial values in estimation vector, step signal and reversal. The maximum module of reference speed is 1000 rev/min (1/3 of maximum speed). The second part consist in acting external load torque and observing of behaviour control system. Investigations were carried out on a drive with parameters given in the Appendix. The position error is counted as difference between estimated value and real position. It should be noticed that observer did not have information about initial speed. The observer do not required any special initiation, they can find initial position after supply motor. This case happen when motor is started. Position error is cancelled and hold in small error range. As poorly shown the load torque is on level near 0,5 [Nm]. Very interesting situation is presented on figure 9 when the motor reversing. During this investigation the demanded and real speeds are near zero values. There is difficult stage of observer. When the speed is near zero, the extorter voltage values are also near zero, what causes zero activate the observer. As shown presented solution of EKF did not lost state vector, rises errors of estimation but system is still stable. After process of reversing the errors are naturally reduced. As shown there are small estimations errors during the steady state. Some errors appears during dynamical acting. The source of errors stays in the differences between motor model and real plant, particularly at current limitation in current controller. Figure 10 presents the main investigation, the transient response of the PMSM on step change of load (50% rated torque) at a motor speed of 1000 rev/min. Before load acting friction and other parasite torques appears. In steady state, the estimated load equals to electromechanical torque. Erroneous load torque dynamical reconstruction declined fast. Source of appears dynamical errors disclose in assumption that differentiation of load torque should be equal to zero (15). In practical consideration we may assumed dynamics limitation. This influence is small compared to a potential wide range of load variation. In the author opinion the construction and physical asymmetry of PMSM rotor issues the apparent systematic position error. Verification short tests with other types of motor shows that this systematic error can be cancelled.
Due to the physical rotor asymmetry, the presented drive is also suitable for position control.

Conclusions
The intent of this chapter was to show the utility of the EKF as a fundamental method for solving range of problems in sensorless control of PMSM. There was presented the design and implementation of high-performance servo motor drive with speed, position and torque estimation. The described control system is a solution without any mechanical sensor for a wide range of applications where good steady-state and dynamical properties are required. The FOC based speed controlled PMSM requires no shaft sensors for rotor position and speed. Due to rotor asymmetry, the presented drive is also suitable for position control. The presented sensorless control scheme and EKF algorithm are self-starting. The most application required tension pick-up for torque measurement can be cheaper and rugged by load torque estimation. The described estimation of torque which was accented, can be helpful in a lot of robotic applications instead of expensive stress sensors. The consideration of the load torque as a constant term in the observation algorithm aims to capture other uncertainties besides the load torque than at rush changes. The results obtained through experiments under various challenging test demonstrate the good performance of the observer. For the experimental study presented above, the system performance was observed to be quiet good under step and reversals desired speed and the load torque changes. The practical success in sensorless control of nonlinear object suggests that the combination of EKF and classical PI controllers can provide powerful rapidity and precision drive. Finally, the chapter shows successful way of design of the EKF based observer of mechanical quantities for sensorless control of PMSM drive. The application of the algorithm demonstrates its potential in real-word robotic context. www.intechopen.com