Coordinate Transformation

The following amplitude invariant coordinate transformations are incorporated in this module. All of them are general purpose. This means, that they can be used to either transform voltages, currents, or any other applicable unit. Transformations for multiphase systems do exist as well.

Three phase systems

Variables structs

These structs are needed to hand over the input values and get the output values of the functions.

struct uz_3ph_abc_t

Struct for the variables of a three-phase-System.

Public Members

float a

Amplitude of the a phase (U)

float b

Amplitude of the b phase (V)

float c

Amplitude of the c phase (W)

struct uz_3ph_dq_t

Struct for the variables of a dq0-System.

Public Members

float d

Amplitude of the direct axis component

float q

Amplitude of the quadrature axis component

float zero

Amplitude of the zero component

struct uz_3ph_alphabeta_t

Struct for the variables of a alpha-beta-gamma-System.

Public Members

float alpha

Amplitude of the alpha component

float beta

Amplitude of the beta component

float gamma

Amplitude of the gamma component

Transformation functions

abc to dq0 transformation

uz_3ph_dq_t uz_transformation_3ph_abc_to_dq(uz_3ph_abc_t input, float theta_el_rad)

Struct for the natural variables of a six-phase system.

Calculates the dq0-components from the abc-Phases

Parameters:
  • input – uz_3ph_abc_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_3ph_dq_t Outputs the calculated dq0-components

This uses the Park transformation to transform a three-phase (abc) signal to a dq0 rotating reference frame. X is a placeholder and can be replaced by either V, I, or any other applicable unit. The d-Axis has to be aligned with the A-phase.

\[\begin{split}\begin{bmatrix} X_d \\ X_q \\ X_0 \\ \end{bmatrix} = \frac{2}{3} \begin{bmatrix} cos{(\theta_{el})} & cos{(\theta_{el}-\frac{2\pi}{3})} & cos{(\theta_{el}-\frac{4\pi}{3})} \\ -sin{(\theta_{el})} & -sin{(\theta_{el}-\frac{2\pi}{3})} & -sin{(\theta_{el}-\frac{4\pi}{3})} \\ \frac{1}{2} & \frac{1}{2} & \frac{1}{2}\\ \end{bmatrix} \begin{bmatrix} X_a \\ X_b \\ X_c \\ \end{bmatrix}\end{split}\]

dq0 to abc transformation

uz_3ph_abc_t uz_transformation_3ph_dq_to_abc(uz_3ph_dq_t input, float theta_el_rad)

Calculates the abc-phases from the dq0-components

Parameters:
  • input – uz_3ph_dq_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_3ph_abc_t Outputs the calculated abc-phases

This uses the inverse Park transformation to transform a dq0 rotating reference frame to a three-phase (abc) signal. X is a placeholder and can be replaced by either V, I, or any other applicable unit. The d-Axis has to be aligned with the A-phase.

\[\begin{split}\begin{bmatrix} X_a \\ X_b \\ X_c \\ \end{bmatrix} = \begin{bmatrix} cos{(\theta_{el})} & -sin{(\theta_{el})} & 1 \\ cos{(\theta_{el}-\frac{2\pi}{3})} & -sin{(\theta_{el}-\frac{2\pi}{3})} & 1\\ cos{(\theta_{el}-\frac{4\pi}{3})} & -sin{(\theta_{el}-\frac{4\pi}{3})} & 1\\ \end{bmatrix} \begin{bmatrix} X_d \\ X_q \\ X_0 \\ \end{bmatrix}\end{split}\]

abc to αβγ transformation

uz_3ph_alphabeta_t uz_transformation_3ph_abc_to_alphabeta(uz_3ph_abc_t input)

Calculates the alpha-beta-gamma-components from the abc-phases.

Parameters:
  • input – uz_3ph_abc_t struct

Returns:

uz_3ph_alphabeta_t Outputs the calculated alpha-beta-gamma-components

The Clarke transformation converts the time-domain components of a three-phase system in an abc reference frame to components in a stationary \(\alpha\beta\gamma\) reference frame. X is a placeholder and can be replaced by either V, I, or any other applicable unit.

