Skip to content

Commit

Permalink
Merge pull request #193 from upb-lea/nightly
Browse files Browse the repository at this point in the history
Version 1.1.0
  • Loading branch information
wkirgsn authored Jun 15, 2022
2 parents e836cd4 + ee7f35d commit f08d629
Show file tree
Hide file tree
Showing 167 changed files with 6,117 additions and 6,738 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ examples/logs/
.coverage

/my_examples/
.vscode/settings.json
.vscode/launch.json
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
##[Unreleased]
## Added

## Changed

## Fixed

## [1.1.0] - 2022-04-25
## Added
- Physical System Wrappers as a new feature to process actions and states directly in the environment. A decent introduction can be found in the [GEM cookbook](https://github.com/upb-lea/gym-electric-motor/blob/nightly/examples/environment_features/GEM_cookbook.ipynb) (Paragraph 2.8)
- The externally excited synchronous motor (EESM) has been added to the GEM-toolbox.
- The environments of the EESM can be instantiated with the following keys: "{Cont|Finite}-{CC|TC|SC}-EESM-v0",

## Changed
- The MotorDashboard has received a "initialize()" method to initialize the plots below a specific cell.
- The MotorDashboard is now compatible with the "%matplotlib widget" backend. Therefore, GEM is now compatible with the integrated jupiter notebook execution of Visual Studio Code

## Fixed
- If multiple converters were used and the time constant tau was changed from its default values, it was possible that the values of tau were different in each converter


## [1.0.1] - 2021-12-20
Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@


# -- Options for LaTeX output ------------------------------------------------
latex_packages = r'''
\usepackage{amsmath}
'''

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
Expand All @@ -131,6 +134,7 @@
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
'packages': latex_packages
}

# Grouping the document tree into LaTeX files. List of tuples
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ documentation specifies the basic interfaces inside a physical system.
parts/reference_generators/reference_generator
parts/reward_functions/reward_function
parts/physical_systems/physical_system
parts/physical_system_wrappers/physical_system_wrapper
parts/visualizations/visualization
parts/constraint_monitor
parts/core
Expand Down
2 changes: 1 addition & 1 deletion docs/parts/callbacks.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Callbacks
#####
##########

.. automodule:: gym_electric_motor.callbacks
:members:
2 changes: 1 addition & 1 deletion docs/parts/constraints/constraint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Constraint Base Class
#####################

How To: Define Your Own Constraints
________________________________
___________________________________


Constraint API Documentation
Expand Down
2 changes: 1 addition & 1 deletion docs/parts/environments/dfim/abccont_cc_dfim.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Abc-Continuous Current Control Doubly Fed Induction Motor Environment
**********************************************************************
.. autoclass:: gym_electric_motor.envs.AbcContCurrentControlDoublyFedInductionMotorEnv
.. autoclass:: gym_electric_motor.envs.ContCurrentControlDoublyFedInductionMotorEnv
:members:
2 changes: 1 addition & 1 deletion docs/parts/environments/dfim/abccont_sc_dfim.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Abc-Continuous Speed Control Doubly Fed Induction Motor Environment
**********************************************************************
.. autoclass:: gym_electric_motor.envs.AbcContSpeedControlDoublyFedInductionMotorEnv
.. autoclass:: gym_electric_motor.envs.ContSpeedControlDoublyFedInductionMotorEnv
:members:
2 changes: 1 addition & 1 deletion docs/parts/environments/dfim/abccont_tc_dfim.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Abc-Continuous Torque Control Doubly Fed Induction Motor Environment
**********************************************************************
.. autoclass:: gym_electric_motor.envs.AbcContTorqueControlDoublyFedInductionMotorEnv
.. autoclass:: gym_electric_motor.envs.ContTorqueControlDoublyFedInductionMotorEnv
:members:
4 changes: 4 additions & 0 deletions docs/parts/environments/eesm/cont_cc_eesm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Continuous Control Set Current Control Externally Excited Synchronous Motor Environment
***************************************************************************************
.. autoclass:: gym_electric_motor.envs.ContCurrentControlExternallyExcitedSynchronousMotorEnv
:members:
4 changes: 4 additions & 0 deletions docs/parts/environments/eesm/cont_sc_eesm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Continuous Control Set Speed Control Externally Excited Synchronous Motor Environment
**************************************************************************************
.. autoclass:: gym_electric_motor.envs.ContSpeedControlExternallyExcitedSynchronousMotorEnv
:members:
4 changes: 4 additions & 0 deletions docs/parts/environments/eesm/cont_tc_eesm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Continuous Control Set Torque Control Externally Excited Synchronous Motor Environment
***************************************************************************************
.. autoclass:: gym_electric_motor.envs.ContTorqueControlExternallyExcitedSynchronousMotorEnv
:members:
12 changes: 12 additions & 0 deletions docs/parts/environments/eesm/eesm_envs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Externally Excited Synchronous Motor Environments
************************************************


