System Controlling: September 2012
Loading [MathJax]/jax/output/HTML-CSS/jax.js

Saturday, September 22, 2012

ACIM model in rotor fixed reference frame

In case of a direct torque control we can use the rotor fixed frame, which means that the $\omega_\gamma=0$. In this case we can describe the motor with the following equations(you can find the deduction under the following link)
[usdusq]=Rr[isdisq]+ddt[ψsdψsq]
[urdurq]=Rr[irdirq]+ddt[ψrdψrq]+ωr[ψrdψrq]
The motor torque can be expressed the rotor flux magnitude $\psi_r$ and stator current component $i_s$
Te=3pLm2Lr(ψrdisqψrqisd)
and the flux equations are the following
[ψsdψsq]=Ls[isdisq]+Lm[irdirq]
[ψrdψrq]=Lm[isdisq]+Lr[irdirq]
I would like to estimate the rotor fluxes and the electrical motor speed $\omega_r$. In this case there are five state variables $[isdisqψrdψrqωr]$, to get the state variables we have to make a few arithmetic operations.
We would like to get the flux equations, after sorting the $2^{nd}$ equation we will end up with the following
ddt[ψrdψrq]=Rr[irdirq]ωr[ψrdψrq]+[urdurq]
We can't measure the rotor currents, but we can express the rotor currents using the $5^{th}$ equations.
[irdirq]=1Lr[ψrdψrq]LmLr[isdisq]
Replacing the rotor currents in the $6^{th}$ expression we will get the rotor flux equations
ddt[ψrdψrq]=Rr(1Lr[ψrdψrq]LmLr[isdisq])ωr[ψrdψrq] ddt[ψrdψrq]=Lmτr[isdisq]+[1τrωrωr1τr][ψrdψrq]
After those arithmetic operation we got the rotor's flux equations, to get the stator's current equations we replace the $1^{st}$ equation's stator fluxes using the $4^{th}$ expressions, also we have to replace in the $4^{th}$ expression the rotor currents, by using the $7^{th}$ equations.
After some arithmetical operation we will get the stator currents
ddt[isdisq]=[Rs+L2mRrL2rLsσ00Rs+L2mRrL2rLsσ][isdisq]+[LmLsσLrτrωrLmLsσLrωrLmLsσLrLmLsσLrτr][ψrdψrq]+[1Lsσ001Lsσ][usdusq]
Where
τr=LrRr
and
σ=1L2mLsLr
The equations above combined with the Extended Kalman filte can be used to estimate the fluxes and rotor speed. The dynamic model for an induction motor by choosing the stator currents $i_sd$, $i_sq$ and rotor fluxes $\psi_rd$, $\psi_rq$ as state variables, is as follows
dxdt=Ax(t)+Bu(t)
y(t)=Cx(t)+Du(t)
where
A=[Rs+L2mRrL2rLsσ0LmLsσLrτrωrLmLsσLr0Rs+L2mRrL2rLsσωrLmLsσLrLmLsσLrτrLmτr01τrωr0Lmτrωr1τr]
B=[1Lsσ001Lsσ0000]
C=[10000100]
D=[0]

Wednesday, September 19, 2012

Three-phase induction motor in different reference frames

In order to understand, analyze and control the ac induction motor, a dynamic model is necessary. The significant step forward in the analysis of the three-phase induction motor was the reference frame theory. Using this theory, it is possible to transform the machine dynamic model to a different reference frame.
Figure 1.
The equations of the ACIM's (alternate current induction motor) is easy to deduce from the machine structure and circuits.
The stator equations are the following
usa=Rsisa+dψsadtusb=Rsisb+dψsbdtusc=Rsisc+dψscdt
and the rotor equations are the following
ura=Rrira+dψradturb=Rrirb+dψrbdturc=Rrirc+dψrcdt
Both the current and the voltage are time dependent. In the three-phase reference frame the motor windings are located at 120 degree. Applying the Clarke transformation on the three phase motor, more info in the previous blog, we can write the three-phase machine equations in two phase
usα=Rsisα+dψsαdtusβ=Rsisβ+dψsβdt
urα=Rrirα+dψrαdturβ=Rrirβ+dψrβdt
The $3^{rd}$ and $4^{th}$ equations are based on two different reference frames, one is the stationary, fixed to the stator, the other is rotating with the rotor at electrical motor speed $\omega_r$. With respect of the $\alpha/\beta$ system, the ACIM can be equally describe by two other perpendicular windings. This transformation is applied to transfer the stator and rotor equation's to a common reference frame named $d/q$ (rotating reference frame). In the common reference frame it is easier to describe the dynamic model and behaviour of the ACIM.There are four reference frames widely used in ACIM analysis, namely he stationary, rotor, synchronous and arbitrary reference frame.

