Skip to content

A Simulink-like power electronics simulation environment built on LTspice, featuring ready-to-use circuit libraries and custom tools.

License

Notifications You must be signed in to change notification settings

kosokno/LTspicePowerSim

Repository files navigation

LTspicePowerSim

LTspicePowerSim is a Simulink-like power electronics simulation environment built on LTspice. It provides a library of ready-to-use circuit designs and custom tools, making power electronics simulation easier and more accessible for engineers and researchers.

Features

  • Optimized Models for Convergence: Includes circuit models specifically designed to enhance simulation convergence.
  • Transparent Model Definitions: All models are defined using LTspice schematic files (.asc), allowing users to view and edit the circuits directly as needed.
  • Extensive Example Circuits: From basic converters such as Buck and Boost to advanced circuits like resonant converters and PFC (Power Factor Correction), the repository includes a wide range of example circuits.

Symbols

alt text

Example List

alt text

Example Screen Shot

Type2 Compensator

alt text

Peak Current Control Buck Converter

alt text

Peak Current Control Boost Converter

alt text

Boundary Mode Flyback Converter

alt text

Phase Shift Full Bridge Converter

alt text

LLC Converter

alt text

2phase Interleaved Single phase input Totempole Bridgeless Boost PFC

alt text

Three phase input Totempole Bridgeless Boost PFC with Table Based Direct Power Control

alt text

Three phase input Totempole Bridgeless Boost PFC with Voltage Oriented Control and SVPWM

alt text

Discrete PID Compensator

alt text

Voltage mode buck with discrete control

alt text

2phase Stepper motor, micro step control

alt text

Nerural Network Conrolled Voltage mode buck using PyTorch2LTspice (WIP)

alt text

Getting Started

Prerequisites

To use LTspicePowerSim, you need to have the following installed:

  1. LTspice – A high-performance SPICE simulation software.
  2. Windows or macOS – The steps below cover installation for both operating systems.

Model Installation (Windows)

  • Copy the contents of the sym\PowerSim folder from this repository to:

    For LTspice 24.0.12 or earler
    C:\Users\<username>\AppData\Local\LTspice\lib\sym\PowerSim
    
    For LTspice 24.1.0 and up
    C:\Users\<username>\Documents\LTspice\lib\sym\PowerSim
    
  • Replace <username> with your username.

  • Or you can use following batch files in bat folders.

    File Name Description
    install.bat Copies the model files into the LTspice folder.
    clean.bat Removes all copied files from the LTspice folder.
    open_install_folder.bat Opens the LTspice directory where the files are installed.

    Note:
    Updated batch files to follow 24.1.0 onwards while keeping old ones in "old(-24.0.12)" folder.

  • For LTspice 24.1.0 and up you also need to set the path for the PowerSim folder to be able to open the example files correctly. Just go to Tools > Setting and add the path as shown below. alt text

Model Installation (macOS)

  • Copy the contents of the sym\PowerSim folder from this repository to:
    /Users/<username>/Library/Application Support/LTspice/lib/
    
  • Replace <username> with your username.

Tips

  • Simulation Convergence: In most cases, the simulation will work smoothly with the Normal Solver. However, if the simulation fails to converge, try switching to the Alternate Solver.
    You can change the solver settings by navigating to Tools > Settings, then selecting the SPICE > Engine > Solver section in the control panel.