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.
-
struct uz_3ph_dq_t
Struct for the variables of a dq0-System.
-
struct uz_3ph_alphabeta_t
Struct for the variables of a alpha-beta-gamma-System.
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.
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.
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.
αβγ 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.
αβγ 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.
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.
Multiphase systems
structs for sixphase VSD transformation
-
struct uz_6ph_abc_t
struct for variables of an abc six-phase-system
-
struct uz_6ph_alphabeta_t
struct for variables of an alpha-beta-system six-phase-system
-
struct uz_6ph_dq_t
struct for variables of an alpha-beta-system six-phase-system
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:
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.
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-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-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-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
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
-
float a1
-
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
-
float alpha
-
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
-
float d
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:
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.
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
// 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:
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).
Create the structs uz_alphabeta_9ph_t and uz_abc_9ph_t for the newly added phase system.
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).
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.
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].
%% 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
- 1
Zoric, M. Jones and E. Levi, “Vector space decomposition algorithm for asymmetrical multiphase machines,” 2017 International Symposium on Power Electronics (Ee), 2017, pp. 1-6, doi: 10.1109/PEE.2017.8171682.
- 2
Zabaleta, “Permament Magnet Multiphase Machine Modeling and Control for MV Wind Energy Applications”, Dissertation, Liverpool John Moores University, 2018, doi: 10.24377/LJMU.t.00008818.
- 3
Rockhill and T. A. Lipo, “A generalized transformation methodology for polyphase electric machines and networks,” 2015 IEEE International Electric Machines & Drives Conference (IEMDC), 2015, pp. 27-34, doi: 10.1109/IEMDC.2015.7409032.
- 4
Rockhill and T. A. Lipo, “A simplified model of a nine phase synchronous machine using vector space decomposition,” 2009 IEEE Power Electronics and Machines in Wind Applications, 2009, pp. 1-5, doi: 10.1109/PEMWA.2009.5208335.