Stationary or stator fixed reference frame


In this case the reference frame speed is 0 and all the variables are referred to the stator fixed reference frame. With the following equation we can describe the current in the d/q reference frame.
ird=irαcosθirβsinθirq=irαsinθ+irβcosθ
The matrices of the transformation $T_{-\theta}$ and inverse transformation $T^{-1}_{-\theta}$ are the following
Tθ=[cosθsinθsinθcosθ]
T1θ=[cosθsinθsinθcosθ]
The $6^{th}$ and $7^{th}$ equations also can apply on the voltage and flux, because of this we can transform the $3^{rd}$ and $4^{th}$ equations 
Tθ[urαurβ]=TθRr[irαirβ]+Tθddt[ψrαψrβ]
Because T1θTθ=1we can multiplying the rotor flux vector, it remain unchanged.
[urdurq]=Rr[irdirq]+Tθddt(T1θTθ[ψrαψrβ])[urdurq]=Rr[irdirq]+Tθddt(T1θ[ψrdψrq])[urdurq]=Rr[irdirq]+TθT1θddt[ψrdψrq]+Tθddt(T1θ)[ψrdψrq]
Where
Tθddt(T1θ)=Tθ(ddθT1θ)dθdt=[0cosθ2+sinθ2cosθ2sinθ20]dθdt=[0110]ωr
If we insert the $12^{th}$ equation into the $11^{th}$ equation finally we get the stator and rotor equations in the same, stator fixed reference frame.
[usdusq]=Rr[isdisq]+ddt[ψsdψsq]
[urdurq]=Rr[irdirq]+ddt[ψrdψrq]+ωr[ψrdψrq]

Rotor fixed reference frame


In this case the common reference is attached to the rotor and it is rotating with the electrical speed $\omega_r$. In this case the transformation matrices are the following,
Tγ=[cosγsinγsinγcosγ]
T1γ=[cosγsinγsinγcosγ]
Applying the same calculation as in the stator fixed reference frame we will get the following equation,
[usdusq]=Rr[isdisq]+ddt[ψsdψsq]+ωr[ψsdψsq]
[urdurq]=Rr[irdirq]+ddt[ψrdψrq]

Arbitrary rotating reference frame


By replacing the $-\theta$ with $\gamma-\theta$ we can obtain the rotor variables and rotor equation in arbitrary reference frame. In this case the transformation matrices are the following
Tγθ=[cos(γθ)sin(γθ)sin(γθ)cos(γθ)]
T1γθ=[cos(γθ)sin(γθ)sin(γθ)cos(γθ)]
Applying the transformation matrices on the $3^{rd}$ and $4^{th}$ equations we will end up with the following equation in the arbitrary reference frame
[usdusq]=Rr[isdisq]+ddt[ψsdψsq]+ωγ[ψsdψsq]
[urdurq]=Rr[irdirq]+ddt[ψrdψrq]+(ωγωr)[ψrdψrq]
The stator and rotor fixed reference frame is just a particular case of the arbitrary rotating reference frame.  In the stator fixed reference frame the $\omega_\gamma$ is set to zero yield. If the reference frame is rotating with $\omega_r$ the equations of the rotor reference frame are obtained.

Sunday, September 9, 2012

Clarke coordinate transformation

The Clarke transformation does a magnitude invariant translation from a three-phase system to a two orthogonal system.
In order to understand the Clarke transformation I will introduce the 3-phase induction motor.
Figure 1. 3 phase induction motor windings

Three windings are organized with 120° angle difference in the physical space between each other. On the right side of the figure they are illustrated in a simplified way, where a winding is represented with an inductor.
At a certain time point, for e.g. the currents in the three windings have the directions and values as shown in Figure 2, they could be summarized by using the vector addition. The result is as shown in the figure.
Figure 2.






Referring to Figure 2 we can calculate the sum of the current vectors as:
is=iu+ive2π3j+iwe4π3j
Using the Euler formula:
ejω=cos(ω)+jsin(ω)
We will get the following equation:
is=(iucos(0)+ivcos(2π3)+iwcos(4π3))+j(iusin(0)+ivsin(2π3)+iwsin(4π3))
is=(iu12iv12iw)+j(0+32iv32iw)
 In order to keep constant magnitude of the vectors during the transformation we put a $k_1$ coefficient.