\[\begin{split}\begin{bmatrix} X_{\alpha} \\ X_{\beta} \\ X_{\gamma} \\ \end{bmatrix} = \frac{2}{3} \begin{bmatrix} 1 & -\frac{1}{2} & -\frac{1}{2} \\ 0 & \frac{\sqrt{3}}{2} & -\frac{\sqrt{3}}{2} \\ \frac{1}{2} & \frac{1}{2} & \frac{1}{2} \\ \end{bmatrix} \begin{bmatrix} X_a \\ X_b \\ X_c \\ \end{bmatrix}\end{split}\]

αβγ to abc transformation

uz_3ph_abc_t uz_transformation_3ph_alphabeta_to_abc(uz_3ph_alphabeta_t input)

Calculates the abc-phases from the alpha-beta-gamma-components.

Parameters:
  • input – uz_3ph_alphabeta_t struct

Returns:

uz_3ph_abc_t Outputs the calculated abc-phases

The inverse Clarke transformation converts the components in a stationary \(\alpha\beta\gamma\) reference frame to the time-domain components of a three-phase system in an abc reference frame. X is a placeholder and can be replaced by either V, I, or any other applicable unit.

\[\begin{split}\begin{bmatrix} X_a \\ X_b \\ X_c \\ \end{bmatrix} = \begin{bmatrix} 1 & 0 & 1 \\ -\frac{1}{2} & \frac{\sqrt{3}}{2} & 1 \\ -\frac{1}{2} & -\frac{\sqrt{3}}{2} & 1 \\ \end{bmatrix} \begin{bmatrix} X_{\alpha} \\ X_{\beta} \\ X_{\gamma} \\ \end{bmatrix}\end{split}\]

αβγ to dq0 transformation

uz_3ph_dq_t uz_transformation_3ph_alphabeta_to_dq(uz_3ph_alphabeta_t input, float theta_el_rad)

Calculates the dq0-components from the alpha-beta-gamma-components.

Parameters:
  • input – uz_3ph_alphabeta_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_3ph_dq_t outputs the calculated dq-components

This function converts the stationary \(\alpha\beta\gamma\) reference frame components into the dq0 rotating reference frame. X is a placeholder and can be replaced by either V, I, or any other applicable unit. The d-Axis has to be aligned with the A-phase.

\[\begin{split}\begin{bmatrix} X_{d} \\ X_{q} \\ X_{0} \end{bmatrix} = \begin{bmatrix} cos(\theta_{el}) & sin(\theta_{el}) & 0\\ -sin(\theta_{el}) & cos(\theta_{el}) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} X_{\alpha} \\ X_{\beta} \\ X_{\gamma} \end{bmatrix} \\\end{split}\]

dq0 to αβγ transformation

uz_3ph_alphabeta_t uz_transformation_3ph_dq_to_alphabeta(uz_3ph_dq_t input, float theta_el_rad)

Calculates the alpha-beta components from the dq-components.

Parameters:
  • input – uz_3ph_dq_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_3ph_alphabeta_t outputs the calculated alpha-beta-gamma-components

This function converts the dq0 rotating reference frame components into the stationary αβγ reference frame. X is a placeholder and can be replaced by either V, I, or any other applicable unit. The d-Axis has to be aligned with the A-phase.

\[\begin{split}\begin{bmatrix} X_{\alpha} \\ X_{\beta} \\ X_{\gamma} \end{bmatrix} = \begin{bmatrix} cos(\theta_{el}) & -sin(\theta_{el}) & 0\\ sin(\theta_{el}) & cos(\theta_{el}) & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} X_{d} \\ X_{q} \\ X_{0} \end{bmatrix} \\\end{split}\]

Multiphase systems

structs for sixphase VSD transformation

struct uz_6ph_abc_t

struct for variables of an abc six-phase-system

Public Members

float a1

Amplitude of the a1 phase

float b1

Amplitude of the b1 phase

float c1

Amplitude of the c1 phase

