You are on page 1of 12

ACI

Description

Emulated (per-unit) 3-phase Induction Motor
This module implements a discrete equivalent of a 3-phase induction motor using trapezoidal approximation with predictor-corrector. The induction model is normalized by the adjustable base quantities of voltage, current, Torque, frequency, and flux linkage. The induction motor is modeled in the stationary reference frame. The outputs of this module are the stator currents, rotor flux linkages, electromagnetic Torque, electrically angular velocity, and actual rotor speed in rpm. All of these outputs are in per-unit except the actual rotor speed.
pu Ualpha Ubeta LoadTorque pu pu pu pu ACI pu pu pu pu Q0 Ialpha Ibeta PsiAlpha PsiBeta Torque Wr WrRpm

Availability

This IQ module is available in one interface format: 1) The C interface version

Module Properties

Type: Target Independent, Application Dependent Target Devices: x281x or x280x C Version File Names: aci.c, aci.h IQmath library files for C: IQmathLib.h, IQmath.lib

Item Code Size

C version 740/740 words

Comments

(x281x/x280x) Data RAM xDAIS ready XDAIS component Multiple instances Reentrancy

0 words• No No Yes Yes IALG layer not implemented

Each pre-initialized “_iq” ACI structure consumes 46 words in the data memory
Code size mentioned here is the size of the calc() function

1

Interface C Interface Object Definition The structure of ACI object is defined by following structure definition typedef struct { _iq Ualpha; _iq Ubeta; _iq LoadTorque; _iq Ialpha; _iq Ibeta; _iq PsiAlpha; _iq PsiBeta; _iq Torque; _iq Wr; int32 WrRpm; _iq K1; _iq K2; _iq K3; _iq K4; _iq K5; _iq K6; _iq K7; _iq K8; _iq K9; _iq K10; Uint32 BaseRpm; _iq Alpha; void (*calc)(); } ACI; typedef ACI *ACI_handle; // Input: alpha-axis phase voltage // Input: beta-axis phase voltage // Input: load Torque // Output: alpha-axis phase current // Output: beta-axis phase current // Output: alpha-axis rotor flux // Output: beta-axis rotor flux // Output: electromagnetic Torque // Output: electrically angular velocity // Output: motor speed in rpm (Q0) // Parameter: constant using in rotor flux calculation // Parameter: constant using in rotor flux calculation // Parameter: constant using in rotor flux calculation // Parameter: constant using in stator current cal // Parameter: constant using in stator current cal // Parameter: constant using in stator current cal // Parameter: constant using in stator current cal // Parameter: constant using in Torque calculation // Parameter: constant using in rotor speed cal // Parameter: constant using in rotor speed cal // Parameter: base motor speed in rpm // Parameter: trapezoidal integration parameter (0-1) // Pointer to calculation function

2

C Interface

Module Terminal Variables/Functions
Item Inputs Name
Ualpha Ubeta LoadTorque Ialpha Ibeta PsiAlpha PsiBeta Torque Wr WrRpm K1 K2 K3 K4 K5 K6 K7 K8 K9 K10 BaseRpm

Description
alpha-axis phase voltage beta-axis phase voltage load Torque alpha-axis phase current beta-axis phase current alpha-axis rotor flux beta-axis rotor flux electromagnetic Torque electrically angular velocity motor speed in rpm constant using in rotor flux cal constant using in rotor flux cal constant using in rotor flux cal constant using in stator current cal constant using in stator current cal constant using in stator current cal constant using in stator current cal constant using in Torque cal constant using in rotor speed cal constant using in rotor speed cal base speed in rpm

Format*
GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q Q0 GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q GLOBAL_Q Q0

Range(Hex)
80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF 80000000-7FFFFFFF

Outputs

ACI parameter

*

GLOBAL_Q valued between 1 and 30 is defined in the IQmathLib.h header file.

Special Constants and Data types ACI The module definition is created as a data type. This makes it convenient to instance an interface to the 3-phase Induction Motor module. To create multiple instances of the module simply declare variables of type ACI. ACI_handle User defined Data type of pointer to ACI module ACI_DEFAULTS Structure symbolic constant to initialize ACI module. This provides the initial values to the terminal variables as well as method pointers.