.. toctree::
:maxdepth: 2
:caption: Environments:
:glob:

*


4 changes: 4 additions & 0 deletions docs/parts/environments/eesm/finite_cc_eesm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Finite Control Set Current Control Externally Excited Synchronous Motor Environment
**********************************************************************************
.. autoclass:: gym_electric_motor.envs.FiniteCurrentControlExternallyExcitedSynchronousMotorEnv
:members:
4 changes: 4 additions & 0 deletions docs/parts/environments/eesm/finite_sc_eesm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Finite Control Set Speed Control Externally Excited Synchronous Motor Environment
************************************************************************************
.. autoclass:: gym_electric_motor.envs.FiniteSpeedControlExternallyExcitedSynchronousMotorEnv
:members:
4 changes: 4 additions & 0 deletions docs/parts/environments/eesm/finite_tc_eesm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Finite Control Set Torque Control Externally Excited Synchronous Motor Environment
*********************************************************************************
.. autoclass:: gym_electric_motor.envs.FiniteTorqueControlExternallyExcitedSynchronousMotorEnv
:members:
52 changes: 26 additions & 26 deletions docs/parts/environments/environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ In general, all environment-ids are structured as follows:

``ControlType-ControlTask-MotorType-v0``

- The ``ControlType`` is in ``{Finite / Cont}`` for all DC Motors and in ``{Finite / AbcCont / DqCont}`` for all AC Motors
- The ``ControlType`` is in ``{Finite / Cont}`` for finite control set and continuous control set action spaces
- The ``ControlTask`` is in ``{TC / SC / CC}`` (Torque / Speed / Current Control)
- The ``MotorType`` is in ``{PermExDc / ExtExDc / SeriesDc / ShuntDc / PMSM / SynRM / DFIM / SCIM }``
- The ``MotorType`` is in ``{PermExDc / ExtExDc / SeriesDc / ShuntDc / PMSM / SynRM / / EESM / DFIM / SCIM }``


=================================================================== ==============================
Expand Down Expand Up @@ -53,50 +53,49 @@ Continuous Current Control Shunt DC Motor Environment ``'Cont-CC-
**Permanent Magnet Synchronous Motor (PMSM) Environments**

Finite Torque Control PMSM Environment ``'Finite-TC-PMSM-v0'``
Abc-Continuous Torque Control PMSM Environment ``'AbcCont-TC-PMSM-v0'``
Dq-Continuous Torque Control PMSM Environment ``'DqCont-TC-PMSM-v0'``
Torque Control PMSM Environment ``'Cont-TC-PMSM-v0'``
Finite Speed Control PMSM Environment ``'Finite-SC-PMSM-v0'``
Abc-Continuous Speed Control PMSM Environment ``'Abc-Cont-SC-PMSM-v0'``
Dq-Continuous Speed Control PMSM Environment ``'Dq-Cont-SC-PMSM-v0'``
Speed Control PMSM Environment ``'Cont-SC-PMSM-v0'``
Finite Current Control PMSM Environment ``'Finite-CC-PMSM-v0'``
Abc-Continuous Current Control PMSM Environment ``'AbcCont-CC-PMSM-v0'``
Dq-Continuous Current Control PMSM Environment ``'DqCont-CC-PMSM-v0'``
Current Control PMSM Environment ``'Cont-CC-PMSM-v0'``


**Externally Excited Synchronous Motor (EESM) Environments**

Finite Torque Control EESM Environment ``'Finite-TC-EESM-v0'``
Torque Control EESM Environment ``'Cont-TC-EESM-v0'``
Finite Speed Control EESM Environment ``'Finite-SC-EESM-v0'``
Speed Control EESM Environment ``'Cont-SC-EESM-v0'``
Finite Current Control EESM Environment ``'Finite-CC-EESM-v0'``
Current Control EESM Environment ``'Cont-CC-EESM-v0'``