float a2

Amplitude of the a2 phase

float b2

Amplitude of the b2 phase

float c2

Amplitude of the c2 phase

struct uz_6ph_alphabeta_t

struct for variables of an alpha-beta-system six-phase-system

Public Members

float alpha

Amplitude of the alpha component

float beta

Amplitude of the beta component

float x

Amplitude of the x component

float y

Amplitude of the y component

float z1

Amplitude of the z1 component

float z2

Amplitude of the z2 component

struct uz_6ph_dq_t

struct for variables of an alpha-beta-system six-phase-system

Public Members

float d

Amplitude of the d component

float q

Amplitude of the q component

float x

Amplitude of the x component

float y

Amplitude of the y component

float z1

Amplitude of the z1 component

float z2

Amplitude of the z2 component

Functions for sixphase VSD systems transformation

6ph-abc to 6ph-αβγ transformation

uz_6ph_alphabeta_t uz_transformation_asym30deg_6ph_abc_to_alphabeta(uz_6ph_abc_t input)

Calculates the 6-phase alpha-beta components from the phase-amplitudes of an asymmetric (30 degree) six phase system.

Parameters:
  • input – uz_6ph_abc_t input of the phase amplitudes

Returns:

uz_6ph_alphabeta_t outputs the calculated six-phase alpha-beta components

The sixphase VSD transformation works like the following equations show:

\[\begin{split}\begin{bmatrix} C \end{bmatrix}= \frac{1}{3} \begin{bmatrix} cos(1\cdot 0\cdot\frac{\pi}{6}) & cos(1\cdot 4\cdot\frac{\pi}{6}) & cos(1\cdot 8\cdot\frac{\pi}{6}) & cos(1\cdot 1\cdot\frac{\pi}{6}) & cos(1\cdot 5\cdot\frac{\pi}{6}) & cos(1\cdot 9\cdot\frac{\pi}{6}) \\ sin(1\cdot 0\cdot\frac{\pi}{6}) & sin(1\cdot 4\cdot\frac{\pi}{6}) & sin(1\cdot 8\cdot\frac{\pi}{6}) & sin(1\cdot 1\cdot\frac{\pi}{6}) & sin(1\cdot 5\cdot\frac{\pi}{6}) & sin(1\cdot 9\cdot\frac{\pi}{6}) \\ cos(5\cdot 0\cdot\frac{\pi}{6}) & cos(5\cdot 4\cdot\frac{\pi}{6}) & cos(5\cdot 8\cdot\frac{\pi}{6}) & cos(5\cdot 1\cdot\frac{\pi}{6}) & cos(5\cdot 5\cdot\frac{\pi}{6}) & cos(5\cdot 9\cdot\frac{\pi}{6}) \\ sin(5\cdot 0\cdot\frac{\pi}{6}) & sin(5\cdot 4\cdot\frac{\pi}{6}) & sin(5\cdot 8\cdot\frac{\pi}{6}) & sin(5\cdot 1\cdot\frac{\pi}{6}) & sin(5\cdot 5\cdot\frac{\pi}{6}) & sin(5\cdot 9\cdot\frac{\pi}{6}) \\ cos(3\cdot 0\cdot\frac{\pi}{6}) & cos(3\cdot 4\cdot\frac{\pi}{6}) & cos(3\cdot 8\cdot\frac{\pi}{6}) & cos(3\cdot 1\cdot\frac{\pi}{6}) & cos(3\cdot 5\cdot\frac{\pi}{6}) & cos(3\cdot 9\cdot\frac{\pi}{6}) \\ sin(3\cdot 0\cdot\frac{\pi}{6}) & sin(3\cdot 4\cdot\frac{\pi}{6}) & sin(3\cdot 8\cdot\frac{\pi}{6}) & sin(3\cdot 1\cdot\frac{\pi}{6}) & sin(3\cdot 5\cdot\frac{\pi}{6}) & sin(3\cdot 9\cdot\frac{\pi}{6}) \\ \end{bmatrix}\end{split}\]
\[\begin{split}\begin{bmatrix} X_{\alpha} \\ X_{\beta} \\ X_{x} \\ X_{y} \\ X_{z_1} \\ X_{z_2} \end{bmatrix} = \begin{bmatrix} C \end{bmatrix}\cdot\begin{bmatrix} X_{a_1} \\ X_{b_1} \\ X_{c_1} \\ X_{a_2} \\ X_{b_2} \\ X_{c_2} \end{bmatrix}\end{split}\]

