a...“- W ‘ 3.x... . . . ‘ . . «0.9.? wt... 5 h. “NS 9.1 . r13? 5:5: . . 9 . 1‘. ~Am’f' =7 .nY—b, . u. ZLX) 7.5} 74‘ .39”: #33»: c. .. km. b. .3 34,221“ _ «as; f l h a... .r m5 . 4n .. .061 -. dam—.14.?" .5.» . it. ..a «“534: M . . .wur ., . u? v.- s (l , u “5E 331‘. .QUa ‘ .9. H.531... . , ,1 m. .mm : . . .4 . . ‘ 9?... H: 9.39“»: Huh“... fix: an. is. .. L.» c. I. i;..:.... .3. z, . , Fr, 1. . nu. .. .15.; 5...... . . , 21.3..“ . . ”stir... . ‘ , .. ru .03: 4. b. , T . w y .. 5.3% JV, ‘ l. 2.7 v .55.: \ L23. 1 . y ; r a. .T: r. .0, '1" law. v Q. A”. - I. ,. ~"2‘n'?.,.-15, . Ex. BEL... This is to certify that the dissertation entitled POSITION AND SPEED SENSORLESS CONTROL OF PERMANENT MAGNET SYNCHRONOUS MOTORS presented by Ali Khurram has been accepted towards fulfillment of the requirements for Ph.D degree in mEngineering (as §(~\ Major professor Datefi M °"' (L‘ 300‘ MSU i: an Affirmative Action/Equal Opportunity Institution 042771 * LIBRARY Michigan State University PLACE IN RETURN Box to remove this checkout from your record. TO AVOID FINES return on or before date due. MAY BE RECALLED with earlier due date if requested. DATE DUE DATE DUE DATE DUE 6/01 cjcmuoateoue.pes-p.15 -—____.. Position and Speed Sensorless Control of Permanent Magnet Synchronous Motors By Ali Khurram A DISSERTATION Submitted to Michigan State University in partial fulfillment of the requirements for the degree of DOCTOR OF PHILOSOPHY Department of Electrical and Computer Engineering 2001 C0 f0; Ti. ABSTRACT Position and Speed Sensorless Control of Permanent Magnet Synchronous Motors By Ali Khurram Advancements in magnetic materials, semiconductor switching devices, and con- trol strategies continue to enhance the popularity of permanent magnet synchronous motors (PMSMS) in drive applications. Their emergence as the actuators of choice in servo systems stems from their desirable features: compact structure, high airgap flux density, high torque capability for a given frame size, high torque-to-inertia ratio, low maintenance cost, mechanical simplicity and ruggedness. They are electronically commutated and can be made to achieve conventional DC motor characteristics, with- out the high maintenance cost of DC motors. But their control is more complicated: they need position sensors to synchronize the stator magnetic field with the rotor position. Also, the application of vector control techniques in AC drives demands accurate position and speed feedback information. The use of such shaft sensors present several disadvantages: cost, reliability, motor size, and weight. There has been extensive research on elimination of rotor-mounted position sensors in PMSM control. This dissertation presents an improved position and speed observer suitable for use with a surface-mounted, sinusoidal EMF PMSM as a software transducer. The proposed scheme works in a closed loop fashion. It enhances the allowable initial position error. It is computationally less intensive; avoids integration of the speed estimate to get the position estimate; can be used without any physical modification; does not rely on rotor saliency and requires no knowledge of the load. The observer is deve10ped from the dq model of the motor. Estimation of position and speed is done using differences between estimates of the current derivatives in the dq frame, each calculated two different ways: first using high-gain observers, and then using the motor model. The estimator equations are derived. Convergence of the observer dy- namics is proved. Results from numerical simulations and practical implementation are presented to validate the proposed scheme. Copyright © by Ali Khurram 2001 To My Parents ACKNOWLEDGMENTS I would like to express my sincere gratitude to Professor Elias Strangas for being my advisor and guidance committee chairperson. His encouragement and unique ideas have been instrumental to the completion of this dissertation. I am also deeply indebted to Professor Hassan Khalil for his guidance throughout my stay at Michigan State University. I owe him a great deal for his contribution to the analysis part of this work. My sincere appreciation also goes to Professors Robert Schlueter and Byron Drachman for the valuable time and effort they spent being on my guidance committee. I owe special thanks to my parents, who encouraged me to pursue my dream and supported me with their prayers. My sincere appreciation goes to my wife Tahira for her love and support that enabled me to focus on this work. I cannot thank enough my brother Sajjad for his patient listening ear and sage advice. I thank Almighty for Humza and Fatima, my wonderful children, whose love made it all worthwhile. I would also like to extend my heartfelt thanks to my sisters Annie and Sughra, and all members of my extended family for their love, support and wishes. I was lucky to have the company of excellent friends at the Electrical Machines and Drives Laboratory, specially Fida and Wes. Their constructive comments and sincere friendship are deeply appreciated. vi LI! LI! n41" 33 TABLE OF CONTENTS LIST OF FIGURES ix LIST OF TABLES xi 1 Introduction 1 1.1 Introduction ................................ 1 1.2 Actuators ................................. 1 1.3 Sensors ................................... 5 1.4 Organization ............................... 7 2 Literature Review 9 2.1 Introduction ................................ 9 2.2 A Taxonomy of PMSMs ......................... 9 2.3 The Mathematical Model ......................... 11 2.4 Approaches to Position and Speed Sensorless Operation ........ 15 2.4.1 Back Electromotive Force .................... 16 2.4.2 Excitation Monitoring ...................... 17 2.4.3 Motor Modification ........................ 18 2.4.4 Magnetic Saliency ......................... 18 2.4.5 Observers ............................. 2D 2.5 High-Gain Observers ........................... 26 3 The Proposed Method 29 3.1 Introduction ................................ 29 3.2 Motivation ................................. 29 3.3 Assumptions ................................ 31 3.4 Problem Statement ............................ 32 3.5 The Proposed Scheme .......................... 32 3.6 Characteristics of the Proposed Scheme ................. 37 3.7 Derivations ................................ 38 vii BIB; 3.7.1 Derivation of Equation (3.4) ................... 3.7.2 Derivation of Equation (3.23) .................. 3.7.3 Derivation of Equation (3.5) ................... 4 Numerical Simulations 4.1 Introduction .......... 4.2 Simulation Results ...... 5 Mathematical Analysis 5.1 Introduction .......... 5.2 Analysis ............ 5.2.1 Speed-Error Dynamics OOOOOOOOOOOOOOOOOOOOOO 5.2.2 Position-Error Dynamics ..................... 5.3 Effect of Parameter Mismatch 6 Experimental Implementation 6.1 Introduction ................................ 6.2 Experimental Setup ............................ 6.2.1 Permanent Magnet Synchronous Motor ............. 6.2.2 Hysteresis Current Controlled PWM Inverter ......... 6.2.3 Digital Signal Processor 6.2.4 Optical Pulse Encoder 6.3 Software ............ 6.4 Experimental Results ..... 6.5 Discussion ........... 7 Conclusions 7.1 Summary ........... 7.2 Contribution .......... 7.3 Future Work .......... 7.3.1 Numerical Simulations 7.3.2 Mathematical Analysis 7.3.3 Experimental Implementation .................. A DSP Code BIBLIOGRAPHY viii 38 41 43 45 45 45 58 58 59 62 63 65 7O 7O 7O 72 72 74 75 78 83 96 97 97 99 100 100 100 101 104 139 2.1 2.2 2.3 2.4 2.5 3.1 3.2 3.3 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10 5.1 6.1 6.2 6.3 6.4 6.5 6.6 6.7 LIST OF FIGURES Magnet placement: (a) interior (b) surface ................ 10 Flux distribution: (a) trapezoidal (b) sinusoidal ............. 11 Two—pole three-phase PMSM. ...................... 12 The back EMF method. ......................... 17 The structure of an observer. ...................... 21 Traditional vector control of PMSM. .................. 30 Overview of the proposed scheme ..................... 33 Details of the proposed scheme. ..................... 37 Simulation: A6,, : 179°, ref speed: 900 RPM. .............. 48 Simulation: A0,, : 179°, ref speed: 180 RPM. .............. 49 Simulation: A9,, : 90°, ref speed: 180 RPM ................ 50 Simulation: A9,, : 90°, ref speed: 10 RPM. ............... 51 Simulation: A0,, : 90°, ref speed: 1 RPM ................. 52 Simulation: A9,, : 90°, ref speed: 0.1 RPM ................ 53 Simulation: A0,, : 90°, R : 0.9R, ref speed: 10 RPM. .......... 54 Simulation: A0,, : 90°, R : 0.9R, ref speed: 1 RPM ............ 55 Simulation: A0,, : 90°, R : 1.1R, ref speed: 8 RPM ............ 56 Simulation: A6,, : 90°, R : 1.1R, ref speed: 1 RPM ............ 57 Orthogonal orientation of the current space vector vis-a-vis rotor flux linkage : (a) base region (b) field weakening region. .......... 68 Experimental setup. ........................... 71 Hysteresis current controller: physical overview. ............ 74 Hysteresis current controller: physical details. ............. 75 Hysteresis current controller: waveform overview. ........... 76 Hysteresis current controller: waveform details. ............ 77 Flowchart of the Assembly language program. ............. 79 Flowchart of the Assembly language program (continued). ...... 80 ix 6.8 6.9 6.10 6.11 6.12 6.13 6.14 6.15 6.16 6.17 6.18 6.19 Initial rotor alignment: (a) stator magnetic field (b) resulting rotor position. .................................. 81 Sensorless closed-loop operation of the PMSM .............. 82 Experiment: ref speed increasing to 550 RPM .............. 86 Experiment: ref speed: 600 RPM ..................... 87 Experiment: ref speed: 150 RPM ..................... 88 Experiment: ref speed: 80 RPM. .................... 89 Experiment: ref speed: 45 RPM. .................... 90 Experiment: ref speed: -600 RPM. ................... 91 Experiment: ref speed: -300 RPM. ................... 92 Experiment: ref speed: -75 RPM. .................... 93 Experiment: ref speed: 600 and -600 RPM ................ 94 Experiment: ref speed: 600 and -300 RPM ................ 95 LIST OF TABLES 6.1 Parameters: Pacific Scientific S21GNNA-RNNM-00 PMSM. xi CHAPTER 1 Introduction 1 .1 Introduction Traditionally, electric motors have been used as actuators. However, they may also be used as sensors of the motion they actuate. This simultaneous operation as an actua- tor and a sensor can be beneficial when additional motion sensors are too expensive, large, unreliable, or otherwise undesirable. Advancement of the state of the art of such a software transducer for the permanent magnet synchronous motor (PMSM) is the motif of this dissertation. This chapter first introduces the PMSM vis-a-vis the different types of actuators commonly employed. It continues with brief description of its structure, defines its niche, and presents the pros and cons of sensors. It concludes with a preview of the succeeding chapters. 1 .2 Actuators DC motors have been the most widespread actuators of choice in high performance systems. The principal reason for their popularity is their highly desirable character— istic: the ability to control their torque and flux independently. The trade-off is their less rugged construction, owing to the presence of brushes and commutators which tend to wear out, thus increasing the maintenance cost. AC motors are more rugged, but they have traditionally been unsuitable for vari- able speed applications, because their torque and flux are coupled: any change in either one will cause a corresponding reaction in the other. This has changed now because of the emergence of new effective control techniques, mainly vector control. This control technique allows independent control of torque and flux of an AC motor, hence achieving linear torque characteristics resembling those of DC motors. Vector control regulates both the instantaneous magnitude and phase of the current, or the voltage, hence its name. This technique requires extensive processing power in order to achieve effective results and has become possible only with recent developments in affordable computing power. Permanent magnet synchronous motors (PMSMs) have emerged as viable can- didates for high-performance servo drive applications. The remarkable advances in semiconductor switching devices, as well as the recent availability of high energy- density permanent-magnet materials at competitive prices has opened up new pos- sibilities for large-scale application of PMSMs. Furthermore, due to the continuing breakthroughs and reduction in cost of powerful microprocessors, the real-time im- plementation of sophisticated control schemes is becoming feasible, thus resulting in the possibility of achieving impressive performance. The popularity of PMSMs stems form their desirable features: 0 high efficiency, 0 high torque to inertia ratio, 0 high torque to volume ratio, 0 high air gap flux density, high power to inertia ratio, high power factor, high acceleration and deceleration rates, lower maintenance cost, simplicity and ruggedness, compact structure, linear response. However, the higher initial cost, operating temperature limitations, and danger of demagnetization can be restrictive for some applications. The rotor of a PMSM has a permanent magnet mounted on it. Traditionally, a position sensor is also present. The signals to the phase windings of the PMSM stator are synchronized with the output from the position sensor to provide electronic commutation. By energizing specific windings in the stator, based on the position of the rotor, a revolving magnetic field is generated. Currents are switched in a prede- termined sequence and hence the permanent magnets on the rotor are made to follow the revolving magnetic field. Since the switching frequency is derived from the rotor, the motor cannot lose synchronism. The current is always switched before the per- manent magnets catch up. Therefore the speed of the motor is directly proportional to the current switching rate. PMSMs are electronically commutated and can be made to achieve conventional DC motor characteristics: speed proportional to the supply voltage, torque propor- tional to the armature current, and start / stall torque higher than the running torque. They have all the advantages traditionally associated with conventional DC motors such as better efficiency, response and linearity, without the high maintenance cost of their DC counterparts. Elimination of brushes and commutators also solves the problems associated with contacts: brush noise, sparking and associated radio frequency interference from brush arcing. This enables the PMSM to be used in hostile and explosive environments. Commutation is achieved through reliable solid-state circuit components. Hence, their speed is not limited by the frictional components of mechanical commutation, but by the voltage limit of the control circuit and motor windings. PMSMs have certain advantages over both induction motors (IMs) and the con- ventional wound-rotor synchronous motors (WRSMs): since there is no field winding on the rotor, there are no attendant rotor Copper losses, and the losses are mainly due to the stator current. Moreover, the power winding is on the stator where heat can be removed more easily. A PMSM is more efficient than a comparable IM: in the steady state, the PMSM always operates at synchronous speed; thus it does not have the slip losses inherent in IM operation. Also, the stator current of an IM contains magnetizing as well as torque—producing components. The use of permanent magnet in the rotor of a PMSM makes it unnecessary to supply magnetizing current through the stator for constant air-gap flux; the stator current need only be torque-producing. Hence for the same output, the PMSM will operate at a higher power factor and will be more efficient than the IM. Finally, since the magnetization is provided from the rotor circuit instead of the stator, the motor can be built with a larger airgap without degraded performance. For these reasons, PMSM has a higher efficiency, torque per ampere, effective power factor and power density when compared with an IM. These factors combine to keep the torque/inertia ratio high in small motors which makes it preferable for certain high-performance applications such as robotics and aerospace actuators. The smaller the motor, the more sense it makes to use permanent magnets for excitation. There is no single ‘breakpoint’, below which PMSMs outperform induction motors, but it is in the 1-10 kW range. Above this size the induction motor improves rapidly, while the cost of magnets works against the PMSM. Compared with a conventional synchronous motor, elimination of the field coil, DC supply, and slip rings results in a much simpler motor. In a PMSM, there is no provision for rotor side excitation control. The control is done entirely through the stator excitation control. Field weakening is possible by applying a negative direct axis current to Oppose the rotor magnet flux. This elimination of the need for separate field excitation results in smaller overall size: for a given field strength, the PM assembly is considerably smaller in diame- ter than its wound field counterpart, providing substantial savings in both size and weight. 1.3 Sensors The application of vector control techniques in AC drives demands accurate position information. The instantaneous angular position of the rotating field flux vector must be known for accurate vector control. The technique involves orienting the stator current vector orthogonally to the rotor flux vector, so as to maintain an appropriate space angle between the stator and rotor fields, a condition needed to maximize torque per ampere. Since PMSMs are constructed with a fixed rotor field, supplied by rotor mounted magnets, the rotor position provides the required magnet flux position [29]. Rotor position information has been traditionally provided by shaft mounted Optical position encoders, resolvers, or Hall-effect devices. These devices tend to be expensive, although schemes for improving the data produced by cheaper, less accurate sensors have been suggested [12]. Apart from higher cost and limited resolution, there are other drawbacks to using position sensors: 0 lowered ruggedness and reliability, 0 susceptibility to environmental conditions, such as temperature, humidity and vibration, 0 increased number of connections, 0 increased size and weight, 0 added moment of inertia, 0 added static and dynamic friction, o interference problems, both ends of the shaft occupied. For speed control, the speed signal is also needed. For robotics and machine- tools applications, the speed must be accurately controlled, in spite of load torque variations. The conventional method of speed computation from position data has good per- formance in the ordinary speed range, but has the disadvantage that the method gives only the average speed during any detection interval; that is to say that the detected motor speed is not the instantaneous motor speed but the average over the last de— tection interval. In the low-speed region, the detection time becomes large due to the low frequency of the encoder pulse and the speed detection delay increases rapidly as the motor speed decreases. Another problem is the presence of an inherent lag in the estimation. Quantization noise from both the transducer and the estimation scheme is also introduced. Digital filters can be applied to address this problem, but the use of older samples compromises the instantaneous accuracy of the speed estimated. Thus, transducer based algorithms do not provide an accurate speed estimate with high resolution. As a consequence, there has been increasing interest in techniques for eliminating the rotor position and speed sensors, and hence bringing about improved reliability and reduced cost of the drive. The idea behind many such methods is to manipulate the motor equations in order to express position and speed as functions of the terminal quantities. In a sense, the motor is used as a sensor of its motion, because this motion affects the voltages and currents in it. Thus, the voltages and currents possess information concerning the motion. What is needed, then, is a means for extracting this information to estimate the desired motion. Some form of signal processing is necessary, and this places additional demands on the control electronics because of the on-line computation. However, as digital processors continue to become faster and less expensive, this additional signal processing becomes less of a burden. 1.4 Organization The rest of the chapters in this dissertation are organized as follows: 0 Chapter 2 gives a review of the research conducted in this area over the last couple of decades. 0 Chapter 3 presents the proposed method. It begins with the problem statement, continues with details of the proposed scheme and concludes with derivations of all the relevant equations. 0 Chapter 4 describes and discusses the results obtained from numerical simula- tions of the preposed ideas. 0 Chapter 5 presents mathematical analysis of the scheme and proves stability of the observer dynamics. 0 Chapter 6 describes the experimental setup built to implement the scheme. It outlines the software developed and concludes with presentation of experimental results which validate the proposed scheme. 0 Chapter 7 summarizes the whole dissertation and proposes avenues for further work. 0 Appendix A contains a listing of the Assembly language code deve10ped to implement the scheme. CHAPTER 2 Literature Review 2.1 Introduction In this chapter, we present a broad classification Of the various techniques proposed to estimate the position and speed of the permanent magnet synchronous motor (PMSM). We begin with a taxonomy of the PMSMs and then develop their mathe- matical model, to make the literature review self-contained. The chapter concludes with a review Of high-gain observers. 2.2 A Taxonomy of PMSMs The PMSM rotor has magnets mounted either on the surface Of the rotor, the so- called surface permanent-magnet motor (SPM), or there can be magnets buried inside the rotor, hence the name interior permanent-magnet motor (IPM). The SPMs have a smooth air gap, whereas saliency arises in the IPMs. The IPMs are more robust and allow Operation at higher speeds. Another advan- tage Of an IPM is that a more efficient design can be Obtained, since the electromag- netic torque contains both the magnet component and the reluctance component. The reluctance component arises because Of the saliency characteristic of IPMs, thus al- (a) (b) Figure 2.1. Magnet placement: (a) interior (b) surface. lowing for a reduction in the quantity of magnet needed in comparison with SPMs for a fixed rated torque. The trade-Off is the higher manufacturing cost associated with IPMs. Also, their narrower air gap means that armature reaction [31] is significant in IPMs. In SPMs, because Of the large airgap, the armature reaction effect on pole flux is insignificant. Therefore the variation Of airgap flux under stator current change is minimized. This provides ease in flux control. Another classification for PMSMs is based on the flux distribution [26], which translates into the shape of the back EMF generated: trapezoidal and sinusoidal. The waveform of the Open-circuit voltages induced in the stator windings due to the permanent magnets, when the machine is run as a generator, determines this characteristic of the back EMF. For a PMSM with trapezoidal flux distribution, also called brushless DC motor, only two of the three stator phases are excited at any instant Of time, so that constant current flows into one of the excited windings and out Of the other. The stator currents Of the motor are square waves with 120 electrical-degree conduction periods. These 10 (a) (b) Figure 2.2. Flux distribution: (a) trapezoidal (b) sinusoidal. rectangular current-fed motors have concentrated windings on the stator, and the induced voltage in the windings is square or trapezoidal. These motors cost less and are normally used in low-power drives. For a PMSM with sinusoidal flux distribution, all three stator phases are excited. The stator currents are quasi-sinusoidal. The sensorless techniques for this type Of motor are more involved. However, this motor is more suited for high performance ap- plications. Also, the torque per ampere is higher because all three phases are excited simultaneously. The sinusoidal current-fed motors have distributed windings on the stator, provide smoother torque and are normally used in high-power applications. 2.3 The Mathematical Model In this section, the equations Of the surface-mounted, sinusoidal-EMF PMSM are presented. The stator Of a PMSM [31, 32] has windings similar to those Of the conven- 11 J O .‘w'lgv. ’5’ .‘S- qaxis daxis bs cs’ 03 Figure 2.3. Two-pole three-phase PMSM. tional wound-rotor synchronous motor: three-phase, Y-connected and sinusoidally distributed. The permanent magnets used in the PMSM have high resistivity, so induced currents in the rotor are negligible. Also, for a sinusoidal-EMF PMSM, there is no difference between the back EMF produced by a permanent magnet and that produced by an excited coil. Hence the mathematical model of a PMSM is similar to that Of a wound rotor synchronous motor. The space vector [24] form Of the stator voltage equation in the stationary frame Of reference is: where, o R is the resistance of the stator winding; 0 a, i, and i]; are the complex space vectors Of the three phase stator voltages, currents and flux linkages, all expressed in the stationary reference frame fixed to the stator. They are defined as: CI H 3230.0» + amt) + attic“)! 8 ll gnaw) + aib(t) + {Ram} (2.2) glifldt) + a114,“) + a21/2c(t)l fil II where omitting the arguments for simplicity, 2 o a, a are spatial Operators: a 2 63'2"”, a2 = (arm/3; va ,vb, and v, are the instantaneous values of the stator phase voltages; in, ib, and i, are the instantaneous values Of the stator phase currents; o 1pc, db, and we are the instantaneous values of the stator flux linkages and are given by: Via = Lain + M2}, + MiC + 112, cos(0) 2 1h = M, + L,z',, + Mi, + 7p. cos(0 — 3w) (2.3) 2 21». = M2}. + Mi, + L32, + u. cos(0 + 371) where, o L, = L3; + L,,,,: L3, L3,, and Lsm are the stator self, leakage and magnetizing inductances; 13 o M is the mutual inductance between the stator windings, and has a value [22] M = Lsm cos(2—3:r-) 1 : —_Lsm 2 o it, is the amplitude Of the flux linkages established in the stator phase windings, by the permanent magnet. It is often referred to as the electromotive force constant, K e; o 0: the rotor position: the angle between the as—axis and the north pole of the permanent magnet. If the windings are star-connected, i,, + ib + i, = O, and defining L = L8 — M 3 = le+ ELsm the following phase-variable equations are Obtained, dz}, + d[¢, cos(6)] El? dt dib d[¢, cos(0 — 27r / 3)] 1),, = Ria+L ’05 = R25 + LE5- + dt (2.4) _ , die d[1/), cos(0 + 27r/3)] vc — R2, + L dt + dt which yield, 22,, = R2,, + Lpz'a — tbrw sin(6) vb = Rib + Lpz'b — 7,0,0) sin(0 — 27r/3) (2.5) v, = Ric + Lpz',C — W/er sin(0 + 27r/3) 14 where o p is the differential Operator, p = d/dt o w is the rotor speed, w = dO/dt All the above formulation can be factored into the stator flux linkage space vector by defining it as: E = Li + the” (2.6) thus: _ _ _, di d(¢,ej°) U—RZ-i'Lg't'd-T (2.7) In the stationary frame Of reference fixed to the stator, the three space vectors defined above can be expressed in terms of their real and imaginary components as: U 2 'UD +j’UQ ; = in +in T = $0 +3.11%) As we can see from the equations, the state-space model Of a PMSM constitutes a highly coupled and nonlinear dynamic system. The nonlinearity can be significantly simplified through the use of the dq transformation, where the target reference frame is fixed to the rotor. We shall see the effect Of this transformation in Section 3.5. 2.4 Approaches to Position and Speed Sensorless Operation Most Of the techniques are based on the voltage equations of the PMSM and the information Of the terminal quantities, such as line voltage and phase current. Using this information, the rotor angle and speed are estimated directly or indirectly. In 15 addition, there are waveform detection methods, which attempt tO identify specific events, such as peaks or zero crossings in the electrical waveforms that are the result Of the speed voltage of the motor. They have been successfully demonstrated for commutation needs and may be implemented using inexpensive electronics, which is advantageous from manufacturing viewpoint. However, they are not as accurate as possible because they do not utilize all the information present in the waveform. French and Acarnley [10] have presented an exhaustive review of the various tech- niques prOposed for sensorless Operation of the PMSM. Their work forms the basis of what follows. 2.4.1 Back Electromotive Force Back electromotive force (EMF) information can be used in brushless DC drive sys- tems, where at any one time only two of the three phases are conducting. The direct back EMF detection method uses measurements Of the instantaneous volt- age across the third, non-conducting, phase. If the drive is designed such that the non-conducting phase current reduces rapidly, then the back EMF can be measured directly across the non-conducting phase. The zero crossing of the phase voltage can then be used to generate commutation data. Iizuka, Uzuhashi, Kano, Endo, and MOhri [16] have explained the principles of this approach, while Bahlmann [3] has given details Of a commercially available integrated circuit which Operates on these principles. The predominant problem with the EMF approach to position estimation is that at low speeds the EMF approaches zero. This is so because the amplitude of the back EMF is proportional to speed: at zero speed, the magnets do not induce any voltage and, also, the voltage and current signals are quite noisy because of the Pulsewidth Modulation (PWM) [14] Operation Of the power stage. In the low-speed range, the voltage on the motor terminal can hardly be detected because Of the small back-EMF 16 .fi .{ .Jfi .. .- {23 .- {E .- .03 2° Figure 2.4. The back EMF method. w i of the motor and the system noise. Considering the precision Of the terminal voltage in PWM operation and the system noise produced by the nonlinear characteristics of the switching devices, the controllable lower speed range Of the conventional sensorless drives is generally limited to the value Of around 100 RPM. Another problem to be considered is the starting capability. At standstill, the EMF is zero, so, some special starting algorithm or initial position detection algorithm must be used. Therefore, the scheme is restricted to applications where low-speed performance is not important, and where an alternative Open-loop excitation scheme is acceptable to start the motor from standstill. 2.4.2 Excitation Monitoring Excitation monitoring schemes involve monitoring the conduction paths of the cur- rent through the inverter. One method is to monitor the conduction state Of the ,inverter’s anti-parallel free-wheeling diodes. Ogasawara and Akagi [28] have done pioneering work with this method. In a brushless DC motor, at any instant, only two phases are conducting, with commutation occurring every 60 electrical degrees. The system Operates by chopping one switching signal and leaving the other device 17 on continuously. The back EMF voltage of the non-switching phase is then measured and when this voltage crosses zero, a commutation position is detected. Like other ' EMF methods, this approach suffers from poor resolution at low speeds. Another method, proposed for sinusoidally excited motors, by Arefeen, Ehsani and Lipo [2], monitors the zero crossings of the phase currents with the aid Of a modified switching technique. The system estimates when the zero crossing point will occur, switches Off the relevant phase, and then monitors the induced voltages in the Open phase. The induced voltages can be used to accurately predict the zero crossing. The scheme is a variation on a scheme, proposed for reluctance motors, by Ehsani and Husain [8], and relies on the motor having a high degree of saliency. 2.4.3 Motor Modification Motor modifications can ease the task Of Obtaining position information by using embedded search coils in the stator. For example, one scheme proposed by Binns, Al-Aubidy, and Simmin [4], uses three embedded search coils on the stator teeth. One is excited with a high-frequency low-voltage signal; the voltages induced by mutual effects in the two search coils are then processed to produce a position signal. The motion-induced effects are cancelled out with the aid of the two receiving sensors. 2.4.4 Magnetic Saliency Variable inductance has also been proposed as a technique for position detection. One approach, proposed by Acarnley, Hill, and Hooper [1], is to monitor the phase current waveform, because the rate Of change of current is a function of the incremental inductance Of the phase circuit, and since phase inductance is a function Of electrical position, the rotor position can be estimated. Kulkarni and Ehsani [23] have proposed a related technique, with the phase induc- 18 tance being calculated in real time. By measuring the phase currents and voltages, and then using a lookup table of position-inductance data, the position can be deter— mined. If the switching frequency is high, for instance greater than 10kH z, then the variation of inductance with the rotor position can be neglected during one switching period. With this assumption, the following instantaneous voltage equation can be used for the phase a Of an IPM: 22,, = Ria + Lp’ia + E, (2.8) where, as discussed in Section 2.3, L=L,—M For the phase a Of an IPM, L, = L,; + Lsm + Lg cos(20) and M = —%L,m + L, cos(20 — 27r/3) With the assumption that the motor back EMF Ea remains constant during a switch- ing period, the instantaneous value of E, is evaluated with the knowledge of the previous two instants: Ea = 11%) d0 _ Abra 05—01' «1». wt], 19 where 0,- and 0,- are the positions at two instants Of time t, and tj, respectively. Rewriting (2.8), va — Ric - Ea Pia L: where, pic = M 13(3) - t(k) The calculated phase inductance is then used to estimate the rotor position, using a set of stored data that relates the phase inductance with the rotor position. Harris and Lang [13] have proposed to inject diagnostic voltage pulses into the non- conducting phase. The resulting currents are evaluated to measure the phase induc- tances. From these inductances, instantaneous motor position is estimated. Ehsani and Husain [8] suggested an alternative analog phase inductance method, which mon- itors the mutually induced voltages in unused adjacent phases. The induced voltages can be used to estimate inductance and hence position. The disadvantage of signal injection is thus avoided. The variable inductance approach has the limitation that it works only with anisotropic rotors and also when the variation of the inductance with the rotor posi- tion is both sufficient and accurately known. Its principal advantage is that the zero speed is handled more easily with this method than the EMF approach. As with other methods described, errors can occur if assumed values of motor parameters are incorrect, for example if the resistance is inaccurate, due to thermal effects, then as the current increases, the error in estimated position also increases. 2.4.5 Observers One way to extract all the required information is to model the dynamics of the motor, drive this motor model with the same input as is used to drive the real motor, and somehow ensure that errors between the modeled motor and real motor are minimized. 2O x(to ) J “(0 X(t) W) —-—> 5c(t) = f (x,u) ~——> y(t) = h(x,u) > 200) , l v fem=f(£,u>+K[y(t)—h<2.u)1 l 5c(t) Figure 2.5. The structure Of an Observer. If this can be done, the states Of the modeled motor will effectively summarize all the information in the waveforms up to the present time, and the model will accurately reflect the behavior of the real motor. A state Observer extends this idea. Here, an output is defined as a function of the states, and this output is compared with the equivalent measured output Of the real motor. Any error between the two signals is then used to correct the state trajectory Of the observer. This processing is shown in Figure 2.5. An Observer is Often implemented to reconstruct the inaccessible states in a system. It is driven by the available system inputs and outputs and it may be implemented using hardware or software. The models for PMSMs are nonlinear, and estimation theory for nonlinear systems is not as well developed as the wealth Of knowledge available for linear systems such as DC motors. 21 Linear Observers Kim and Sul [21] proposed a Luenberger Observer based technique where the rotor angle and the motor speed information are Obtained by transforming the terminal voltages to the stationary reference frame. A linear Observer is built assuming that the motor speed is nearly constant during the processing time. An angle compen- sation algorithm to reject the system noise is also utilized. The method uses the resistance and inductance parameters to perform the calculations. Any change in these parameters causes the estimations to detune. Nonlinear Observers Observer-based systems allow the controller to access states which are not directly measurable. For example, flux linkage is not a directly measurable quantity. SO, to Obtain the flux linkage, the motor’s phase voltages and currents are measured. These can be used, together with the phase resistance, to Obtain an estimate of flux-linkage via integration. One example of this approach applied to a surface mounted PMSM is described by Wu and Slemon [33], where EMF is estimated from the measurement of terminal voltages and stator currents and is then processed to produce the stator flux linkage space vector. The angle of this vector is used to produce the stator current command signals. The system also uses the rate of change of the flux linkage angle to Obtain a speed signal. Consoli, Musumeci, Raciti and Taste [5] have proposed a similar technique for interior permanent magnet motor. Due to the integration process by which flux linkage is Obtained, these techniques suffer from the effects Of integrator drift, which can be compensated either by analog electronics or software techniques as proposed by Hu and Wu [15]. The systems described above use the Open loop flux linkage estimated values. In an Observer system, this quantity is used to estimate a measurable quantity so that 22 the system can update its motor model and, in the case of flux linkage estimation, compensate for integrator drift. With the availability Of cost-effective powerful signal processors within the last few years, the sophistication Of such Observers schemes has increased. One such technique, based on measuring both input and output parameters to generate a corrected model was presented by Matsui and Shigyo [25]. Their scheme uses the estimated flux linkage value, together with measured current, to estimate the phase voltage. The error between the measured and estimated voltages is used to correct the flux-linkage. This correction to flux-linkage translates into correction to the speed estimate. In this work, Matsui and Shigyo have presented the following equation for speed estimate: L0 = 21,, — (R + Lpfiq + (KpAde + K.- [Afiddt)sign(d2) Apr + 142:! where, All: = 13d - 174m and a... = (R + Lpfid — We The position estimate is found by integration of the speed estimate. Extended Kalman Filter Another class of Observers uses the extended Kalman filter (EKF) to estimate both position and speed in real time. The work done by Dhaouadi, Mohan, and Norumu [7] illustrates the principles. The EKF is an Optimal recursive estimation algorithm. It is based on the state-space model of the motor, together with a statistical description of the uncertainties involved. The uncertainties are modeled by three covariance 23 matrices for mom The lI where [hi I, and (T. I(i,) and The 3 Where 1]] It has an The ( estimate The E t“'0 steps measuren Star; 1. 1 State COl'af “Mental i matrices: P(t) for the system state vector, Q(t) for the model uncertainty, and R(t) for measurement uncertainty. The EKF describes the system of interest by the nonlinear state space model: 1'30) = fl$(t), W), t] + 1110) where the initial state vector :r(t,,) is modeled as a Gaussian random vector with mean 1:, and covariance P,,, while w(t) is a zero-mean white Gaussian noise independent of 2:(t,,) and with a covariance matrix Q(t). The available measurements are modeled as: 31(9) = h[:r(t,-), til + ”(til where v(t,~) is a zero-mean white Gaussian noise that is independent of a:(t,,) and w(t). It has a covariance matrix R(t,). The Optimal state estimate, :i:(t), generated by the EKF is a minimum-variance estimate Of :r(t), and is computed in a recursive manner. The EKF has a predictor-corrector structure, and can be described in the following two steps, where the superscripts — and + refer to the time before and after the measurements have been processed. Step 1. Prediction (from til-1 to t,— ): The Optimal state estimate, :i:(t), and the state covariance matrix, P(t), are propagated from measurement time til to t,“ , by numerical integration of the following equations, where t 6 [tin t5]: 40) = f[i(t),U(t),tl P(t) = FTP(t) + P(t)F + Q(t) 24 where evaluated at :i: = :i:(t;*_1). Step 2. Correction (from t,‘ to tfi) By comparing the measurement vector, y(t,~), to the estimated one, Q(ti), a correction factor is Obtained and is used to correct both the state vector and the covariance matrix. The following equations describe this step: fit?) = i(t.-‘)+K(t.-){y(t.-) —h[:%(t:),t.-]} P(ti) = P0?) - K(ti)HP(t.-’) where the filter gain matrix K (t,) is defined as K(t.-) = P(t.‘)HT[HP(t.-‘)HT + Red]—1 and H = am, t,-) 0:): evaluated at :i: = :i:(t,-’ ). The algorithm is computationally intensive, and the accuracy also depends on the model parameters used. A critical part of the design is to use correct initial values for the various covariance matrices. These have important effects on the filter stability and convergence times. In principle, these need to be obtained by considering the stochastic properties of the corresponding noises. However since these are usually not known, trial-and-error is used for the initial estimates of the elements of these matrices to get the best tradeoff between filter stability and convergence time. Implementing the algorithm requires powerful signal processing technology. Also, 25 there is no apriori performance or stability guarantee, i.e., in general if incorrect initial values are used, the EKF algorithm may not converge to the correct values. 2.5 High-Gain Observers High-gain Observers have played a pivotal role in this dissertation. They have been used in estimating derivatives in the proposed scheme and also in proving stability Of the position and speed dynamics. This section reviews the concept and provides references for further investigation. The use of high-gain observers in robust estimation Of output derivatives was first introduced by Esfandiari and Khalil [9], and since then has been used by many other researchers [20]. To illustrate a simple version Of this concept [6], consider the case of a single-input, single-output nonlinear system which has a uniform relative degree [17] equal to the dimension of the state vector. Such a system has no zero dynamics [19] and can be transformed into the normal form: in = A2: + B[a(:r)u + b(:r)] y = Ca: where, r . - . O 1 0 0 0 0 0 1 O 0 A: , B: O O 1 0 O 0 O 0 1 0 0 O O 0 1 .. -nxn - ~nx1 C: 1 0 . o 0 1 26 and a(:r) 74 0. Suppose that there exists a state feedback stabilizing control it 2 112(3), where, tb(:r) is a locally Lipschitz [19] function. TO estimate the state x, we use the Observer, is = A5: + B[a,,(:i:)tb(;f:) + b,,(i)] + H(y — 0:2) (2.9) where a,,(:r) and b,,(:r), the nominal models of the nonlinear functions a(:c) and b(:r), respectively, and the n x 1 matrix H is the observer gain. The estimation error, e = a: — 5:, satisfies the equation é = (A — HC)e + BA(a:, e, t) where A(-) = [0(1) - ao(i)l¢(i) + 5(1) - b,,(§:) The Observer gain, H, is taken as T H — a] a? c e a: where e is a small positive parameter and the positive constants a, are chosen such that the roots of s"+a13"-l +---+a,,_ls+a,, =0 (2.10) have negative real parts. This choice Of H assigns the eigenvalues Of (A - H C) at 1 / 6 times the roots of (2.10). Using singular perturbation analysis, it is shown in [9] that the estimation error will decay to 0(6) values after a short transient period Of the form [0, T1(e)] where lim,_,o T1(£) = 0. The Observer equation (2.9) is nonlinear due to the terms aozp and ()0. Choosing 27 the nominal functions a,,(a:) and bo(a:) to be zero results in the linear form Of the Observer, f:=A:i:+H(y—C:i:) It is important to notice that this linear version of the high-gain observer is an ap- proximate differentiator. This can be seen by examining the transfer function from y to 5:, given by: G(s) = (31 — A + HC)"1H For n=2, G(s) is given by 1 6801 + a2 C(s) = 22 63 068 a + 1 +2 028 It is clear that G2(s), the transfer function from y to $2, approaches 3 as 6 tends to zero, which shows that 5:2 approximates the derivative 3). 28 CHAPTER 3 The Proposed Method 3. 1 Introduction In this chapter, the specifics Of the dissertation are being presented. It begins with the motivation for such a scheme. It continues with the problem statement, and culminates in the derivation Of the proposed estimation scheme. The last section presents the detailed derivations carried out. 3.2 Motivation In the previous chapters, we have seen that the PMSM has emerged as an actuator Of choice in servo systems. It owes its niche to its desirable characteristics as well as the latest advancements in the areas Of magnetic materials, semiconductor switches and control strategies. Also the need for position and speed sensors for an effective implementation of the vector control techniques has been described. One such technique commonly used to control the speed Of a PMSM is shown in Figure 3.1. Here, the actual speed, w, is measured and is fed back. The difference between the reference speed, w,, and the actual speed, w, is calculated. The resulting speed error, Aw, is applied as input to a 29 qr iOr ‘ I a) + Aw Speed I e ,9 ‘ ' 2 __) 3 ‘ it, Current-controlled ' . PWM inverter Controller _.p —.——H . a a, iw = 0 'D' Cf ‘ 9 Figure 3.1. Traditional vector control of PMSM. PI controller. The output of the PI controller is i,,,, the torque producing component Of the stator reference current, transformed to the rotor frame of reference. The other component, 2,1,, is the flux producing component. Its reference value is kept at zero, unless the motor is to be driven at a speed which exceeds the base value, determined by the DC bus voltage. In that case, the value Of id, is set to a negative number. The details Of this mode Of Operation will be given in Section 5.3. The role Of position sensing comes into the picture at this point: the reference values 2'9, and id, are transformed into the stator frame of reference currents iar, 2),, and i“, using the measured position 0. A current controlled PWM inverter is used to ensure that the actual currents established in the PMSM follow the reference currents. Since the primary focus Of this dissertation is the estimation of position and speed, we shall limit the control part to using the above classical PI controller scheme throughout this work. In the last chapter, the disadvantages associated with the use Of mechanical sensors have been highlighted, most important of which are cost and reliability. Hence the 30 move towards eliminating these sensors. The techniques prOposed by most researchers rely on using electrical or magnetic quantities that vary with position. Back EMF-based schemes have proved to be popular, but they exhibit uncertainties at low speed. Also, they have been mostly used with the motors with trapezoidal EMF, the so—called brushless DC motors, hence are restricted in their application. Schemes that exploit inductance variation avoid the low-speed problem associated with the back EMF-based techniques. However, these schemes are effective only when there is large and accurately known variation Of phase inductance with position, thus limiting the scope to motors with interior permanent magnets and their attendant saliency. Schemes based on motor modification suffer from a similar drawback: they cannot be applied to Off-the-shelf motors, or to the ones which are already being used in industry. The flux linkage based methods have the advantage that they could be used in both sinusoidal and rectangular types Of motors, although most proposed schemes have relied on Open loop flux estimations and thus suffer from integrator drift. The above synopsis highlights the importance of techniques based on Observers. Many schemes along these lines have been proposed, as discussed in Chapter 2. The proposed idea builds upon the work done with such schemes. 3.3 Assumptions In this work, the following assumptions are made regarding the PMSM: o the rotor has surface mounted permanent magnets; o the induced EMF is sinusoidal; 31 o magnetic saturation is neglected; o stator windings are star connected. 3.4 Problem Statement The primary Objective Of this dissertation is to formulate a scheme which estimates the position of the rotor, with the knowledge of only three motor parameters: resistance R, inductance L, and rotor fiux linkage 111,. The input to the scheme must consist Of only the terminal quantities: voltages and currents. The scheme must not rely on rotor saliency or any physical modification. It must be able to correct errors in the position estimate. These errors might result from a lack of knowledge Of the initial rotor position, or might arise from any other causes. The secondary Objective is, that under the same constraints, to come up with the speed estimate and a formulation to correct it, should this estimate be erroneous. Once such scheme is formulated, it must be validated using numerical simulations and experimental implementation. Mathematical analysis must also be performed to prove stability of the position and speed dynamics. 3.5 The Proposed Scheme This scheme was inspired by the work done by Matsui and Shigyo [25], as described in Section 2.4.5. The proposed scheme takes the approach Of using the difference Of current derivatives to estimate position and speed. The motivation for the use of current derivatives to do this estimation comes from the work of Khalil, Strangas and Miller [18]. They use a high-gain Observer to approximate the derivative of 3,, the torque producing component of stator current, 32 A A V4 , vq 0 ——-—D Transformations ‘4 . ‘q Estimator . y (b 9 (D Figure 3.2. Overview of the proposed scheme. transformed to the estimate Of the rotor flux. This derivative is then used to estimate the speed Of an induction motor. The underlying steps in the proposed scheme are: measure the motor currents and voltages; transform these variables to the rotor frame Of reference using 9, the estimate of 0; calculate the derivatives Of each of the currents id and 39, two different ways; use the error between the current derivatives to drive the Observer. Figure 3.2 gives an overview Of the proposed scheme. The details Of the scheme follow. The voltage model Of the motor, as given in Equation (2.5) is the starting point. 33 The equation is rewritten here, for convenience: 12,, = Ric + Lpz'a — wrw sin(0) 2),, = Rib + Lpz'b — wrw sin(0 — 27r/3) (3.1) v, = Ric + Lpz'c - wrw sin(0 + 27r/3) If the rotor position 9 is known, the following matrix transforms the variables of the stator reference frame to the one fixed to the rotor: fd 2 cos 0 cos(0 — 27r/3) cos(0 + 21r/ 3) fa = 3 fb (3-2) fq — sin 0 — sin(0 — 27r/3) — sin(9 + 27r/3) f where, f represents either a voltage or a current. Since we are developing a sensorless scheme, 0 is unknown, we use its estimate 0. This modifies (3.2) to: - . - . fa fd 2 cos 0 cos(0 — 27r/ 3) cos(0 + 27r/3) . = 3 . . . fb (33) f,, — sin 0 — sin(i9 — 27r/3) — sin(0 + 27r/3) fc Carrying out the transformation, (3.1) and (3.2) yieldlz v R + Lp —Lw id 0 d = + W (3.4) 11,, Lw R + Lp i, 1 1Equations (3.4) and (3.5) are derived in Section 3.7. 34 while, (3.1) and (3.3) result in: a, R + Lp —La 2, — sin A0 = . + wrw (3.5) 6,, Lab R + Lp t, cos A9 where, w is the actual speed, while (22 is its estimate, and aozo—é (am Rearranging (3.5), we get: id 1 ’Dd R —LLD 2d — sin A0 P .. = E — ,. "' Ibrw (3'7) 2'9 6,, La?) R 2}, cos A0 The right-hand side of (3.7) contains the variables we are estimating: w and 0. The variables on the left-hand side, p3,, and pig, can be calculated by finding the derivatives Of the signals known to us: id and iq. High-gain Observers [9] will be used to find these derivatives. At this point, the Objective is to come up with expressions that relate the unknown with the known: the errors in our estimates 0 —R and w —c?J with errors in computable signals. To this end, we define a new set of variables, replicating (3.7) but assuming A0=Oand<§2=wz 2,1,, 1 a, R —Lo 2,, . 0 P . = E - .. —1/J,.w (3.8) A, a, La It i, 1 Further defining: = p - p (3-9) (3.7) - (3.8) yields the error in current derivatives: 35 Apzd _ d), w sin A0 . L (3.10) Apiq —w cos A0 + (22 Assuming that A0 is small, the following simplification is used: sin A0 z A0 cos A0 a: 1 Thus, A "' wA0 pf" = 1:1 (3.11) Apt}, -—Aw where, Aw = w — a (3.12) Equation (3.11) states that an error in the position estimate manifests itself in the signal Apid. Similarly, if there is an error in the speed estimate, it reflects itself in the signal Apiq. Rearranging (3.11), we get: L .. Aw = ——Apiq T L .. A0 _ wrwApzd Defining k = L/TA- and substituting the definitions Of Aw and A0 from (3.6) and (3.12), the above set Of equations can be re-written as: w = w—kApiq (3.13) 9 = “#3:“ (3.14) 36 —:—> ¢ > d/dt 1—?>+ (15,9 14 pg —>(9,-Ri,-L03i,-¢,ffi)/L { C. P," A ____, —-u (fid—Rfd+Ldfq)/L ——A—>+ sport”: pa... ,, d/dt -—,>:_J '4 pic! Figure 3.3. Details Of the proposed scheme. For the purpose Of implementation, (3.13) and (3.14) can be expressed as: one, = w-kApiq (3.15) . . A " 0..., = 0+kam‘1 (3.16) Figure 3.3 shows the above algorithm graphically. 3.6 Characteristics of the Proposed Scheme There are several advantages to the proposed scheme. First, the scheme works in a closed-loop fashion meaning that it has an inherent correction mechanism. For instance, if there is an error in the position estimate, the scheme has a way to fix it. Another advantage relates to computational burden. Since there are just two terms in each expression: the previous value Of the estimate and the correction term, the scheme cuts down on the number of calculations. This contrasts with the more traditional Observer equations, which have an estimation term, often replicating the 37 plant dynamics, in addition to the correction term. The third salient feature is that that the scheme does not estimate position by the commonly employed technique of integrating the speed estimate. Instead it rather uses the d-axis current derivatives, thus avoiding drift problems associated with the integration process. Another advantage relates to the scope of the scheme: it does not rely on some special motor feature, for instance, saliency Of poles. It can be used in the existing motors without any physical modification, such as placement of search coils. Also, it does not require knowledge of the mechanical load attached. Finally, the scheme does not require the availability Of the neutral point for voltage computation. Infact, it can be implemented with just two current sensors: the use of voltage sensors can be avoided using knowledge of the PWM pattern. The major limitation Of the scheme is that it requires knowledge of three motor parameters: resistance R, inductance L and rotor flux linkage #2,: parameter mis- match can influence the accuracy of the estimates. This will be further investigated in the next chapters. 3.7 Derivations 3.7 .1 Derivation of Equation (3.4) We begin the derivation with the general form of Equation (3.2): quo '2 M'Uabc (3.17) In expanded form, this equation is written as: 38 I- II I- q 12,; cos 0 cos(0 — 27r / 3) cos(0 + 21r / 3) 1),, WIN — sin 0 — sin(0 — 27r/3) — sin(0 + 27r/3) 12,, (3-18) 2),, “' 1),, 1 1/2 1/2 1/2 22, Here the third component 22,, is not associated with the rotor reference frame. Instead it is related arithmetically to the abc variables, independent Of 0. When the three-phase system is symmetrical and the voltages form a balanced three-phase set of abc sequence, the sum Of the set is zero, hence the 1),, variable is zero. The derivation that follows also uses the relationship between voltages, currents and flux linkages in the abc frame of reference: vabc = Riabc + Wabc (319) Similar to Equation (3.17), the flux linkages across the frames are related as: I(jdqo = M11411»; (3.20) This translates to: 2ibabc : M—llpdqo (3.21) Putting Equations (3.17), (3.19), and (3.21) together, we have: vdqo : Advabc = M{Riabc + pz/jabc} : M Riabc + M Wabc = Ridqo + Mp{M—lwdqo} 39 = Ridqo + M{[P(M—1)lwdqo + MAIN/Jaw} = Ridqo + M[p(M—l)]lr/jdqo + MM—Iquo 2 Ridge + M[p(M-l)]¢dqo + 19¢qu Further manipulation leads us to: , - O -10 M[p(M")]=w 1 o o O 0 0 (3.22) (3.23) Equation (3.23) is derived in Section (3.7.2). Equations (3.22) and (3.23) yield the following result, written in expanded form: F -I I- 1 F q l 'Ud id 0 —1 0 (wt! vq=Riq+w100 ¢,+pw, l. .. L b This leads us to the relation: W = Rid — w¢q + 101/id = R2,; — wLiq + Lp’id = (R + Lp)id — sz'q where, we have used the definitions of #24 and dig 711d = de + wr '1’!) = Lit: 40 ltbd. ’Uo i0 0 0 0 $0 1100 (3.24) Similarly, Q «a II = R2}, + Lpz'q + sz'd + rut/2,. = (R + Lp)z'q + w(Lz'd + 1b,) This concludes the derivation of Equation (3.4). 3.7 .2 Derivation of Equation (3.23) In this section, the details leading to Equation (3.23) are being presented. We begin with the transformation matrix M: - cos 0 cos(0 - 27r/3) cos(0 + 27r/3) - M = - — sin 0 — sin(0 — 27r/3) — sin(6 + 27r/3) (3-25) 1/2 1/2 1/2 This matrix has the inverse M ’1: l cos 0 — sin 0 1 M—1 = cos(0 — 27r/3) — sin(0 — 27r/3) 1 (326) cos(0 + 27r/3) — sin(0 + 27r/3) 1 Taking the derivative of Equation (3.26), we get: —sin0 —cos€ 0 I’M/r1] = w — sin(0 — 27r/3) — cos(0 — 27r/3) 0 (3.27) - sin(0 + 22/3) — cos(0 + 22/3) 0 J Multiplying Equations (3.25) and (3.27) together, we get: 41 M11 M12 0 _ 2 Mle 1 zwg M21 M21 0 (3°28) L M31 M32 0 . where, the elements of the matrix are written and manipulated below: M11 = — costinO — cos(0 — 27r/3) sin(0 — 27r/3) — cos(0 + 21r/3) sin(6 + 27r/3) = 0 M12 2 — cos2 0 — C082(0 — 27r/3) — cos2(0 + 27r/3) _ _§ 2 M21 = sin2 9 + sin2(0 — 22/3) + sin2(0 + 22/3) _ § 2 M22 = sin0cosl9 + sin(0 — 21r/3) cos(6 — 27r/3) + sin(0 + 27r/3) cos(0 + 21r/3) = 0 M31 = —%{sin0 + sin(0 — 27r/3) + sin(0 + 27r/3)} = 0 M32 = —%{cosl9 + cos(0 — 27r/3) + cos(6 + 27r/3)} = 0 Putting all the elements back into Equation (3.28), we get: I! O I moo Mp[M'1]= (a; NI“ O O O O O l 42 i.e., 0 —1 0 Mle‘1]=w 1 0 0 000 This concludes the derivation of Equation (3.23). 3.7 .3 Derivation of Equation (3.5) The first first row of the matrix equation (3.5), is derived as follows: g [on cosé + 2),, cos(é — 27r/3) + 126 cos(é + 27r/3)] §[{Ria + Lpia — 21W sin 0} cosé +{Rib + L192}J — 1A4.) sin(0 -— 27r/3)} cos(é — 27r/3) +{Ric + Lpz'c - wrw sin(9 + 27r/3)} cos(é + 21r/3)] R[§{z’a cosé + 2}, cos(é — 27r/3) + 2}; cos(é + 27r/3)}] +L[§-{p[2’a cos 5] + p[z'b cos(é — 27r/3)] + p[z'c cos(é + 27r/3)]}] —z/2,w[§{sin6cosé + sin(0 — 27r/3) cos(é — 27r/3) + sin(0 + 22/3) cos(é + 22/3») Rid + L[§~{cos épia + cos(é — 27r/3)pib + cos(é + 27r/3)pz'c}] +L[§-{-ia€u siné — ibo sin(é — 22/3) — icdl sin(0“ + 22/3)}] wag-{g sin(0 — ém R2,. + Lpid — L623, — (brwsinw —- (9) (R + Lpfid — L23, — w...) sin A0 This derivation makes use of the following trigonometric identity: 43 . . 27r sm :2: cos y + srn(x — ?) cos(y 27r 2 2 3 )+ sin(a: + 37:) cos(y + 37:) = Esin(sr: — y) 2 Along similar lines, the second row of the matrix equation (3.5), is derived as follows: _§ [2, M + v. sin(é — 22/3) + vc sin(é + 2723)] _§[{Ria + Lp’ia — (bra; sin 0} siné +{Rib + Lpz'b — 1,0,.ch sin(0 — 27r/3)} sin(é — 27r/3) +{Rz’c + Lpz'c — (at; sin(0 + 22/3» sin(é + 22/3)] R[—§{ia siné + ib sin(é — 27r/3) + ic sin(é + 27r/3)}] +L[—§{p[ia sin 5] + p[ib sin(é — 27r/3)] + p[z'c sin(é + 27r/3)]}] +¢,w[—§-{sin Osiné + sin(6 — 27r/3) sin(é - 27F/3) + sin(0 + 21r/3)sin(§ + 22/3)}] R2,, + L[§{sin 9m, + sin(é — 27r/3)pib + sin(é + 27r/3)pic}] +L[§{iacb cosé + no“) cos(é — 21r/3) + 2'ch cos(é + 27r/3)}] +¢.w[—§{§ cosw — 6)}1 RE, + Lpiq + Laid + 4er cos(0 — (5) (R + Lpfi, + Laid + «(W cos A0 This derivation uses the following trigonometric identity: 27r 27r 27r 2 sinxsiny + sin(rr — —) sin(y — 3) + sin(x + -§-) sin(y + l) = £5-cos(:lc — y) 3 3 2 This concludes the derivation of Equation (3.5). 44 CHAPTER 4 Numerical Simulations 4.1 Introduction In this chapter, results from the numerical simulations are presented. All the simula- tions were carried out with Simulz'nk using the default variable-step ode45 (Dormand— Prince) algorithm. The maximum step size, relative tolerance and absolute tolerance were all set at 1e—3. 4.2 Simulation Results A Figure 4.1 sets the baseline for the results: it shows that the estimated position, 0, converges to the actual one, 0, in less than a tenth of a second. This is despite the fact that the estimate is initially off the actual by 179°. This ability to converge despite such a wide initial estimation error, (0 — 6),, is a major strength of the proposed scheme. The speed estimate, (1), is working well too, with the estimation error, no — Lb, converging to zero in less than a tenth of a second, as well. In Figure 4.2, the same simulation is carried out with the motor running at about one fifth the speed of the first one, and also with a load attached. No deterioration in performance is observed. In both these cases, the speed estimation error is seen approaching a maximum 45 of about 3 rad/sec during the initial transient. The simulation shown in Figure 4.3, investigates this error. Here, the initial position error is reduced to 90°. It is observed that the speed estimation error is cut down significantly to about 0.5 rad/sec. This is expected because the estimated position 0 is the most critical element in the whole estimation scheme, as the transformation to the rotor frame of reference relies on the accuracy of 0. The speed estimate is very sensitive to the initial position error. For the rest of the simulations, the initial position error is kept at the 90° level. The next three simulations investigate the performance of the estimation scheme as the motor is rotated at reduced speeds. Figure 4.4 shows that the estimation scheme is working quite acceptably at speeds of 10, 1 and 0.1 RPM. The estimation converges much slowly as the motor speed dr0ps beneath 1 RPM. The next four simulations examine the impact of parameter mismatch on the performance of the estimation scheme. The parameter chosen is the resistance of the stator winding. This choice follows from the fact that the resistance is the most sensitive of all the parameters, increasing as the motor heats up. In these simulations, we continue starting the position estimate 90° off the actual one. We are interested in exploring whether the position estimation error is still converging to zero or not. A load is applied so as to emphasize the impact of the mismatch: in the absence of a load, the motor currents drop to negligible values once the desired speed is reached, thus downplaying the effect of a parameter mismatch. The motor is turned at the low speeds of 10 and 1 RPM, thus further eliminating factors which mask the impact of parameter mismatch: at higher speeds, most of the estimation schemes work well, it is the lower speed interval where most stop converging. Figures 4.7 and 4.8 show the results of the case when the value of the resistance used by the estimation algorithm is less than the actual. This corresponds to the situation where the motor has heated up. We see that the position estimate is still working as well as in the previous cases, while the speed estimate fails to converge to 46 the correct value. The accuracy of the speed estimate is more important for the speed controller, which is not the main focus of the discussion here. Since transformation to the rotor frame of reference depends on the correct value of the position estimate, its convergence is critical for the estimator to work. The speed estimate is found to be about 10% more than the actual. Part of the problem can be attributed to the fact that the motor has a resistance value of 6-52 per phase, which is higher than the usual 0.5-1.0!) range. Thus a 10% mismatch figures much more prominently. Figures 4.9 and 4.10 present the situation when the resistance value assumed by the estimator is 10% higher than the nominal. This corresponds to a colder than normal motor. The results are comparable to the ones obtained above: the position estimate shows agreement with the actual, while the speed estimate is found to be about 10% less. This concludes the presentation of the simulation results. We have noticed that the estimation scheme has its strengths and weaknesses: as far the estimation of position, the proposed scheme performs quite well, with estimation error converging to zero even in the face of parameter mismatch, and in the presence of an initial error of as much as 179°. Whereas, the speed estimate performs well when there is perfect parameter knowledge, but has problems when the assumed resistance value does not match the actual. We shall explain these observations through mathematical analysis in the next chapter. 47 250 I I I I I 7 I I I _ 0 200~ .. 0" ’13 b 150 - .5 ”E, 100 ~ 0 a. 50 _ o ‘ I I I I I m 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) 4 I I I I I I I I — 9-0" a 3 * . I ‘g 2- a: I.“ 1(- 8 :oz- 0 - V‘ (I) O O. _1 ,_ _2 1 1 1 1 1 1 1 1 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) 4 I I I j I I I I A — 01-0) 2 a - B 1:: 2- O u’i 1 ‘O 8 s 0 F _1 I I I I 4 I I I I 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) 400 I I I I I I I I I g 300 B 200 2 8 100 5’} O _100 l I I I I I I I I 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) Figure 4.1. Simulation: A00 : 179°, ref speed: 900 RPM. 48 Figure 4.2. Simulation: A00 : 179°, ref speed: 180 RPM. 49 50 6 I I I I I I I I I 40 - .. 0" s? e: 30 - C 8 'a 20 - O n. 10 - o a I I I I I I I I J 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) 4 I I I i I I I I — 0 — 0" A 3 - ‘U E W 1’ 2 - 9 1‘13 1 - 8 E- 0 - v 8 D. _1 .. _2 I I I I I I I I I 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Tums (sec) 3 I I I I I I I I A -— a) - a)" E! § 1 u“; 20 g a) _1 J I I I I I I l I 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) I I I I .2 B E I; a) _20 I I I I I I I l I 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) 50 40 ’7: :30 c .9 if. 20 O a 10 o - 2 I I I I I I I I A —- 0 - 0" E 1 l § .3 o — C .9 g o -1 - a. _2 I I I I I I I L I 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) 0.6 I I I I I l I I g — a) - a) B 0.4 b g g 0.2- m o - .r 2 4 I r _0.2 I I I I I I I I I 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) I F I I .3. B 2! .3 _20 I I I I I I I I I 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Tame (sec) Figure 4.3. Simulation: A00 : 90°, ref speed: 180 RPM. 50 0| & (D N Position (red) -I O .5 ‘0'” P a: Position Error (red) O s Speed Error (rad/sec) 0) Speed (rad/sec) M an. 0 V I I I I I I I _'_ 0A d I I I I I I I I I 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 ' Time (sec) l I I l I I f I — 11-0" 4 ., T I I I I I I I I I 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Time (sec) l I I I I r I I I -— m-m" I I I I J I I I L 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Time (sec) 1 I I I I I r I r __ co . a)“ I I I I I I I I I 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Time (sec) Figure 4.4. Simulation: A00 : 90°, ref speed: 10 RPM. 51 Speed Error (rad/sec) Position (rad) Position Error (rad) 55 Speed (rad/sec) .0 :2 N 01 -‘ OI N CI 0 o u. UIOUI-‘UIN ‘3 P in on P d I I I I I I I _ 0 *- . . e" 1 1 1 1 1 1 1 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time (sec) I I I I I I I I I I I 0 4 0.5 0.6 0 7 0 8 Time (sec) I I I I I I I I I I I I I 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time (sec) I I j I I I I l A -( I I I I I I I L 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Time (sec) Figure 4.5. Simulation: A00 : 90°, ref speed: 1 RPM. 52 Error (rad/sec) -0.015 0 Speed (rad/sec) Position Error (rad) Position (rad) P .-* N 01 d 01 N 01 00 0.05 0.04 0.03 0.02 0.01 -0.01 0 I I I I l l l I Time (sec) 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 I I I I I I I I I ml I I I I I I 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Time (sec) Figure 4.6. Simulation: A00 : 90°, ref speed: 0.1 RPM. 53 1.8 Position Error (rad) rror (rad/sec) LU S _ 9 A3 P ' 9A 0 3. .5 2 - '5 : no. . 1 - 3 0 1 1 1 1 1 1 1 1 1 O 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 T1me (sec) I I I I I f I T I I I I I I I I 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 T1me(sec) 0.1 I I T I I I I 0 -0.1 -O.2 -o.3 ” i _o.4 I I I L I I I J L O 0.1 0 2 0.3 0 4 0.5 0.6 0.7 0.8 0.9 Time (sec) 4 I I I I I I I I _ a) 373 ~ ' “’A .................................................... .. $3 :32 h- i a) 1 - O I I I I I I I I I O 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) Figure 4.7. Simulation 54 : A00 : 90°, R : 0.9R, ref speed: 10 RPM. N or I 7 I _ 0 2 - .. 0" ’6‘ g 1.5 - c _o '3 1 - o o. 0.5 - 0 5 1 1 1 1 4 1 1 1 1 O 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) I T I I I I ’6 g ‘2' 171 C .9 '5; o o. I I I I I I O 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 T1me(sec) 0.02 r r 1 I r I I I A — a) - a)“ 8 € 0 g g -—0 02 - 11.1 g4.“ - ca '0.06 I I I I J J l I I O 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) I I I I B E 8 3 m “-0.1 I I I I I I I I I 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (sec) Figure 4.8. Simulation: A00 : 90", R : 0.9R, ref speed: 1 RPM. 55 I I T I I I I I I _ 0 A 3 4 ' ”A - u g ,8 2 - - a; - a . 1 - _: d 0 1 1 1 1 L 1 1 1 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Time (sec) I I I I T I I I 6 - 2 2 III e C .9 g 8 O- -1 I_ I I I I I I I 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Time (sec) 0.4 r f r I r I F I A —- a) - co" § 0 3 - - ‘ a . v. ff v T 3; g 0.2 - ~ LU $0.1 —- . o L I I I L L I I I O 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Time (sec) 3 I I I T I I I Speed (rad/sec) L I 0.1 0.2 0.3 0.4 Figure 4.9. Simulation: A00 0.5 Time (sec) 56 0.6 0.7 0.8 : 900,1‘2: 1.112, ref speed: 8 RPM. 0.9 1 ." N ammo! Position (rad) .0 0'1 3.. d d'mm Position Error (rad) o 01 0.2 Speed (rad/sec) o o d I p d I I I I I I I 0.1 0.2 0.3 0.4 0.5 Time (sec) 0.6 I I I 0.1 0.2 0.3 0.4 0.5 Time (sec) 0.6 0.7 0.8 0.9 I I I I 0.1 0.2 0.3 0.4 0.5 Time (sec) 0.9 I I I I I I 0.1 0.2 0.3 0.4 Figure 4.10. Simulation: A00 : 90", R : 1.1R, ref speed: 1 RPM. 0.5 Time (sec) 57 0.6 0.7 0.8 0.9 CHAPTER 5 Mathematical Analysis 5.1 Introduction So far, the prOposed scheme has been developed on the basis of intuition: starting with the motor model, we transformed the electrical variables to the assumed rotor frame of reference; manipulation of the resulting equations provided us with the means of estimating rotor position and speed. Specifically, we calculated the derivatives of the two rotor-frame currents, 3,, and id, each two different ways. The two derivatives of 5}, were called p3,; and pidm. Similarly, the derivatives of 3,, were called pig and piqm. We then calculated the difference of the corresponding derivatives. This produced the signals Apid and Apiq. We saw that an error in our position estimate, A0, manifested itself in the signal Apid, while an error in our speed estimate, Aw, reflected itself in the signal Apiq. This observation provided us with the mechanism to correct our estimates. This is the intuitive basis of the estimation scheme. In this chapter, we shall recast the proposed scheme in the standard controls terminology, in effect we begin to bridge the gap between intuition and rigor. We shall show that the scheme consists of two uncoupled first order high-gain observers [9], one each for position and speed. Each observer is driven by an independent measurement. This lets us study the stability of each observer independently. The high-gain feature 58 analytically explains the rapid convergence of the position and speed estimates to the actual values, as we observed numerically in the simulation results. This chapter starts with the analysis of the prOposed scheme, proceeds with ar- guing the stability of the speed- and the position-error dynamics, and concludes with an explanation of the effect of parameter mismatch. 5.2 Analysis We begin the analysis by reviewing the key relationships. The implemented observer equations are: anew : (bold _ kApgq (51) . . A ° anew = gold + kwmd (5'2) where, 112nm is the new corrected speed estimate, and can be written as £21.“; (2201,; is the old speed estimate, and can be written as (2%; -kApiq is the speed correction term; k = 11%, the ratio of the stator phase inductance to the rotor flux linkage; APfq = pig - piqm, the difference between the two derivatives of iq; 9mm, is the new corrected position estimate, and can be written as 0H1; do” is the old position estimate, and can be written as ék; kApid/cbnew is the position correction term; Apid = pi; - pidm, the difference between the two derivatives of id. 59 y. Equations (5.1) and (5.2) are based on the following relationship between estima- tion errors and differences in the current derivatives: Api wA9 . d ‘2 (5.3) Apiq —Aw where, A0 = 19—1? (5.4) Aw = w—LD (5.5) Having reviewed the key relationships, we proceed to a rigorous treatment of the proposed observer. Our objective is to estimate the position and speed of the motor. So, we begin with the mechanical dynamics of the motor, which can be expressed as: 9 — Fl (56) where, F1 represents to the motor speed (.1), while F2 represents its acceleration. The implemented observer equations, (5.1) and (5.2), can be expressed as: Q)‘ = hznpi, (5.9) a» where hl and hg are the observer gains whose choices will be justified based on stability considerations. Equations (5.3), (5.8), and (5.9) yield: '* _ 7.1% 60 5 = -—h2———Aw (5.11) Differentiating both sides of equations (5.4) and (5.5) with respect to time, we get: (Am = 9—9 513 (Aw) = 51—5 (5.13) The task at hand is to show that the intuitive choices made for the observer gains hl and ’12 lead to the conclusion that both the position-error dynamics (A0) and the speed-error dynamics (Aw) are stable. Substituting expressions for 9, 5, w, and 5 from equations (5.6), (5.10), (5.7), and (5.11), respectively, into equations (5.12) and (5.13), we get: (M) = —h1%wA0+F1 (Aw) = hg-‘t-‘EALU‘I'Fg These error dynamics can be put in the matrix form as: A9 —h1%w 0 A0 F1 + Ad) 0 112% Aw F2 or more succinctly, as: é=Ae+f where, 61 A: —h1%w 0 , 8: A6 , f: F1 0 hf??? Aw F2 In this analysis, the f will be treated as a bounded disturbance vector and con- ditions will be introduced to ensure that it does not destroy the stability property of the rest of the system dynamics. The above formulation decouples the position and r— speed error dynamics, so each one can be studied independent of the other. 5.2.1 Speed-Error Dynamics EF- The speed-error dynamics are: (Aw) = 1.2%»; + F2 (5.14) Now, we shall show that these dynamics are stable. To that end, the implemented equation for wnew , (5.1), is rewritten and manipulated: anew : acid _ kApgq anew _ (bold : “'kAp‘iq - - L e wne _ wold : ——Apz w ¢r q anew — (bold L ’t —— = ——-——A 5.15 T er P24 ( ) Equation (5.9) is also rewritten: 5 = 52mm, (5.16) Equations (5.15) and (5.16) show that the speed observer implementation corre- 62 sponds to choosing h2 as L MT ’12: where T is the sampling time period. Substituting this choice for h2 into the speed- error dynamics equation, (5.14), we get: - Aw (Aw) — —T + F2 The typical sampling frequency is 10kHz—20kH z. This translates into a very high gain for the linear part of the above equation. This high-gain observer formulation ensures that the effect of the disturbance term F2 can be neglected and hence, the error in speed estimation assumes an infinitesimal value in a short time (less than a tenth of a second in our initial simulations). Neglecting the disturbance term, the above equation can be written as: This concludes the stability proof of the speed error dynamics. We have shown that the speed error is ultimately bounded [19], with the bound proportional to the sampling period T. 5.2.2 Position-Error Dynamics The argument for the stability of the position-error dynamics closely mirrors the one presented above for those of the speed-error. The position-error dynamics are: (A9) = —h1-‘%wA0 + F1 (5.17) 63 Now, we shall show that these dynamics are stable. To that end, the implemented equation for 0mm, , (5.2), is rewritten and manipulated: A A ’6 ~. 901d + . Apia anew wnew énew _ gold A k A1721! wnew .. .. L .: anew - 601d I/er‘Jnew Apzd énew —’ éold L ’t ______ = ——A .1 T mm... m“ (5 8) Equation (5.8) is also rewritten: Equations (5.18) and (5.19) show that the position observer implementation cor- responds to choosing h as L hl = ——.—- erwnew where T is the sampling time. Substituting this choice for hl into the position—error dynamics equation, (5.17), we get: &w A wnew (A6)=" +F1 Since, we have already argued the stability of the speed-error dynamics, the factor . w —) 1 + 6, with 6 small, very fast. wnew Neglecting e, we are left with, - A0 A0 =—— ( ) T +F1 The comments made regarding the stability of the speed-error dynamics apply 64 here as well: the typical sampling frequency is 10kH z - ZOkHz. This translates into a very high gain for the linear part of the above equation. Similar to what we saw above, this high-gain observer formulation does two things: first, it ensures that the error in position estimation becomes infinitesimal in a short time (less than a tenth of a second in our initial simulations) and second, the effect of disturbance term F1 can be neglected. Neglecting the disturbance term, the above equation can be written as: A0 ma=—T This concludes the stability proof of the position error dynamics. 5.3 Effect of Parameter Mismatch In this section, we present an analytical explanation of the observer behavior in the presence of parameter mismatch. The parameter of interest is R, the stator resistance. The resistance mismatch can be modeled by using R = R+AR instead of R in our derivation, where R is the nominal stator resistance, while AR is the mismatch. This affects the development starting with equation (3.14). All prior equations remain unaffected. Equations (3.13) and (3.14) are rewritten below for convenience: id 1 79d R —LL‘1:J id — sin A0 p . = Z - . .— .1...) (5.20) 1}, 13,, LC.) R 1}, cos A0 idm 1 '04 R —L(:) id .. 0 p .. : Z '_ .. — i/er 1,... 5,, Lo R 1, 1 With the resistance mismatch incorporated, the above equation becomes: 65 id... 1 5,, R + AR —Lo 3,, - 0 A 1,... 5,, Let; R + AR ’1‘, 1 Here, including the subscript r in the signal names pidm, and piqm, indicates the presence of resistance mismatch. The same convention will be followed below as well. Defining: Apidr id 7:dmr = P . ‘P . AInqr zq 2qmr (5.20) - (5.21) yields the difference in current derivatives: Apid, _ %w sin A0 + A—f—id Apiq, 39,f(—w cos A0 + w) + 9133,, As before, we assume that A0 is small, and use the following simplification: sin A0 z A0 cos A0 z 1 Thus, A ‘ ,. 3g’LwA0 + 95-; 1““ = L L :1 (5.22) Apiq, . —-%’Aw + ALE-z}, Rearranging (5.22), we get: L . AR» Aw = _-'t—/):Apiqr + $1,, L . ARA A0 = ' ,. — ' IflrwAp‘d 112.de Again, defining k = L/iflr and substituting the definitions of Aw and A0 from 66 (5.4) and (5.5), the above set of equations can be re—written as: AR. E7“ - . A AR . gnaw = 601d+k Ind id (5.24) anew : wold _ kApgqr + (523) A wnew Wrwnew Hence the resistance mismatch results in one additional term each in the expres- sions for anew and 0am. Efl'ect on Position Estimate: Our estimation effort is focused in the speed region where there is no field weakening effect. This means that we choose to force id, the flux-producing component of the stator current in the estimated rotor frame of reference, to be zero. This is done to obtain the maximum torque-to—current ratio. This optimal mode of operation is suitable below the base rotor speed, where sufficient voltage is available from the inverter which supplies the stator windings of the motor. The hysteresis current controller ensures this, and the resulting id that flows is very close to zero. As a result, we can analytically explain what we observed in our simulations: the proposed scheme works well as far the position estimation, even in the presence of resistance mismatch. The situation is different at speeds above the base speed, in the constant-power range. Since the permanent magnet rotor flux is constant, the induced EMF increases directly with the motor speed. If a given speed is to be reached, the terminal voltage must also be increased to match the increased stator EMF. The increased stator terminal voltage would require an increase in the voltage rating of the inverter used. However, with a given inverter, there is a ceiling voltage which cannot be exceeded. Thus to limit the terminal voltage of the motor to the ceiling voltage of the inverter, field weakening has to be introduced. The effect of field weakening can be obtained by controlling the stator currents in such a way that the stator-current space vector 67 >~¢ fi-Q +fs=jiq _ Dd a... 4.--__--_--_..- w . (a) (b) Figure 5.1. Orthogonal orientation of the current space vector vis-a-vis rotor flux linkage : (a) base region (b) field weakening region. in the rotor reference frame contains a direct-axis component 1,; along the negative direct-axis of the rotor reference frame, in addition to the quadrature-axis stator current component 1,]. This is shown in Figure 5.1. The resistance mismatch could have more pronounced effect under field weakening. But in this region the one“, factor, in equation (5.24), in the denominator helps, since, this will act to attenuate the impact of having non-zero id. This explains why the resistance mismatch will have no appreciable effect on the position estimate, even with field weakening in place. Effect on Speed Estimate: The situation is different in the case of speed esti- mation: the resistance mismatch results in the term (AR/112,03,” in equation (5.23). .Here, the AR factor comes multiplied with iq, the torque-producing component of the stator current in the estimated rotor frame of reference. The value of iq increases linearly with the torque demand, the electric torque developed being given by the 68 relation: 3 . Te : Ep‘wrzq where, 0 Te is the torque deve10ped; o P is the number of pole pairs in the motor; 0 11), is the rotor flux linkage. If there is no load attached to the motor, the torque demand is there only while starting from rest: once the desired speed is reached, 3,, dr0ps to a low value just enough to overcome friction and windage. In this situation, the impact of resistance mismatch is going to be minimal. But when the motor is loaded, this being the more typical case, the impact of resistance mismatch is significant. This will depend on the torque demanded. For a constant torque load, the 3,, will be constant, and the error in speed estimation will be prOportional to AR, as observed in simulation results. This concludes our mathematical analysis of the proposed scheme. 69 CHAPTER 6 Experimental Implementation 6.1 Introduction To investigate the viability of the proposed scheme, an implementation was carried out. We present details of this implementation in this chapter. It begins with a description of the experimental setup built for this purpose. It continues with the description of the software developed and presentation of results of the various ex- periments conducted. It concludes with a discussion of these results. 6.2 Experimental Setup The experimental setup, built to test the scheme in real-time, is shown in Figure 6.1. It consists of the following modules: 0 A 3—phase sinusoidal EMF permanent magnet synchronous motor; 0 A hysteresis current controlled PWM inverter; 0 A digital signal processor board, that implements the estimation algorithm; 0 Current and voltage sensors; 70 DSP Digital I/OBoard ‘ 1‘ TE Analog l/O Board «VP Counters V Inverter ll DC / .. ) Motor \ Optical n F. “3413 <— 34) AC +— Figure 6.1. Experimental setup. 71 0 An optical pulse encoder to verify the estimated speed and position; 0 A load in the form of either a DC brake or a DC motor fed by a 3-phase controlled rectifier / regenerative dynamometer. 6.2.1 Permanent Magnet Synchronous Motor The PMSM used is part of the high performance servo motor series manufactured by Pacific Scientific. It is a three-phase, six-pole motor and has Neodymium-Iron- Boron (NdFeB) rotor magnets. At room temperature, NdFeB has the highest energy- product of all commercially available magnets. Energy-product is the product of B, the magnetic flux density, and H, the magnetizing force or field intensity. The high remanence and coercivity of NdFeB permit reductions in motor frame-size for the same output compared with motors using ceramic magnets. This translates into high torque-to—inertia ratio. The PMSM used is rated at 320V DC bus voltage. The nominal parameters are given in Table 6.1. 6.2.2 Hysteresis Current Controlled PWM Inverter The inverter consists of a 3—phase 60 Hz 208V full-wave rectifier section followed by a set of six 20 kHz insulated—gate bipolar transistor (IGBT) switches, rated at 30 A, 60 V. The switches used are part of the Powerex Intellimod [30] series. They are controlled by the signals generated by the DSP board. The specific module used is PM30RSF060. The current-controlled PWM inverter consists of a conventional PWM voltage- source inverter equipped with current-regulating loops to provide a controlled current output. Since the inverter has a high switching frequency, the stator currents of the motor can be rapidly adjusted in magnitude and phase. 72 Table 6.1. Parameters: Pacific Scientific S21GNNA-RNNM-00 PMSM. [ . Parameter l Symbol I Value 1 Units j Number of Pole Pairs P 3 Resistance R 6 Q Inductance L 8 mH Voltage Constant 1/1, 0.0572 prk / rad/ sec Rated Speed W, 7900 RPM Rated Torque T c, 0.44 N m Moment of Inertia J M 0.042m kgm2 Thermal Resistance RT” 2.2 deg.C / Watt Thermal Time Constant 7TH 5.0 min. Continuous Stall Torque T as 0.5 N m Continuous Stall Current 1c, 1.5 Am, Static Friction (max) T f 0.008 N m Viscous Damping Coefficient K DV 0.003 N m/ kRPM Weight (motor only) W 1.4 kg The reference current waveform is generated and fed to a comparator, together with the actual measured current of the motor. The comparator error is used to switch the devices in the inverter so as to limit the instantaneous current error. If the motor phase current is more positive than the reference current value, the upper device is turned off, and the lower device is turned on, causing the motor current to decrease, and vice versa. The comparator has a hysteresis band that determines the permitted deviation of the actual phase current from the reference value before an inverter switching is initiated. Thus, the actual current tracks the reference current without significant amplitude error or phase delay. There are three independent current controllers for each inverter phase. Figure 6.2 gives an overview of the controller, whereas Figure 6.3 shows the details. Typical output current waveforms obtained with hysteresis current control are illustrated in Figure 6.4. Figure 6.5 shows the detailed picture. A small hysteresis band gives a near-sinusoidal motor current with a small current ripple, but requires 73 C I Current-controlled @— ~ 0— 3-phase rectifier PWM inverter ,_ T V'\ HCC = Hysteresis Current Controller Figure 6.2. Hysteresis current controller: physical overview. a high switching frequency in the inverter. The switching frequency is not constant for a given hysteresis band, but is modulated by the variations in motor inductance and back emf. 6.2.3 Digital Signal Processor The digital signal processor board uses the AT&T DPS3ZC processor. It has the following characteristics: A 32-bit floating-point unit; A 16-/24-bit fixed-point unit; 1536x32 bit words of on-chip memory; Parallel and serial interfaces. The DSP32C processor operates at a clock rate of 50MHz and is capable of per- forming 25 million floating point computations in a second. 74 HCC = Hysteresis Current Controller Figure 6.3. Hysteresis current controller: physical details. The DSP board has two on-board 200kHz, 16-bit analog-to-digital converters. Also included is the DSPLINK parallel expansion bus that allows further expansion of the analog and digital I / O capabilities of the board by connecting expansion boards. The DSP board outputs the control signals, which are fed, via isolated drive control circuitry, to the gate inputs of the IGBTs. These control signals are interfaced via PC/32DIO, a 32 channel digital I/O peripheral board that connects to the DSP via the DSPLINK interface. The 32 channels are arranged as four 8-bit bidirectional ports. 6.2.4 Optical Pulse Encoder The optical pulse encoder is an incremental device that provides pulsed output wave- form. The choice of an incremental, as Opposed to an absolute, encoder results in higher resolution at a lower cost, and with fewer output lines. It has a resolution of 75 ' o 500 1000 1500 2000 2500 3000 3500 1 5 I I I I I j 1 e - 0.5 - - _.o o - .. —o.5 - -1 .. _1.5 I I I I I I 500 1000 1500 2000 2500 3000 3500 I I I I I . I I ' I .I _ I 500 1000 1500 2000 2500 3000 3500 samples Figure 6.4. Hysteresis current controller: waveform overview. 76 1.5 0.5 -1 r r r r r _. l' I” (‘1 (,1 1H 1, _ i . i -_ I, - i 1‘ “ 1 III‘ I ‘N 11’ (f ‘ . . ' (I N u 4’ I l1~~ ”£14,, _ ii” I I I I I 0 100 200 300 400 500 600 samples Figure 6.5. Hysteresis current controller: waveform details. 77 1024 pulses per revolution. It uses two output channels in quadrature for position sensing. By viewing the transition on one channel relative to the state of the other, we can detect the direction of motion as well. The output pulses generated are pro- cessed by counters and are then sent to the DSP board via two ports of the digital I/O board. 6.3 Software To ensure generation of optimized code which executes at the speed required by the algorithm, all programming has been done in Assembly language. A flow-chart of the software developed is shown in Figures 6.6 and 6.7. The code is included in Appendix A. The initialization step consists of configuring various control registers of the pro- cessor and the bidirectional ports of the PC/32DIO board, resetting the counters, and setting up the interrupt frequency. This is followed by the alignment step, where a current pulse is repeatedly applied to the motor. The objective is to bring the rotor to the zero degree position. When this is accomplished, the north pole of the permanent magnet is coincident with the as-axis, the magnetic axis of the phase-a winding. This processing is shown in Figure 6.8. The motor is started by introducing a revolving magnetic field. This is done by injecting three-phase sinusoidal currents, with appropriate phases, into the stator. The frequencies of these currents are chosen such that the motor follows a specific speed profile. Actual currents and voltages are measured. These measured currents are com- pared with the reference values. Three hysteresis current controllers then calculate the appropriate switching pattern to ensure that the measured currents stay within 78 Initialization i Bring rotor to 0° l Wait for the next interrupt l Calculate time I and ref. speed a), Measure rotor position 9 + d9 Calculate speed: (0 = I /\/\ Open switches. stow) 7 Measure currents and voltages v Filter the signals measured l Transformation: stator -> rotor Figure 6.6. Flowchart of the Assembly language program. 79 E. Estimate current derivatives using h.g.o. l Estimate current derivatives using the model i Estimate speed and position: é) & 6 1 Calculate Ar?) = w, — a“) l Calculate ref. current: fer = PI(Aa’i) l Transform: calculate ref. currents i... it... i", l Hysteresis current control: calculate the PWM pattern l Send the PWM pattern to the inverter 4} Save all the variables into the DSP memory Figure 6.7. Flowchart of the Assembly language program (continued). 80 Figure 6.8. Initial rotor alignment: (a) stator magnetic field (b) resulting rotor posi- tion. 81 the hysteresis bandwidth of the reference ones. This pattern is sent to the inverter controller, which translates the switching pattern to actual switches being closed or opened. A i" PI ——ui"' ———>iQ' ‘ a) + Ad) 5 2 3 1}, Current-controlled ' Speed 3’ '9 —’ PWM inverter - Controller .. —F ——,-—F icr fi idr = O in l s 16 e I Position & Current & Speed Voltage I Estimator Measurements Figure 6.9. Sensorless closed-loop operation of the PMSM. Torque is produced and the motor starts rotating. The position, 0, is measured and speed, w, is calculated using a high-gain observer. The details of the high-gain observer were given in Section 2.5. The measured currents and voltages are filtered using second order Butterworth low-pass filters. This filtering is needed to get rid of the current ripple which does not contribute to the torque produced but can cause problems with the calculation of derivatives using the high-gain observer. The DSP board has its own analog low-pass filters. These filters limit noise and provide anti-aliasing protection. The filtered currents and voltages are transformed to the rotor frame of refer- ence, using the estimate of position from the previous iteration. This is followed 82 by estimation of derivatives of these transformed currents, using high-gain observers. The derivatives of these transformed currents are then computed from the model of the PMSM, using Equation (3.8). Position and Speed are then estimated using Equations (3.15) and (3.16) of the proposed scheme. For closed loop Operation, the motor is started open loop, as described above. When it reaches a certain speed, the loop is closed: speed estimate is fed back to a PI controller, which compares the estimate with the reference speed. The output of the controller is, 3;, the torque-producing component of the stator reference current in the estimated rotor frame of reference. The flux-producing component, 33, is chosen as zero, since no field weakening is intended. The above two reference currents are transformed to the stator frame of reference, using the position estimate. This gen- erates the three-phase reference currents: in" it», and, 2'“. These reference currents are then compared with the actual ones, as explained above. Figure 6.9 describes the processing. Once the experiment is carried out, the resulting data are retrieved from the DSP board memory using a C language program. The data are analyzed further using Matlab’s visualization tools. 6.4 Experimental Results In this section, we present results from the experiments conducted. The reference speed profile followed is similar to the one used in numerical simulations: the reference speed increases, or decreases in the case of negative speeds, for the first half second and then reaches a steady level. In some experiments, the reference speed kept increasing, while in others, bidirectional profiles are used, going positive initially and then assuming negative values. In each of these figures, the first plot shows the actual position of the motor 83 while the second one shows the estimated position. The third plot presents the error between the actual position and its estimate. In all these plots, the angles have been mapped to the [—1r, 7r] domain. This has been done for two reasons. First, plotting the data without this mapping can mask any estimation errors, since the original scale would go from zero to the maximum value of the position. For instance, if the motor is running at 200 radians/sec, then in two seconds, the position reaches 400 radians. On this scale, the actual and estimated position plots can look identical, even if they have some mismatch. Mapping to the [-7r, 1r] domain prevents it and reveals the two signals in detail. The second reason is related to the limitation of any practical setup. Any processor used to implement the scheme will have a finite word length. If the motor is run for a long time, the overflow and underfiow errors can cause the scheme to collapse. So, in practice, the actual and estimated positions are always mapped onto the 27r long domain. One effect of this mapping is that we notice sharp discontinuities in the position estimates while the experiment is in the initial part of its run. These discontinuities arise each time the estimation error falls outside the [—7r, 7r] domain. Figure 6.10 shows the result of an experiment where the motor is kept speeding up to 550 RPM. In this case, the loop is closed at about 0.3 s, and the estimate of position converges to a constant number. It is important to mention here that the indication of success in these experiments is the position estimation error converging either to zero, or to a constant number. The latter case is due to the initial offset in actual position measurement and is explained below. In simulations, we know where the rotor initially is: this being simply a matter of initializing the particular state of the state space model at the desired value. In actual practice, this cannot hold true. The present setup uses an Optical pulse encoder which sends pulses to a pair of counters. As described in Section 6.3, the first part of the experiment involves initial rotor alignment, where we repeatedly apply a current 84 pulse to the motor. The objective is to bring the rotor to a the zero degree position. We then send a pulse to the counters to reset them, so that the count starts from zero. This processing was shown in Figure 6.8. This arrangement is the most effective we can implement, since we are working with a surface-mounted permanent magnet motor. This arrangement cannot guarantee that the zero position reported by the position sensor is infact so. An offset in this initial alignment shows up as the constant number to which the position estimation error converges. We notice that position estimator does not converge at low speed. To investigate this further, a series of experiments have been conducted, and the motor is rotated at lower speeds. Figures 6.11 - 6.14 give results of experiments, where the motor is rotated at 600, 150, 80 and 45 RPM. The accuracy of the position estimate suffers as the reference speed is decreased. In case of Fig 6.14, the estimator has been re-tuned for the low speed. It appears that depending on the intended application speed, the proposed algorithm might be tuned further to make it work below the 45 RPM threshold. But so far, in the experiments, we have been able to get reasonable results down to this speed only. Another set of experiments conducted uses negative reference speed profiles. The motor has been made to turn at speeds of -600, -300 and -75 RPM. Figures 6.15 - 6.17 present these results. A third set of experiments conducted involves investigating the behavior of the proposed scheme under speed reversal. Figures 6.18 and 6.19 show the results. While the estimator converges eventually, it does not show satisfactory performance in the first part of the experiment. 85 Speed (rad/sec) Position (rad) lb 0 N I 1_ a \ A .. - _ - .4 q -. I N r Position (rad) o to I b - i In- I- P & .q q .4 .4 .1 - - _4 I l I I l l l O 02 04 06 0.8 1 12 14 16 18 Time(sec) 4 I I l I T I I :5 E S g m C .9 .1: U) o n. 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time (sec) 200 I I I I I I I 150 100 50 0 " _50 l l l l l l l 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time (sec) Figure 6.10. Experiment: ref speed increasing to 550 RPM. 86 4 I I T I I I f I -— 0 ’6 2 ' ‘ E; 5 o .2 «I: a? .2 .— _4 I I I I I I I I 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 'I'Ime(sec) I“ 4 I I I I I I I — 9? A 2 . '0 £3. .5. o - « g m s a -: .2 - / l: _4 L 1 I I I I I 1 , O 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time(sec) Position Error (rad) O 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time(sec) am I I I I I I I jg zoo ......................... «n a .2: 100 - ‘D a m 0 " d _1m I I J _I I I A L 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1 .6 1.8 Time(sec) Figure 6.11. Experiment: ref speed: 600 RPM. 87 I I I I r I I I I — 0 l A 2 ' .4 U E! .5 0 g In 0 a _2 _ _ _4 I I I I I L I I o 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time sec ( ) r 4 I I I I I I I I ' — 0" A 2 .. '0 g .5 o 1 .1: U) . c2 -. .2 q 3 ‘7‘— __4 I I I I I I I _I O 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time (sec) 4 I I I I I I I ... i 3 — e-m E 2 .1 ........................................................................................... — E III 0 . ‘ ...................................................................................... _ c O ’3 l 8 _2 .......................................................................................... .. 0. Speed (rad/sec) I I I I I I I I 0.8 1 1.2 1.4 1.6 1.8 Time (sec) 0.4 0.6 Figure 6.12. Experiment: ref speed: 150 RPM. 88 I I I I I I I I — 9 ’6 2 - - g 5 o - :2 m 8 -2 - - _4 I I I I I I I l O 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time (sec) 4 I I I I I I f N Position (rad) O 92* _4 I I I I I I L I O 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time(sec) 4 I I I I I I I A ' -e-e" g 2. ............................................................................................ _ £0. .................... C .2. 2 8_2HI .......................................... ._ “- : _4 I l I I I I I I O 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time(sec) 40 I I I I I I I Speed (rad/sec) l I I I I I I I 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time (see) Figure 6.13. Experiment: ref speed: 80 RPM. 89 Position (rad) O O 0.2 alime (sec) Position (rad) O I I I I I I; l 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time (sec) Position Error (rad) i E g i; _20 I I l g i 1 1 I O 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time (see) Figure 6.14. Experiment: ref speed: 45 RPM. 90 Position (rad) Position (red) 0 Position Error (rad) 0.2 0.4 0.6 0 8 1 1.2 1.4 .Time (sec) 1.8 I 0.4 0.6 0.8 1 1 .2 1 .4 Time (sec) I I I I I I I I I I I I 0.2 0.4 0.6 0.8 1 1 .2 1 .4 Time (see) Figure 6.15. Experiment: ref speed: -600 RPM. 91 1.8 Speed (rad/sec) I I I f T 1 I I I — o A 2 '- '0 2 g o .2 m a? .2 — - _4 I I I I I I I I O 0.2 0.4 0.6 0.8 1 1.2 1.4 1 .6 Time (sec) 1.8 Position (rad) Position Error (rad) _150 1 1 1 ¥ 1 1 1 1 O 0.2 0.4 0.6 0.8 1 1 .2 1.4 1 .6 Time (see) Figure 6.16. Experiment: ref speed: -300 RPM. 92 1.8 Position (rad) 0 Position (rad) o I I I I I 7 I I I I I I I I I I 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time (see) I I I I I I I i- | I I I I I I I I 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Time (see) I I I I I I T ' — 6 - 0" .................................................................................. 1 Position Error (rad) § E g i -30 l 1 1 1 'L 1 1 1 O 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Time (see) Figure 6.17. Experiment: ref speed: -75 RPM. 93 Illli IIIIII III" w ‘1' ‘I. _ _ 3.5 2.5 I 2 Time (sec) 1.5 0.5 2 0 J. as: 828.“. 4 _ "I 2 0 n/__.l is 828; 2.5 3.5 Time (sec) 1.5 0.5 0—6" 4 2 o 2 _ 62V .otm 553.“. 3.5 2.5 2 Time (sec) 0.5 AM ”UV 2 m o m _ Genie: vooam "QW 3.5 2 2.5 Time (sec) 1.5 0.5 Figure 6.18. Experiment: ref speed: 600 and —600 RPM. 94 Speed (rad/sec) I I I I I I A 2 '- 'O 2 .5 0 ’ ‘ 30;; a? -2 — — _4 1 1 1 I 1 1 1 O 0.5 1 1.5 2 2.5 3 3.5 4 Time (sec) 4 II I I I I I I __ 0A A 2 13 E a . , s o - i g (I) 8 -2 - _ _4 I L I I I I I 0 0.5 1 1.5 2 2.5 3 3.5 4 Time (sec) 4 I v ! . ! I A ‘ 2 z — e - e“ g 2_ ............... g. ............ g ....................... - § 2 s [I] o - . '2 . .............. . ............ ....................... _ c : : : .9 ; - - 'g _2 . . . . .. .g ................. g ............ g ....................... _ “- : : : _4 I I I I I I I 0 0.5 1 1.5 2 2.5 3 3.5 4 Time (sec) 3% I I I I I I I ._ to . (0" AM I I I I l I I —‘W 0.5 1 1.5 2 2.5 3 3.5 4 Time (sec) Figure 6.19. Experiment: 95 ref speed: 600 and -300 RPM. 6.5 Discussion As we have seen, the experimental results show the viability of the prOposed scheme. When we compare the experimental results with the ones obtained from simulations, we notice some disparity. This disparity can be explained by taking a closer look at the various factors that contribute to this departure from the behavior predicted by simulations. The main factor that causes disparity between simulation and implementation is the current hysteresis controller. Incorporating the hysteresis controller in simulations has proved impracticable. A simulation that runs within a few minutes of computer time with the assumption that the actual currents are equal to the reference currents, would take a few days if the hysteresis effect is incorporated. The reason being that at every single step of the simulation, the state of each of the three hysteresis current controllers changes thus significantly slowing down the simulation process. As seen in Figure 6.5, the behavior of the hysteresis current controller is far from ideal. Another factor is the nonlinearity inherent in current and voltage sensors. While simulations assume that the values used in estimation are the actual ones, in practice, this cannot be realized perfectly. The sensors have been very carefully calibrated. A set of known voltages and currents was applied and the resulting data were plotted against the actual values. Matlab was used to find the coefficients of a linear poly- nomial that fit the data in a least-square sense. While this is an effective calibration technique, it cannot compensate for the nonlinearity inherent in the transducers. Parameter detuning is another contributory factor. The parameter values change with temperature, for example that of resistance. While, values of inductance change as function of saturation. This concludes our discussion of the experimental results obtained. 96 CHAPTER 7 Conclusions 7. 1 Summary In this dissertation, a promising scheme has been presented to estimate the posi- tion and speed of surface-mounted sinusoidal electromotive force (EMF) permanent magnet synchronous motors (PMSMs). After introducing the PMSM vis-a-vis other contenders for servo-control, the first chapter discussed the need and the disadvantages of using sensors in the PMSM control. It indicated that vector control of PMSMs involves orienting the current space vector orthogonally to the rotor flux vector. This explains the need for sensing the rotor position. But position sensors increase the cost and lower the reliability of the drive: hence the research on sensorless operation. The second chapter presented a review of the research done in the field over the last couple of decades. It developed the mathematical model of the PMSM. It presented the pros and cons of the major approaches proposed: back EMF, excitation monitoring, magnetic saliency, motor modification, and observers. It was noticed that observers provided the most promising and most generally applicable of all the approaches. The third chapter presented the problem statement and the proposed methodol- 97 ‘1. ogy. The difference of current derivatives was presented as the means of estimating position and speed. Error in position estimate was shown to manifest itself in the difference of derivatives of the flux-producing components of stator current. The er- ror in speed estimate was shown to show up as the difference of derivatives of the torque-producing components of stator current. This led to the expressions for posi- tion and speed estimates which were used in the rest of the work. All the intermediate derivations leading to the algorithm were presented in the concluding section of the chapter. The fourth chapter presented results of numerical simulations of the proposed scheme: the estimates were shown to converge to the actual variables. Another observation was the large initial error allowable in position estimate, which would still result in stable estimation of position and speed. The concluding simulations explored the impact of parameter mismatch on convergence of the estimates. It was observed that the position estimate still converged, but speed estimate suffered significantly in the face of parameter detuning. The convergence of the estimation scheme observed in numerical simulations was analytically proved in chapter five. It showed that the scheme consists of two uncou- pled first-order high-gain observers, one each for position and speed. Each observer was driven by an independent measurement. This fact allowed us to study the sta- bility of each observer independent of the other. The sixth chapter presented results from a set of experiments carried out to inves- tigate the viability of the proposed scheme. It detailed the experimental setup and also included a flowchart of the Assembly language code developed for the purpose. 98 7 .2 Contribution In this work, we have advanced the state of the art of position and speed estimation of permanent magnet synchronous motors. We have presented a novel scheme using current derivatives to do this estimation. The current derivatives are first calculated using high-gain observers and then using the motor model. The difference in the two results is used to drive the position and speed observers. A systematic and analytical approach for developing the scheme has been pre- sented. After developing the idea, we have validated it three different ways: first through numerical simulations, then with mathematical analysis and finally with ex- perimentation. The numerical simulations have been carried out using Matlab and Simulink. The mathematical analysis part has proved stability of the estimator dy- namics using the notion of high-gain observers. The experimental part consists of implementing the scheme with an off-the-shelf motor, using a digital signal processor. The observer shows promising results not only in the low speed region but also with speed reversal. The scheme does not rely on the motor having salient poles. It does not involve physical modification such as placement of search coils. The scheme does not rely on integration of the speed estimate to get the position estimate. It works in a closed- loop mode i.e., it includes inherent correction mechanism. Also, it is computationally less intensive than many other schemes proposed. It does not require the knowledge of the mechanical load or the moment of inertia. All it needs is the knowledge of three motor parameters to do the estimation: its resistance, inductance and rotor flux linkage. These parameters are always included in the manufacturer’s data sheets. 99 7 .3 Future Work A number of avenues can be explored to further analyze, simulate and implement the proposed technique. Some ideas for possible future work are discussed in this section. 7 .3.1 Numerical Simulations One important contribution would be to incorporate more of the phenomena observed at the implementation stage into numerical simulations. For instance, hysteresis cur- rent controller model; inverter switching delays; saturation effects; analog-to—digital converter quantization effects; parameter detuning effects. One such incorporation was done with the hysteresis current controller model. The resulting simulation was found to be too slow to be of use. With faster processors and larger memories becom- ing economical, such increasingly realistic simulations should become more feasible in future. A related idea would be to use integration algorithms, which are real-time implementable. 7 .3.2 Mathematical Analysis The analysis carried out here was based on linearization of the estimator dynamics. One possible research direction would be to carry out this analysis based on the nonlinear system theory. Also, while studying the effect of parameter mismatch, the analysis focused on the stator resistance value. One possible direction would be to explore the impact of variation in the other two parameters: stator inductance and rotor fiux linkage. Also, it was shown that the position estimate was insensitive to resistance mismatch. The speed estimate, on the other hand, was seen to be directly affected by such a mismatch. One contribution would be to make the speed estimate also insensitive to such a mismatch. Another possibility would be to investigate the extension of these results to other AC motors. 100 ‘1 7 .3.3 Experimental Implementation Further experiments can be conducted to bring the real-time implementation results closer to those predicted by numerical simulations. Given that the prototype has been built and tested, further work could be carried out without major effort with the setup. Real-time implementation of a simulated algorithm often entails tuning of various filters, high-gain observers and controllers used. This is needed to account for the phenomena which were not modeled in simulations. In the experimental part of this work, we focused our tuning effort on ensuring that the position estimate converged to the right value. The speed estimation, being more important for the controller, was considered to have secondary significance. One possible improvement would be to ensure that the whole setup is tuned so that both the position and the speed estimates converged to the right values. A related idea is to implement platform migration from the present DSP, to Real Time Linux with the objective of cutting down on deve10pment time and speeding up testing various settings. This approach should make it easier to focus on the main objectives rather than being caught up in Assembly language coding details. Another advantage of this idea would be the much larger memory available for storing various variables of interest and be able to run the experiments longer. The present setup is able to store 32,000 floating point variables hence limiting the length of experimental runs: while storing 32 such variables, at 10 kHz interrupt frequency, the experiment can be run for only 0.13. The various plots included in the implementation results were obtained by staggering data storage across different interrupts. Another possibility is to incorporate integration algorithms other than the Eu- ler’s used in the present setup. Also, the use of other advanced PWM techniques can be investigated: the present setup uses a hysteresis current controlled PWM in- 101 verter. Other approaches such as space vector based PWM could be investigated as alternatives. One improvement would be to implement the scheme without using voltage sen- sors. In principle, the scheme can be implemented with just two current sensors. The knowledge of the pulse pattern generated by the hysteresis current controller and the DC bus voltage can be translated to the voltage applied to each phase. 102 APPENDIX 103 APPENDIX A DSP Code /e _____________________ ___ ___t t t # File: estimator.s * * Description: Implements the proposed scheme * * Author: Ali Khurram * e_ ____ ___ ___e/ #define ivtp r22e #define out r21 #define PortA 01400000 #define PortB 01400008 #define PortC 01400010 #define PortD 01400018 #define PControl 0140001C #define SHReset 0140001C #define Controla 01400020 #define Statusa 01400020 #define Counter 01400024 #define VADCO 01400064 #define VADCI 01400094 /:i- __________________________________________________________ */ .rsect ".start" goto main nop /* ______________ 104 .rsect ".table" /* 800,000 1= 30 */ itable: 2*nop goto 018004d4 nop 6*nop goto isr nop /* _-- */ .rsect ".prog" /# 10 l = 7f0 */ p- .align 4 /* a: t t * system parameters * t It * (ad= 6/2“16 )*(lem - 1000)/(Rm.=50.4) / (turns = 3) * E" * La II=7.2e-3 abc: L=1.5*La dq * e */ count_lim: int 011000 /* start up */ count_dummy: int 0 curr_conv: float 6.05507502489-4 Ke: float 0.0572 L: float 12e-3 LoKe: float 0.20979020979021 oneoL: float 83.3333333333333 R: float 6.0 Rhat: float 6.0 c_speed: float 200.0 /* the const speed */ v_speed: float 400.0 /* the varbl speed */ t_inc: float 200e-6 /* f_int: 5 kHz */ eid: float 50.0 /* hgo gains, d/dt */ eiq: float 50.0 eomega: float 50.0 eomegahat: float 5.0 /* for feed-back */ eth: float 10.0 /* msd th -> speed */ ethhat: float 10.0 /* for feed-back * pzone: float 1.0 /* time to switch */ 105 /e _____________________________________________________________ e t t * tuning parameters * t * * [A,B,C,D]=butter(2,2*pi*fc,’s’) * * a21 - -a12; a22-0; b1= -a12; b2=0; c1=0; c2=1; d=0; * *__ _ __ _ _ t/ 111: float -1332.86488144751 /* 150Hz lpfltr */ 112: float -942.477796076938 v11: float -1332.86488144751 v12: float -942.477796076938 fact: float 0.01840776945463 /* 6*pi/1024 */ hyst: float 0.05 /* bandwidth */ iqrm: float -1.5 Ki: float 4.0e-5 Kp: float 0.1 offsetvO: float 0.074364 offsetvl: float -0.710401 sloPevo: float 0.0094 slopevl: float 0.0095 offsetia: float 0.0077345 offsetib: float -0.010243277 Blopeia: float -6.02511224Se-4 slopeib: float -6.069107457e-4 t-start: float 0.0 /* time to start */ t-stop: float 2.0 /* time to stop */ store_start: float 0.0 /* start data storage */ store_stop: float 2.0 /* stop " " " " */ /‘ _________ constants___ _______ */ n_16: float 16.0 one: float 1.0 one_neg: float -1.0 one_over_2_pi: float 0.159154943092 /* 1/(2tpi) _bigsin */ one_over_pi_by_2: float 0.636619772366 /* 2/pi _sin */ oneosqrt3: float 0.57735026918963 /* 1/sqrt3 -dq */ one_third: float 0.33333333333334 /* 1/3 _dq */ pi: float 3.14159265359 It _sin */ pi_by-2: float 1.5707963268 /* _dq */ point-five: float 0.5 /* wr */ point_five_neg: float -0.5 /* iqr */ point_tvo: float 0.2 /* _estimator */ two: float 2.0 /* _dq */ tvo_pi_by_3: float 2.094395102393 /* _ref */ 106 /*- two_pi: float 6.28318530718 /* _sin */ zero: float 0.000000 _ __ variables _________ __*/ costhhat: float 0.0 delomega: float 0.0 i_c: float 0.0 /* ic is reserved */ ia: float 0.0 iaf: float 0.0 /* 12 of the lpf */ iar: float 0.0 ia11: float 0.0 ib: float 0.0 ib_f: float 0.0 /* ib12, ibf is reserved */ ibr: float 0.0 ib11: float 0.0 icr: float 0.0 id: float 0.0 idp: float 0.0 idpm: float 0.0 idf: float 0.0 10: float 0.0 iq: float 0.0 iqf: float 0.0 iqp: float 0.0 iqpm: float 0.0 iqr1: float 0.0 iqr2: float 0.0 iqr2p: float 0.0 iqr: float 0.0 -localV: 2*float 0.0 loops: float 0.0 loops_temp: float 0.0 /* intra interrupt wait loops */ omega: float 0.0 omegaf: float 0.0 /* filter (hgo) _filter */ omegahat: float 0.0 omegahatf: float 0.0 /* filtered omegahat */ omegahatp: float 0.0 omegahatfsw: float 0.0 omegahatfsw_inv:float 0.0 omegap: float 0.0 portcv: float 0.0 /* the variable storing float(PortC) */ portdv: float 0.0 portcv_old: float 0.0 /* old value - forward */ portdv_old: float 0.0 /* old value - reverse */ posnet: float 0.0 posn: float 0.0 107 posp: float 0.0 sign_w: float 0.0 sign_what: float 0.0 /* to remedy wr+ w- scenario */ sinthhat: float 0.0 t: float 0.0 th: float 0.0 thf: float 0.0 /* th -> hgo -> omega */ thhat: float 0.0 thhatf: float 0.0 thhatp: float 0.0 thr: float 0.0 vba: float 0.0 /* ch0: green */ vbaf: float 0.0 vba11: float 0.0 /* 12 is the filtered l'=/ vca: float 0.0 /* ch1: white It/ vcaf: float 0.0 vca11: float 0.0 /* 12 is the filtered */ vd: float 0.0 vD: float 0.0 v0: float 0.0 vq: float 0.0 wr: float 0.0 /* _____________ integers ____________ _*/ count: int 0 /* starting only */ flagstart: int 0 /* start s/r Open loop */ one_int: int 1 twl: int 0 /* _ _ ___________ */ main: call _initialize(r19) /* the prog starts */ nOp end: 5*nop /* loops_temp++ */ rle 8 one r2e a loops_temp *r2 8 a0 = *r2 + *r1 /* no ai used as ip */ goto end nop /* _____________________ __ _ _______________________ * initialization * _____________________ _- ___---__-__--____--____*/ 108 _initialize: ivtp itable r7e 8 count /* int */ #r7 8 0 17 I 014432 pcw - r7 r8e 8 01200008 It interrupt frequency (Hz) */ 196 = 01f830 /* 20 k: feOc; 10k : fc18 */ *r8 8 19 /* 6.25k: f9c0; 5k : £830 */ /* 6.67k: fa24; 2k: ec78 */ r2e = Controla /* 1.0k: d8f0; dec2he1(55536) */ r1 I 010000 *r2 - 11 /* 01400024 analog board */ r2e - Counter /* 20k: fe71, 10k: fee1, 5k: f9c1 */ 11 - 01f9c1 /* interrupt freq */ *r2 - r1 /* 1k: eOc1 */ r13e - 0180000 /* points to beginning of data buffer */ r2e = SHReset /* read the SW reset register */ 11 - *r2 r2e a PControl /* write into the PC Control reg */ 11 - 0111 /* Ports single buffered */ #12 . r1 /* PortB: 01400008 cntr set/reset */ r2e - PortB /* sending H to reset the counter */ r3 - 01FF #12 = 13 /* PortC,D: 01400010,8 pulse count */ /"I L to put it in the counter mode */ r3 = 0100 *r2 - r3 /* PortA: 01400000 */ /* inverter switching pulse */ r3e - PortA /* open all the inverter switches */ out = 0100 /* ... 01 01 01 */ *r3 8 out /* ...0 aa’ bb’ cc’ */ /* to avoid 111: 110011 */ /* top: 1 on; 0 off */ /* bottom: 0 on; 1 off */ return (r19) nop 109 /* ......... call nOp call nop call nop call nop call nop call nop call nop call nop call nOp call nop call nop call nop call nop ireturn the interrupt service routine : _________ -- */ _start(r19) /* starting s/r */ _loops(r19) /* ensure enough time */ _store(r19) /* store data: 0180000 onwards */ _measure_v(r20) /* voltage measurement */ _time(119) /* timing of the program */ _pos_speed_meas(r19) /* position #/ _measure_i(r20) /* called by _start as well */ _lowpass(r19) /* filtering the signals sampled */ _dq(r19) _idp(r19) -estimator(r19) _ref(r19) /"I generate reference currents */ _hysteresis(119) /* hysteresis controller */ 110 /* ______________________ e t * * start-up: Open loop * t t * flagstart initially set to zero (not yet started) * * when set to one => started, so bypass this s/r; * t if ia within hysteresis band, keep applying 0130 t # else, apply 0100 (open all) onto PortA * * orient rotor along the as-axis, O-deg position * t t * _____________ __ ___* _start: r1e - flagstart /* int I"/ r2 - *rl r3e - one_int /* r2 = r2-1 */ r4 . *r3 nop r4 - r2 /* CA condition: no latency */ if(ne) choto not_started_yet nop return(119) /# bypass this s/r, motor started */ nop /* execute the other subroutines */ /* */ not_started_yet: 16e- r3 - nop r3 - *r68 15e- r4 - nop r3 - count #16 r3 + 1 r3 count_lim #r5 14 It count++ */ /* if count != count_lim */ if(ne) pcgoto to_be_cont_s nOp rSe PortA 111 \ '11 0100 out out 8 *r3 8 r1e 8 r2e 8 r3 8 flagstart one_int 8r2 nop 8r1 8 r3 return(r19) nop to-be_cont_s: /* /8 count_lim reached: set flag_start <- 1 start flag /8 to 1 2 never come back to this 8/1 call _measure_i(r20) nop ia one one_neg rSe 8 r6e r7e 8 813 8r6 817 a0 8 E: a3 8 a1 8 a2 - a0 38nop if(age) pcgoto cont2_s nop pcgoto cont9_s nop cont2-s: a1 8 a3 - a0 38nOp /* bypass this s/r, execute others /* ia, ib, i_c updated */ /8 hysteresis controller 8/ /* libl 8 Iiel 8 0.5*Iial */ /* so ia check enough */ /8 ia > 0, ib 8 ic < 0 KCL*/ /* a0 has ia */ /* a2 has ceiling 8 1.0 */ /* a3 has floor 8 -1.0 8/ /* ceiling check */ l8 is ceiling - ia >8 O? 8/ /* if ia <8 ceiling, safe */ /8 no alarm, do floor check 8/ *l */ */ /8 else, alarm, apply 00he1 (cont9_s) */ /* floor check /8 a1 8 floor - ia; alt8less than 0 /8 if ia > floor, all safe if(alt) pcgoto cont3-s /8 no alarm, keep applying 0130 nop pcgoto cont9_s nop */ */ */ *l /* else, alarm, apply 00he1 (cont9-s) */ 112 /* write out the corresponding word 8/ cont3_s: /8 no alarm: currents safe 8/ out 8 0130 /8 110000, a:top on, b,c: top off 8/ 13e 8 PortA /* Vdc applied to la + (2b ll Zc) */ 813 8 out ireturn cont9_s: /8 alarm: current too big 8/ out 8 0100 /* all top three off, bottom on */ 13e 8 PortA /8 8> effectively all off 8/ 813 8 out ireturn /* no more s/r be executed */ /* * 8 store number of wait loops counted waiting: loopstemp —> loops * 8 (development only, so don’t incorporate into other s/rs) * _IOOps: rle 8 loops 12e 8 loops_temp 13a 8 zero 8r1 8 a0 8 812 812 a0 8 813 return(r19) nop \ Ir /* loops <- loopstemp */ /8 loopstemp <- 0.0 8/ ********* _store: r1e 8 t 12e 8 store_start [at 32,000 8 4 spaces/float 8 128,000 _store: store data: 0180000 onwards: 32000 floats 8 128 K data stored on every twl_th interrupt, and that too, only if store_start < time < store_stop (AND condition) total 1000 data-storing-interrupts permissible 2-sec run: 20kHz -> 40,000 interrupts, store every 40th 10kHz -> 20,000 ints, store every 20th, 5kH, every 10th store if w_sta < t < store_stop 113 **I****** Ir \ **‘I‘** */ Fae. 13e 8 store_stop a0 8 812 - 811 38nop nOp a1 8 813 - 811 38nop /* /* if(alt) pcgoto sto_exit nop rle 8 twl 12 8 811 nop 12 12 - 1 811 8 12 /e store_start - t 8/ /* to have optimal Optimization of space /8 age: no storage at t80, 32000 i/o 32032 8/ if(age) pcgoto sto_exit /8 if t < store_start, don’t store 8/ /8 sto_A:8 bypass this s/r, run others store_stop - t */ 8/ 8/ /8 if t > store_stop, don’t store 8/ needed else, ’using reg loaded 8/ /8 in previous /8 instruction’ if(pl) pcgoto sto_exit nOp 11e 8 t 8r13++ 8 a0 11a 8 iaf 8r13++ 8 a0 11e 8 iar 8113++ 8 a0 r1e 8 ib_f 8r13++ 8 a0 rie 8 ibr 8113++ 8 a0 r1e 8 id 8113++ 8 a0 rie 8 idp 8113++ 8 a0 11e 8 idpm 8113++ 8 a0 rle 8 idf 8113++ 8 a0 11e 8 iq 8r13++ 8 a0 11a 8 iqf 8113++ 8 a0 11e 8 iqp 811 811 811 811 811 811 811 811 811 811 811 /* /8 /* /e /8 /¢ /* /* /* 114 -10.. -11- _12.. 8/ warning message shows up 8/ 8/ 8/ *l 8113++ 8 a0 8 811 11e 8 iqpm /8 -13- 8/ 8113++ 8 a0 8 811 116 8 iqr /8 -14- 8/ 8113++ 8 a0 8 811 r1e 8 omega /8 -15- 8/ 8113++ 8 a0 8 811 rle 8 omegaf /8 -16- 8/ 8113++ 8 a0 8 811 11e 8 omegahat /8 -17- 8/ 8113++ 8 a0 8 811 r1e 8 omegahatf /8 -18- 8/ 8113++ 8 a0 8 811 rle 8 wr /8 -19- 8/ 8113++ 8 a0 8 811 11e 8 th /8 -20- 8/ 8113++ 8 a0 8 811 rle 8 thf /8 -21- 8/ 8113++ 8 a0 8 811 rle 8 thhat /8 -22- 8/ 8113++ 8 a0 8 811 rie 8 thhatf /8 -23- 8/ 8113++ 8 a0 8 811 11e 8 thhatp /8 -24- 8/ 8113++ 8 a0 8 8r1 r1e 8 thr /8 -25- 8/ 8113++ 8 a0 8 811 rle 8 vbaf /* -26- 8/ 8113++ 8 a0 8 811 119 8 vcaf /* -27- 8/ 8113++ 8 a0 8 811 rie 8 vd /8 -28- 8/ 8113++ 8 a0 8 811 11e 8 vq /8 -29- 8/ 8113++ 8 a0 8 811 11a 8 sign_w /* -30- */ 8113++ 8 a0 8 811 11a 8 vca /* -31- 8/ 8113++ 8 a0 8 811 11e 8 vba /8 -32- 8/ 8113++ 8 a0 8 811 11e 8 9 /8 18> skip 1 interrupt: 8/ r2e 8 twl /8 store every 2nd interrupt: */ 812 8 11 /8 t_stop82 - 1 should be put? 8/ /* store every 40th interrupt 8/ 115 /8 19 for 10kHz, 39 for 20kHz 8/ /8 N -> store every N+1th intpt 8/ sto_exit: return(119) /8 9 for 5kHz, 1 for 1 kHz 8/ nop /8 restore t_w_1 8/ /¢ _________________ ____ _ _ 8 t * 8 program timing: apply inputs only if 8 8 t_start < t < t_stop 8 8 _________________________ ___ 8/ _time: 11a 8 t r2e 8 t_stop a1 8 812 - 811 /8 t_stop - t ?>8 O 8/ r3e 8 t_inc /8 t_inc 8 1/f_int 8/ 811 8 a0 8 811 + 813 /8 t 8 t + t_inc 8/ nop /8 if(age)’s L83 being fulfilled 8/ if(age) pcgoto go_on /8 if t_stop >8 t, run the other s/r 8/ nop /8 else ’game over’: infinity loop 8/ 13a 8 PortA /8 the final infinity loop 8/ out 8 0100 /8 game over 8/ 813 8 out finish: pcgoto finish nop go_on: r2e 8 t r4e 8 wr 15s 8 c_speed r7e 8 point_five r8e 8 v_speed /8 inc_speed: 8/ a0 8 812 - 817 /8 a0 8 t - 0.5 8/ 38nop if(age) pcgoto const_speed /8 if t - 0.5 >8 0 8/ nop /* if t >8 0.5, c_spd 8/ 814 8 a2 8 818 8 812 /8 else, wr 8 v_speed8t 8/ 38nop 116 return(r19) nop const_speed: 814 8 a2 8 815 /8 wr 8 c_speed 8/ 38nop /8 need it 1!! 8/ return(119) nOp /* ____________________________________________ _ _ 8 It It 8 rotor position measurement 8 t t 8 _______________________________________________________ #/ _pos_speed_meas: rle 8 portcv_old /8 OCH-Motion 8/ r2e 8 portdv_old /8 CW-Hotion 8/ r3e 8 PortC /8 a port name */ r4e 8 PortD 15e 8 n_16 /8 rollover correction 8/ r7e 8 portcv /8 a variable name */ 18e 8 portdv 817 8 a2 8 float(8r3) /8 a2, portcv ’ve PortC’s float version 8/ 818 8 a1 8 float(8r4) /8 a1, portdv ’ve PortD’s float version 8/ /* rollover processing 1/ a2 8 a2 - 811 /8 a2 8 portcv - portcv_old 8/ 38nop /* if(age) L83 */ if(age) pcgoto pos_1 /8 if new >8 old, no rollover 8/ nop a2 8 a2 + 815 /8 else, yes rollover, add 16.0 to diff 8/ P°3-1= /* a1 is ccw 8/ a1 8 a1 - 812 /8 a1 8 portdv - portdv_old 8/ 38nop if(age) pcgoto pos_2 /8 new >8 old: no rollover, keep going 8/ nop a1 8 a1 + 815 /8 yes rollover,add 16.0 to the diff 8/ 117 pos_2: 38nOp a0 8 a1 - a2 156 176 186 815 817 818 156 166 811 812 8 126 136 156 812 116 126 136 146 posnet POSP posn a0 8 a0 + 815 a2 8 a2 + 817 a1 8 a1 + 818 portcv portdv a0 8 815 a1 8 816 th fact posnet a0 8 815 8 813 8 th thf omega eth call _hgo(120) nOp a0 166 176 186 if(alt) pcgoto _minus nop 813 sign_w one one_neg 816 8 a2 8 817 pcgoto _nextw nop /* a2 is cw ? 8/ /8 if (a1 - a2)>0 then speed is cw ? 8/ /8 a0 8 net position 8 portcv - portdv 8/ /8 a2 latency: L 8 2, ’mult’ input 8/ /* posnet +8 posnet_n6w 8/ /8 posp +8 rollover_processed_portcv 8/ /8 posn +8 rollov61_processed_portdv 8/ /8 book-keeping for the next interrupt 8/ /* portcv_old <- portcv 8/ /* portdv_old <- portdv 8/ /8 posnet: float -> rad 8/ /* 68pi/1024 */ /8 a0 has the th value */ /8 th -> hgo -> omega 8/ /8 eth 8 10.0 8/ /8 1206 8 .+4 8/ /8 to affect flags 8/ 118 _minus: 816 8 a2 8 818 _nextw: 116 8 omega /8 omega cleanup 8/ 126 8 omegaf 136 8 omegap 146 8 eomega call _hgo(120) nop /8 r2068.+4 8/ return(119) nop .rsect ".text" /8 prog continues at 8006ac, 187954 8/ I8 __________________ ___ 8 t 8 lowpass : Low Pass Filter: 2nd order, Butterworth 8 */ _lowpass 176 8 ill 186 8 112 116 8 ia 136 8 iaxl r46 8 iaf /8 same as ia12 8/ call _lpf(r20) r206 8. +4 116 8 ib r36 8 ibxi r46 8 ib_f call _lpf(120) r206 8. +4 176 8 v11 186 8 v12 116 8 vba 136 8 vbaxl 146 8 vbaf call _lpf(120) 119 1206 8 .+4 116 8 vca 136 8 vcaxi 146 8 vcaf call _lpf(r20) /8 uses same cut off freq as above 8/ 1206 8 .+4 return(r19) nop _lpf: /8 11dot formation 8/ a0 8 814 - 811 /8 x2 - u 8/ 28nop /8 a0 latency L82, 8 input 8/ a1 8 818 8 a0 /8 a12 8 ( 12 - u ) 8/ a2 8 a1 + 817 8 813 /8 11dot 8 a12(x2-u) + a11118/ a3 8 -818 8 813 /8 x2dot 8 -a12.11 8/ 126 8 t_inc /8 a2, a3 used as mult input 8/ 813 8 a2 8 813 + a2 8 812 /8 11811 + 11d . h 8/ 814 8 a3 8 814 + a3 8 812 /8 12812 + 12d . h 8/ return(r20) nop /8 _______ _ __-_ _ _ * measure currents 8 _ ___- */ _measure_i: 116 8 01200000 /8 channel a’s A/D 8/ a0 8 float(811) 136 8 offsetia 166 8 ia 146 8 slopeia 816 8 a1 8 813 + a0 8 814 116 8 01200004 /8 channel b’s A/D 8/ 126 8 ib 120 return (120) nop / ......................... * ******** a3 136 146 812 146 814 float(811) offsetib slopeib a2 8 813 + a3 8 814 i-c a3 8 -a2 - a1 /8 a1 latency L82, ’8’ input 8/ /* storing i_c */ 116 146 156 a1 a2 166 176 817 116 126 a0 a2 136 146 814 _______________________ 8! III abc -> dq frame of reference 8 t 10 8 iaf 8 in 8 1/sq1t(3) 8( iaf + 28ib_f ) 8 v0 8 1/3 8( -vbaf - vcaf ) 8 v0 8 1/sqrt(3) 8( vbaf - vcaf ) 8 ___________________________ 8/ iaf /8 i0 8 iaf 8/ ib-f /8 i0 8 1/sqrt(3) 8(iaf+28ib_f) 8/ two 814 8 815 /8 2ib_f 8/ a1 + 811 /8 iaf+2ib_f 8/ oneosqrt3 iQ /8 a2 mult input, L82 8/ a3 8 816 8 a2 /8 i0 8 1/sqrt(3)(iaf+2ib_f) 8/ /8 ----8/ vbaf /8 vD 8 1/38( -vbaf - vcaf) 8/ vcaf -811 - 812 /8 -vbaf - vcaf 8/ 811 - 812 /8 vbaf - vcaf 8/ one_third vD a1 8 a0 8 813 /8 a0 mult input, L82 8/ 121 ‘I' / ******* 156 8 v0 /8 v0 8 1/sq1t(3)8( vbaf -vcaf) 1"/ 815 8 a3 8 816 8 a2 /8 a2 mult input, L82 116 8 thhatf /8 sin(thhat) */ r26 8 in 812 a0 8 811 call _bigsin(118) 1186 8 .+4 116 8 outs r26 8 sinthhat 812 8 a0 8 811 116 8 thhatf /8 cos(thhat) 8 sin(thhat+pi/2) */ 126 8 in 136 8 pi_by_2 812 8 a0 8 811 + 813 /8 thhat + pi/2 8/ call -bigsin(r18) 1186 8 .+4 116 8 outs 166 8 costhhat 816 8 a0 8 811 D0 to dq fd 8 fD8cos(thhat) + fQ8sin(thhat) fq 8 -fD8sin(thhat) + fQ8cos(thhat) 116 8 v0 126 8 v0 136 8 vq 146 8 vd 156 8 sinthhat /8 166 8 costhhat /8 fd formation 122 8/ 8/ 8/ ******* a0 8 811 8 815 /8 fQ8sin(thhat) 8/ 814 8 a1 8 a0 + 812 8 816 /8 " + fD8cos(thhat) */ /8 fq formation 8/ a2 8 811 8 816 /8 f08cos(thhat) 8/ 813 8 a3 8 a2 - 812 8 815 /8 " - fD8sin(thhat) 8/ 116 8 i0 126 8 iaf /8 i0 8 iaf 8/ 136 8 iq 146 8 id /8 fd formation 8/ a0 8 811 8 815 /8 fQ8sin(thhat) 8/ 814 8 a1 8 a0 + 812 8 816 /8 " + fD8cos(thhat) 8/ /8 fq formation 8/ a2 8 811 8 816 /8 f08cos(thhat) 8/ 813 8 a3 8 a2 - 812 8 815 /8 " - fD8sin(thhat) 8/ return (119) nop /8 ___________________________ ___ __ _idp: 116 8 id /8 input 8/ 126 8 idf /8 state 1 */ 136 8 idp /8 derivative, 12 8/ 146 8 eid call _hgo(r20) 1206 8 .+4 _iqp: 116 8 iq r26 8 iqf 136 8 iqp 146 8 6iq call _hgo(r20) 1206 8 .+4 return (119) nop /8 _______________________________________________________ high gain observer *‘I‘I‘I 11dot 8 ud + [68(u - uh)] 123 ****§ 8 12dot 8 68[e8(u - uh)] 8 t It 8 usage: 116 8 u (input) 8 8 126 8 uh (11, the filtered output) 8 8 136 8 ud (12, the reqd derivative) 8 8 146 8 6 (gain: 1/6ps) 8 t t 1 call _hgo(r20) * 8 1206 8 .+4 8 e _________________________ e/ _hgo: a0 8 811 - 812 l8 u - 11 8/ 28nop /8 a0 mult input, L82 8/ a1 8 a0 8 814 /* 6(u - 11) 8/ a2 8 a1 + 813 /8 x2 + 6(u - 11) 8 11dot 8/ 15 8 t_inc /8 a1, a2 latency, L82, 8input 8/ a1 8 a1 8 814 /8 686(u - 11) 8 x2dot 8/ nop 812 8 a2 8 812 + a2 8 815 /8 uh 8 uh + 11dot 8 tine 8/ 813 8 a3 8 813 + a1 8 815 /8 ud 8 ud + x2dot 8 tinc 8/ return(r20) nop /8 ____________________________ _ __8 t * 8 ref: calculate iar, ibr, icr 8 8 __________________________________ 8/ _ref: 166 8 delomega 176 8 wr r36 8 omegahatf 816 8 a1 8 817 - 813 /8 delomega 8 wr - omega 8/ /* iqr8 PI of delomega */ 186 8 Kp /8 iqu 8 Kp8delomega 8/ 196 8 iq11 819 8 a2 8 a1 8 818 /8 a1 mult input L82 8/ 1106 8 Ki /* iqr2p 8 Ki 8 delomega 8/ 1116 8 iqr2p 8111 8 a3 8 8110 8 816 /8 816 L83, memory write-read 8/ 124 1126 8 iq12 /8 iqr2 8 iqr2 + iqr2p 8 t_inc 8/ 136 8 t_inc 8112 146 8 iq1 /8 iqr 8 iqu + iqr2 814 8 a1 8 + a0 + 819 nop /8 mult input lat 8 2 8/ 116 8 sign_w 814 8 a1 8 a1 8 811 28nop 156 8 point_five if (alt) pcgoto _iqrneg nop /8 ______ iqr > O: ensuring iqr never dips below +0.5 ______ 8/ 60 8 a1 - 815 38nop if(age) pcgoto _n61t /8 do nothing if >8 0.5 8/ 60 8 8112 + a3 8 813 /8 a3 mult ip, L82 8/ 8/ nop /8 else it could be 0.4 then put 0.5 8/ 814 8 a0 8 815 pcgoto _next nop _iqrneg: /8 if it is -O.4, then put -O.5, not now 8/ a0 8 a1 + 815 28nop r76 8 point_five_n6g if(ale) pcgoto _next nop 814 8 a0 8817 _next: 156 8 one /8 saturating the iqr 125 8/ 16 6 8 one_neg a0 8 814 - 815 /8 is iqr - 1.0 >8 0 8/ 38nop /8 is iqr >8 1.0 8/ if(age) pcgoto hi_q /8 if so, saturate it at 1.0 8/ nOp /8 6186, check for lower limit 8/ a1 8 816 - 814 /8 is -1.0 - iqr >8 O ? 8/ 38nop /8 -1.0 ?>= iqr, iqr ?<8 -1. 8/ if(age) pcgoto lo-q /8 if so, saturate it at -1.0 8/ nop /8 else, all clear, do next task 8/ pcgoto clear_q nap hi_q: 814 8 a0 8 815 /8 iqr 81, overwritten, if too big 8/ pcgoto clear_q /8 all clear, do next task 8/ nop lo_q: 814 8 a0 8 816 /8 iqr8-1, overwritten, if smaller 8/ clear_q: 1116 8 wr /8 thr 8 thr + wr 8 t_inc 8/ 1126 8 thr a3 8 8111 /8 a3 has wr 8/ 28nop /8 a3 mult ip L82 8/ 8112 8 a0 8 8112 + a3 8 813 38nop /8 112 lat: 3 8/ 116 8t /8 after pzone sec, thr <- thhatf 8/ r2e 8pzon6 /8 try reducing this time 8/ a0 8 811 - 812 38nop if (alt) pcgoto _sless nop 1126 8 thr 116 thhatf 8112 8 a0 8 811 1126 iq1m 126 116 8 iqr 8112 8 a0 8 811 _sless: 126 8 thr /8 116 8 in /8 811 8 so 8 812 /8 call _bigsin(118) 1186 8 .+4 /* r16 8 iar /8 r46 8 outs 156 8 iqrm /* 811 8 a1 8 -815 8 814 /8 166 8 thr /8 176 8 two_pi_by_3 116 8 in /8 811 8 60 8 816 - 817 /8 call _bigsin(118) ia8 8 -iq 8 sin(thhat) 8/ inport of sin(1) 8/ sin(thhat) 8/ out has result 8/ 8iq to get ia‘ 8/ iqr or iq1m8-1 8/ iar 8 -iq1m 8 sin(thr) 8/ ibr 8 -iq1 8 sin(th-28pi/3) 8/ argument of _bigsin() 8/ in 8 thr - 2pi/3 8/ 1186 8 .+4 116 8 outs /8 got the result 8/ 196 8 ibr 11068 iqrm /8 811 L83, memory write/read 8/ 819 8 a2 8 -8110 8 811 /8 ibr 8 a2 8 -iq1m 8 sin(thr-2pi/3) 8/ 116 8 iar /8 icr 8 -ia1 - ibr 8/ 136 8 icr 813 8 a2 8 -a2 - 811 return (119) nop /8 ........................................................... hysteresis current controller 8 ________________________ 8/ _hysteresis: cont1: cont2: cont3: 156 8 hyst 166 8 iar a1 8 815 a0 8 816 136 8 is a2 8 a0 + a1 a3 8 a0 - a1 60 8 813 a1 8 -a0 + a2 38nop if(age) pcgoto cont2 nop out 8 out & 0141 al 8 a3 - a0 /* 38nop /8 if(alt) pcgoto cont3 nop /8 /8 out 8 out I 0130 /8 a1 8 815 146 8 ibr a0 8 814 a2 8 a0 + a1 8/ /8 phase a /8 a1 8 hyst 8/ /8 a0 8 ia_tilde 8/ /8 a2 has ceiling 8 ia_tilde + hyst 8/ /8 a3 has floor 8 ia_tilde - hyst 8/ /8 a0 has ia 8/ /8 is -ia + ceiling >8 O ? 8/ /8 i6 is ceiling >8 ia ? 8/ /8 if yes, do nothing 8/ /8 /8 else, ia too bigzopen top switch: 0 /8 t close bottom sw.: 0: force 0: t O ..01 00 11 11 ; h 1 8> b c unchanged8/ 8/ 8/ 8/ 8/ a1 8 floor - ia <0; alt8less than 0 is floor < ia, if so, ia > floor /8 do nothing 8/ else, ia too low: close top switch: 18/ 1 open bottom switch: send 1:force 1:|8/ ..OO 11 OO 00 ; I 0 8> b c unchang6d8/ /8 phase b 8/ /8 15 still points to location hyst 8/ /8 a1 8 hyst */ /8 14 points to the reqd ib~ 8/ /* a0 = ib_tilde */ /8 a1 ’mult’ ip, needs L82 8/ /8 a2 has ceiling 8 ib_tilde +hyst 8/ 128 cont4: cont5: cont6: cont7: a3 8 a0 - a1 /8 a3 has floor 8 ib-tilde -hyst 8/ r36 8 ib 60 8 813 /8 a0 has ib 8/ a1 8 -a0 + a2 /8 a2 L 8 2 8/ 38nop if(age) pcgoto cont5 /8 if ib <8 ceiling, do nothing 8/ nop out 8 out & 0173 /8 01 11 00 11; t 1 8> a c unchanged 8/ a1 8 a3 - a0 /8 al 8 floor - ib; alt8less than 0 8/ 38nop if(alt) pcgoto cont6 /8 if ib > floor, do nothing 8/ nop out 8 out I 010c /8 00 00 11 00; I 0 8> a c unchang6d8/ /8 15 still points to location hyst 8/ a1 8 815 /8 a1 8 hyst 8/ 136 8 icr /8 phase c 8/ a0 8 813 /8 a0 8 icr ictilde 8/ /8 because a1 needs L82, ’mult’ ip 8/ a2 8 60 + a1 /8 a2 has ceiling 8 icr + hyst 8/ a3 8 a0 - a1 /8 a3 has floor 8 icr - hyst 8/ 146 8 i_c /8 ic: reserved name, so ic 8/ a0 8 814 /8 a0 has i_c 8/ a1 8 860 + a2 38nop if(age) pcgoto cont8 /8 if ic <8 ceiling, do nothing 8/ nop out 8 out & 017C /8 01 11 11 00; t 1 8> a b unchanged 8/ 129 r: v q ‘9. cont8: a1 8 a3 - a0 /8 a1 8 floor - i_c; alt8less than 0 8/ 38nop /8 a0 safest X field8/ if(alt) pcgoto cont9 /8 if i_c > floor, do nothing 8/ nop out 8 out I 0103 /8 ... 00 00 11: I 0 => a b unchang6d8/ /8 write out the corresponding word 8/ cont9: 136 8 PortA /8writing the 6 bits out8/ 813 8 out return (119) nop /8 ________________________ bigsin(1) ________ r18 __ * 8 the subroutine to compute the sin of any number t 8 usage: the variable in has the argument 8 the variable outs has the result * sinA: float 0.26019030366-5, -0.1980741826-3 float 0.83330251396-2, -0.166665668 in: float 0.0 outs: float 0.0 neg: int 0 n: int 0 nn: int 0 abc: int 4 /8__ ________ _ 8 II t 8 absolute value function simulation 8 III 8! 8 find if 1 < 0, if so set a variable 8 8 sign to be negative; take absolute value 8 8 of 1, proceed with the algorithm, and at 8 8 the end, negate the result because sin(-1)8-sin(1) 8 8 ________ 8/ 130 ****** 'I' _bigsin: pos: hoo: 116 8 in a0 8 811 /8 flags affected 8/ 116 8 neg /8 new portion: 1 o/s range 8/ 28nop /8 new, L83 8/ if(age) pcgoto pos nop a0 8 -a0 /8if r2 8 1 811 8 r2 pcgoto hoo nop r2 8 0 811 8 r2 dauc 8 0110 116 8 n 126 8 one_over_2_pi a0 8 812 a2 8 int(a1) a1 811 136 8 two_pi 28nop a2 8 float(811) 28nop a0 8 a0 - a2 8 813 136 8 nn 146 8 on6-over_pi_by_2 a0 8 814 a2 8 int(al) a1 813 38nop 14 8 813 quad_1: 15 8 0 1<0, negate it8/ /8 truncation i/o rounding 8/ /8 n81/360:g6t no. of cycles 8/ /8 ceiling or floor: rounding 8/ /8 latency83 for memory write 8/ /8 latency82 for acc mult ip 8/ /8 1 8 1 - n8360 8/ /8 a0 L82 mult input 8/ /8 quadrant no: 1/90 8/ /8 rounding 8/ /8 813 L83 mem write/read 8/ 131 15 - 14 if(ne) pcgoto quad_4 nop call _sin(120) 1206 8 .+4 pcgoto minus nap quad_4: 15 8 3 15 - r4 if(ne) pcgoto quad_23 nop r36 8 two_pi a0 8 a0 - 813 call _sin(120) r206 8.84 pcgoto minus nop quad_23: 136 8 pi a0 8 a0 - 813 call _sin(r20) 1206 8 .+4 a0 8 -a0 minus: 116 8 neg r2 8 1 13 8 811 28nop 12 - 13 if(ne) pcgoto quad_5 nop a0 8 -aO /8 because of truncation: floor() 8/ /8x81-360 use the alg directly8/ /8n6gat6 the result 8/ /8if 1<0, negate the result 8/ 132 quad_5: 116 8 outs 811 8 a0 8 a0 return (118) nop /8 ........ sin: r26 8 _sinA a2 8 a0 8 a0 28nop a3 8 a2 8 a0 a2 8 8r2++ + a28 8r2++ a1 8 812++ + a28 812++ a3 8 a3 8 a0 a2 8 a2 8 a3 a1 8 a0 + a1 8 a3 28nop a0 8 a1 + a2 8 a3 nop return (120) nop /8 ........ ......... 8/ _measure_v 2 116 126 a0 136 146 812 116 126 a1 8 VADCO 8 vba float(811) 8 offsetvo 8 slopev0 8 a1 8 813 + a0 8 814 8 VADCI 8 vca 8 float(811) 133 136 8 offsetvl 146 8 slopev1 812 a1 8 813 8 a1 8 814 return(r20) nop /8 _________________ inverse of a no.: a081/a0 ___________________ 8/ inv: a2 8 seed(a0) 1146 8 inv_A nop 60 8 811488 - a0 8 a2 a1 8 a2 8 811488 a2 8 811488 - a0 8 a2 a0 8 811488 + a0 8 a0 a1 8 a0 8 a1 a2 8 a2 8 a1 nop a0 8 a2 + a0 8 a1 return(118) nop inv_A: float 1.4074074347, 0.81 float 2.27424702, -0.263374728 /8 ______________________ _ __________ 8 It It 8 estimator: speed/position 8 8 It 8 iqpm8(vq-10.86-38omegahatf8id-RC8iq-0.05728omegahatf)/10.86-3 8 8 idpm8(vd+10.86-38omegahatf8iq-RC8id)/10.8683 8 8 deliqp8iqp-iqpm 8 8 delidp8idp-idpm 8 8 omegahat-omegahatf-O.18888delpiq 8 it It 8 if omegahat>80.2, omegahatfsw8omegahatf 8 8 else omegahatfsw80.5 8 8 end 8 It It 8 thhat 8thhatf80.18888d61pid/om6gahatfsw 8 *_ __ ___ */ 134 _estimator: /8 116 8 omegahat /8 estimate from last iteration 8/ 126 8 omegahatf /8 not overwritten since then 8/ 136 8 omegahatp 146 8 eomegahat call _hgo(r20) 1206 8 .84 116 8 thhat r26 thhatf 136 8 thhatp 146 8 ethhat call _hgo(r20) 1206 8 .84 =_ 8/ /8 iqpm8([vq-Rhat8iq1-[K68L8id]8omegahatf)/L 8/ 116 8 K6 126 8 L 136 8 id a0 8 811 /8 a0 8 K6 8/ 60 8 a0 + 812 8 813 /8 a0 8 K6 8 L id 8/ 146 8 vq 156 8 Rhat 166 8 iq a1 8 814 /8 a1 8 vq 8/ a1 8 a1 - 815 8 816 /8 a1 8 vq - Rhat 8 iq 8/ 176 8 omegahatf /8 to ensure iqp 8 iqpm 8/ a0 8 a1 - a0 8 817 /8 a0 8 [vq-Rhat8qu-[K68Lid]8omegahatf 8/ 186 8 oneoL 196 8 iqpm /8 a0 L 8 2 8/ 819 8 a0 8 a0 8 818 /8 iqpm8([vq-Rhat8iq1-[K68Lid]8omegahatf)/L 8/ 135 r46 8 iqp a0 8 -a0 8 814 /8 deliqp 8 iqp - iqpm 8/ /8 no need of saving deliqp 8/ /8 a0 8 deliqp 8 0, if iqp 8 iqpm 8/ /8 omegahat 8 omegahatf - deliqp 8 (L/Ke) 8/ 176 8 omegahatf 116 8 omegahat /8 if dont put r768, subtract from omegaf! 8/ r46 8 LoKe /8 L over K6 8/ 811 8 60 8 817 - 60 8 814 /8 a0 L 8 2 8/ 116 point_two a1 8 a0 - 811 116 8 omegahatfsw 146 8 point_five nop if(age) pcgoto actual nop 811 8 a0 8 814 pcgoto go_on2 nop actual: 811 8 a0 8 a0 go_on2: call _inv(r18) 11868.84 116 8 omegahatfsw_inv 811 8 a0 8 a0 /8 omegahatfsw 8/ /8 is omegahat - 0.2 >8 0 ? 8/ /8 is omeghahat >8 0.2 ? 8/ /8 if so, use it else, use 0.5 8/ /8 omegahatfsw 8 0.5 8/ /8 ensure enough nops before _inv 8/ /8 60 8 1/60 8/ /8 argument, result 8 a0 8/ /8 a0 to be preserved for use 1.0. 8/ /8 _____ id, idp, idpm _____________________ 8/ /8 idpm8(vd8L8omegahatf8iq-Rhat8id)/L 8/ a1 8 812 8 817 116 8 vd nop /8 a1 8 L8omegahatf 8/ 136 a1 8 a1 8 816 a1 8 a1 - 815 8 813 a1 8 a1 8 811 116 8 idpm 156 8 idp 811 8 a1 8 a1 8 818 a1 8 -a1 8 815 116 8 thhat 126 8 thhatf a1 8 a1 8 a0 nop r46 LoKe /8 /* /8 /8 /8 /8 a1 8 L8omegahtf8iq 8/ a1 8 L8omegahatf8iq - Rhat8id 8/ a2 8 vd+L8omegahatf8iq-Rhat8id 8/ a1 8 idpm 8 " 8 1/L 8/ a1 8 d61_idp 8 idp - idpm 8/ 14 points to LoKe 8/ a1 8 d61_idp / omegahatfsw 8/ /8 thhat-thhatf8(d61_idp/omegahatfsw)8L/Ke 8/ 811 8 61 8 812 + 61 8 814 return (119) nop 137 BIBLIOGRAPHY 138 BIBLIOGRAPHY [1] P. P. Acarnley, R. J. Hill, and C. W. H00per. Detection of rotor position in stepping and switched reluctance motors by monitoring of current waveform. IEEE Transactions on Industrial Electronics, 32:215-222, 1985. [2] M. S. Arefeen, M. Ehsani, and T. A. Lipo. Sensorless position measurement in syn- chronous reluctance motor. IEEE Transactions on Power Electronics, 9:624—630, 1994. [3] J. P. M. Bahlmann. A full-wave motor drive IC based on the back EMF sensing principle. IEEE Transactions on Consumer Electronics, 35:415—420, 1989. [4] K. J. Binns, K. M. Al-Aubidy, and D. W. Simmin. Implicit rotor position sensing using search coils for self-commutating permanent magnet motors. Proc. Inst. Elect. Eng., pt. 3., 137:253—258, 1990. [5] A. Consoli, S. Musumeci, A Raciti, and A. Testa. Sensorless vector control of brushless motor drives. IEEE Transactions on Industrial Electronics, 41:91-95, 1994. [6] A. Dabroom. Output feedback sampled-data control of nonlinear systems using high- gain observers. Ph.D. Dissertation, Michigan State University, 20—22, 2000. [7] R. Dhaouadi, N. Mohan, and L. Norumu. Design and implementation of an extended Kalman filter for the state estimation of a permanent magnet synchronous motor. IEEE Transactions on Power Electronics, 6:491—497, 1991. [8] M. Ehsani and I. Husain. Rotor sensing in switched reluctance motor drives by mea- suring mutually induced voltages. IEEE Industry Applications Society Annual Meeting Conf. Rec, Houston, TX, pages 422—429, 1992. [9] F. Esfandiari and H. K. Khalil. Output feedback stabilization of fully linearizable systems. International Journal of Control, 56:1007—1037, 1992. [10] C. French and P. Acarnley. Control of permanent magnet motor drives using a new position estimation technique. IEEE Transactions on Industry Applications, 32:1089- 1097, 1996. 139 [11] T. Furuhashi, S. Sangwongwanich, and S. Okuma. A position-and—velocity sensor— less control for brushless DC motors using an adaptive sliding mode observer. IEEE Transactions on Industry Applications, 28:89—95, 1992. [12] D. C. Hanselman. Resolver signal requirements for high accuracy resolver-to-digital conversion. IEEE Transactions on Industrial Electronics, 37:556-561, 1990. [13] W. D. Harris and J. H. Lang. A simple motion estimator for variable reluctance motors. IEEE Transactions on Industry Applications, 26:237—243, 1990. [14] J. Holtz. Pulsewidth Modulation for Electronic Power Conversion. Proceedings of the IEEE, 82:1194-1214, 1994. [15] Jun Hu and Bin Wu. New integration algorithms for estimating motor flux over a wide speed range. IEEE Transactions on Power Electronics, 13:969—977, 1998. [16] K. Iizuka, H. Uzuhashi, M. Kano, T. Endo, and K. Mohri. Microcomputer control for sensorless brushless motor. IEEE Transactions on Industry Applications, 21:595-601, 1985. [17] A. Isidori. Nonlinear Control Systems. Springer-Verlag, 1995. [18] H. K. Khalil, E. G. Strangas and J .M. Miller. A torque controller for induction motors without rotor position sensors. ICEM 96', Vigo, Spain, September 1996. [19] H. K. Khalil. Nonlinear Systems. Prentice Hall, 1996. [20] H. K. Khalil. High-gain observers in nonlinear feedback control. New Directions in Nonlinear Observer Design: Lecture Notes in Control and Information Sciences, H. Nijmeijer and T.I. Fossen, editors, 244:249—268, 1999. [21] J. S. Kim and S. Sul. High peformance PMSM drives without rotational position sensors using reduced order observer. IEEE IAS Conf. Rea, pages 75—82, 1995. [22] P. C. Krause, O Wasynczuk, S. D. Sudhoff. Analysis of Electric Machinery. IEEE Press, 1995. [23] A. B. Kulkarni and M. Ehsani. A novel position sensor elimination technique for the interior permanent magnet synchronous motor drive. IEEE Transactions on Industry Applications, 28:144—150, 1992. [24] W. Leonhard. Control of Electrical Drives. Springer, 1996. [25] N. Matsui and M. Shigyo. Brushless DC motor control without position and speed sensors. IEEE Transactions on Industry Applications, 28:120-127, 1992. 140 [26] [27] [28] [29] [30] [31] [32] [33] T. J. Miller Brushless Permanent-Magnet and Reluctance Motor Drives. Oxford Uni- versity Press, 1989. M. Naidu and B. K. Bose. Rotor position estimation scheme of a permanent mag- net synchronous machine for high performance variable speed drive. IEEE Industry Applications Society Annual Meeting Conference Record, Houston, TX, 28:48-53, 1992. S. Ogasawara and H. Akagi. An approach to position sensorless drive for brushless DC motors. IEEE Transactions on Industry Applications, 27:928—933, 1991. P. Pillay and Krihsnan R. Modeling, simulation, and analysis of permanent magnet motor drives, Part I: The permanent magnet synchronous motor drive. IEEE Trans- actions on Industry Applications, 25:265—273, 1989. Powerex. IGBTMOD and Intellimod - Intellgent Power Modules: Applications and Technical Data Book. Powerex, Inc., 1994. P. Vas. Electrical machines and drives: a space-vector theory approach. Oxford Uni- versity Press, 1993. P. Vas. Sensorless vector and direct torque control. Oxford University Press, 1998. R. Wu and G. R. Slemon. A permanent magnet motor drive without a shaft sensor. IEEE Transactions on Industry Applications, 27:1005—1011, 1991. 141