Giter VIP home page Giter VIP logo

acmsimpy's Introduction

acmsimpy logo

Motor Control Simulation and its Visualization

This project is initially intended to adopt the PyOneDark Qt Modern GUI for visualization, but ueasterday (2022-09-18) I found a better solutioin with DearPyGui. The file main.py uses the PySide6 (or PyQt6) and the DearPyGui is simply a script /simulation/dem_demo.py.

installation

    1. Install Anaconda 3 and open command prompt cmd.exe on Windows
    1. conda create -n main python=3.10
    1. conda activate main
    1. pip install PySide6 matplotlib pandas numba qtconsole control dearpygui
    1. cd /d D:\acmsimpy
    1. python main.py for PySide6 GUI or python ./simulation/dem_demo.py for DearPyGui. Or, you can simply run any core script in ./simulation folder, e.g., python ./simulation/tutorials_ep6_maglev_motor.py.

To avoid PyQt plugin issues (with Anaconda Python 3.8), please go with Anaconda Python 3.10 as exemplified above.

Examples

PyOneDark (with PySide6) Example

What is shown in the screenshot below is a dual-rotor-topology axial-flux in-wheel motor driven by a three-phase voltage source inverter. Space-vector PWM with deadtime insertedd and a 300 V DC bus are simulated. The motor is closed-loop controlled with speed/position feedback. The speed command is sinusoidals and aims to sweep through different frequencies to inspect dynamic speed control performance.

Example 1

DEM (with DearPyGUi) Example

add later

Features

  • A unified ac motor model based on active flux concept by Ion Boldea is implemented. Thanks to this, all AC motors can be simulated as control target.
  • Numerical simulation is done by Runge–Kutta method (RK4, ode4).
  • Space-vector PWM is implemented according to TI ControlSUITE.
  • User input logic separation from code and a modern GUI.
  • Batch making technical-paper-ready figures. The code is the figure itself not the .pdf file!
  • Real-time simulation as if you are debugging in CCS with an actual motor. You can change anything during the simulation in real-time. This is a feature that even Simulink does not provide.
  • With DearPyGui (a python binding or wrapper for implot and imgui), GPU accelerated rendering plots is now possible, yay!

acmsimpy's People

Contributors

horychen 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.