6ph-alpha-beta-gamma to 6ph-abc transformation

uz_6ph_abc_t uz_transformation_asym30deg_6ph_alphabeta_to_abc(uz_6ph_alphabeta_t input)

Calculates the abc-phases from the alphabeta components of an asymmetric (30 degree) six phase system.

Parameters:
  • input – uz_6ph_alphabeta_t struct

Returns:

uz_6ph_abc_t outputs the calculated abc-phases

The inverse transformation uses the inverse of the before shown matrix.

\[\begin{split}\begin{bmatrix} X_{a_1} \\ X_{b_1} \\ X_{c_1} \\ X_{a_2} \\ X_{b_2} \\ X_{c_2} \end{bmatrix} = \begin{bmatrix} C \end{bmatrix}^{-1}\cdot\begin{bmatrix} X_{\alpha} \\ X_{\beta} \\ X_{x} \\ X_{y} \\ X_{z_1} \\ X_{z_2} \end{bmatrix}\end{split}\]

6ph-αβγ to 6ph-dq transformation

uz_6ph_dq_t uz_transformation_asym30deg_6ph_alphabeta_to_dq(uz_6ph_alphabeta_t input, float theta_el_rad)

Calculates the dq components from alpha and beta and leaves the additional systems untouched.

Parameters:
  • input – uz_6ph_alphabeta_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_6ph_dq_t Outputs the calculated stationary and rotating reference frame values

6ph-αβγ-XY to 6ph-dq-xy transformation

uz_6ph_dq_t uz_transformation_asym30deg_6ph_alphabeta_XY_to_dq_xy(uz_6ph_alphabeta_t input, float theta_el_rad_dq, float theta_el_rad_xy)

Calculates the dq and rotated xy components from the alpha/beta and X/Y components. Leaves z1/z2 untouched.

Parameters:
  • input – uz_6ph_alphabeta_t

  • theta_el_rad_dq – electrical rotor angle in rad for dq-transformation

  • theta_el_rad_xy – electrical rotor angle in rad for xy-transformation

Returns:

uz_6ph_dq_t Outputs the calculated stationary and rotating reference frame values

6ph-dq to 6ph-αβγ transformation

uz_6ph_alphabeta_t uz_transformation_asym30deg_6ph_dq_to_alphabeta(uz_6ph_dq_t input, float theta_el_rad)

Calculates the alpha and beta components from the dq values and leaves the additional systems untouched.

Parameters:
  • input – uz_6ph_dq_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_6ph_alphabeta_t Outputs the calculated stationary reference frame values

6ph-dq-xy to 6ph-αβγ-XY transformation

uz_6ph_alphabeta_t uz_transformation_asym30deg_6ph_dq_xy_to_alphabeta_XY(uz_6ph_dq_t input, float theta_el_rad_dq, float theta_el_rad_xy)

Calculates the alpha/beta and X/Y components from the dq and rotated xy values and leaves z1/z2 untouched.

Parameters:
  • input – uz_6ph_dq_t struct

  • theta_el_rad_dq – electrical rotor angle in rad for dq-transformation

  • theta_el_rad_xy – electrical rotor angle in rad for xy-transformation

Returns:

uz_6ph_alphabeta_t Outputs the calculated stationary reference frame values

6ph-abc to 6ph-dq transformation

uz_6ph_dq_t uz_transformation_asym30deg_6ph_abc_to_dq(uz_6ph_abc_t input, float theta_el_rad)

Calculates the stationary reference frame values from the phase values using the VSD transformation. Afterwards calculates the dq components from alpha and beta only while leaving the additional stationary reference frame components untouched.

