pyleecan.Functions.Electrical.dqh_transformation module

n2dqh_DataTime(data_n, is_dqh_rms=True, phase_dir=None)[source]

n phases to dqh equivalent coordinate transformation of DataTime object

Parameters:
  • data_n (DataTime) – data object containing values over time and phase axes

  • is_dqh_rms (boolean) – True to return dq currents in rms value (Pyleecan convention), False to return peak values

  • phase_dir (int) – direction of phase distribution: +/-1 (-1 clockwise) to enforce

Returns:

data_dqh – data object transformed in dqh frame

Return type:

DataTime

n2dqh(Z_n, angle_elec, is_dqh_rms=True, phase_dir=None)[source]

n phases to dqh equivalent coordinate transformation

Parameters:
  • Z_n (ndarray) – matrix (N x n) of n phases values

  • angle_elec (ndarray) – angle of the rotor coordinate system

  • is_dqh_rms (boolean) – True to return dq currents in rms value (Pyleecan convention), False to return peak values

  • phase_dir (int) – direction of phase distribution: +/-1 (-1 clockwise) to enforce

Returns:

Z_dqh – transformed matrix (N x 3) of dqh equivalent values

Return type:

ndarray

n2abc(Z_n, phase_dir=None)[source]

n phase to 3 phases equivalent coordinate transformation, i.e. Clarke transformation

Parameters:
  • Z_n (ndarray) – matrix (N x n) of n phase values

  • phase_dir (int) – direction of phase distribution: +/-1 (-1 clockwise) to enforce

Returns:

Z_abc – transformed matrix (N x 3) of 3 phases equivalent values (alpha-beta-gamma)

Return type:

ndarray

abc2dqh(Z_abc, angle_elec)[source]

alpha-beta-gamma to dqh coordinate transformation

Parameters:
  • Z_abc (ndarray) – matrix (N x 3) of alpha-beta-gamma - reference frame values

  • angle_elec (ndarray) – angle of the rotor coordinate system

Returns:

Z_dqh – transformed (dqh) values

Return type:

ndarray

dqh2n_DataTime(data_dqh, n, is_n_rms=False, phase_dir=None)[source]

dqh to n phase coordinate transformation of DataTime object

Parameters:
  • data_dqh (DataTime) – data object containing values over time in dqh frame

  • n (int) – number of phases

  • is_n_rms (boolean) – True to return n currents in rms value, False to return peak values (Pyleecan convention)

  • phase_dir (int) – direction of phase distribution: +/-1 (-1 clockwise) to enforce

Returns:

data_n – data object containing values over time and phase axes

Return type:

DataTime

dqh2n(Z_dqh, angle_elec, n, is_n_rms=False, phase_dir=None)[source]

dqh to n phase coordinate transformation

Parameters:
  • Z_dqh (ndarray) – matrix (N x 3) of dqh phase values

  • angle_elec (ndarray) – angle of the rotor coordinate system

  • n (int) – number of phases

  • is_n_rms (boolean) – True to return n currents in rms value, False to return peak values (Pyleecan convention)

  • phase_dir (int) – direction of phase distribution: +/-1 (-1 clockwise) to enforce

Returns:

Z_n – transformed matrix (N x n) of n phase values

Return type:

ndarray

abc2n(Z_abc, n=3, phase_dir=None)[source]

3 phase equivalent to n phase coordinate transformation, i.e. Clarke transformation

Parameters:
  • Z_abc (ndarray) – matrix (N x 3) of 3 phase equivalent values in alpha-beta-gamma frame

  • n (int) – number of phases

  • phase_dir (int) – direction of phase distribution: +/-1 (-1 clockwise) to enforce

Returns:

Z_n – transformed matrix (N x n) of n phase values

Return type:

ndarray

dqh2abc(Z_dqh, angle_elec)[source]

dqh to alpha-beta-gamma coordinate transformation

Parameters:
  • Z_dqh (ndarray) – matrix (N x 3) of dqh - reference frame values

  • angle_elec (ndarray) – angle of the rotor coordinate system

Returns:

Z_abc – transformed array

Return type:

ndarray

comp_Clarke_transform(n, is_inv=False, phase_dir=None)[source]

Compute Clarke transformation for given number of phases and rotating direction of phases

Parameters:
  • n (int) – number of phases

  • is_inv (bool) – False to return Clarke transform, True to return inverse of Clarke transform

  • phase_dir (int) – direction of phase distribution: +/-1 (-1 clockwise) to enforce

Returns:

mat – Clarke transform matrix of size (n, 3)

Return type:

ndarray

get_phase_dir_DataTime(data_n)[source]

Get the phase rotating direction of input n-phase DataTime object

Parameters:

data_n (DataTime) – data object containing values over time and phase axes

Returns:

phase_dir – rotating direction of phases +/-1

Return type:

int

get_phase_dir(Z_n, current_dir)[source]

Get the phase rotating direction of input n-phase quantity by looking at phase of maximum component

Parameters:
  • Z_n (ndarray) – matrix (N x n) of n phase values

  • current_dir (int) – direction of current waveform: +/-1 (-1 clockwise) to enforce

Returns:

phase_dir – rotating direction of phases +/-1

Return type:

int