Finite Control Set Torque Control Six Phase Permanent Magnet Synchronous Motor Environment
- class gym_electric_motor.envs.FiniteTorqueControlSixPhasePermanentMagnetSynchronousMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
- Description:
Environment to simulate Finite control set torque controlled six phase permanent magnet synchr. motor.
- Key:
' Finite-TC-SIXPMSM-v0'
- Default Components:
Supply:
IdealVoltageSupply
Converter:
FiniteB6BridgeConverter
Motor:
SixPhasePMSM
Load:
ConstantSpeedLoad
Ode-Solver:
ScipyOdeSolver
Reference Generator:
WienerProcessReferenceGenerator
Reference Quantity:'torque'
Reward Function:
WeightedSumOfErrors
reward_weights:'torque' = 1.0
Visualization:
MotorDashboard
current and action plotsConstraints:
SquaredConstraint
on the currents'i_sd', 'i_sq', 'i_sx', 'i_sy'
- State Variables:
['omega' , 'torque', 'i_a1', 'i_b1', 'i_c1', 'i_a2', 'i_b2', 'i_c2', 'i_sd', 'i_sq', 'i_sx', 'i_sy', 'u_a1', 'u_b1', 'u_c1', 'u_a2', 'u_b2', 'u_c2', 'u_sd', 'u_sq', 'u_sx', 'u_sy', 'epsilon', 'u_sup']
- Reference Variables:
['torque']
- Control Cycle Time:
tau = 1e-4 seconds
- Observation Space:
Type: Tuple(State_Space, Reference_Space)
- State Space:
Box(low=23 * [-1], high=23 * [1])
- Reference Space:
Box(low=[-1, -1], high=[1, 1])
Action Space:
- Initial State:
Zeros on all state variables.
Example
>>> import gym_electric_motor as gem >>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator >>> # Update the default arguments to the voltage supply by passing a parameter dict >>> my_changed_voltage_supply_args = {'u_nominal': 400.0} >>> >>> # Replace the reference generator by passing a new instance >>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator( ... reference_state='i_sq', ... sigma_range=(1e-3, 1e-2) ... ) >>> env = gem.make( ... "Finite-TC-SIXPMSM-v0", ... voltage_supply=my_changed_voltage_supply_args, ... reference_generator=my_new_ref_gen_instance ... ) >>> terminated = True >>> for _ in range(1000): >>> if terminated: >>> state, reference = env.reset() >>> (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
- Parameters:
supply (env-arg) – Specification of the
VoltageSupply
for the environmentconverter (env-arg) – Specification of the
PowerElectronicConverter
for the environmentmotor (env-arg) – Specification of the
ElectricMotor
for the environmentload (env-arg) – Specification of the
MechanicalLoad
for the environmentode_solver (env-arg) – Specification of the
OdeSolver
for the environmentreward_function (env-arg) – Specification of the
RewardFunction
for the environmentreference_generator (env-arg) – Specification of the
ReferenceGenerator
for the environmentvisualization (env-arg) – Specification of the
ElectricMotorVisualization
for the environmentconstraints (iterable(str/Constraint)) –
All Constraints of the environment.
str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)
can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)
instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and
passed to the environment.
calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the simulation. This may lead to speed improvements. Default: True
tau (float) – Duration of one control step in seconds. Default: 1e-4.
state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)
callbacks (list(Callback)) – Callbacks for user interaction. Default: ()
physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the
Default (actions to and states from the physical system before they are used in the environment.) – ()
- Note on the env-arg type:
All parameters of type env-arg can be selected as one of the following types:
instance: Pass an already instantiated object derived from the corresponding base class (e.g.
reward_function=MyRewardFunction()
). This is directly used in the environment.dict: Pass a dict to update the default parameters of the default type. (e.g.
visualization=dict(state_plots=('omega', 'u'))
)str: Pass a string out of the registered classes to select a different class for the component. This class is then initialized with its default parameters. The available strings can be looked up in the documentation. (e.g.
converter='Finite-2QC'
)