Parameters:
  • input – uz_6ph_abc_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_6ph_dq_t Outputs the calculated stationary and rotating reference frame values

6ph-abc to 6ph-dq-xy transformation

uz_6ph_dq_t uz_transformation_asym30deg_6ph_abc_to_dq_xy(uz_6ph_abc_t input, float theta_el_rad_dq, float theta_el_rad_xy)

Calculates the stationary reference frame values from the phase values using the VSD transformation. Afterwards calculates the dq and rotated xy components. Leaves the z1/z2 values untouched.

Parameters:
  • input – uz_6ph_abc_t struct

  • theta_el_rad_dq – electrical rotor angle in rad for dq-transformation

  • theta_el_rad_xy – electrical rotor angle in rad for xy-transformation

Returns:

uz_6ph_dq_t Outputs the calculated stationary and rotating reference frame values

6ph-dq to 6ph-abc transformation

uz_6ph_abc_t uz_transformation_asym30deg_6ph_dq_to_abc(uz_6ph_dq_t input, float theta_el_rad)

Calculates the alpha beta components from the dq components. Uses the stationary reference frame values to calculate the the abc values with the inverse VSD transformation.

Parameters:
  • input – uz_6ph_dq_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_6ph_abc_t Outputs the calculated abc-phases

6ph-dq-xy to 6ph-abc transformation

uz_6ph_abc_t uz_transformation_asym30deg_6ph_dq_xy_to_abc(uz_6ph_dq_t input, float theta_el_rad_dq, float theta_el_rad_xy)

Calculates the alpha/beta and XY components from the dq and rotated xy components. Uses the stationary reference frame values to calculate the the abc values with the inverse VSD transformation.

Parameters:
  • input – uz_6ph_dq_t struct

  • theta_el_rad_dq – electrical rotor angle in rad for dq-transformation

  • theta_el_rad_xy – electrical rotor angle in rad for xy-transformation

Returns:

uz_6ph_abc_t Outputs the calculated abc-phases

structs for ninephase VSD transformation

struct uz_9ph_abc_t

Struct for the natural variables of a nine-phase system.

Public Members

float a1

Amplitude of the a1 phase

float b1

Amplitude of the b1 phase

float c1

Amplitude of the c1 phase

float a2

Amplitude of the a2 phase

float b2

Amplitude of the b2 phase

float c2

Amplitude of the c2 phase

float a3

Amplitude of the a3 phase

float b3

Amplitude of the b3 phase

float c3

Amplitude of the c3 phase

struct uz_9ph_alphabeta_t

Struct for the variables of an alpha-beta nine-phase system.

Public Members

float alpha

Amplitude of the alpha component

float beta

Amplitude of the beta component

float x1

Amplitude of the x1 component

float y1

Amplitude of the y1 component

float x2

Amplitude of the x2 component

float y2

Amplitude of the y2 component

float x3

Amplitude of the x3 component

float y3

Amplitude of the y3 component

float zero

Amplitude of the zero component

struct uz_9ph_dq_t

Struct for the variable of an rotating dq-frame for nine-phase systems.

Public Members

float d

Amplitude of the d component

float q

Amplitude of the q component

float x1

Amplitude of the x1 component

float y1

Amplitude of the y1 component

float x2

Amplitude of the x2 component

float y2

Amplitude of the y2 component

float x3

Amplitude of the x3 component

float y3

Amplitude of the y3 component

float zero

Amplitude of the zero component

Naming of the subspaces according to [[2]].

Functions for ninephase VSD systems transformation

9ph-abc to 9ph-αβγ transformation

uz_9ph_alphabeta_t uz_transformation_9ph_abc_to_alphabeta(uz_9ph_abc_t input)

Calculates the stationary reference frame values from abc-phases using the ninephase VSD Transformation.

Parameters:
  • input – uz_9ph_abc_t

Returns:

uz_9ph_alphabeta_t Outputs the calculated stationary reference frame components

The amplitude invariant ninephase VSD transformation is defined by the following equations:

\[\begin{split}\begin{bmatrix} C \end{bmatrix}= \frac{2}{9} \begin{bmatrix} cos(1\cdot 0\cdot\frac{\pi}{9}) & cos(1\cdot 6\cdot\frac{\pi}{9}) & cos(1\cdot 12\cdot\frac{\pi}{9}) & cos(1\cdot 1\cdot\frac{\pi}{9}) & cos(1\cdot 7\cdot\frac{\pi}{9}) & cos(1\cdot 13\cdot\frac{\pi}{9}) & cos(1\cdot 2\cdot\frac{\pi}{9}) & cos(1\cdot 8\cdot\frac{\pi}{9}) & cos(1\cdot 14\cdot\frac{\pi}{9}) &\\ sin(1\cdot 0\cdot\frac{\pi}{9}) & sin(1\cdot 6\cdot\frac{\pi}{9}) & sin(1\cdot 12\cdot\frac{\pi}{9}) & sin(1\cdot 1\cdot\frac{\pi}{9}) & sin(1\cdot 7\cdot\frac{\pi}{9}) & sin(1\cdot 13\cdot\frac{\pi}{9}) & sin(1\cdot 2\cdot\frac{\pi}{9}) & sin(1\cdot 8\cdot\frac{\pi}{9}) & sin(1\cdot 14\cdot\frac{\pi}{9}) \\ cos(3\cdot 0\cdot\frac{\pi}{9}) & cos(3\cdot 6\cdot\frac{\pi}{9}) & cos(3\cdot 12\cdot\frac{\pi}{9}) & cos(3\cdot 1\cdot\frac{\pi}{9}) & cos(3\cdot 7\cdot\frac{\pi}{9}) & cos(3\cdot 13\cdot\frac{\pi}{9}) & cos(3\cdot 2\cdot\frac{\pi}{9}) & cos(3\cdot 8\cdot\frac{\pi}{9}) & cos(3\cdot 14\cdot\frac{\pi}{9}) \\ sin(3\cdot 0\cdot\frac{\pi}{9}) & sin(3\cdot 6\cdot\frac{\pi}{9}) & sin(3\cdot 12\cdot\frac{\pi}{9}) & sin(3\cdot 1\cdot\frac{\pi}{9}) & sin(3\cdot 7\cdot\frac{\pi}{9}) & sin(3\cdot 13\cdot\frac{\pi}{9}) & sin(3\cdot 2\cdot\frac{\pi}{9}) & sin(3\cdot 8\cdot\frac{\pi}{9}) & sin(3\cdot 14\cdot\frac{\pi}{9}) \\ cos(5\cdot 0\cdot\frac{\pi}{9}) & cos(5\cdot 6\cdot\frac{\pi}{9}) & cos(5\cdot 12\cdot\frac{\pi}{9}) & cos(5\cdot 1\cdot\frac{\pi}{9}) & cos(5\cdot 7\cdot\frac{\pi}{9}) & cos(5\cdot 13\cdot\frac{\pi}{9}) & cos(5\cdot 2\cdot\frac{\pi}{9}) & cos(5\cdot 8\cdot\frac{\pi}{9}) & cos(5\cdot 14\cdot\frac{\pi}{9}) \\ sin(5\cdot 0\cdot\frac{\pi}{9}) & sin(5\cdot 6\cdot\frac{\pi}{9}) & sin(5\cdot 12\cdot\frac{\pi}{9}) & sin(5\cdot 1\cdot\frac{\pi}{9}) & sin(5\cdot 7\cdot\frac{\pi}{9}) & sin(5\cdot 13\cdot\frac{\pi}{9}) & sin(5\cdot 2\cdot\frac{\pi}{9}) & sin(5\cdot 8\cdot\frac{\pi}{9}) & sin(5\cdot 14\cdot\frac{\pi}{9}) \\ cos(7\cdot 0\cdot\frac{\pi}{9}) & cos(7\cdot 6\cdot\frac{\pi}{9}) & cos(7\cdot 12\cdot\frac{\pi}{9}) & cos(7\cdot 1\cdot\frac{\pi}{9}) & cos(7\cdot 7\cdot\frac{\pi}{9}) & cos(7\cdot 13\cdot\frac{\pi}{9}) & cos(7\cdot 2\cdot\frac{\pi}{9}) & cos(7\cdot 8\cdot\frac{\pi}{9}) & cos(7\cdot 14\cdot\frac{\pi}{9}) \\ sin(7\cdot 0\cdot\frac{\pi}{9}) & sin(7\cdot 6\cdot\frac{\pi}{9}) & sin(7\cdot 12\cdot\frac{\pi}{9}) & sin(7\cdot 1\cdot\frac{\pi}{9}) & sin(7\cdot 7\cdot\frac{\pi}{9}) & sin(7\cdot 13\cdot\frac{\pi}{9}) & sin(7\cdot 2\cdot\frac{\pi}{9}) & sin(7\cdot 8\cdot\frac{\pi}{9}) & sin(7\cdot 14\cdot\frac{\pi}{9}) \\ \frac{1}{2} & \frac{1}{2} & \frac{1}{2} & -\frac{1}{2} & -\frac{1}{2} & -\frac{1}{2} & \frac{1}{2} & \frac{1}{2} & \frac{1}{2} \\ \end{bmatrix}\end{split}\]
\[\begin{split}\begin{bmatrix} X_{\alpha} \\ X_{\beta} \\ X_{x_1} \\ X_{y_1} \\ X_{x_2} \\ X_{y_2} \\ X_{x_3} \\ X_{y_3} \\ X_{zero} \end{bmatrix} = \begin{bmatrix} C \end{bmatrix}\cdot\begin{bmatrix} X_{a_1} \\ X_{b_1} \\ X_{c_1} \\ X_{a_2} \\ X_{b_2} \\ X_{c_2} \\ X_{a_3} \\ X_{b_3} \\ X_{c_3} \end{bmatrix}\end{split}\]

