This article discusses the parameter tuning of a PSIM Level 2 switch model using a SPICE model as a reference. As you may already know, PSIM offers a wide variety of switch types. Check out the following article about different switch model options before reviewing this one.
Learning how to navigate through the PSIM switch model options
    
        
             
    
A common issue that arises is that some users wish to use a specific switch for their application, but only a SPICE model is available for that particular device. This means that users are limited to using the Hyperspice or LTspice solver. Furthermore, PSIM also offers a high fidelity model, which is much more robust than the spice based syntax models. Its called LvL2 or LvL3 switch model and is available both for MOS/Sic/GaN and IGBTs.
    
        
             
    
For this reason, we will attempt to convert the SPICE model into a Level 2 model to make the simulation compatible with the PSIM solver.
PSIM schematic 
To implement the SPICE-to-Level 2 model conversion, we developed the following PSIM schematic.
    
        
             
    
In the parameter file, there is a parameter named “SPICE”. When it is set to 1, the SPICE submodel is activated, while setting it to 0 activates the Level 2 submodel. 
    
        
             
    
Right now we cannot support mixed PSIM/Spice simulations. Not all PSIM blocks are supported by spice and PSIM cannot solve schematics containing spice syntax. This is why we need to disable/enable subcircuits and click on a different solver each time. This is going to change in PSIM upcoming versions.
For more info about spice simulations in PSIM, you should watch the following videos
At the example we worked on, the main objective is to match the Vds curves. To achieve this, we formulate a minimization problem where the objective function represents the area between the two curves. Of course it is up to the user to define the objective function. 
    
        
             
    
Hyperstudy analysis
To solve this optimization problem, we will use HyperStudy and import two models: one that uses the Hyperspice solver and another that uses the PSIM solver. If you have not worked with HyperStudy before, you should refer to the following article, 
Automating PSIM with Hyperstudy vs Scripting
and if you haven't connected Hyperspice solver to Hyperstudy before, you should read the article below 
Connecting HyperStudy with HyperSpice & LTspice using a PSIM schematic
Model and Parameters Import
As mentioned earlier, we import two models: one that uses the PSIM solver and another that uses the Hyperspice solver.
    
        
             
    
Among the imported parameters, there are two key variables — SPICE and SPICE_psim — which define which model is selected.
    
        
             
    
The SPICE parameter must be set to 1, and SPICE_psim to 0. The LvL2 model parameters used to search for the optimal solution are shown in the following picture,
    
        
             
    
but first navigate to Help >> Index >> Type Level2 in PSIM and read the following tutorials.
    
        
             
    
The optimization results indicate the minimum area between the Vds curves, which is defined as shown at the pictures below.
    
        
             
    
By clicking on the three dots icon at the "File" column a window will pop-up which is needed to define the calculated area.
    
        
             
    
Keep in mind that you can trim the bounds of time axis to focus on optimizing specifically turn on or turn off events.
The area is minimized using Adaptive Response Surface Method for 50 runs
    
        
             
    
When all the runs are done, we reach to the minimum calculated area,
    
        
             
    
The following figure indicates the Vds curves in the same plot.
    
        
             
    
With this technique we managed to find the parameters of the Level 2 model that is multiple times faster than the Spice one with a comparable accuracy. 
    
        
             
    
We can apply the same process to analyze the current flowing through the switches, or alternatively, we can examine the turn-on and turn-off conditions separately and much more switches' characteristics.
Uploaded files
At the following .zip file you will find the PSIM simulation and Hyperstudy analysis
When you open the lv2_study.hstx file, a folder with the same name will be automatically created. Place the attached .tpl file inside this folder.
As a last step, you have to open PSIM v2025 and set it as the default PSIM application, as there is a problem with PSIM v2025.1 and automated spice calls. Until it's fixed please use the PSIM v2025.
    
        
            