Using SPICE Models with Simscape
Overview
MathWorks engineers will demonstrate how to import a manufacturer's SPICE subcircuits into Simscape using different workflows. Control and system design engineers can then use these imported components to simulate or validate their control algorithms with selected manufacturers' power electronics.
Highlights
- Initial system-level converter design using abstract semiconductor device
- Convert SPICE to a lookup-table representation for validating the converter design
- Convert SPICE to an equivalent Simscape block for validating the converter design
About the Presenters
Since joining MathWorks in 2018, Yifan Yang has contributed as a Senior Physical Modeling Engineer in the Simscape Electrical team, specializing in power electronics modeling. Yifan holds a PhD from the University of Cambridge, with research focusing on semiconductor modeling and circuit design.
Danielle Chu is a product manager at MathWorks supporting the Simscape product family and specializing in power electronics and battery systems. Prior to joining MathWorks, Danielle was at John Deere for 7 years, involved in developing power electronics control systems. She received her PhD in electrical engineering from the University of South Carolina and her MS in electrical engineering from Mississippi State University.
Recorded: 20 Nov 2024
Hi, my name is Danielle Chu. I have been a product manager at MathWorks for three years. Prior to MathWorks, I worked at John Deere for seven years on power electronics control and control system integration after half a year postdoctoral experience at the Florida State University. I'm joined by my colleague Yifan Yang, a physical modeling engineer at MathWorks for five years, focusing on electronic systems. She has a PhD from the University of Cambridge, specializing in power electronics and semiconductor modeling.
Today, you are here because you work on converter design. You use Simulink and Simscape to develop power electronics control algorithms. At this stage, you are using abstract semiconductor device models like ideal switching to develop and test your control algorithms. Then you look for detailed semiconductor models to validate your converter design. At this stage, you download these detailed models-- typically SPICE models-- from the semiconductor vendor's website.
Now, here comes the questions. How do you integrate the SPICE models into your systems and how do you parameterize the models? What about the simulation speed?
We have the answers to your questions. Simscape provides semiconductor models with different fidelity levels, which enables you to choose the right model based on your engineering goals. We offer abstract models which are fast running models without charging dynamics. You can use them to design voltage controllers or inner loop current controllers. Validate the system behavior in multi-domain systems like electrical drive systems.
The abstract models have a thermal port option, enabling you to estimate loss and efficiency. Customers often use them for initial analysis to find the ideal part from the manufacturer. We also have detailed models with charge. These include gate voltage-dependent, tabulated current voltage curves or physical based nonlinear models.
SPICE models are normally nonlinear detailed models. You can use these models to analyze circuit transients down to device time constants-- for example, to confirm a suitable blanking time to prevent shoot through. They are also very useful for designing your software switching converter and gate drives.
This webinar focuses on using SPICE models with Simscape for converter design and detailed validation. We are going to show the entire workflow of designing and validating a converter using different fidelity levels. First, we will show how to do a system-level converter design using ideal switching or abstract model.
Then we will demonstrate detailed converter validation using two methods with SPICE models. One method is to convert the SPICE models to a lookup table representation in Simscape. The other method is to convert the SPICE model to an equivalent Simscape block. Now I will hand it over to Yifan, who will walk you through the workflows.
Thanks, Danielle. Welcome, everyone. Now let me show you the workflow to design your converter using both fast running and detailed model simultaneously in Simscape. We will start with the initial system-level converter design using ideal switching MOSFETs.
For this example, we want to use our converter in our automotive 48 to 12 volt application, with a target efficiency around 85%. In the application, such as hybrid electric vehicles, the DC/DC converter is a mandatory part of our overall system. It typically supplies electrical energy to a 12 volt system, which is powered by a 48 starter generator. In this example, we assume all the controllers and key circuit parameters, such as the main inductors and capacitance values of the converter, has already been designed.
The question for us now is, how can we parameterize these MOSFETs? In the initial analysis of a buck converter design, it's actually sufficient to use ideal switching models instead of detailed model MOSFETs. It will result in faster simulation speed and allow you, our designers, to effectively explore the design space.
Here is an easy way to do parameterization. If you double click on the block-- and you will see there is a hyperlink saying, Click to Select. Clicking it will open the Block Parameterization Manager. It's opening. This is the interface of the Block Parameterization Manager of MOSFETs.
And here is a list. You can select your parts from the list from different manufacturers. And if you find the one that you want to use, then you just simply click on, Apply All.
And the parts with permuted parameters from the vendor's datasheet and other information will automatically populate your block.
Now you can see that the block has already labeled with the corresponding part number and manufacturer. And the Select Parts hyperlink is also labeled with the part number.
All the parameters like on-state voltage, on-state current, and also the switching losses-- da-da-da-- and also the diode, if it's included. They are all there. They have all been parameterized. Now your selected part is ready to use.
If you want certain parts but not in the previous list, please let us know by the link below. In my case, unfortunately, the particular part I would like to select is not in the list. However, I can still use the datasheet to parameterize my device. I just need two parameters. One is the threshold voltage, another is on-state resistance for the drain and source resistance.
Regarding the switching losses, models that account for these losses may not be available in the datasheet. And sometimes they may not be that accurate for your converter typology. So therefore, we can start with the ideal switching model and later incorporate a data model to evaluate the switching losses. And then sequentially, we use them back to the ideal switching losses for the ideal switching for design iteration. This approach helps to refine the initial system-level design and ensure it meets the desired simulation performance.
Now, when you pass a parameter while its ready-- so here we just are using the threshold voltage and the on-state resistance. They are totally linear. So you can perform the initial analysis with a very fast simulation speed. It's actually super quick, and then simulation done.
The simulation of the ideal semiconductor models show that our buck converter has successfully achieved 12 volts output voltage, which meets our specification. The duty cycle stabilizes around 0.3-- in their case, the effective voltage regulation. The supply and load current plots confirm efficient power delivery.
Now we need to validate the selected part with a detailed model to confirm the device temperature, check the efficiency, and ensure that there is no shoot through of the device. To do that, we can use the manufacturer-provided SPICE model and convert it into a lookup table based representation in Simscape. Here is a detailed lookup table based MOSFET model.
So the question often comes to me is, how can we parameterize it with a vendor's information? The datasheet normally contains only single dimension charge information, so that may not be sufficient for loss or switching transients evaluation. A detailed SPICE model is sometimes needed. It includes both a detailed 2D charge model, which normally contains both drain charge information and gate charge information, and a thermal model which normally-- Cauer thermal model.
Then the following question that comes to me is, how can we incorporate them into our blocks-- our N-channel MOSFETs? Here we can have a lookup table based representation from a SPICE model. How can we do that? Here is an example.
Let me open it. If you open it, the name of the example is called silicon carbide MOSFET parameterization using simulation results from SPICE. You can check it afterwards, and they are all available in our website.
Here, what we want to do is, we want to convert an Infineon silicon carbide MOSFET into a lookup table based representation using a SPICE model. To do this, the first thing you need to do is to download the SPICE library from the manufacturer's website. And then you need to define the corresponding subcircuit name from the library. They must be exactly the same name as appears in the library. And here you can see it's a definition of the subcircuit from the vendor.
And what else do you need? You also need the output path which is-- you can store your generated netlist and outputs. Terminal is the nodes connection orders defined in the subcircuit. So it also should match with the subcircuit. Also, you need to specify the engine path of the SPICE engine.
Additionally, you may specify other input arguments. They are not necessary, but you can specify them, such as the voltage and temperature range and whether you want to include the capacitance of the diode model. Then use function ee.spice.semiconductor2lookup. It generates some SPICE netlists as shown in the left side of the current folder panel.
These netlists are used to characterize your device. They will be simulated in the SPICE 2 you have defined. So now you can see that there are some DOS outfile added to that directory, which are the simulation results from the corresponding SPICE 2. We will be using these outfiles to extract lookup table based parameters.
They are probably having some warnings you need to pay attention to. The generated data needs a bit manual check for calibration. And finally, this function returns a structure with diode, channel, and capacitance containing the corresponding lookup table data. And now you can use them to populate your block.
You can validate the generated lookup table data against the SPICE results. Here is what we did in the previous example. We ran the same validation circuit in both Simscape and SPICE-- in both Simscape and SPICE. And comparing the results, you can see that the figure shows they are aligned with each other.
Now you can replace the ideal MOSFETs with a lookup table based representation. If you click on that, you can see the MOSFET has been already populated with the data generated by the previous step. Doo-doo-doo. These capacitance, I-V, current voltage, and also diode information are all included.
The MOSFET is a model-- is more detailed. It's including the charge model. Then it will result in slower simulations compared with the ideal MOSFET. So what can we do here? You can reduce your total simulation time by using the steady state circuit conditions, which have been run on that from the previous stage, saving the total simulation time here needed to reach to the steady state.
Here we are still using the same total time for demonstration-- checking the junction temperature. With the thermal model and more detailed charge model, you can now perform further analysis for your converter, such as checking the junction temperature. In this case, both the MOSFET 1 and 2 haven't reached 40 degrees Celsius-- which is within the rated range.
You can also calculate the average power dissipation in the MOSFET to ensure it does not exceed the device power rating. In my case, it doesn't. It's both under 50 watts.
And also, you can check the efficiency of the converter. You can calculate it. The efficiency in this case is 89%, which meets our design goals. You can also investigate any significant losses, and also analyzing the transient response to ensure that there is no shot through in the device, which no one wants.
The alternative workflow of using SPICE model in Simscape is to convert it into an equivalent SPICE block. So instead of using a lookup table based representation as we were just talking about, they represent the same exactly physical model as the original subcircuit SPICE model. We have already integrated some of them in our product.
They are using the vendor's subcircuit library. You can open the original SPICE subcircuit by the hyperlink in the block. In the block of SPICE-imported MOSFETs, you can select the series and also the device, the part number from the list. And actually, you can use it directly. They have been all tested and validated already against SPICE 2.
So how about if you cannot find it in our library? You can still build your by subcircuit library in Simscape, and it's quite simple. Here is how to do that.
First, still, you need to download the SPICE subcircuit library from the manufacturer's vendor's websites. And also you need to-- you can specify your device. And a library of the destination library name-- here is a plus of O-P-T-I-- mus, underscore, 80 volts. Optimus underscore 80 volts.
And then with the help of the function subcircuit2ssc, it will convert use a specified device into an equivalent Simscape block. This block uses our equivalent part built SPICE block inside Simscape. You can see in the current folder panel, there is a folder-- naming plus optimus_80. And it contains the corresponding ssc file and amp file. If you do not give this specific device name, then the functions of circuit to SSA in line number five, it will just convert all the subcircuits inside the SPICE library and in the given directory.
And finally, you can use the function ssc_build to build your own Simscape library. You can see in the optimus_80volts_lib.ssrx. That's the library. Your component is already included here.
With the component, some people want to easily validate it against the SPICE tool. Here we're having another example-- SPICE conversion of MOSFET subcircuit and validate. You can also check this example afterwards with the help of the two-- called ee_converted MOSFET validation. It will run some standard characteristics, such as the full current, voltage, and charge for the equivalent models in Simscape and the original subcircuit in SPICE, and then compare the results.
Here is an example of the validation tool results. The results show that it matches the corresponding simulations. They are matched exactly.
Now you can validate your converter design with your equivalent MOSFET model. You may use-- da-da-da-- if you click on that-- and there are some parameters. Some of them are convergency eight parameters. And you may use them to help with your simulation.
The SPICE model is typically very nonlinear, which results in relatively slower simulation compared with ideal MOSFETs. Yeah, but you can run it, right? Yeah. Then this is validation results.
The output voltage is still 12 volts, as specified. The junction temperature is within the rated value. I think in here, we have already used the steady state conditions we gained previously from the ideal MOSFET simulations.
So the output voltage and duty cycle-- they are almost starting from the steady state. From the figure here, the duty cycle and the load current all looks good as well. Then the average power of both MOSFETs is under 50 watts, which is within the rated range. The average efficiency is around 89%, and it matches the validation results from the lookup table based representation.
So we're having similar results with the two workflows. That's the second workflow that you can use to convert your SPICE model into Simscape Electrical. Thanks, everyone. And now I will hand over to Danielle for the summary. Thank you.
Thank you, Yifan. In summary, you can convert SPICE models to Simscape for converter design and detailed validation. You develop your control algorithms in Simulink and Simscape using abstract models. Then with the same simulation environment, like we walked you through the workflow, now you can use detailed models converted from SPICE for detailed validation, by either converting to a lookup table based representation, or converting SPICE model to an equivalent Simscape block. There are some additional resources, including examples, semiconductor model selection guidelines, and the function of converting SPICE to Simscape. Please let us if you have any questions. Thank you.