Methods void aci_calc(ACI_handle); This definition implements one method viz., the Induction Motor computation function. The input argument to this function is the module handle. Module Usage Instantiation The following example instances two ACI objects ACI aci1, aci2;

3

C Interface

Initialization To Instance pre-initialized objects ACI aci1 = ACI_DEFAULTS; ACI aci2 = ACI_DEFAULTS; Invoking the computation function aci1.calc(&aci1); aci2.calc(&aci2);

Example The following pseudo code provides the information about the module usage. main() { aci1.K1 = parem1_1; . . . aci1.K10 = parem1_10; aci2.K1 = parem2_1; . . . aci2.K10 = parem2_10; } void interrupt periodic_interrupt_isr() { aci1.Ualpha = valpha1; aci1.Ubeta = vbeta1; aci1.LoadTorque = T_load1; aci2.Ualpha = valpha2; aci2.Ubeta = vbeta2; aci2.LoadTorque = T_load2; aci1.calc(&aci1); aci2.calc(&aci2); Ialpha1 = aci1.Ialpha; Ibeta1 = aci1.Ibeta; psi_alfa1 = aci1.PsiAlpha; psi_beta1 = aci1.PsiBeta; Wr1 = aci1.Wr; WrRpm1 = aci1.WrRpm; Ialpha2 = aci2.Ialpha; Ibeta2 = aci2.Ibeta; psi_alfa2 = aci2.PsiAlpha; psi_beta2 = aci2.PsiBeta; // Pass parameters to aci1 . . . // Pass parameters to aci1 // Pass parameters to aci2 . . . // Pass parameters to aci2

// Pass inputs to aci1 // Pass inputs to aci1 // Pass inputs to aci1 // Pass inputs to aci2 // Pass inputs to aci2 // Pass inputs to aci2 // Call compute function for aci1 // Call compute function for aci2 // Access the outputs of aci1 // Access the outputs of aci1 // Access the outputs of aci1 // Access the outputs of aci1 // Access the outputs of aci1 // Access the outputs of aci1 // Access the outputs of aci2 // Access the outputs of aci2 // Access the outputs of aci2 // Access the outputs of aci2

4

C Interface Wr2 = aci2.Wr; WrRpm2 = aci2.WrRpm; } // Access the outputs of aci2 // Access the outputs of aci2

5

Constant Computation Function Constant Computation Function Since the Induction motor module requires ten constants (K1,…, K10) to be input basing on the machine parameters, base quantities, mechanical parameters, and sampling period. These ten constants can be internally computed by the C function (aci_const.c, aci_const.h). The followings show how to use the C constant computation function.

Object Definition The structure of ACI_CONST object is defined by following structure definition typedef struct { float32 Rs; float32 Rr; float32 Ls; float32 Lr; float32 Lm; float32 p; float32 B; float32 J; float32 Ib; float32 Vb; float32 Wb; float32 Tb; float32 Lb; float32 Ts; float32 K1; float32 K2; float32 K3; float32 K4; float32 K5; float32 K6; float32 K7; float32 K8; float32 K9; float32 K10; void (*calc)(); } ACI_CONST; // Input: Stator resistance (ohm) // Input: Rotor resistance (ohm) // Input: Stator inductance (H) // Input: Rotor inductance (H) // Input: Magnetizing inductance (H) // Input: Number of poles // Input: Damping coefficient (N.m.sec/rad) // Input: Moment of inertia of rotor mass (kg.m^2) // Input: Base phase current (amp) // Input: Base phase voltage (volt) // Input: Base electrically angular velocity (rad/sec) // Input: Base Torque (N.m) // Input: Base flux linkage (volt.sec/rad) // Input: Sampling period (sec) // Output: constant using in rotor flux calculation // Output: constant using in rotor flux calculation // Output: constant using in rotor flux calculation // Output: constant using in stator current calculation // Output: constant using in stator current calculation // Output: constant using in stator current calculation // Output: constant using in stator current calculation // Output: constant using in Torque calculation // Output: constant using in rotor speed calculation // Output: constant using in rotor speed calculation // Pointer to calculation function

typedef ACI_CONST *ACI_CONST_handle;

6

Constant Computation Function