Transformation matrix according to [[3]][[4]].

9ph-αβγ to 9ph-abc transformation

uz_9ph_abc_t uz_transformation_9ph_alphabeta_to_abc(uz_9ph_alphabeta_t input)

Calculates the abc frame values from the stationary reference frame values using the inverse ninephase VSD Transformation.

Parameters:
  • input – uz_9ph_alphabeta_t struct

Returns:

uz_9ph_abc_t Outputs the calculated abc-phases

The inverse transformation uses the inverse of the before shown matrix.

\[\begin{split}\begin{bmatrix} X_{a_1} \\ X_{b_1} \\ X_{c_1} \\ X_{a_2} \\ X_{b_2} \\ X_{c_2} \\ X_{a_3} \\ X_{b_3} \\ X_{c_3} \end{bmatrix} = \begin{bmatrix} C \end{bmatrix}^{-1}\cdot\begin{bmatrix} X_{\alpha} \\ X_{\beta} \\ X_{x_1} \\ X_{y_1} \\ X_{x_2} \\ X_{y_2} \\ X_{x_3} \\ X_{y_3} \\ X_{zero} \end{bmatrix}\end{split}\]

9ph-αβγ to 9ph-dq transformation

uz_9ph_dq_t uz_transformation_9ph_alphabeta_to_dq(uz_9ph_alphabeta_t input, float theta_el_rad)

Calculates the dq components from alpha and beta and leaves the additional systems untouched.

Parameters:
  • input – uz_9ph_alphabeta_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_9ph_dq_t Outputs the calculated stationary and rotating reference frame values

9ph-dq to 9ph-αβγ transformation

uz_9ph_alphabeta_t uz_transformation_9ph_dq_to_alphabeta(uz_9ph_dq_t input, float theta_el_rad)

Calculates the alpha and beta components from the dq values and leaves the additional systems untouched.

Parameters:
  • input – uz_9ph_dq_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_9ph_alphabeta_t Outputs the calculated stationary reference frame values

9ph-abc to 9ph-dq transformation

