How to implement voltage source inverter connected to a resistive load in Simscape in a proper way?

I am trying to implement a simple voltage source inverter connected to a resistive load in open loop. An LCL filter is also included to filter out the switching frequency components from current. The simscape model of this VSI I tried to implement has been attached (gatedrive_openloop_simscape.png). The VSI makes use of MOSFET with gate drive circuitry for the provision of gate pulses. The MOSFET (external diode is connected for MOSFET) with gate drive circuit is implemented as shown in the figure (MOSFET_with_gatedrive.png) attached.
Is the following implementation correct? Also, to verify my circuit I tried running it but it runs very slow and takes a lot of time. Is there any better way to optimize it? The solver configuration is also attached (solver_simscape_config) below.
Please help in resolving this problem. I wanted to make use of gatedriver for the inverter.

Answers (1)

Hi Avinash,
I see that you are implementing a high-fidelity model that is using N-Channel MOSFET blocks with gate driving circuitry. I am expecting this model to run slowly as you are experiencing.
Do you really need this high-level of fidelity?
  1. If not you can use the "sibling" MOSFET (Ideal, Switching) block or even an elegant solution with the Converter (Three-Phase) block. With these implementations you can get rid of the gate driving circuitry and drive the gates directly from the PWM, thus enhancing the performance of you simulation. NOTE#1: I see that you are using PWM block from Specialized Power Systems. Even though this is possible, are you aware that in Simscape > Electrical > Control > Pulse Width Modulation you can use the PWM Generator (Three-phase, Two-level) block more efficiently? NOTE#2: you may want to double check the Simulink solver settings as well. The recommended solver for this type of simulation is ode23t with relatively not too small tolerances.
  2. If you need this high-level of fidelity, I would recommend you parameterize you N-Channel MOSFET block by using lookup tables. To do so, from Parameterization you have to select Lookup Table (2-D, temperature indipendent) or the 3-D temperature dependant variant. This way you can run a detailed model in a reasonable amount of time. However, you need to parameterize the MOSFET from a datasheet, which requires digitalization of the current-voltage and capacitances-voltage device characteristics.
Anyhow, the concepts of converter model fidelity, solver settings, power semiconductor device parameterization, are covered in the training course I authored: Power Electronics Control Design with Simulink and Simscape (see schedule).

8 Comments

Hi,
I tried the first point you suggested of using the ideal MOSFET in simscape library. This speeds up the simulation time and works in open loop. Finially in the end I wanted to use this for a closed loop control. Using simulink blocks the same control works but with simscape switches, it has few issues. It gives me errors but it still manages to run (however output is not correct). It gives me the following error at the begining (simulation_error.png).
Thanks.
Hi again,
Can you show how you connect the PWM Generator (Three-phase, Two-level) block outputs to the gats of your MOSFETs? I have a strong feeling the error message has to do with that.
Cheers,
Antonino
Following is the way I am implementing.
  1. There is closed loop control implementation which generates the reference modulating signals for the VSI.
  2. The reference are given to PWM generator block which was suggested in earlier post with DC bus voltage of 800V.
  3. Dead time of 0.4us is also there.
  4. Since switch has thresh hold voltage of 2V, PWM signals are multiplied with a gain of 15 which goes to pulse for switches.
Hi,
Your logical steps make sense to me. However, I am afraid that I do need to open your model to do debugging more systematically. Feel free.
Cheers,
Antonino
Hi,
I am working on a closed loop model whose output waveforms seem to be dependent on switching waveforms of MOSFET. This simcape block would still limit it to ideal switching characteristics of MOSFET. Is there any way I could incorparate practical switching of MOSFET in simscape or simulink faster? I have currently a working model in simulink but that too has ideal switching only. The switch could use any datasheet parameters in case it is available.
Thanks
Hi Avinash,
You can refer to the following doc page:
  1. Parameterization Methods (from this page you can follow the links under “Topics”)
My advice for you would be to use the MOSFET (Ideal, Switching) block and use the ee_importDeviceParameters function to import and xml file you can donwload from a power semiconductor manufacturer. Notice that "ideal, switching" means that you won't see switching transients. Rather, still switching events but the device would log info about conduction and switching losses as istantaneus calculations. From that you can assess converter losses and efficiciency with the ee_getEfficiency function.
If you are instead interested in switching transients (to see the Miller effect, the negative current spikes given by diode reverse recovery, etc.) you may need to use the N-Channel MOSFET block. For balncing details and simulation speed my advice is to parameterize it using 2-D or 3-D tables after the device characteristics that you may want to digitalize with the graphImporter available since R24a.
Both topics are well covered in the Power Electronics Control Design with Simulink and Simscape training course I authored. {the learning curve is pretty long if you attempt learning by yourself}
Cheers,
Antonino
Hi,
Following is the attached simscape file of a volatge source inverter connected to resistance load. It is operating in open-loop condition. To understand how the n-channel MOSFET with gate driver circuit works, I am trying to simulate this simple circuit but I am facing few errors. I am using MATLAB version 2020a.
Thanks
Firstly, does xml file provided by manufacturers work for simscape ? When I try to import, I get errors.
Then is there any way that i can get a plot only for switching losses ?
And I can give values for "collector current for switching loss", "Turn on energy loss" and "Turn off energy loss for N-channel IGBT but not for N-channel MOSFET block ? Am I missing something or is it not possible with Simscape?

Sign in to comment.

Communities

More Answers in the  Power Electronics Control

Products

Release

R2020a

Asked:

on 30 Jan 2025

Edited:

on 12 May 2026

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!