Doubly Fed Induction Motor

Schematic

../../../_images/ESB_DFIM_alphabeta.svg

Electrical ODE

\[\begin{split}\frac{\mathrm{d} i_\mathrm{s \alpha}}{\mathrm{d} t}&= -\frac{1}{\tau_\sigma} i_\mathrm{s \alpha} + \frac{R_\mathrm{r} L_\mathrm{m}}{\sigma L_\mathrm{r}^2 L_\mathrm{s}} \psi_\mathrm{r \alpha} + p \omega_\mathrm{\text{me}} \frac{L_\mathrm{m}}{\sigma L_\mathrm{r} L_\mathrm{s}} \psi_\mathrm{r \beta} + \frac{1}{\sigma L_\mathrm{s}} u_\mathrm{s \alpha} - \frac{L_\mathrm{m}}{\sigma L_\mathrm{r} L_\mathrm{s}} u_\mathrm{r \alpha}\\ \frac{\mathrm{d} i_\mathrm{s \beta}}{\mathrm{d} t}&= -\frac{1}{\tau_\sigma} i_\mathrm{s \beta} - p \omega_\mathrm{\text{me}} \frac{L_\mathrm{m}}{\sigma L_\mathrm{r} L_\mathrm{s}} \psi_\mathrm{r \alpha} + \frac{R_\mathrm{r} L_\mathrm{m}}{\sigma L_\mathrm{r}^2 L_\mathrm{s}} \psi_\mathrm{r \beta} + \frac{1}{\sigma L_\mathrm{s}} u_\mathrm{s \beta} - \frac{L_\mathrm{m}}{\sigma L_\mathrm{r} L_\mathrm{s}} u_\mathrm{r \beta}\\ \frac{\mathrm{d} \psi_\mathrm{r \alpha}}{\mathrm{d} t}&= \frac{L_\mathrm{m}}{\tau_\mathrm{r}} i_\mathrm{s \alpha} - \frac{1}{\tau_\mathrm{r}} \psi_\mathrm{r \alpha} - p \omega_\mathrm{\text{me}} \psi_\mathrm{r \beta} + u_\mathrm{r \alpha}\\ \frac{\mathrm{d} \psi_\mathrm{r \beta}}{\mathrm{d} t}&= \frac{L_\mathrm{m}}{\tau_\mathrm{r}} i_\mathrm{s \beta} + p \omega_\mathrm{\text{me}} \psi_\mathrm{r \alpha} - \frac{1}{\tau_\mathrm{r}} \psi_\mathrm{r \beta} + u_\mathrm{r \beta}\\ \frac{\mathrm{d} \varepsilon_\mathrm{el}}{\mathrm{d} t}&= p \omega_\mathrm{me}\end{split}\]

with

\[\begin{split}L_\mathrm{s} &= L_\mathrm{m} + L_\mathrm{\sigma s} & \quad L_\mathrm{r} &= L_\mathrm{m} + L_\mathrm{\sigma r}\\ \sigma &= \frac{L_\mathrm{r} L_\mathrm{s} - L_\mathrm{m}^2}{L_\mathrm{r} L_\mathrm{s}} & \quad \tau_\mathrm{r} &=\frac{L_\mathrm{r}}{R_\mathrm{r}} & \quad \tau_\sigma &= \frac{\sigma L_\mathrm{s}}{R_\mathrm{s} + R_\mathrm{r} \frac{L_\mathrm{m}^2}{L_\mathrm{r}^2}}\end{split}\]

Torque Equation

\[T=\frac{3}{2} p \frac{L_\mathrm{m}}{L_\mathrm{r}} (\psi_\mathrm{r \alpha} i_\mathrm{s \beta} - \psi_\mathrm{r \beta} i_\mathrm{s \alpha})\]

Code Documentation

class gym_electric_motor.physical_systems.electric_motors.DoublyFedInductionMotor(**kwargs)[source]

Motor Parameter

Unit

Default Value

Description

r_s

Ohm

4.42

Stator resistance

r_r

Ohm

3.51

Rotor resistance

l_m

H

297.5e-3

Main inductance

l_sigs

H

25.71e-3

Stator-side stray inductance

l_sigr

H

25.71e-3

Rotor-side stray inductance

p

1

2

Pole pair number

j_rotor

kg/m^2

13.695e-3

Moment of inertia of the rotor

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_sa

A

Current through branch a

i_sb

A

Current through branch b

i_sc

A

Current through branch c

i_salpha

A

Current in alpha axis

i_sbeta

A

Current in beta axis

Rotor flux

Unit

Description

psi_rd

Vs

Direct axis of the rotor oriented flux

psi_rq

Vs

Quadrature axis of the rotor oriented flux

psi_ra

Vs

Rotor oriented flux in branch a

psi_rb

Vs

Rotor oriented flux in branch b

psi_rc

Vs

Rotor oriented flux in branch c

psi_ralpha

Vs

Rotor oriented flux in alpha direction

psi_rbeta

Vs

Rotor oriented flux in beta direction

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_sa

V

Stator voltage through branch a

u_sb

V

Stator voltage through branch b

u_sc

V

Stator voltage through branch c

u_salpha

V

Stator voltage in alpha axis

u_sbeta

V

Stator voltage in beta axis

u_ralpha

V

Rotor voltage in alpha axis

u_rbeta

V

Rotor voltage in beta axis

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_sa

Current in phase a

i_sb

Current in phase b

i_sc

Current in phase c

i_salpha

Current in alpha axis

i_sbeta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

omega

Mechanical angular Velocity

torque

Motor generated torque

u_sa

Voltage in phase a

u_sb

Voltage in phase b

u_sc

Voltage in phase c

u_salpha

Voltage in alpha axis

u_sbeta

Voltage in beta axis