**Synchronous Reluctance Motor (SynRM) Environments**

Finite Torque Control SynRM Environment ``'Finite-TC-SynRM-v0'``
Abc-Continuous Torque Control SynRM Environment ``'AbcCont-TC-SynRM-v0'``
Dq-Continuous Torque Control SynRM Environment ``'DqCont-TC-SynRM-v0'``
Torque Control SynRM Environment ``'Cont-TC-SynRM-v0'``
Finite Speed Control SynRM Environment ``'Finite-SC-SynRM-v0'``
Abc-Continuous Speed Control SynRM Environment ``'Abc-Cont-SC-SynRM-v0'``
Dq-Continuous Speed Control SynRM Environment ``'Dq-Cont-SC-SynRM-v0'``
Speed Control SynRM Environment ``'Cont-SC-SynRM-v0'``
Finite Current Control SynRM Environment ``'Finite-CC-SynRM-v0'``
Abc-Continuous Current Control SynRM Environment ``'AbcCont-CC-SynRM-v0'``
Dq-Continuous Current Control SynRM Environment ``'DqCont-CC-SynRM-v0'``
Current Control SynRM Environment ``'Cont-CC-SynRM-v0'``

**Squirrel Cage Induction Motor (SCIM) Environments**

Finite Torque Control SCIM Environment ``'Finite-TC-SCIM-v0'``
Abc-Continuous Torque Control SCIM Environment ``'AbcCont-TC-SCIM-v0'``
Dq-Continuous Torque Control SCIM Environment ``'DqCont-TC-SCIM-v0'``
Torque Control SCIM Environment ``'Cont-TC-SCIM-v0'``
Finite Speed Control SCIM Environment ``'Finite-SC-SCIM-v0'``
Abc-Continuous Speed Control SCIM Environment ``'Abc-Cont-SC-SCIM-v0'``
Dq-Continuous Speed Control SCIM Environment ``'Dq-Cont-SC-SCIM-v0'``
Speed Control SCIM Environment ``'Cont-SC-SCIM-v0'``
Finite Current Control SCIM Environment ``'Finite-CC-SCIM-v0'``
Abc-Continuous Current Control SCIM Environment ``'AbcCont-CC-SCIM-v0'``
Dq-Continuous Current Control SCIM Environment ``'DqCont-CC-SCIM-v0'``
Current Control SCIM Environment ``'Cont-CC-SCIM-v0'``

**Doubly Fed Induction Motor (DFIM) Environments**

Finite Torque Control DFIM Environment ``'Finite-TC-DFIM-v0'``
Abc-Continuous Torque Control DFIM Environment ``'AbcCont-TC-DFIM-v0'``
Dq-Continuous Torque Control DFIM Environment ``'DqCont-TC-DFIM-v0'``
Torque Control DFIM Environment ``'Cont-TC-DFIM-v0'``
Finite Speed Control DFIM Environment ``'Finite-SC-DFIM-v0'``
Abc-Continuous Speed Control DFIM Environment ``'Abc-Cont-SC-DFIM-v0'``
Dq-Continuous Speed Control DFIM Environment ``'Dq-Cont-SC-DFIM-v0'``
Speed Control DFIM Environment ``'Cont-SC-DFIM-v0'``
Finite Current Control DFIM Environment ``'Finite-CC-DFIM-v0'``
Abc-Continuous Current Control DFIM Environment ``'AbcCont-CC-DFIM-v0'``
Dq-Continuous Current Control DFIM Environment ``'DqCont-CC-DFIM-v0'``
Current Control DFIM Environment ``'Cont-CC-DFIM-v0'``

=================================================================== ==============================

.. toctree::
Expand All @@ -109,6 +108,7 @@ Dq-Continuous Current Control DFIM Environment ``'DqCont-C
series_dc/series_dc_envs
shunt_dc/shunt_dc_envs
pmsm/pmsm_envs
eesm/eesm_envs
synrm/synrm_envs
scim/scim_envs
dfim/dfim_envs
Expand Down
4 changes: 0 additions & 4 deletions docs/parts/environments/pmsm/abccont_cc_pmsm.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/parts/environments/pmsm/abccont_sc_pmsm.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/parts/environments/pmsm/abccont_tc_pmsm.rst

