Git Product home page Git Product logo

gym-electric-motor's Introduction

Gym Electric Motor

Overview paper | Reinforcement learning paper | Quickstart | Install guide | Reference docs | Release notes

Build Status codecov PyPI version shields.io License DOI Zenodo DOI JOSS

Overview

The gym-electric-motor (GEM) package is a Python toolbox for the simulation and control of various electric motors. It is built upon OpenAI Gym Environments, and, therefore, can be used for both, classical control simulation and reinforcement learning experiments. It allows you to construct a typical drive train with the usual building blocks, i.e., supply voltages, converters, electric motors and load models, and obtain not only a closed-loop simulation of this physical structure, but also a rich interface for plugging in any decision making algorithm, from linear feedback control to Deep Deterministic Policy Gradient agents.

Getting Started

An easy way to get started with GEM is by playing around with the following interactive notebooks in Google Colaboratory. Most important features of GEM as well as application demonstrations are showcased, and give a kickstart for engineers in industry and academia.

There is a list of standalone example scripts as well for minimalistic demonstrations.

A basic routine is as simple as:

import gym_electric_motor as gem

if __name__ == '__main__':
    env = gem.make("Finite-CC-PMSM-v0")  # instantiate a discretely controlled PMSM
    env.reset()
    for _ in range(10000):
        env.render()  # visualize environment
        (states, references), rewards, done, _ =\ 
        	env.step(env.action_space.sample())  # pick random control actions
        if done:
            (states, references) = env.reset()
    env.close()

Installation

  • Install gym-electric-motor from PyPI (recommended):
pip install gym-electric-motor
  • Install from Github source:
git clone [email protected]:upb-lea/gym-electric-motor.git 
cd gym-electric-motor
# Then either
python setup.py install
# or alternatively
pip install -e .

Building Blocks

A GEM environment consists of following building blocks:

  • Physical structure:
    • Supply voltage
    • Converter
    • Electric motor
    • Load model
  • Utility functions for reference generation, reward calculation and visualization

Information Flow in a GEM Environment

Among various DC-motor models, the following AC motors - together with their power electronic counterparts - are available:

  • Permanent magnet synchronous motor (PMSM),
  • Synchronous reluctance motor (SynRM)
  • Squirrel cage induction motor (SCIM)
  • Doubly-fed induction motor (DFIM)

The converters can be driven by means of a duty cycle (continuous control set) or switching commands (finite control set).

Citation

A white paper for the general toolbox in the context of drive simulation and control prototyping can be found in the Journal of Open Sorce Software (JOSS). Please use the following BibTeX entry for citing it:

@article{Balakrishna2021,
    doi = {10.21105/joss.02498},
    url = {https://doi.org/10.21105/joss.02498},
    year = {2021},
    publisher = {The Open Journal},
    volume = {6},
    number = {58},
    pages = {2498},
    author = {Praneeth {Balakrishna} and Gerrit {Book} and Wilhelm {Kirchgässner} and Maximilian {Schenke} and Arne {Traue} and Oliver {Wallscheid}},
    title = {gym-electric-motor (GEM): A Python toolbox for the simulation of electric drive systems},
    journal = {Journal of Open Source Software}
}

A white paper for the utilization of this framework within reinforcement learning is available at IEEE-Xplore (preprint: arxiv.org/abs/1910.09434). Please use the following BibTeX entry for citing it:

@article{9241851,  
    doi={10.1109/TNNLS.2020.3029573}
    author={A. {Traue} and G. {Book} and W. {Kirchgässner} and O. {Wallscheid}},  
    journal={IEEE Transactions on Neural Networks and Learning Systems},   
    title={Toward a Reinforcement Learning Environment Toolbox for Intelligent Electric Motor Control},   
    year={2020},  volume={},  number={},      
    pages={1-10},  
}

Running Unit Tests with Pytest

To run the unit tests ''pytest'' is required. All tests can be found in the ''tests'' folder. Execute pytest in the project's root folder:

>>> pytest

or with test coverage:

>>> pytest --cov=./

All tests shall pass.

gym-electric-motor's People

Contributors

atra94 avatar wkirgsn avatar fbook98 avatar max-schenke avatar gitpascalp avatar xydrkrulof avatar wallscheid avatar rohithcharand avatar praneeth-b avatar traviscibot avatar otteri avatar pramodcm95 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.