IEEE TRANSACTIONS ON POWER ELECTRONICS, VOL. 12, NO. 3, MAY 1997 495 Modeling and Simulation of Induction Machine Vector Control with Rotor Resistance Identification Scott Wade, Matthew W. Dunnigan, and Barry W. Williams Abstract— This paper shows that it is possible to use currently available commercial software to model and simulate a vector-controlled induction machine system. The components of a typical vector control system are introduced and methods given for incorporating these in the MATLAB/SIMULINK software package. The identification of rotor resistance is important in vector control, if high-performance torque control is needed, and modeling of the extended Kalman filter (EKF) algorithm for parameter identification is discussed. It is certainly advisable, when feasible, to precede implementation of new algorithms, whether for control or identification purposes, with an extensive simulation phase. Additionally, a technique for generating pulsewidth modulation (PWM) phase commands to extend machine operation to higher speeds before field weakening occurs is simulated in a vector-controlled induction machine, driven by a PWM inverter. This demonstrates the versatility of the vectorcontrolled induction machine system model. Index Terms— Induction machines, modeling, parameter estimation, simulation, vector control. NOMENCLATURE - and -axis stator and rotor currents in the stationary reference frame, A. synchronous frame - and -axis stator currents, A. Synchronous frame - and -axis stator reference currents, A. Stationary frame - and -axis stator voltages, V. Synchronous frame - and -axis stator voltages, V. Electrical developed torque, Nm. Stator and rotor leakage inductances, H. Stator, magnetizing and rotor inductances, H. Stator and rotor referred resistance, . Sampling interval, . synchronous speed, rotor speed, and slip speed, rad s . State-space system state, input and output vectors. Laplace operator, differential . Manuscript received March 25, 1996; revised August 16, 1996. The authors are with the Department of Computing and Electrical Engineering, Heriot-Watt University, Riccarton, Edinburgh, U.K. EH14 4AS. Publisher Item Identifier S 0885-8993(97)03288-2. I. INTRODUCTION The method of vector control allows high-performance control of torque, speed, or position to be achieved from an induction machine [1]. This method can provide at least the same performance from an inverter-driven induction machine as is obtainable from a separately excited dc machine. Vector control provides decoupled control of the rotor flux magnitude and the torque-producing current, with a fast, near-step change in torque achievable. The fast torque response is achieved by estimating, measuring, or calculating the magnitude and position of the rotor flux in the machine. In the indirect method of vector control presented here, the calculation of the rotor flux position is dependent on the rotor resistance value. A parameter identification algorithm, such as the extended Kalman filter (EKF) [2], can be used for the estimation of rotor resistance. The evaluation of a vector-controlled induction machine system can be performed in two ways. The first approach uses a real machine with an appropriate vector controller and a current-regulated pulse width modulation (PWM) inverter. The vector controller is usually implemented on a microprocessor or microcontroller and the algorithm coded in assembler or “C” if a compiler is available. A digital signal processor (DSP) is required if rotor resistance estimation is also to be implemented. The second approach uses a simulation of the system. It is therefore necessary to be able to model the components of the system. Advantages of the first approach are that it naturally includes factors such as the actual noise present, the PWM waveform and nonlinear device, and sensor characteristics that are difficult or impossible to include in a simulation. Advantages of using a simulation environment are that all quantities can be readily observed and parameters altered to investigate their effect and to help debug estimation and control routines. Sensor noise can be added to simulate the performance of real sensors in addition to testing the ability of parameter identification techniques to cope with noisy measurements. Process noise can be added to include model imperfections in the machine model. If tests on more powerful or higher rated speed machines are required, this can be readily implemented by changing only the parameters of the machine model. The ability to run the simulation slowly also aids diagnostics. Disadvantages of the practical approach are that it is difficult to observe and change the electrical parameters of the machine while it is running—necessary to fully test the performance of the identification algorithm. Having a fixed motor size, type, 0885–8993/97$10.00 1997 IEEE 496 IEEE TRANSACTIONS ON POWER ELECTRONICS, VOL. 12, NO. 3, MAY 1997 Fig. 1. Vector-controlled induction machine system. and power supply is also a limitation. Disadvantages of the simulation approach are that it is slow in comparison to the hardware approach. If perfect sensors are simulated, with no sensor noise, results can be misleading. Using these perfect “measurements” in a parameter identification algorithm would give better results than if the algorithm had been used on a real machine. This paper will demonstrate that it is feasible to model and simulate a vector-controlled induction machine system, including parameter identification, with a commercially available software package, MATLAB/SIMULINK,1 that can be used for modeling and simulation of dynamic systems. It is also shown that new techniques for improvements in vector control can be readily investigated and incorporated in this simulation environment. II. SYSTEM MODELING In the past, researchers have developed their own software packages for the modeling and simulation of vectorcontrolled induction machines [3]–[5]. In [3], a software package was developed, using the FORTRAN programming language, for the steady-state and dynamic simulation of induction motor drives. Digital simulation of field-oriented control of an induction motor, again implemented in FORTRAN, is described in [4]. Both of these approaches required the development of numerical integration routines for the solution of the resultant state-space equations that describe the systems. A general-purpose program, the electromagnetic transients program (EMTP), is described in [5] for the digital simulation of field-oriented control of induction motor drives. This program has the facility to extend simulation to other machine types. It will be demonstrated that it is now unnecessary to develop user-written software for this purpose, and a proprietary software package such as MATLAB/SIMULINK, licensed by Mathworks, is better suited to this task. MATLAB provides a powerful matrix environment, the basis of state-space 1 MATLAB and SIMULINK are trademarks of The MathWorks, Inc. modeling of dynamic systems, for system design, modeling, and algorithm development. SIMULINK is an extension to MATLAB and allows graphical block diagram modeling and simulation of dynamic systems. It is easier to develop a vector-controlled induction machine system simulation using this package, as many components of the system are already included in the SIMULINK block diagram library. Some component examples are a transfer function block, general function block, summing junction block, and saturation block. This makes simulation design more efficient and allows other interested parties to understand the operation of the system more easily than a programming-language implementation. It is easy to capture, store, process, and display results using the predefined functions for these purposes. Integration algorithms included with the software are accurate and efficient, removing the need to write these. The disadvantage of using a proprietary simulation platform is the execution speed, although there are C compilers available for MATLAB files and SIMULINK system block diagrams that can help alleviate this problem [6], [7]. It is also possible to build stand-alone applications using the MATLAB C Math Library [8] together with MATLAB and the MATLAB compiler. This application can then be run on a DSP platform, with an appropriate C compiler, for real-time control purposes. This greatly reduces development time and increases algorithm reliability. As in all system design activity, it is useful to split the system into smaller functional blocks and design and test each individually. The vector-controlled induction machine system with parameter identification was split into several smaller parts for the purpose of modeling (Fig. 1). These consist of the induction machine electrical and mechanical models, the vector controller, and the parameter identification algorithm. PWM was also included at a later stage. A. Induction Machine Electrical Model The continuous-time electromechanical model of an induction machine is fifth order and nonlinear [9], with possible states (the choice of states for a state-space model is not WADE et al.: MODELING AND SIMULATION OF INDUCTION MACHINE VECTOR CONTROL unique) being the stator current phasor, rotor current phasor, and rotor speed. This represents the induction machine without core losses and neglects magnetic saturation and hysteresis, which can be incorporated at the expense of slower simulation. This can be expressed either in the stationary two-axis ( – ) or synchronous two-axis ( – ) frame. The stationary two-axis ( – ) frame model is [10], as shown in (1)–(5) at the bottom of the page, where . It is possible to use either a block diagram representation of the machine, constructed from component blocks available in the SIMULINK block diagram library, or enter the differential equations directly into an -function-type of -file. A discrete-time system can be entered as a set of difference equations into an -function-type of -file. An -file is a MATLAB program that allows algorithms or equations to be entered in a programming language that is similar to C or Pascal. An -function block, from the SIMULINK nonlinear block diagram library, links this file into a graphical block for use within the overall vector control system block diagram. This allows the flexibility of a mixed block diagram and differential equation “programmed” system to be entered. The graphical block diagram method of entering system descriptions can be inefficient if the number of system states is greater than two. Therefore, due to the induction machine electrical model having four states, the -file form of entry was chosen, using the continuous-time description of the machine, as shown in (1)–(5). The induction machine function -file is given in Appendix II, with the parameters of the machine given in Appendix I. The -function provides the derivatives of all the states in that model, based on the current time, its input, and its states. The derivative vector is returned to the MATLAB integration routine, which uses it to calculate a new state vector. The -function is provided to give SIMULINK the ability to make generic simulation blocks to handle continuous simulation, discrete simulation, and mixed discrete-continuous simulation. For the machine model created, the inputs chosen were the stator voltages, rotor speed, and rotor resistance. The states chosen were the stator currents and rotor currents using the – (twin) axis model in the stationary reference frame. This gives the four electrical states. The outputs chosen were the stator and rotor currents and the electrical developed torque. In a practical machine, the rotor currents are not directly measurable and require a state observer to estimate them. 497 (a) (b) Fig. 2. SIMULINK block diagram of the induction machine mechanical model. B. Induction Machine Mechanical Model The mechanical model was created separately from the electrical model of the induction machine, and the equations are (6) (7) where shaft and load inertia; maximum rated torque; maximum rated speed. The load represents an inertia with viscous friction. Due to the simple nature of the mechanical model, it was entered using SIMULINK blocks for integration and multiplication [Fig. 2(a)]. This was then grouped into one block to make the overall simulation model appear simpler [Fig. 2(b)]. C. Vector-Controller Modeling The indirect method of vector control was simulated to investigate the effects of rotor resistance detuning on the induction machine’s torque response. This method also allows the performance of rotor resistance estimation schemes to be (1) (2) (3) (4) (5) 498 IEEE TRANSACTIONS ON POWER ELECTRONICS, VOL. 12, NO. 3, MAY 1997 Fig. 3. Vector-controlled induction machine SIMULINK block diagram and scope traces. evaluated. To implement indirect vector control, measurements required are the induction machine stator currents, as well as the rotor speed or position. These are obtained directly from the induction machine model. A rotor slip calculation is used to find the slip speed that is integrated to give the slip position. Adding this to the rotor position measurement gives the rotor flux position and, hence, the unit vectors required to transform between the stationary frame and rotating frame quantities. The differential equations that describe the calculation of the slip position are [9] to the rotor angle (10) The flux position, given by , is then used to calculate the quadrature unit vectors and . The stator currents are transformed from the stationary to synchronous reference frame by the following equations: (8) (9) (11) The actual position of the rotor flux is found by integrating the calculated slip speed and adding the resultant slip angle The errors in stator currents in the rotating reference frame were used to calculate the stator voltages using continuous- WADE et al.: MODELING AND SIMULATION OF INDUCTION MACHINE VECTOR CONTROL 499 time proportional-integral (PI) controllers (12) where integral gain and proportional gain. The stator voltages are transformed from the synchronous to stationary frame by the following equations: (13) An -function -file was written to implement vector control in continuous time using (8)–(13) and then placed in a SIMULINK -function block. The vector-controller function -file is given in Appendix III. This vector control block has stator currents, rotor speed, torque demand, flux demand, and rotor resistance estimate as inputs. The outputs are the stator voltages used to drive the machine and also the vector controller’s estimates of the rotor flux linkage and rotating frame stator currents. At this stage, it was possible to simulate the induction machine being driven by the vector controller. The complete SIMULINK block diagram is shown in Fig. 3. Torque and flux commands, actual rotor resistance of the machine, and the rotor resistance estimate as used by the vector controller can be time-varying. They were, therefore, entered in matrices in an initialization -file that was run before the simulation commenced. The matrices are then used in SIMULINK “from workspace” blocks, which interpolate the time and input values contained in the matrices. It was found that to maintain simulation accuracy, a maximum integration step time of 100 s was required when using the Runge–Kutta integration routine. Larger step times could be used if there are no step changes in the flux or torque demands. Simulation results are shown in Figs. 3 and 4 for a constant torque command to the vector controller and a high initial flux-producing current command for 0.04 s followed by a smaller flux producing current command to maintain a constant flux level. This produces the torque curve as shown, with an initial torque ramp while the flux is increasing, then a constant level when the rotor flux and torque-producing current are constant. The four traces shown in Fig. 3 are produced by using the SIMULINK scope blocks and allow these quantities, and to be observed while the simulation is running. Fig. 4 is produced by using the MATLAB plot command once the simulation has terminated. D. PWM Generation To verify that using a PWM supply would give similar results to the linear supply produced by the vector controller, a PWM block was created to generate a PWM switching waveform from any input waveform. This uses the usual triangular waveform and comparator method to calculate the switching points. This was coded in an -function -file (which, this time, had no states), given in Appendix IV, and Fig. 4. Stator current, torque, and rotor speed. Simulation results for a linear supply. Simulation: 20-min CPU time (486dx2-66). was masked to produce a custom block with user-definable parameters for switching frequency, output voltage, and input voltage for 100% duty cycle. Although minimum on-time, offtime, and pulse deletion were not included in this simulation, MATLAB/SIMULINK can be used to include these PWM features, at the expense of increased simulation time. The system was simulated with the PWM generators inserted between the vector controller’s outputs and the machine’s stator voltage inputs. A 5-kHz PWM switching rate was used with a peak output of 500 V. Due to the fast switching nature of the PWM signal, the maximum integration step time had to be reduced from 100 to 2 s to maintain simulation accuracy. The results are shown in Fig. 5. These are similar to the results shown in Fig. 4, where the simulation was executed under the same conditions, but using linear (sine-wave) drive voltages instead of PWM voltages. (The drive voltages of the voltage source current-regulated vectorcontrolled machines are only sinusoidal under steady-state conditions.) The similarity of these sets of results suggest that it is not necessary to include PWM in the simulation. III. ROTOR RESISTANCE IDENTIFICATION The identification of the rotor resistance parameter was implemented separately from the rest of the system because simulation of the entire system is very slow. It is not necessary to have new simulation data every time a modified identification algorithm is to be tested. The decoupling of the parameter identifier from the vector-controller simulation has the disadvantage of not being able to feedback the parameter estimates into the vector controller. The parameter identification algorithms used in the identification of the rotor resistance divide into stochastic and deterministic types. The EKF [11], [12], taking into account process and measurement noise, is in the former class, and the extended Luenberger observer (ELO) [13], [14] belongs to the latter class. The modeling of the EKF in MATLAB is described here. 500 IEEE TRANSACTIONS ON POWER ELECTRONICS, VOL. 12, NO. 3, MAY 1997 The EKF equations are (18) (19) (20) Evaluating the partial differential of gives (21), shown at the bottom of the page, for the stationary frame induction machine model Fig. 5. Stator current, torque, and rotor speed. Simulation results for PWM supply. Simulation: 10-h CPU time (486dx2-66). The standard KF [15] is a recursive state estimator capable of use on a multi-input/output system with noisy measurement data and process noise (stochastic plant models). It uses the plant’s inputs and output measurements, together with a statespace model of the system, to give optimal estimates of the system states. In this standard form, it can only estimate the stator – and rotor – currents. To estimate the rotor resistance, this time-varying parameter is treated as a state, and a nonlinear model is formed with the states consisting of the parameter to be estimated and the original states. This new model is nonlinear due to the multiplication of the parameter (now a state) with the other states and is linearized about the operating point, resulting in a linear perturbation model. The new state-space model is written as (14) (15) is the where is the combined state and parameter matrix, nonlinear state function, is the process noise, and is the measurement noise. The output matrix of (15) is (22) is the state estimate error covariance matrix, is the error covariance of the initial state estimate , is the Kalman gain matrix, is the process noise covariance matrix, and is the sensor noise covariance matrix. The process noise and sensor noise are assumed statistically independent. The basis of the EKF algorithm is (18)–(20). The matrices in these equations have been stated in (16) and (21) and the constants defined in (22). The initial value of the matrix and the and matrices were where (16) To use a nonlinear model with the standard KF, the model must be linearized about the current operating point, giving a linear perturbation model (23) (17) (24) (21) WADE et al.: MODELING AND SIMULATION OF INDUCTION MACHINE VECTOR CONTROL Fig. 6. EKF estimate of rotor resistance. Simulation: 10-min CPU time (486dx2-66). These equations were coded in an -file, given in Appendix V, this time being written in a similar way to a C or Pascal program rather than in the -function format. Fig. 6 shows the results for the EKF. In this case, the EKF algorithm operated at a sample rate of 10 kHz, the same as the system simulation, but it is possible to use lower sample rates. The rotor resistance was stepped from 1 to 1.5 , thereby simulating a change in rotor resistance due to a temperature change. The flux and torque commands were both set at 9 A, their rated values, and the rotor speed was held constant at 100 rad s . Although convergence is fast, there is a steady-state error in the rotor resistance estimate. The authors have discussed this effect in [16] and developed techniques to reduce the bias. Although the above estimation was carried out on simulation data without any noise added, it is possible to add any amount of noise to the measurements (sensor noise) without having to rerun the simulation, only the estimation. IV. FIELD WEAKENING AND PWM TRIPLEN HARMONIC “INJECTION” One advantage of using vector control on an induction machine is the possibility of operation at speeds above the base speed—in the field-weakening region. This is possible by driving the machine at full volts, but with a frequency above the machine’s rated supply frequency, or in the case of a vector-controlled machine, by reducing the flux command reference. This results in a weaker field in the machine due to the lack of volts available from the inverter. If the frequency applied to the motor is increased, an increase in voltage is required to overcome the drop across the machine inductances. With a voltage source inverter, the dc-link voltage is often derived by rectifying the three-phase mains supply. This gives a dc rail voltage of , where is the mains line voltage. Applying sinusoidal voltage commands to the PWM generator gives an output phase voltage swing of or . Direct connection an output line voltage swing of to the mains would give an output line voltage swing of , which means the inverter-driven machine only sees 501 Fig. 7. Voltage command with and without extended saturation operation in steady state. (or approximately 86.6%) of the voltage available to a machine connected directly to the mains. This results in field weakening occurring at approximately 86.6% of the rated speed. One solution to this problem is to increase the dc-link voltage above the value obtainable by directly rectifying the three-phase mains. This requires a switch-mode supply or another three-phase bridge with line reactors on the input. A disadvantage of this increased dc-link voltage is the increased risk of insulation breakdown in the motor. A motor connected directly to the mains experiences a peak voltage of across its windings. A motor driven by a switching supply, with a dc link obtained by directly rectifying the mains, sees a peak voltage of regardless of what effective voltage the motor is being supplied with. A motor driven by a switching supply with a dc-link voltage higher than this value will have a higher peak winding voltage than the rated value, resulting in the increased risk of insulation breakdown. Injection of triplen-series harmonics into the inverter phase voltages has been used in the past to extend the effective sine-wave voltage seen by voltage-fed machines [17]. A new technique developed for a vector-controlled synchronous reluctance motor [18] has been tested in the simulated vectorcontrolled induction machine system. This method utilizes the fact that when one phase of the motor is at the peak voltage, then neither of the other two phases can be at the opposite polarity peak. An offset can therefore be added to all phase commands to shift the PWM commands away from the saturation point. Since the same offset is added to all phase commands, the motor still sees the same waveform as before. However, larger amplitude waveforms can now be produced. The stationary – axis voltages from the vector controller are fed into the new transformation algorithm, which calculates the three-phase voltage commands for the induction machine (or PWM inverter), with an extended voltage saturation range over standard sine-wave voltage commands. Fig. 7 shows steady-state operation, with the nonsinusoidal voltage 502 IEEE TRANSACTIONS ON POWER ELECTRONICS, VOL. 12, NO. 3, MAY 1997 Fig. 8. SIMULINK block diagram of the additions to the original system to demonstrate voltage saturation. command to the PWM generator together with a sine-wave command that produces the same voltage as seen by the motor. This boosts the effective output voltage as seen by the motor by a factor of , exactly what is lost by using an inverter with sinusoidal PWM commands over direct connection to the mains. Note that the voltages seen by the motor are still sinusoidal, despite using a nonsinusoidal PWM drive command. To prove that this technique works, voltage saturation blocks were included in the simulated system between the vector-controller voltage outputs and induction machine inputs (Fig. 8). A listing of the -file for the extended saturation algorithm is given in Appendix VI. Phase-to-line and threephase-to-two-phase transformations were also required since the induction machine model requires twin-axis voltages, not three-phase voltages. The simulation results can be seen in Fig. 9. These results were obtained by setting the peak voltage available to 170 V and slowly accelerating the machine to find the speed at which saturation occurs (the field-weakening region). It can be seen that using the algorithm to extend the effective saturation voltage range (by 15.5%) has allowed the machine speed to be increased from approximately 220 to 256 rad s (16.4% increase) before inverter saturation occurs (the start of the field-weakening region). (a) V. CONCLUSIONS It has been shown that the MATLAB/SIMULINK software package is suitable for vector-controlled induction machine simulations. Parameter identification algorithms for rotor resistance identification, such as the EKF, may be coded in an -file and easily modified. Models may be created in block diagram form from differential equations, or difference equations if the process is discrete, with the simulation software providing efficient integration algorithms. The vector-controlled induction machine system was simulated using a linear supply (sine-wave in steady state) and a PWM supply. The results were found to be the same except for a small amount of expected ripple at the switching frequency in the case of the PWM waveform. It was found that the maximum integration step time for the PWM simulation had to be about 100 times smaller than the PWM carrier period to maintain accuracy, resulting in slower simulation compared to the linear supply simulation. Because of the similarity in results between the two waveforms, it is sufficient to use a linear supply for simulations, giving a quicker simulation. (b) Fig. 9. Torque versus rotor speed as operation approaches the field-weakening region: (a) without extended saturation algorithm and (b) with extended saturation algorithm Simulation: 30-min CPU time for 0.5-s motor time (486dx2-66). The EKF algorithm for identification of rotor resistance was presented and the equations and -file listing given. This file was operated in a stand-alone manner from the vector control simulation to reduce simulation time and allowed offline investigation of the properties of the EKF algorithm. MATLAB was used to implement a method of triplen-series injection into the stator voltages of voltage-source currentregulated vector-controlled induction machines using the same WADE et al.: MODELING AND SIMULATION OF INDUCTION MACHINE VECTOR CONTROL simulation system that was created for testing parameter identification routines. It was found that this harmonic injection method extended the speed range before field weakening occurred. This shows the suitability of the software to quickly evaluate new designs that can be incorporated in a vectorcontrolled induction machine system. INDUCTION MACHINE - APPENDIX III VECTOR CONTROLLER ALGORITHM -FUNCTION-TYPE m-FILE LISTING function [sys,x0]=vecctrl5(t,x,u,flag) %Produces induction machine stator dq volts. (Also unit vectors, idse & iqse) %Inputs: Wr idss iqss idse* iqse* Rrhat %Outputs: Vdss Vqss idse iqse Psir %This is a continuous-time simulation. APPENDIX I MOTOR PARAMETERS ; ; H; H; H; at moment of inertia, 503 and 50 Hz; kg m . APPENDIX II -FUNCTION-TYPE m-FILE LISTING function [sys,x0] = indmod1 (t,x,u,flag) %Induction motor model as set of diff-equations %This is a continuous-time simulation. %Variables required before execution: Rs,Ls,Lr,Lm %Inputs: Vds Vqs Wr Rr %Outputs: Ids Iqs Idr Iqr Te Rs=5.90; Ls=0.831; Lm=0.809; Lr=0.833; a0=1/ (Lm*Lm-Lr*Ls); if abs (flag) == 1 % If flag=1,return state derivatives,xdot Rr=u(4); idsn=( Rs*Lr*x(1) - u(3)*Lm*Lm*x(2) - Rr*Lm*x(3) - u(3)*Lr*Lm*x(4) - Lr*u(1))*a0; iqsn=( u(3)*Lm*Lm*x(1) + Rs*Lr*x(2) + u(3)*Lr*Lm*x(3) - Rr*Lm*x(4) - Lr*u(2) )*a0; idrn=-( Rs*Lm*x(1) - u(3)*Lm*Ls*x(2) - Rr*Ls*x(3) - u(3)*Lr*Ls*x(4) - Lm*u(1) )*a0; iqrn=-( u(3)*Lm*Ls*x(1) + Rs*Lm*x(2) + u(3)*Lr*Ls*x(3) - Rr*Ls*x(4) -Lm*u(2) )*a0; sys=[idsn;iqsn;idrn;iqrn]; elseif flag == 3 % If flag=3,return system outputs,y Te=1.5*Lm*(x(2)*x(3)-x(1)*x(4)); sys=[x(1);x(2);x(3);x(4);Te]; elseif flag == 0 %return system dimensions and init. conditions %no.continuous states, no. discrete states, outputs, inputs, %discontinuous roots, direct feedthrough from inputs to outputs. sys=[4,0,5,4,0,0]; x0=zeros(4,1); % initial state vector else sys=[ ];end %otherwise, don’t return anything. Rs=5.09; Lm=0.809; Ls=0.831; Lr= 0.833; G1=2e5; G3=400; %G1 = integral gain, G3 = proportional gain if flag == 3 % If flag=3,return system outputs,y cose=cos(rem(x(2)+x(3),2*pi)); sine=sin(rem(x(2)+x(3),2*pi)); idse=u(2)*cose+u(3)*sine; iqse=-u(2)*sine+u(3)*cose; iderr=u(4)-(u(2)*cose+u(3)*sine); iqerr=u(5)-(-u(2)*sine+u(3)*cose); Vdse=x(4)+G3*iderr; Vqse=x(5)+G3*iqerr; Vdss=Vdse*cose-Vqse*sine; Vqss=Vdse*sine+Vqse*cose; % Return: Vdss, Vqss, idse, iqse, Psir sys=[Vdss;Vqss;idse;iqse;x(1)]; elseif flag == 1 % return system state derivatives cose=cos(rem(x(2)+x(3),2*pi)); sine=sin(rem(x(2)+x(3),2*pi)); idse=u(2)*cose+u(3)*sine; iqse=-u(2)*sine+u(3)*cose; temp=u(6)/Lr; if x(1)==0 Psir=1e-6; else Psir=x(1); end % State derivatives of: Psir Osl, Or, G1*idserr & G1*iqserr sys=[temp*(Lm*idse-x(1));Lm/Psir*temp*iqse;u(1); G1*(u(4) -idse);G1*(u(5)-iqse)]; elseif flag == 0 x0=zeros(5,1); sys=[5,0,5,6,0,1]; else sys=[ ]; end. 504 IEEE TRANSACTIONS ON POWER ELECTRONICS, VOL. 12, NO. 3, MAY 1997 APPENDIX IV PWM GENERATION ALGORITHM -FUNCTION-TYPE m-FILE LISTING function [sys,x0]=s PWM(t,x,u,flag,PWM f,PWM pk,vi pk) %Produces PWM waveform for input %Inputs: Vi (range -vi pk to +vi pk) %Outputs: Vo PWM pk vi pk %Parameters: PWM f % where PWM f is the switching frequency % PWM pk is the output on voltage % vi pk is the input voltage for 100% output duty cycle %This is a continuous-time simulation. HEstmtx=[1 0 0 0 0;0 1 0 0 0]; XEstmtx=[Ids(koff);Iqs(koff);0;0;R2Estinit]; Pmtx=PMTXINIT*eye(5); Pmtx(5,5)=PMTXINIT/100; Qmtx=QMTXINIT*eye(5); Qmtx(3,3)=QMTXr; Qmtx(4,4)=QMTXr; Qmtx(5,5)=Q55; Rmtx=RMTXINIT*eye(2); Kmtx=zeros(5,2); IdsEstmtx=zeros(MAXSAMPLES,1); IqsEstmtx=IdsEstmtx; IdrEstmtx=IdsEstmtx; IqrEstmtx=IdsEstmtx; RrEstmtx=IdsEstmtx; %Return: Vo sys=[Vo]; % Time-invariant quantities a0=-1/(Ls*Lr-Lm*Lm); a11=1+Rs*Lr*tsest*a0; a12=-Lm*Lm*tsest*a0; a13=-Lm*tsest*a0; a14=-Lm*Lr*tsest*a0; a31=-Rs*Lm*tsest*a0; a32=Ls*Lm*tsest*a0; a33=Ls*tsest*a0; a34=Ls*Lr*tsest*a0; a9=-Lr*a0*tsest; a10=Lm*a0*tsest; GEstmtx=[a9 0;0 a9;a10 0;0 a10;0 0]; % Calc. GEst, input coupling matrix FEstmtx(1,1)=a11; FEstmtx(2,2)=a11; FEstmtx(3,1)=a31; FEstmtx(4,2)=a31; FEstmtx(5,1)=0; FEstmtx(5,2)=0; FEstmtx(5,3)=0; FEstmtx(5,4)=0; FEstmtx(5,5)=1; elseif flag == 0 sys=[0,0,1,1,0,1]; % Now start parameter estimation loop for k=1:MAXSAMPLES-1, else sys=[ ]; end. sample=k*STEP+koff; % sample number from raw data Umtx(1)=Vds(sample); Umtx(2)=Vqs(sample); Ymtx(1)=Ids(sample); Ymtx(2)=Iqs(sample); wr=Wr(sample); if flag == 3 if (abs(u(1))/vi pk) = (PWM f*rem(t,1/PWM f)), Vo=PWM pk; else Vo=0; end; if u(1) , Vo=-Vo; end; EKF APPENDIX V m-FILE LISTING STEP=1; %Step size koff=12 000; %Start sample ts=1.0e-4; %Simulation input sampling period tsest=STEP*ts; %estimation sampling period MAXSAMPLES=floor(max(size(Wr)-koff)/STEP); Rs=0.55; Lm=0.063; Ls=Lm+0.005; Lr=Ls; % motor constants R2Estinit=0.5; % initial Rr estimate PMTXINIT=10; % state error covariance QMTXINIT=5e-9; QMTXr=5e-7; Q55=5e-8; % process noise covar RMTXINIT=0.03; % sensor noise covar % First calculate FEst matrix (time-varying) FEstmtx(1,2)=a12*wr; FEstmtx(1,3)=a13 *XEstmtx(5); FEstmtx(1,4)=a14*wr; FEstmtx(1,5)=a13 *XEstmtx(3); FEstmtx(2,1)=-FEstmtx(1,2); FEstmtx(2,3)= -FEstmtx(1,4); FEstmtx(2,4)=FEstmtx(1,3); FEstmtx(2,5)=a13 *XEstmtx(4); FEstmtx(3,2)=a32*wr; FEstmtx(3,3)=1+a33 *XEstmtx(5); FEstmtx(3,4)=a34*wr; FEstmtx(3,5)=a33 *XEstmtx(3); FEstmtx(4,1)=-FEstmtx(3,2); FEstmtx(4,3)= -FEstmtx(3,4); FEstmtx(4,4)=FEstmtx(3,3); FEstmtx(4,5)=a33 *XEstmtx(4); Amtx=FEstmtx; Amtx(:,5)=zeros(5,1); Amtx(5,5)=1; % Create matrices Umtx=zeros(2,1); Ymtx=Umtx; FEstmtx=zeros(5,5); % K(k)=F(k)*P(k)*HT*inv(H*P(k)*HT+R) Kmtx=FEstmtx*Pmtx*HEstmtx’*inv % THEKF1.M Extended Kalman Filter Identification Algorithm % States are stator/rotor currents & rotor resistance WADE et al.: MODELING AND SIMULATION OF INDUCTION MACHINE VECTOR CONTROL (HEstmtx*Pmtx*HEstmtx’+Rmtx); % Now, XEst=f(XEst,U)+K*(Y-H*XEst) XEstmtx=Amtx*XEstmtx+GEstmtx*Umtx+Kmtx* (Ymtx-HEstmtx*XEstmtx); % Lastly, Pmtx=F*P*FT+Q-K*(H*P*HT+R)*KT Pmtx=FEstmtx*Pmtx*FEstmtx’+Qmtx-Kmtx* (HEstmtx*Pmtx*HEstmtx’+Rmtx)*Kmtx’; % Save variables as required IdsEstmtx(k+1)=XEstmtx(1); IqsEstmtx(k+1)=XEstmtx(2); IdrEstmtx(k+1)=XEstmtx(3); IqrEstmtx(k+1)=XEstmtx(4); RrEstmtx(k+1)=XEstmtx(5); end; %end of estimation loop. APPENDIX VI EXTENDED SATURATION ALGORITHM -FUNCTION-TYPE m-FILE LISTING function [sys,x0]=s nosat(t,x,u,flag) %Extends effective inverter saturation volts %Inputs: Vdss Vqss (stationary frame) %Outputs: Va Vb Vc %This is a continuous-time simulation block. if flag == 3 %return system outputs,y Va=u(2); %convert 2-phase to 3-phase Vb=-0.5*u(2)-sqrt(3)/2*u(1); Vc=-0.5*u(2)+sqrt(3)/2*u(1); Vlimit=sqrt(3)/2*sqrt(u(1) 2+u(2) 2); Vasat=Va; Vbsat=Vb; Vcsat=Vc; % Limit Va,Vb,Vc if Va Vlimit, Vasat=Vlimit;end; if -Va Vlimit, Vasat=-Vlimit;end; if Vb Vlimit, Vbsat=Vlimit;end; if -Vb Vlimit, Vbsat=-Vlimit;end; if Vc Vlimit, Vcsat=Vlimit;end; if -Vc Vlimit, Vcsat=-Vlimit;end; Verror=Vasat+Vbsat+Vcsat; Va=Va+Verror; Vb=Vb+Verror; Vc=Vc+Verror; % Return: Va, Vb, Vc & Verror (for monitoring) sys=[Va;Vb;Vc;Verror]; elseif flag == 0 sys=[0,0,4,2,0,1]; else sys=[ ]; end. 505 REFERENCES [1] P. Vas, Vector Control of AC Machines. London, U.K.: Oxford Univ. Press, 1990. [2] S. Wade, M. W. Dunnigan, and B. W. Williams, “Parameter identification for vector controlled induction machines,” Control ’94, vol. 2, no. 389, pp. 1187–1192, 1994. [3] J. D. Lavers and R. W. Y. Cheung, “A software package for the steady state and dynamic simulation of induction motor drives,” IEEE Trans. Power Syst., vol. PWRS-1, May 1986, pp. 167–173. [4] S. Sathikumar and J. Vithayathil, “Digital simulation of field-oriented control of induction motor,” IEEE Trans. Ind. Electron., vol. IE-31, May 1984, pp. 141–148. [5] Z. Daboussi and N. Mohan, “Digital simulation of field-oriented control of induction motor drives using EMTP,” IEEE Trans. Energy Conversion, vol. 3, Sept. 1988, pp. 667–673. [6] “The MATLAB compiler user’s guide,” in Mathworks Handbook. Math Works, 1994. [7] “The SIMULINK accelerator user’s guide,” in Mathworks Handbook. Math Works, 1994. [8] “The MATLAB C math library user’s guide,” in Mathworks Handbook. Math Works, 1994. [9] B. K. Bose, Power Electronics and AC Drives. Englewood Cliffs, NJ: Prentice-Hall, 1986. [10] D. J. Atkinson, P. P. Acarnley, and J. W. Finch, “Observers for induction motor state and parameter estimation,” IEEE Trans. Ind. Applicat., vol. 27, no. 6, pp. 1119–1127, 1991. [11] L. Loron and G. Laliberté, “Application of the extended Kalman filter to parameters estimation of induction motors,” in EPE Conf., Brighton, U.K., 1993, pp. 85–90. [12] D. J. Atkinson, P. P. Acarnley, and J. W. Finch, “Parameter identification techniques for induction motor drives,” in EPE Conf., Aachen, Germany, 1989, pp. 307–312. [13] T. Orlowska-Kowalska, “Application of extended Luenberger observer for flux and rotor time-constant estimation in induction motor drives,” Proc. Inst. Elect. Eng., vol. 136, pt. D, no. 6, pp. 324–330, 1989. [14] T. Du, P. Vas, and F. Stronach, “Design and application of extended observers for joint state and parameter estimation in high-performance AC drives,” IEE Proc. Elec. Power Appl., vol. 142, no. 2, pp. 71–78, 1995. [15] H. F. Vanlandingham, Introduction to Digital Control Systems. New York: Macmillan, 1992. [16] S. Wade, M. W. Dunnigan, and B. W. Williams, “Comparison of stochastic and deterministic parameter identification algorithms for indirect vector control,” in IEE Colloquium on Vector Control and Direct Torque Control of Induction Machines, London, U.K., 1995, pp. 2/1–2/5. [17] B. W. Williams, Power Electronics. London: Macmillan, 1992, pp. 368–371. [18] J. E. Fletcher, T. C. Green, and B. W. Williams, “Vector control of a synchronous reluctance motor utilizing an axially laminated rotor,” in IEE PEVD ’94, 1994, pp. 42–47. Scott Wade received the M.Eng. degree in electrical and electronic engineering (with merit) in 1991 and the Ph.D. degree in 1996, both from Heriot-Watt University, Edinburgh, U.K. Since then, he has been carrying out research in parameter estimation and nonlinear position/speed control for vector-controlled induction machines and the application of high-performance DSP’s and microcontrollers to motor control. 506 IEEE TRANSACTIONS ON POWER ELECTRONICS, VOL. 12, NO. 3, MAY 1997 Matthew W. Dunnigan received the B.Sc. degree in electrical and electronic engineering (with FirstClass Honors) from Glasgow University, Glasgow, U.K., in 1985 and the M.Sc. and Ph.D. degrees from Heriot-Watt University, Edinburgh, U.K., in 1989 and 1994, respectively. He was employed by Ferranti from 1985 to 1988 as a Development Engineer in the design of power supplies and control systems for moving optical assemblies and device temperature stabilization. In 1989, he became a Lecturer at Heriot-Watt University, where he was concerned with the evaluation and reduction of the dynamic coupling between a robotic manipulator and an underwater vehicle. His research grants and interests include the areas of hybrid position/force control of an underwater manipulator, coupled control of manipulator-vehicle systems, nonlinear position/speed control and parameter estimation methods in vector control of induction machines, frequency domain self-tuning/adaptive filter control methods for random vibration, and shock testing using electrodynamic actuators. Barry W. Williams received the M.Eng.Sc. degree from the University of Adelaide, Adelaide, Australia, in 1978 and the Ph.D. degree from Cambridge University, Cambridge, U.K., in 1980. After seven years as a Lecturer at Imperial College, University of London, U.K., he was appointed to as Chair of Electrical Engineering at Heriot-Watt University, Edinburgh, U.K., in 1986. His teaching covers power electronics (in which he has a text published) and drive systems. His research activities include power semiconductor modeling and protection, converter topologies and soft-switching techniques, and application of ASIC’s and microprocessors to industrial electronics.