Design of Extended Kalman Filters for High Performance Position Control of Electrical Drives Stephan Beineke Lust Antriebstechnik GmbH Gewerbestrasse 9, D-35633 Lahnau, Germany Phone: 49-644-96626, Fax: 49-644-96637 e-mail: entwicklung@lust-tec.de Abstract: High performance position control of electrical drives requires controllers adapted to the mechanic. As some of the mechanical parameters, e.g. total inertia of the drive, vary with time, effective schemes are needed to track timevarying parameters. Although the extended Kalman filter has turned out to be suitable for dealing with this problem, industry application of this advanced algorithm is especially hindered by a lack of systematic commissioning schemes. This paper presents a design method for extended Kalman filters adapted to fast position control. The design is based on a physical approach and provides a physical insight into the extended Kalman filter algorithm. This facilitates an easy transfer of this approach to a broad range of other applications, such as sensorless drives or system monitoring. I. INTRODUCTION While designing dynamic speed and position control loops time variation of certain parameters has to be considered. Large variations of load inertia occur in many industrial motion control applications where different load masses have to be transported. Typical industrial applications are linear axes with belt or screw spindle transmissions where variable load masses are transported on a moveable carriage. The common solution with respect to control is a robust controller design for all load conditions. As stability has to be ensured at the same time, this compromise leads to a loss of dynamics. Furthermore, maximum acceleration of the drive depends on the load inertia. Thus, position reference trajectories, which have to be designed for the worst-case (lowest acceleration at maximum inertia), and machine cycle times can be optimized by adaptation according to time-varying inertia. If load inertia variations become significantly large, it is therefore meaningful to adapt the controller gains and trajectory parameters to the actual load to attain both, stability and optimum dynamics. An often used approach is to identify model parameters first and then to adapt the controller according to the identification result (Model Identification Adaptive System MIAS). For the position control task the MIAS control scheme used in this paper is depicted in Fig.. Harald Wertz Institute of Power Electronics and Electrical Drives Univ. of Paderborn, FB-4 LEA, D-3395 Paderborn Phone: 49-525-622, Fax: 49-525-63443 e-mail: wertz@lea.uni-paderborn.de For identification of inertia parameter and changing load conditions an adaptive model of the system is required. Here, the extended Kalman filter (EKF) is selected for identification due to the following reasons. The EKF makes use of all a-priori information about internal model structure and parameters because it is based on a state space model, takes measurement and process uncertainties directly into account and represents an efficient algorithm for real time applications due to its recursive working principle. Good performance of this algorithm was reported, even for parameter and state estimation of mechanics featuring elasticity [4]. In addition, the possibility of integrating basis function networks to identify nonlinear deterministic parameter and load torque variations (e.g. friction) was demonstrated in [5]. The remaining drawback of this advanced algorithm is the lack of systematic design methods which are required for an easy commissioning. Without a commissioning scheme the EKF, like any advanced algorithm proposed for drive control, is not accepted for industry applications. This has motivated industry to support research on self-commissioning field oriented control of ac motors [] and commissioning of advanced speed control [2]. Commissioning is especially a difficult task for online identification schemes, because estimation results are effected by many process specific conditions, which have to be analysed. Most remarkable influences on the estimation results are summarized in Fig. 2. Altogether, the main contribution of this paper is to introduce and discuss a novel scheme for designing an EKF for adaptive position control. The design method can be easily transferred to a broad range of other drive applications, because it is based on a physical approach and provides a physical insight into the extended Kalman filter algorithm,
q ML M L Speed Feedforward adaptive q ωm PI-Controller K L ω T N T * M Ei M * ε* M M MM - ω M ε M System Excitation Process Model Errors (System Noise) Sensors K P Adaptation algorithm Torque Control / q JΣ Estimation Results ω Mf J T F,J Σf T F,n ω M ε M M L Extended Kalman Filter Fig. : Adaptive position control as MIAS structure One-mass system r Structure (System Model) Adaptive Model Adaptation Algorithm (Design) Fig. 2: Main influences on estimation results obtained with adaptive schemes II. EXTENDED KALMAN FILTERS (EKF) IN DRIVE APPLICATIONS The signal flow chart of the continuous discrete EKF, described in [4] and used throughout this paper, is depicted in Fig. 3. The basic idea of the EKF is to expand the mathematical state vector x of the physical states x S (e. g. motor speed ω M, motor position ε M, load torque M L ) by the unknown parameters x P (e. g. inertia ) yielding x = ( x S, x P ). After that the mechanical system is modelled by a set of nonlinear state space equations: dx ----- = fxut (,, ) + q, y = h( x, u, t) + r () dt Inaccurately modelled dynamics are considered as system noise q, whereas inaccuracies in the measurement equation are modelled by the measurement noise r. nonlinear, continuous system (mechanic) u(t) f(x,u,t) x(t k t k ) q(t). x(t) x(t o ) x(t) continuous-discrete extended Kalman Filter (adaptive model of mechanic) h(x,t) digital signal processing r(t) residuum y(t) sampler y(t k ) u(t) y(t k ) Prediction: t k x(t y(t k t k- ) k t k- ) x(t k t k- )=x(t k- t k- )+ f(x,u,t)dt h(x,t k ) - t k- e(t k ) x(t k- t k- ) Iz - Correction: x(t k t k ) = x(t k t k- )+K(t k )e(t k ) Fig. 3: Structure of continuous-discrete EKF The Kalman filter is based on the assumption that q and r are white noise processes. In this case q and r are exactly defined by their covariances being the elements of noise matrices Q and R. If these noise processes are white and the true covariances are given by Q and R, Kalman filters are proved to be optimal estimators and able to find an optimal Kalman gain K to correct the state vector x according to the observed error e = y ŷ. If the states can be estimated correctly, the same is true for the extended Kalman filter, which performs a linearization at the actual states and inputs of the system. Although these conditions are not fulfilled exactly in most physical systems, and drive systems in particular, EKF perform well compared to most other adaptive schemes, if suitable covariance matrices Q and R are chosen. The elements of Q and R can be seen as free design parameters of the EKF. Note, that most other recursive algorithms, e.g. recursive least squares (RLS) or least mean squares (LMS) algorithms, can be derived from the EKF algorithm as special cases, see [3] for general and [9] for specific drive considerations. During the last years many papers have been published presenting successful results of extended Kalman filters for drive applications, most of them for sensorless induction and permanent synchronous motor drives [8], but also for online identification of motor parameters, like rotor resistance of induction motors [6], and for estimation of mechanical states in adaptive speed control featuring active vibration damping [4], just to cite one publication for each topic. Determination of the noise matrices, which are considered as free design parameters of the EKF, does not become obvious or is not even mentioned in some of these papers. This is due to the fact that the EKF is often only regarded as an optimization algorithm and the physical meaning of noise parameters remains hidden. Thus, noise matrices are often determined by trial-and-error procedures.
As trial-and-error procedures should be avoided in industrial practice, a novel approach is presented in this paper, which provides a systematic design of EKF for adaptive position control. Note, that this approach also facilitates basic physical insight into the EKF algorithm and a transfer to other drive applications, e.g. sensorless drives [7], as well as to system monitoring or system identification in general. III. DESIGN OF THE EKF A. Modelling the mechanical system If the controller is only adapted to time-varying load inertia and load torque, simple one-mass system model of the drive is sufficient for online estimation. In order to reduce linearisation errors the inverse of total inertia is chosen as system parameter x P =. d ---- dt ε M () t ω M () t M L () t () t = yt ( k ) = ε M ( t k ) + rt ( k ) ω M () t () t ( M M () t M L () t ) q εm () t q ωm () t q ML () t q JΣ () t As not all system states can be observed, conditions for identifiability must be fulfilled. This requires further measures for providing or supervising sufficient excitation to avoid divergence of the EKF estimates, as presented in [4]. In fast positioning applications sufficient natural excitation is provided by the process itself during acceleration time and therefore no additional excitation is needed. Adaptation of inertia parameter is only active if acceleration is detected to be sufficient by a supervising algorithm [4]. The matrices Q and R are now designed during a three step commissioning procedure. Step : Estimating Q and R (roughly) by physical interpretation Step 2: Analysing the dynamics of the linear subsystem Step 3: Fine tuning of Q and R (noise parameters) during experiments B. Step : Estimating Q and R by physical interpretation As inferred from (), the noise processes describe uncertainties of the one-mass system which cannot exactly model the real mechanic. Thus, noise processes q i () t model errors in each prediction step, wheras discrete noise rt ( k ) describes uncertainties in the measurement equation. + (2) Keeping this in mind it becomes obvious that noise introduced by the position sensor immediately contributes to rt ( k ). An incremental encoder with N bit resolution is used for position measurement ans so the maximum observation error is given by εmax M = 2π 2 N. Regarding εmax M 2 as standard deviation, and using an encoder with 7 bit effective information the covariance R of rt ( k ) is calculated as R = ( εmax M 2) 2 = 5,75 ( rad) 2. For further analysis it is assumed that correlations of noise processes q i () t are only weak, leading to a diagonal structure of the respective covariance matrix of system noise, Q = diag( q, q 22, q 33, q 44 ). Thus, only 4 instead of 6 noise parameters have to be determined. First, a variance value q 33 for noise process q ML () t is derived. The variation of load torque is modelled by dm L () t dt = + q ML () t, (3) which means that no information about the deterministic variation is known a priori and all variations are driven by the stochastic process q ML () t. In this simple case the expected load torque variation during one sampling instant T is assumed to be M L. Regarding M L as standard deviation noise parameter q 33 is calculated by squaring this value. q 33 = M 2 L. (4) To ease interpretation the input of some normalized values is supported by a graphical user interface (GUI). These values are then automatically transferred into values for q ii. The variation d ML is related to time t, MN L and d N ML are related to nomimal torque M N. M L M d ML = ----------, MN L MN, (5) t L = ---------- dn L M ML = ----------- N t Normalized inputs are also supported for the other parameters in a similar manner, but this is not outlined here. Different a priori values and the corresponding related quantities for the experimental set-up ( M N = 8Nm) are given in table I. The meaning of adaptation delay time T ada and poles s i is clearified during design step 2. The variation of inertia is determined in a similar way, except that inverse of inertia is selected as state variable. For a given variation noise parameter q 44 is calculated as q 44 ------------- ----------------------------- 2 2 = -------------, off, off + J2 Σ, off with, off =,32kgm 2 being the inertia identified by an offline scheme for a fixed load inertia. In the following experiment the inertia is assumed to vary d JΣ =,5 ( kgm 2 s) resulting in = d JΣ T and q 44 = 2,6 6 ( kgm 2 ) 2. (6)
Table : Variation of noise parameter q 33, its physical interpretation and influence on adaptation dynamic Configuration I II III IV V q 33 ( Nm) 2 28, 7 29, 6 5 5 5 4,6 3 M L Nm 5,3 4,7 3 7, 3 2,2 2 4 2 MN L in %, 7, 2, 89 28, 5, 6 Im{s} 4 2 pole determing load torque estimation (increasing q 33 ) increasing q 33 d ML ( Nm s) 5, 34, 4, 44, 7 8 d N ML (% s) 3, 2 42, 8 77, 7 56, 8 5 s 232 2 ± j37 Poles / ( rad s) 23 ± j39 22 ± j37 95 ± j36 82 ± j47 s 5 7 7 94 297 3 T ada s, 578, 98, 29, 92, 72-2 -4-6 -4-35 -3-25 -2-5 - -5 Re{s} Fig. 4: Variation of pole configurations when varying noise parameter q 33, which mainly determines the dynamic of the load torque estimation. As there are no uncertainties in state equation dε M dt = ω M, the respective noise parameter is set to zero q =. Although the uncertainty for the variation of ω M in (2) can be given directly, a better physical interpretation is achieved if this variation is assumed to be caused by an additional, ficticious disturbance torque M M. Unmodelled torque ripples produced by unsymmetries of the motor, e.g. cogging torque, imperfect torque control, neglected elasticities or locally changing friction conditions contribute to this additional torque. Because measurements for determining these torque variations require high efforts and values around,m N < M M <,M N were found to work well in many experiments, a value of M M =,25M N is taken for this first design step, from which the noise parameter is then calculated as q 22 M M J ------------- T Σ, off 2 = = 5,74 5 ( rad s) 2 C. Step 2: Analysing the dynamics of the linear subsystem Sometimes it is more convenient to think in dynamic quantities (e.g. delay times) instead in uncertainties (noises). Therefore, the dynamics of linear subsystems are analyzed in frequency domain during the next step assuming a constant inertia parameter, off. For linear time-invariant systems (constant parameters and noise conditions), the Kalman gain K converges to a constant value K stat, independent from initial values or excitation. (7) Fig. 5: Experimental results for variation of noise parameter q 33 K stat is calculated by simulation of the EKF equations. The dynamics are then analysed by calculating the poles of the difference equation for estimation error e x = x xˆ, e x ( t k + ) = ( Φ S K stat H T ) e x ( t k ), with H T = h x = [ ] where Φ S represents the transition matrix of the linearized system. Transformation of the poles into the Laplacedomain gives important information concerning the dynamics of the adaptive system. First, a time constant for tracking load torque changes can be derived from the pole on the real axis in Fig. 4, which mainly determines the dynamics of the load torque estimation. To obtain a fast load torque estimation noise parameter q 33 is chosen as q 33 = 5 4 ( Nm) 2, which corresponds to configuration IV in Fig. 4. For different configurations of q 33 please refer to table I and the respective courses of load torque estimation, measured on the experimental set-up, are given by Fig. 5. (8)
2 5 Im{s} 5-5 - -5 R=e -9 rad 2 R=e - rad 2 R=e -2 rad 2-2 -4-3 -2 - Re{s} Second, it is possible to judge filtering of higher frequency contents in motor position, which is often more desirable than tracking the high frequency oscillations and feeding them back to the controller. In drive applications speed oscillations are often caused by motor torque ripple (e.g. pole and slot harmonics) and eigenfrequencies of the driven mechanic. In this case it is obvious that these errors should not be added to system noise q ωm () t but to measurement noise rt (), which results in filtering, instead of tracking these effects. Fig. 6 shows how an increasing variance R influences the location of the poles. For the example system R = 5,75 ( rad) 2 derived from encoder resolution is enlarged to R = 8 ( rad) 2 as indicated in Fig. 6 resulting in an effective filtering of high frequency oscillations. ψ R=e -6 rad 2 R=e -8 rad 2 (selected) R=e - rad 2 ω (determined from encoder resolution) Fig. 6: Influence of noise parameter R on pole pair describing mainly noise filtering of motor position and speed; The other noise parameters are fixed (configuration II of table I is used) (a) 5 ε M / rad 5 (b) 5 ω M / (rad s - ) -5 5 t / s 5 t / s Fig. 7: Reference position trajectory (a) and resulting speed (b); Note, measured and estimated position and speed are almost identical to references D. Step 3: Fine tuning of Q and R during experiments After having performed steps and 2 noise parameters are finally tuned by performing the following experiments on a mechanical drive set-up. Kalman filtering and adaptive speed control is implemented on a dspace 3 rapid prototyping board with TMS32C4 signalprocessor (cycle time 5µs, computation time for Kalman filter 6µs ) which is coupled with an industrial servo inverter (Lust Antriebstechnik MC748), which performs torque control and the required measurements [] in an 25µs interrupt). The drive features a belt transmission with an eigenfrequency of f e 85Hz and a damping of d, and is driven by a permanent magnet synchronous motor. The position control follows the desired trajectory depicted in Fig. 7 using a non adaptive, low bandwidth PI speed controller during this commissioning phase. The results of the estimation using the noise parameters selected after step 2 are depicted in Fig. 8(a). Direct evaluation of estimation performance from these results is not feasible because real values of inertia and load torque are usually unknown. Therefore an appropriate measure has to be found and evaluated. In this particular case an estimation error in leads to a correlation between estimated load torque and acceleration. A suitable correlation measure c Y M d between load torque and signal which is proportional to reference acceleration is calculated online for N L y = 3 sam- ples and its course is shown in Fig. 8(d). c y ( t k ) N = ------------ d. (9) N y ( t k i ) Mˆ L( t k i ) i = Minimization of c Y, the mean absolute value of c Y, is now performed by online tuning of the noise parameters. The course of this procedure for noise parameter q 33, the variance of q ML () t, is drawn in Fig. 8. It turns out that a reduction of q 33 (configuration II of table I) leads to a reduced c Y and improved estimation results. Parameter is estimated with a time delay of about 5 ms, which is usually sufficient for adaptive speed control. The estimated load torque is close to the offline determined friction of the drive (Coulomb friction M FC,3Nm ). Further reduction of q 33 (configuration I of table I) increases the correlation measure c Y as well as the bias in the estimation of (Fig. 8(c)). In this case configuration II gives the best parameter estimation for. Considering the pole configurations in Fig. 4(a) reduction of q 33 decreases the dynamics of load torque estimation, as discussed above. Thus, a compromise has to be found between fast estimation of load torque M L and a fast, unbiased estimation of.
ML / Nm ML / Nm ML / Nm.6.4.2 -.2 -.4 -.6. 5 t / s 5 t / s.6.4.2 -.2 -.4.6.4.2 -.2 -.4 (a) configuration q 33 = 5x -4 N 2 m 2 (c) configuration q 33 = 2.5x -7 N 2 m 2.3.2. -.6. 5 t / s 5 t / s IV. SUMMARY AND ADDTIONAL REMARKS Two main points can be summarized as results of this novel design procedure. Analysis based on physical interpretation (step ) and evaluation of dynamic quantities (step 2) usually leads already to well tuned noise parameters. / (kgm 2 ) / (kgm 2 ).3.2. (b) configuration q 33 = 2.9x -6 N 2 m 2 / (kgm 2 ).3.2. -.6. 5 t / s 5 t / s (d) - c y -5-2 -25-3 offline identified (reference) -35 2 3 4 5 t / s 6 7 8 9 configuration configuration configuration Fig. 8: Experiments during fine tuning of the noise parameters for different configurations of table I (a) - (c) and the respective correlation measure between acceleration and estimated load torque (d). Further improvement can be achieved during an interactive fine tuning procedure by evaluation of a correlation measure. Additional remarks may be essential for the user: Estimation results are especially influenced by selection of noise parameters, if system excitation is low. In case of friction model equations (2) are persistantly disturbed by non-white load torque changes. This leads to significant systematic errors in inertia estimation. But when improving the load model by integrating a basis function network to identify the nonlinear friction characteristic the systematic error can be largely reduced, see [5]. The results of the inertia estimation can be immediately used for the adaptive control scheme given in Fig.. REFERENCES [] A. Bünte, H. Grotstollen: Parameter Identification of an Inverter-Fed Induction Motor at Standstill, Proceedings of EPE (Eur. Conf. on Power Electronics) 995, Sevilla, Spain, pp. 3.492-3.496. [2] S. Beineke et al.: Identification of Nonlinear Two- Mass Systems for Self-Commissioning Speed Control of Electrical Drives, Proceedings of IECON (IEEE Conf. on Industrial Electronics) 998, Aachen, Germany, pp. 225-2256. [3] L. Guo, L. Ljung: Performance Analysis of General Tracking Algorithms, IEEE Transactions on Automatic Control, Vol. 4, No. 8, 995, pp. 388-42. [4] F. Schütte, S. Beineke, A. Rolfsmeier, H. Grotstollen: "Online Identification of Mechanical Parameters Using Extended Kalman Filters", Proceedings of IAS (IEEE Conf. on Industry Applications) 997, New Orleans, USA, pp. 5-58. [5] S. Beineke, F. Schütte, H. Grotstollen: "Online Identification of Nonlinear Mechanics Using Extended Kalman Filters with Basis Function Networks", Proceedings of IECON 997, New Orleans, USA, pp. 36-32. [6] D.J. Atkinson, P.P. Acarnley, J.W. Finch: Method for the Estimation of Rotor Resistance in Induction Motors, Proc. of EPE 99, Firenze, Italy. pp. 338-342. [7] S. Beineke, H. Grotstollen: Practical Design of Kalman Filters for Sensorless Control of Synchronous Motors (in German), Proceeding of SPS/IPC/Drives 997, Nürnberg, Germany, pp. 482-493. [8] A. Broesse, G. Henneberger, Th. Klepsch, Positioning Accuracy of a Sensorless Controlled Servo Drive System, Proceedings of EPE 95, Sevilla, Spain, pp. 3.67-3.72. [9] S. Beineke: Online Estimation of mechanical parameters, states and nonlinear characteristics in speed controlled drives, (in German), Ph. D. Thesis, University of Paderborn, Germany, to appear in 999.