is=k1is
The real and imaginary parts can be separated and rewritten as:
iα=Re(is)=k1(iu12iv12iw)iβ=Im(is)=k1(0+32iv32iw)
Adding a zero-axis value
i0=k1k2(iu+iv+iw)
Using the $6$ and $7$ equation we can write the following transformation:
[iαiβi0]=k1[1121203232k2k2k2][iuiviw]
Where the $T$ transformation matrix is as follows
T=k1[1121203232k2k2k2]
and the inverse $T^{-1}$ transformation matrix is
T1=k1[10k21232k21232k2]
To determine the $k_1$ and $k_2$ we have to solve the following equation
T1T=[100010001]
Using the $11^th$ equation we can write the following
k21[10k21232k21232k2][1121203232k2k2k2]=[100010001]
Solving the $12^th$ equation the $k_1$ and $k_2$ value will be:
k1=23

k2=12
Replacing $k_1$ and $k_2$ in the $T$ matrix, finally we will get the following transformation matrix
T=23[1121203232121212]
No we can test the above transformation matrices, for this purpose I implemented the transformation matrices in python using numpy
def clarke_p_i_i0(self,a,b,c):
        T = sqrt(2./3.)* array([
                              [1., -1./2., -1./2.],
                              [0., sqrt(3.)/2., -sqrt(3.)/2.],
                              [1./sqrt(2.), 1./sqrt(2.), 1./sqrt(2.)]
                              ])
        return  dot(T, array([[a],[b],[c]]));
        
    
def inv_clarke_p_i_i0(self,alpha, beta, Io=0):
        T = sqrt(2./3.)* array([
                              [1., 0., 1/sqrt(2.)], 
                              [-1./2.,  sqrt(3.)/2., 1./sqrt(2.)], 
                              [-1./2.,  -sqrt(3.)/2., 1./sqrt(2.)]
                              ])
        
        return  dot(T, array([[alpha],[beta],[Io]])); 

The output of the transformation and inverse transformation is the following
Figure 3.

Using the following relation
iu+iv+iw=0
so
iw=iuiv
Applying the $17^th$ relation on the $6^th$ equation the value of the $i_\alpha$ will be the following
iα=iu12iv12(iuiv)iα=32iu
applying this to the $i_\beta$ we get the following equation
iβ=32iu+3iv
The $18^th$ and $19^th$, applied on voltage and current, is not power invariant, because of this we have to solve the following equation
uuiu+uviv+uwiw=uαiα+uβiβ
uαiα+uβiβ=32uu32iu+(32uu+3ub)(32iu+3ib)=32(uuiu+uviv+uwiw)
So the $2\over3$ scaling factor guarantee the power invariance. Because of the symmetrical distribution of the scaling factor $2\over3$, following equations are used to transform the three-phase reference frame to two-phase reference frame.
iα=2332iv=32iv
and
iβ=23(32iu+3iv)=12iu+2iv
Writing the matrix form the equation above
T=[320122]
and the inverse transformation
T1=[23016121612]
The equation above can apply also for voltage transformation.
Python implementation:
def clarke_p_i(self,a,b):

        """"""

        T = array([
                    [sqrt(3./2.), 0],
                    [1./sqrt(2.), sqrt(2.)]
                ])

        return  dot(T, array([[a],[b]]));

        

def inv_clarke_p_i(self,alpha, beta):

        T = array([
                    [sqrt(2./3.), 0],
                    [-1./sqrt(6.), 1./sqrt(2.)],
                    [-1./sqrt(6.), -1./sqrt(2.)],
                 ])
        
        return dot(T, array([[alpha],[beta]]))
Figure 4.
The transformation matrices mentioned above are power invariant, but also it's possible to write the magnitude invariant transformation. If we replace the $k_1$ and $k_2$ in the $9^{th}$ equation with ${2\over3}$ and ${1\over3}$, the transformation and inverse transformation matrices are the following

T=23[1121203232121212]
T1=32[23012131312131312]
Python implementation: 
def clarke_m_i(self,a,b,c): 
        T = 2./3.* array([
                              [1., -1./2., -1./2.],
                              [0., sqrt(3.)/2., -sqrt(3.)/2.],
                              [1./2., 1./2., 1./2.]
                              ])
        return  dot(T, array([[a],[b],[c]]));
        
 def inv_clarke_m_i(self,alpha, beta, Io):
        T = 3./2.* array([
                              [2./3., 0., 1./2.], 
                              [-1./3.,  1/sqrt(3.), 1./2.], 
                              [-1./3.,  -1/sqrt(3.), 1./2.]
                              ])        
        return  dot(T, array([[alpha],[beta],[Io]]));

Figure 5.

As you see on the $Figure 3.$, $Figure 4.$ the amplitude of the transformation is not invariant, comparing with the $Figure 5.$ where the amplitude is invariant.

You can find an example in the github under the T_CoorTrans.py
Sources:
[1] Fujitsu Coordinate transform
[2] BME - Villamos Hajtások, Villamos Energetika Tanszék
[3] Mircea Popescu - Induction motor modelling for vector control purpose
[4] Prof. Dr.-Ing. Ralph Kennel - Master course Power Electronics