System Controlling: Clarke coordinate transformation

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:
$$i_s = i_u+i_ve^{{2\pi\over3}j}+i_we^{{4\pi\over3}j}\tag{1}$$
Using the Euler formula:
$$e^{j\omega} = \cos(\omega)+j \sin(\omega)\tag{2}$$
We will get the following equation:
$$i_s = \left(i_ucos(0)+i_vcos\left({2\pi\over3}\right)+i_wcos\left({4\pi\over3}\right)\right)\\+j\left(i_usin(0)+i_vsin\left({2\pi\over3}\right)+i_wsin\left({4\pi\over3}\right) \right)\tag{3}$$
$$i_s = \left(i_u-{1\over2}i_v-{1\over2}i_w\right)+j\left(0+{\sqrt3\over2}i_v-{\sqrt3\over2}i_w\right)\tag{4}$$
 In order to keep constant magnitude of the vectors during the transformation we put a $k_1$ coefficient.
$$i_s={k_1}i_s\tag{5}$$
The real and imaginary parts can be separated and rewritten as:
$$i_\alpha =Re\left(i_s\right)=k_1\left(i_u-{1\over2}i_v-{1\over2}i_w\right)\\
i_\beta =Im\left(i_s\right)=k_1\left(0+{\sqrt3\over2}i_v-{\sqrt3\over2}i_w\right)\tag{6}$$
Adding a zero-axis value
$$i_0={k_1}{k_2}(i_u+i_v+i_w)\tag{7}$$
Using the $6$ and $7$ equation we can write the following transformation:
$$ \left[ \begin{array}{c} i_\alpha \\ i_\beta \\ i_0 \end{array} \right] =k_1 \begin{bmatrix}  1 & -{1\over2} & -{1\over2} \\ 0 & {\sqrt3\over2} & -{\sqrt3\over2} \\ {k_2} & {k_2} & {k_2} \end{bmatrix}\left[ \begin{array}{c} i_u \\ i_v \\ i_w \end{array} \right]\tag{8}$$
Where the $T$ transformation matrix is as follows
$$T=k_1 \begin{bmatrix}  1 & -{1\over2} & -{1\over2} \\ 0 & {\sqrt3\over2} & -{\sqrt3\over2} \\ {k_2} & {k_2} & {k_2} \end{bmatrix}\tag{9}$$
and the inverse $T^{-1}$ transformation matrix is
$$T^{-1}=k_1 \begin{bmatrix}  1 & 0 & {k_2} \\ -{1\over2} & {\sqrt3\over2} & {k_2} \\ -{1\over2}  & -{\sqrt3\over2} & {k_2}  \end{bmatrix}\tag{10}$$
To determine the $k_1$ and $k_2$ we have to solve the following equation
$$
 T^{-1}T=\begin{bmatrix}  1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\tag{11}
$$
Using the $11^th$ equation we can write the following
$$
k_1^2 \begin{bmatrix}  1 & 0 & {k_2} \\ -{1\over2} & {\sqrt3\over2} & {k_2} \\ -{1\over2}  & -{\sqrt3\over2} & {k_2}  \end{bmatrix}\begin{bmatrix}  1 & -{1\over2} & -{1\over2} \\ 0 & {\sqrt3\over2} & -{\sqrt3\over2} \\ {k_2} & {k_2} & {k_2} \end{bmatrix}=\begin{bmatrix}  1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\tag{12}
$$
Solving the $12^th$ equation the $k_1$ and $k_2$ value will be:
$$k_1=\sqrt{2\over3}\tag{13}$$

$$k_2={1\over{\sqrt2}}\tag{14}$$
Replacing $k_1$ and $k_2$ in the $T$ matrix, finally we will get the following transformation matrix
$$T=\sqrt{2\over3} \begin{bmatrix}  1 & -{1\over2} & -{1\over2} \\ 0 & {\sqrt3\over2} & -{\sqrt3\over2} \\ {1\over{\sqrt2}} & {1\over{\sqrt2}} & {1\over{\sqrt2}} \end{bmatrix}\tag{15}$$
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
$$
i_u+i_v+i_w=0\tag{16}
$$
so
$$
 i_w = -i_u-i_v\tag{17}
$$
Applying the $17^th$ relation on the $6^th$ equation the value of the $i_\alpha$ will be the following
$$
i_\alpha = i_u-{1\over2}i_v- {1\over2}\left(-i_u-i_v\right)\\
i_\alpha = {3\over2}i_u\tag{18}
$$
applying this to the $i_\beta$ we get the following equation
$$
i_\beta =  {{\sqrt3}\over2}i_u+{\sqrt{3}}i_v\tag{19}
$$
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
$$
u_ui_u+u_vi_v+u_wi_w=u_\alpha i_\alpha+u_\beta i_\beta\tag{20}
$$
$$
u_\alpha i_\alpha+u_\beta i_\beta =  {3\over2}u_u {3\over2}i_u+
\left(\sqrt{3\over2}u_u+\sqrt{3}u_b\right) \left(\sqrt{3\over2}i_u+\sqrt{3}i_b\right) \\
={3\over2}\left(u_ui_u+u_vi_v+u_wi_w\right)\tag{21}
$$
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 _\alpha={\sqrt{2\over3}}{3\over2}i_v={\sqrt{3\over2}}i_v\tag{22}
$$
and
$$
i_\beta =  {\sqrt{2\over3}}\left({{\sqrt3}\over2}i_u+{\sqrt{3}}i_v\right)\\
={1\over\sqrt2}i_u+{\sqrt2}i_v\tag{23}
$$
Writing the matrix form the equation above
$$
T= \begin{bmatrix} \sqrt{3\over2} & 0 \\ {1\over\sqrt2} &  {\sqrt2} \end{bmatrix}\tag{24}
$$
and the inverse transformation
$$
T^{-1}= \begin{bmatrix} \sqrt{2\over3} & 0 \\ -{1\over\sqrt6} & {1\over\sqrt2} \\
-{1\over\sqrt6} & -{1\over\sqrt2}  \end{bmatrix}\tag{25}
$$
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={2\over3} \begin{bmatrix}  1 & -{1\over2} & -{1\over2} \\ 0 & {\sqrt3\over2} & -{\sqrt3\over2} \\ 1\over2 & 1\over2 & 1\over2 \end{bmatrix}\tag{26}$$
$$T^{-1}={3\over2} \begin{bmatrix}  {2\over3} & 0 & {1\over2} \\ -{1\over3} & {1\over\sqrt3} & {1\over2} \\ -{1\over3}  & -{1\over\sqrt3} & {1\over2}  \end{bmatrix}\tag{27}
$$
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

No comments:

Post a Comment