Module Terminal Variables/Functions
Item Inputs Name
Rs Rr Ls Lr Lm p B J Ib Vb Wb Tb Lb Ts K1 K2 K3 K4 K5 K6 K7 K8 K9 K10

Description
Stator resistance (ohm) Rotor resistance (ohm) Stator inductance (H) Rotor inductance (H) Magnetizing inductance (H) Number of poles Damping coefficient (N.m.sec/rad) Moment of inertia (kg.m^2) Base phase current (amp) Base phase voltage (volt) Base electrical angular speed (rad/sec) Base Torque (N.m) Base flux linkage (volt.sec/rad) Sampling period (sec) constant using in rotor flux calculation constant using in rotor flux calculation constant using in rotor flux calculation constant using in stator current cal. constant using in stator current cal. constant using in stator current cal. constant using in stator current cal. constant using in Torque calculation constant using in rotor speed cal. constant using in rotor speed cal.

Format
Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating Floating

Range(Hex)
N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A

Outputs

Special Constants and Data types ACI_CONST The module definition is created as a data type. This makes it convenient to instance an interface to the 3-phase Induction Motor constant computation module. To create multiple instances of the module simply declare variables of type ACI_CONST. ACI_CONST_handle User defined Data type of pointer to ACI_CONST module ACI_CONST_DEFAULTS Structure symbolic constant to initialize ACI_CONST module. This provides the initial values to the terminal variables as well as method pointers.

Methods void aci_const_calc(ACI_CONST_handle); This definition implements one method viz., the Induction Motor constant computation function. The input argument to this function is the module handle.

7

Constant Computation Function

Module Usage Instantiation The following example instances two ACI_CONST objects ACI_CONST aci1_const, aci2_const; Initialization To Instance pre-initialized objects ACI_CONST aci1_const = ACI_CONST_DEFAULTS; ACI_CONST aci2_const = ACI_CONST_DEFAULTS; Invoking the computation function aci1_const.calc(&aci1_const); aci2_const.calc(&aci2_const);

