Six Phase Permanent Magnet Synchronous Motor
Electrical ODE
Torque Equation
Code Documentation
- class gym_electric_motor.physical_systems.electric_motors.SixPhasePMSM(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
Motor Parameter
Unit
Default Value
Description
r_s
Ohm
64.3e-3
Stator resistance
l_d
H
125e-6
Direct axis inductance
l_q
H
126e-6
Quadrature axis inductance
l_x
H
39e-6
x-axis inductance
l_y
H
35e-6
y-axis inductance
p
1
5
Pole pair number
psi_PM
Vs
4.7e-3
flux linkage of the permanent magnets
Motor Currents
Unit
Description
i_sd
A
Direct axis current
i_sq
A
Quadrature axis current
i_sx
A
Stator current in the counter-rotating system
i_sy
A
Stator current in the counter-rotating system
i_salpha
A
Stator current in alpha direction
i_sbeta
A
Stator current in beta direction
i_sX
A
Stator current in X direction
i_sY
A
Stator current in Y direction
i_sa1
A
Stator current in phase a1
i_sa2
A
Stator current in phase a2
i_sb1
A
Stator current in phase b1
i_sb2
A
Stator current in phase b2
i_sc1
A
Stator current in phase c1
i_sc2
A
Stator current in phase c2
Motor Voltages
Unit
Description
u_sd
V
Direct axis voltage
u_sq
V
Quadrature axis voltage
u_sx
V
voltage in the counter-rotating system
u_sy
V
voltage in the counter-rotating system
u_a1
V
Phase voltage in phase a1
u_a2
V
Phase voltage in phase a2
u_b1
V
Phase voltage in phase b1
u_b2
V
Phase voltage in phase b2
u_c1
V
Phase voltage in phase c1
u_c2
V
Phase voltage in phase c2
Limits /
Nominal Value Dictionary Entries:
Entry
Description
i
General current limit / nominal value
- 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_sd', 'i_sq', 'i_sx', 'i_sy']
List of the motor currents names
- Type:
CURRENTS(list(str))
- CURRENTS_IDX = [0, 1, 2, 3]
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 = ['u_sd', 'u_sq', 'u_sx', 'u_sy']
List of the motor input voltages names
- Type:
VOLTAGES(list(str))
- electrical_jacobian(state, u_in, omega, *args)[source]
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_dqxy, omega, *_)[source]
The differential equation of the Six phase PMSM.
- Parameters:
state – The current state of the motor. [i_sd, i_sq, i_sx, i_sy, epsilon]
omega – electrical rotational speed
u_qdxy – The input voltages [u_sd, u_sq, u_sx, u_sy]
- Returns:
The derivatives of the state vector d/dt([i_sd, i_sq, i_sx, i_sy, epsilon])
- i_in(state)[source]
- 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 abc representation into dq using the electrical angle
- Parameters:
quantities – the properties in the abc representation like ‘’[i_sa1, i_sb1, i_sc1, i_sa2, i_sb2, i_sc2]’’
epsilon – electrical rotor position
- Returns:
The converted quantities in the dq representation like ‘’[i_sd, i_sq, i_sx, i_sy, i_s0+, i_s0-]’’. since 2N topology is considered (case where the neutral points are not connected) i_s0+, i_s0- will not be taken into account
- static q_inv(quantities, epsilon)
Transformation of the dq representation into abc
- Parameters:
quantities – the properties in the dq representation like ‘’[i_sd, i_sq, i_sx, i_sy, i_s0+, i_s0-]’’.
epsilon – electrical rotor position
- Returns:
The converted quantities in the abc representation like ‘’[i_sa1, i_sb1, i_sc1, i_sa2, i_sb2, i_sc2]’’.
- property random_generator
The random generator that has to be used to draw the random numbers.
- reset(state_space, state_positions, **__)[source]
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_46(quantities)
Transformation from abc representation to alpha-beta representation
- Parameters:
quantities – The properties in the abc representation like ‘’[i_sa1, i_sb1, i_sc1, i_sa2, i_sb2, i_sc2]’’
- Returns:
The converted quantities in the alpha-beta representation like ‘’[i_salpha, i_sbeta, i_sX, i_sY]’’