uz_9ph_dq_t uz_transformation_9ph_abc_to_dq(uz_9ph_abc_t input, float theta_el_rad)

Calculates the stationary reference frame values from the phase values using the VSD transformation. Afterwards calculates the dq components from alpha and beta only while leaving the additional stationary reference frame components untouched.

Parameters:
  • input – uz_9ph_abc_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_9ph_dq_t Outputs the calculated stationary and rotating reference frame values

9ph-dq to 9ph-abc transformation

uz_9ph_abc_t uz_transformation_9ph_dq_to_abc(uz_9ph_dq_t input, float theta_el_rad)

Calculates the alpha beta components from the dq components. Uses the stationary reference frame values to calculate the the abc values with the inverse VSD transformation.

Parameters:
  • input – uz_9ph_dq_t struct

  • theta_el_rad – electrical rotor angle in rad

Returns:

uz_9ph_abc_t Outputs the calculated abc-phases

Example usage of the ninephase transformation

Listing 39 Application example
// declare necessary structs and variables
uz_9ph_abc_t natural_values = {0};             // holds the natural values
uz_9ph_alphabeta_t stationary_values = {0};    // holds the stationary reference frame values
uz_9ph_dq_t rotating_values = {0};             // holds the rotating reference frame and additional system stationary reference frame values
float theta_el = 0.0f;                         // electric rotor angle

// common usage
rotating_values = uz_transformation_9ph_abc_to_dq(natural_values, theta_el);
natural_values = uz_transformation_9ph_dq_to_abc(rotating_values, theta_el);

// accessing intermediate values
stationary_values = uz_transformation_9ph_abc_to_alphabeta(natural_values);
rotating_values = uz_transformation_9ph_alphabeta_to_dq(stationary_values, theta_el);
stationary_values = uz_transformation_9ph_dq_to_alphabeta(rotating_values, theta_el);
natural_values = uz_transformation_9ph_alphabeta_to_abc(stationary_values);

Adding transformations

When adding a new transformation for systems with different amounts of phases one must know if the principle of the existing VSD transformation can be used. If this is the case, go through the following steps:

  1. Copy the functions uz_9ph_clarke_transformation, uz_transformation_9ph_alphabeta_to_abc and uz_9ph_arraymul and rename them accordingly (e.g. uz_6ph_arraymul).

  2. Create the structs uz_alphabeta_9ph_t and uz_abc_9ph_t for the newly added phase system.

  3. In uz_9ph_arraymul adapt the expected array dimensions and limit of the for-loop to your amount of phases (everywhere where there is a 9).

  4. Do the same with the Clarke transformation functions and change the structs to your newly created ones. For the VSD transformation, the Matlab script (see below) can be used.

  5. Adapt the input/output writing accordingly.

To use the Matlab script that outputs the VSD matrix in C code, the variable “n” must be changed to the target amount of phases. The placeholder “VSD_MATRIX” should be replaced with the Matlab variable that holds the VSD matrix (e.g. from your workspace). The factor for amplitude invariance will be multiplied afterward so the user should not apply it to your VSD matrix by himself. The creation of a transformation matrix with this method was presented in [[1]].

Listing 40 Matlab script
%% VSD matrix
n = 9;
z = single(2/n*VSD_MATRIX);
invz = inv(z);

%% print code for normal matrix
fprintf('\nTransformation Matrix:\n');
printcode(z,n);

%% print code for inverse matrix
fprintf('\nInverse Transformation Matrix:\n');
printcode(invz,n);

%% function printcode function declare: print c code for matrix to 2D array
function printcode(matrix,phases)
  fprintf('float const vsd_mat[%d][%d] = \n{\n',phases,phases);
  for y = (0:(phases-1))
    fprintf('    { ');
    for x = (0:(phases-1))
      fprintf('%.7ff',matrix(y+1,x+1));
      if x<(phases-1)
        fprintf(', ');
      end
    end
  if y<(phases-1)
    fprintf(' },\n');
  else
    fprintf(' }\n');
  end
end
fprintf('};\n');
end

Sources