Example The following pseudo code provides the information about the module usage. main() { aci1_const.Rs = Rs1; aci1_const.Rr = Rr1; aci1_const.Ls = Ls1; aci1_const.Lr = Lr1; aci1_const.Lm = Lm1; aci1_const.p = p1; aci1_const.B = B1; aci1_const.J = J1; aci1_const.Ib = Ib1; aci1_const.Vb = Vb1; aci1_const.Wb = Wb1; aci1_const.Tb = Tb1; aci1_const.Lb = Lb1; aci1_const.Ts = Ts1; aci2_const.Rs = Rs2; aci2_const.Rr = Rr2; aci2_const.Ls = Ls2; aci2_const.Lr = Lr2; aci2_const.Lm = Lm2; aci2_const.p = p2; aci2_const.B = B2; aci2_const.J = J2; aci2_const.Ib = Ib2; aci2_const.Vb = Vb2; aci2_const.Wb = Wb2; aci2_const.Tb = Tb2; aci2_const.Lb = Lb2; aci2_const.Ts = Ts2; // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci1_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const // Pass floating-point inputs to aci2_const

8

Optional Constant Computation Function aci1_const.calc(&aci1_const); aci2_const.calc(&aci2_const); // Call compute function for aci1_const // Call compute function for aci2_const

aci1.K1 = _IQ(aci1_const.K1); // Access the floating-point outputs of aci1_const . . . . . . aci1.K10 = _IQ(aci1_const.K10); // Access the floating-point outputs of aci1_const aci2.K1 = _IQ(aci2_const.K1); // Access the floating-point outputs of aci2_const . . . . . . aci2.K10 = _IQ(aci2_const.K10); // Access the floating-point outputs of aci2_const }

9

Technical Background

Technical Background The mathematic model of a 3-phase induction motor in the stationary reference frame is described by the fifth-order differential equations as follows:

= f 1 (ψ βr , ψ αr , i βs , ω r ) = −αψ βr + ω r ψ αr + αL m i βs dt dψ αr = f 2 (ψ βr , ψ αr , i αs , ω r ) = −ω r ψ βr − αψ αr + αL m i αs dt di βs 1 = f 3 (ψ βr , ψ αr , i βs , v βs , ω r ) = αβψ βr − βω r ψ αr − γi βs + v βs σL s dt di αs 1 = f 4 (ψ βr , ψ αr , i αs , v αs , ω r ) = βω r ψ βr + αβψ αr − γi αs + v αs σL s dt np dω r B (Te − Tl ) = f 5 (ψ βr , ψ αr , i βs , i αs , ω r ) = − ω r + dt J J 3 Lmn p (ψ αr i βs − ψ βr i αs ) Te = 2 Lr
where σ = 1 −

dψ βr

(1) (2) (3) (4) (5) (6)

Lm L2m R r + L2r R s L2m 1 Rr = , γ= , α= , and β = 2 Ls Lr τr Lr σL s L r σL s L r

(

)

Equations (1)-(4) can be compactly reWritten in the state-space model as follows:

x = A(ω r ) x + Bu
⎡ ψ βr ⎤ ⎢ψ ⎥ αr ⎥ where x = ⎢ , ⎢ i βs ⎥ ⎥ ⎢ ⎣ i αs ⎦ ⎡−α ⎢ −ω A (ω r ) = ⎢ r ⎢ αβ ⎢ ⎣βω r ωr −α − βω r αβ αL m 0 −γ 0

(7)

⎡ 0 0 ⎤ ⎢ 0 ⎢ 1 ⎥ αL m ⎥ , B=⎢ ⎢ σL s 0 ⎥ ⎢ ⎥ −γ ⎦ ⎢ 0 ⎣

0 ⎤ 0 ⎥ ⎥ 0 ⎥ , and ⎥ 1 ⎥ ⎥ σL s ⎦

⎡v ⎤ u = ⎢ βs ⎥ . Then, the differential equations seen in equations (5) and (7) are discretized by ⎣ v αs ⎦
the trapezoidal integration method with the predictor-corrector. Predictors:

x p ( k ) = x(k − 1) + T (A (ω r ( k − 1)) x( k − 1) + Bu ( k ) )

(8)

np ⎛ B ⎞ (Te (k ) − Tl (k ) )⎟ ω r ,p (k ) = ω r (k − 1) + T⎜ − ω r (k − 1) + ⎜ J ⎟ J ⎝ ⎠
Correctors:

(9)

10

Technical Background

x( k ) = x( k − 1) +

T ⎛ (1 + a )(A (ω r ( k − 1))x p (k ) + Bu (k ) ) + ⎞ ⎜ ⎟ 2 ⎜ (1 − a )(A (ω r ( k − 1))x( k − 1) + Bu ( k ) )⎟ ⎝ ⎠

(10)

⎛ n ⎞ ⎞ ⎛ ⎜ (1 + a )⎜ − B ω r ,p (k ) + p (Te (k ) − Tl (k ) )⎟ + ⎟ ⎟ ⎟ ⎜ J J T⎜ ⎠ ⎝ ω r (k ) = ω r (k − 1) + ⎜ ⎟ 2⎜ np ⎞⎟ ⎛ B ⎜ (1 − a )⎜ − J ω r (k − 1) + J (Te (k ) − Tl (k ) )⎟ ⎟ ⎟ ⎜ ⎠⎠ ⎝ ⎝ 3 Lmn p (ψ αr (k)i βs (k) − ψ βr (k)i αs (k)) Te (k ) = 2 Lr

(11)

(12)

where T is sampling period (sec) and a is the weight of predictor in between 0 and 1. Next, the discretized equations in (10) and (11) are normalized by the base quantities of voltage ( Vb ), current ( I b ), flux linkage ( ψ b ), Torque ( Tb ), and electrically angular velocity ( ω b ). As a result, the per-unit, discrete-time equations of induction motor can be summarized as follows: Predictors:

ψ βr ,p (k ) = ψ βr (k − 1) − K 1ψ βr (k − 1) + K 2 ω r (k − 1)ψ αr (k − 1) + K 3i βs (k − 1) ψ αr ,p (k ) = ψ αr (k − 1) − K 1ψ αr (k − 1) − K 2 ω r (k − 1)ψ βr (k − 1) + K 3i αs (k − 1)

(13) (14)

i βs ,p (k ) = i βs (k − 1) + K 4 ψ βr (k − 1) − K 5 ω r (k − 1)ψ αr (k − 1) − K 6 i βs (k − 1) + K 7 v βs (k ) (15) i αs ,p (k ) = i αs (k − 1) + K 4 ψ αr (k − 1) + K 5 ω r (k − 1)ψ βr (k − 1) − K 6 i αs (k − 1) + K 7 v αs (k ) (16)
ω r ,p (k ) = ω r (k − 1) − K 9 ω r (k − 1) + K 10 (Te (k ) − Tl (k ) )
(17)

Correctors:

∆ψ βr ,p (k ) = − K 1ψ βr ,p (k ) + K 2 ω r (k − 1)ψ αr ,p (k ) + K 3 i βs ,p (k ) ∆ψ αr ,p (k ) = −K 1ψ αr ,p (k ) − K 2 ω r (k − 1)ψ βr ,p (k ) + K 3 i αs ,p (k )

(18) (19) (20) (21) (22) (23) (24) (25)

∆i βs ,p (k ) = K 4 ψ βr ,p (k ) − K 5 ω r (k − 1)ψ αr ,p (k ) − K 6 i βs ,p (k ) + K 7 v βs (k ) ∆i αs ,p (k ) = K 4 ψ αr ,p (k ) + K 5 ω r (k − 1)ψ βr ,p (k ) − K 6 i αs ,p (k ) + K 7 v αs (k )
∆ω r ,p (k ) = −K 9 ω r ,p (k ) + K 10 (Te (k ) − Tl (k ) )

∆ψ βr (k ) = − K 1ψ βr (k − 1) + K 2 ω r (k − 1)ψ αr (k − 1) + K 3i βs (k − 1) ∆ψ αr (k ) = − K 1ψ αr (k − 1) − K 2 ω r (k − 1)ψ βr (k − 1) + K 3i αs (k − 1)

∆i βs (k ) = K 4 ψ βr (k − 1) − K 5 ω r (k − 1)ψ αr (k − 1) − K 6 i βs (k − 1) + K 7 v βs (k )

∆i αs (k ) = K 4 ψ αr (k − 1) + K 5 ω r (k − 1)ψ βr (k − 1) − K 6 i αs (k − 1) + K 7 v αs (k ) (26)

11

Technical Background

ψ αr (k ) = ψ αr (k − 1) + 0.5((1 + a )∆ψ αr ,p (k ) + (1 − a )∆ψ αr (k ) )

∆ω r (k ) = − K 9 ω r (k − 1) + K 10 (Te (k ) − Tl (k ) ) ψ βr (k ) = ψ βr (k − 1) + 0.5((1 + a )∆ψ βr ,p (k ) + (1 − a )∆ψ βr (k ) )

(27) (28) (29) (30) (31) (32) (33)

i αs (k ) = i αs (k − 1) + 0.5((1 + a )∆i αs ,p (k ) + (1 − a )∆i αs (k ) )
ω r (k ) = ω r (k − 1) + 0.5((1 + a )∆ω r ,p (k ) + (1 − a )∆ω r (k ) )

i βs (k ) = i βs (k − 1) + 0.5((1 + a )∆i βs ,p (k ) + (1 − a )∆i βs (k ) )

Te = K 8 (ψ αr (k )i βs (k ) − ψ βr (k )i αs (k ) ) K 2 = Tω b , K 3 = T αL m
Ib , ψb

where

K 1 = Tα ,

K 4 = Tαβ

ψb , Ib

K 5 = Tβ

ψ b ωb , Ib

K 6 = Tγ , K 7 = T

n p Tb L ψ I B 1 Vb , K 8 = 1.5n p m b b , K 9 = T , K 10 = T L r Tb σL s I b J J ωb

Table 1 shows the correspondence of notation between variables used here and variables used in the program (i.e., aci.c, aci.h). The software module requires that both input and output variables are in per unit values.

Equation Variables

v αs
Inputs

Program Variables Ualpha Ubeta LoadTorque Ialpha Ibeta PsiAlpha PsiBeta Torque Wr K1 K2 K3 K4 K5 K6 K7 K8 K9 K10 Alpha

v βs
Tl i αs

i βs
Outputs

ψ αr ψ βr Te
ωr
K1 K2 K3 K4 K5 K6 K7 K8 K9 K10 a Table 1: Correspondence of notations

Others

12