u_sd

Voltage in direct axis

u_sq

Voltage in quadrature axis

u_ralpha

Rotor voltage in alpha axis

u_rbeta

Rotor voltage in beta axis

Note: The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). A phase voltage denotes the potential difference from a line to the neutral point in contrast to the line voltage between two lines. Typically the RMS value for the line voltage (\(U_L\)) is given as \(\hat{u}_S=\sqrt{2/3}~U_L\)

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). Typically the RMS value for the phase current (\(I_S\)) is given as \(\hat{i}_S = \sqrt{2}~I_S\)

If not specified, nominal values are equal to their corresponding limit values. Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from the general limits/nominal values (e.g. i)

Parameters:
  • motor_parameter – Motor parameter dictionary. Contents specified for each motor.

  • nominal_values – Nominal values for the motor quantities.

  • limit_values – Limits for the motor quantities.

  • motor_initializer

    Initial motor states (currents) (‘constant’, ‘uniform’, ‘gaussian’ sampled from

    given interval or out of nominal motor values)

  • initial_limits – limits for of the initial state-value

CURRENTS = ['i_salpha', 'i_sbeta']

List of the motor currents names

Type:

CURRENTS(list(str))

CURRENTS_IDX = [0, 1]

Indices for accessing all motor currents.

Type:

CURRENTS_IDX(list(int))

HAS_JACOBIAN = True

Parameter indicating if the class is implementing the optional jacobian function

VOLTAGES = []

List of the motor input voltages names

Type:

VOLTAGES(list(str))

electrical_jacobian(state, u_in, omega, *args)

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also be set to True. Otherwise, the jacobian will not be called.

Parameters:
  • state (ndarray(float)) – The motors state.

  • u_in (list(float)) – The motors input voltages.

  • omega (float) – Angular velocity of the motor

Returns:

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) [1]: Derivatives of all electrical motor states over omega shape:(states,) [2]: Derivative of Torque over all motor states shape:(states,)

Return type:

Tuple(ndarray, ndarray, ndarray)

electrical_ode(state, u_sr_alphabeta, omega, *args)

The differential equation of the Induction Motor.

Parameters:
  • state – The momentary state of the motor. [i_salpha, i_sbeta, psi_ralpha, psi_rbeta, epsilon]

  • omega – The mechanical load

  • u_sr_alphabeta – The input voltages [u_salpha, u_sbeta, u_ralpha, u_rbeta]

Returns:

The derivatives of the state vector d/dt( [i_salpha, i_sbeta, psi_ralpha, psi_rbeta, epsilon])

i_in(state)
Parameters:

state (ndarray(float)) – ODE state of the motor

Returns:

List of all currents flowing into the motor.

Return type:

list(float)

property initial_limits

Returns: dict: nominal motor limits for choosing initial values

initialize(state_space, state_positions, **__)

Initializes given state values. Values can be given as a constant or sampled random out of a statistical distribution. Initial value is in range of the nominal values or a given interval. Values are written in initial_states attribute

Parameters:
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • state_positions (dict) – indices of system states (given by physical system)

property initializer

Returns: dict: Motor initial state and additional initializer parameter

property limits

Readonly motors limit state array. Entries are set to the maximum physical possible values in case of unspecified limits.

Returns:

Limits of the motor.

Return type:

dict(float)

property motor_parameter

Returns: dict(float): The motors parameter dictionary

next_generator()

Sets a new reference generator for a new episode.

property nominal_values

Readonly motors nominal values.

Returns:

Current nominal values of the motor.

Return type:

dict(float)

static q(quantities, epsilon)

Transformation of the dq-representation into alpha-beta using the electrical angle

Parameters:
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • epsilon – Current electrical angle of the motor

Returns:

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

static q_inv(quantities, epsilon)

Transformation of the alpha-beta-representation into dq using the electrical angle

Parameters:
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • epsilon – Current electrical angle of the motor

Returns:

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

Note

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. So this method calls q(quantities, -epsilon).

q_inv_me(quantities, epsilon)

Transformation of the alpha-beta-representation into dq using the mechanical angle

Parameters:
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • epsilon – Current mechanical angle of the motor

Returns:

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

Note

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. So this method calls q(quantities, -epsilon).

q_me(quantities, epsilon)

Transformation of the dq-representation into alpha-beta using the mechanical angle

Parameters:
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • epsilon – Current mechanical angle of the motor

Returns:

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

property random_generator

The random generator that has to be used to draw the random numbers.

reset(state_space, state_positions, omega=None)

Reset the motors state to a new initial state. (Default 0)

Parameters:
  • state_space (gymnasium.Box) – normalized state space boundaries

  • state_positions (dict) – indexes of system states

Returns:

The initial motor states.

Return type:

numpy.ndarray(float)

seed(seed=None)

The function to set the seed.

This function is called by within the global seed call of the environment. The environment passes the sub-seed to this component that is generated based on the source-seed of the env.

Parameters:

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every episode start. Default: None (a new SeedSequence is generated).

Returns:

A list containing all seeds within this RandomComponent. In general, this list has length 1. If the RandomComponent holds further RandomComponent instances, the list has to contain also these entropies. The entropy of this instance has to be placed always at first place.

Return type:

List(int)

property seed_sequence

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

static t_23(quantities)

Transformation from abc representation to alpha-beta representation

Parameters:

quantities – The properties in the abc representation like ‘’[u_a, u_b, u_c]’’

Returns:

The converted quantities in the alpha-beta representation like ‘’[u_alpha, u_beta]’’

static t_32(quantities)

Transformation from alpha-beta representation to abc representation

Parameters:

quantities – The properties in the alpha-beta representation like [u_alpha, u_beta]

Returns:

The converted quantities in the abc representation like [u_a, u_b, u_c]