This file was deleted.

4 changes: 4 additions & 0 deletions docs/parts/environments/pmsm/cont_cc_pmsm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Current Control Permanent Magnet Synchronous Motor Environment
*****************************************************************************
.. autoclass:: gym_electric_motor.envs.ContCurrentControlPermanentMagnetSynchronousMotorEnv
:members:
4 changes: 4 additions & 0 deletions docs/parts/environments/pmsm/cont_sc_pmsm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Speed Control Permanent Magnet Synchronous Motor Environment
****************************************************************************
.. autoclass:: gym_electric_motor.envs.ContSpeedControlPermanentMagnetSynchronousMotorEnv
:members:
4 changes: 4 additions & 0 deletions docs/parts/environments/pmsm/cont_tc_pmsm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Torque Control Permanent Magnet Synchronous Motor Environment
******************************************************************************
.. autoclass:: gym_electric_motor.envs.ContTorqueControlPermanentMagnetSynchronousMotorEnv
:members:
4 changes: 0 additions & 4 deletions docs/parts/environments/pmsm/dqcont_cc_pmsm.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/parts/environments/pmsm/dqcont_sc_pmsm.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/parts/environments/pmsm/dqcont_tc_pmsm.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/parts/environments/scim/abccont_cc_scim.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Abc-Continuous Current Control Squirrel Cage Induction Motor Environment
*************************************************************************
.. autoclass:: gym_electric_motor.envs.AbcContCurrentControlSquirrelCageInductionMotorEnv
.. autoclass:: gym_electric_motor.envs.ContCurrentControlSquirrelCageInductionMotorEnv
:members:
2 changes: 1 addition & 1 deletion docs/parts/environments/scim/abccont_sc_scim.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Abc-Continuous Speed Control Squirrel Cage Induction Motor Environment
**********************************************************************
.. autoclass:: gym_electric_motor.envs.AbcContSpeedControlSquirrelCageInductionMotorEnv
.. autoclass:: gym_electric_motor.envs.ContSpeedControlSquirrelCageInductionMotorEnv
:members:
2 changes: 1 addition & 1 deletion docs/parts/environments/scim/abccont_tc_scim.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Abc-Continuous Torque Control Squirrel Cage Induction Motor Environment
************************************************************************
.. autoclass:: gym_electric_motor.envs.AbcContTorqueControlSquirrelCageInductionMotorEnv
.. autoclass:: gym_electric_motor.envs.ContTorqueControlSquirrelCageInductionMotorEnv
:members:
2 changes: 1 addition & 1 deletion docs/parts/environments/synrm/abccont_cc_synrm.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Abc-Continuous Current Control Synchronous Reluctance Motor Environment
*****************************************************************************
.. autoclass:: gym_electric_motor.envs.AbcContCurrentControlSynchronousReluctanceMotorEnv
.. autoclass:: gym_electric_motor.envs.ContCurrentControlSynchronousReluctanceMotorEnv
:members:
2 changes: 1 addition & 1 deletion docs/parts/environments/synrm/abccont_sc_synrm.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Abc-Continuous Speed Control Synchronous Reluctance Motor Environment
****************************************************************************
.. autoclass:: gym_electric_motor.envs.AbcContSpeedControlSynchronousReluctanceMotorEnv
.. autoclass:: gym_electric_motor.envs.ContSpeedControlSynchronousReluctanceMotorEnv
:members:
2 changes: 1 addition & 1 deletion docs/parts/environments/synrm/abccont_tc_synrm.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Abc-Continuous Torque Control Synchronous Reluctance Motor Environment
******************************************************************************
.. autoclass:: gym_electric_motor.envs.AbcContTorqueControlSynchronousReluctanceMotorEnv
.. autoclass:: gym_electric_motor.envs.ContTorqueControlSynchronousReluctanceMotorEnv
:members:
39 changes: 39 additions & 0 deletions docs/parts/physical_systems/electric_motors/eesm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Extertnally Excited Synchronous Motor
######################################

Schematic
*********
.. figure:: ../../../plots/ESB_EESM_dq.svg

.. math::
L_{\sigma \mathrm{d}} &= L_\mathrm{d} - L_\mathrm{m} \\
L_{\sigma \mathrm{e}} &= L_\mathrm{e} - L_\mathrm{m} \\
\psi_\mathrm{d} &= L_\mathrm{d} i_\mathrm{sd} + L_\mathrm{m} i_\mathrm{e} \\
\psi_\mathrm{q} &= L_\mathrm{q} i_\mathrm{sq}
Electrical ODE
**************

.. math::
\sigma = \frac{L_\mathrm{d} L_\mathrm{e} - L_\mathrm{m}^2}{L_\mathrm{d} L_\mathrm{e}}
.. math::
\frac{\mathrm{d} i_\mathrm{sd}}{\mathrm{d} t} &= - \frac{ R_\mathrm{s} }{ \sigma L_{\mathrm{d} } } i_\mathrm{sd} + \frac{L_\mathrm{q}}{\sigma L_\mathrm{d}} p \omega_\mathrm{me} i_\mathrm{sq} + \frac{L_\mathrm{m} R_\mathrm{e}}{\sigma L_\mathrm{d} L_\mathrm{e}} i_\mathrm{e} + \frac{1}{\sigma L_\mathrm{d}} u_\mathrm{d} - \frac{L_\mathrm{m}}{\sigma L_\mathrm{d} L_\mathrm{e}} u_\mathrm{e} \\
\frac{\mathrm{d} i_\mathrm{sq}}{\mathrm{d} t} &= -\frac{L_\mathrm{d}}{L_\mathrm{q}} p \omega_\mathrm{me} i_\mathrm{sd} - \frac{R_\mathrm{s}}{L_\mathrm{q}} i_\mathrm{sq} - \frac{L_\mathrm{m}}{L_\mathrm{q}} p \omega_\mathrm{me} i_\mathrm{e} + \frac{1}{L_\mathrm{q}} u_\mathrm{q} \\
\frac{\mathrm{d} i_\mathrm{e}}{\mathrm{d} t} &= \frac{L_\mathrm{m} R_\mathrm{s}}{\sigma L_\mathrm{d} L_\mathrm{e}} i_\mathrm{sd} - \frac{L_\mathrm{m} L_\mathrm{q}}{ \sigma L_\mathrm{d} L_\mathrm{e}} p \omega_\mathrm{me} i_\mathrm{sq} - \frac{R_\mathrm{s}}{ \sigma L_\mathrm{e}} i_\mathrm{e} - \frac{L_\mathrm{m}}{\sigma L_\mathrm{d}L_\mathrm{e}} u_\mathrm{d} + \frac{1}{\sigma L_\mathrm{e}} u_\mathrm{e} \\
\frac{\mathrm{d} \varepsilon_\mathrm{el}}{\mathrm{d} t} &= p \omega_\mathrm{me} \\
Torque Equation
***************

.. math::
T = 1.5 p (L_\mathrm{m} i_\mathrm{e} + (L_\mathrm{d} - L_\mathrm{q}) i_\mathrm{sd}) i_\mathrm{sq}
Code Documentation
******************

.. autoclass:: gym_electric_motor.physical_systems.electric_motors.ExternallyExcitedSynchronousMotor
:members:
:inherited-members:
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Electric Motors
series
shunt
pmsm
eesm
synrm
scim
dfim
Expand Down
6 changes: 6 additions & 0 deletions docs/parts/state_action_processors/cos_sin_processor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Cos Sin Processor
#####################

.. autoclass:: gym_electric_motor.physical_system_wrappers.CosSinProcessor
:members:
:inherited-members:
6 changes: 6 additions & 0 deletions docs/parts/state_action_processors/current_sum_processor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Current Sum Processor
######################

.. autoclass:: gym_electric_motor.physical_system_wrappers.current_sum_processor.CurrentSumProcessor
:members:
:inherited-members:
6 changes: 6 additions & 0 deletions docs/parts/state_action_processors/dead_time_processor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Dead Time Processor
#####################

.. autoclass:: gym_electric_motor.physical_system_wrappers.DeadTimeProcessor
:members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Dq To Abc Action Processor
##########################

.. autoclass:: gym_electric_motor.physical_system_wrappers.DqToAbcActionProcessor
:members:
:inherited-members:

6 changes: 6 additions & 0 deletions docs/parts/state_action_processors/flux_observer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Flux Observer
######################

.. autoclass:: gym_electric_motor.physical_system_wrappers.FluxObserver
:members:
:inherited-members:
Loading

0 comments on commit f08d629

Please sign in to comment.