SPICE Circuit Simulation Made Simple with Examples

David Haboud
|  Created: March 4, 2021  |  Updated: April 12, 2021

SPICE simulation saves you critical time in the prototyping phase. Understanding your simulation interface makes it simple to analyze how your circuits work in different scenarios. Altium Designer provides an intuitive, dedicated interface to support your simulation verification, setup, and analysis directly in your schematic environment. You also benefit from growing support for popular model formats, as well as generic models, simplifying circuit definition and simulation.

Transcript

David Haboud:

Welcome everyone. I'm David Haboud. Today's webinar will cover the improvements to the SPICE engine and user interface in Altium Designer. As always, a recording will be posted to the Altium Academy YouTube channel. Understanding your simulation interface makes it simple to analyze how your circuits work in different scenarios. We'll begin by discussing a new type of generic components that includes predefined parameters for easy circuit prototyping. You'll also have the option of importing existing schematics to quickly get started with existing simulation information. We'll spend time reviewing the new interface and touch on some of the benefits provided by the new workflow. Altium Designer provides an intuitive, dedicated interface to support your simulation verification setup and analysis directly in your schematic environment. Lastly, we will take a look at the growing support for popular model formats and end with the demonstration and Q&A. The generic simulation components library offers 189 components derived from the most used elements of electronic circuits.

All library components are parameterized so you can customize the models to match real world components. The generic models can be placed directly from the components panel to prototype your schematic capture. Symbols can be placed, wired, and simulated in under a minute. In order to start working with a generic simulation components library, you need to install the mixed simulation engine. This will be included in your Altium Designer installation. The mixed simulation engine can be installed during a new installation of Altium Designer. You enable the Mixed Simulation checkbox under the design functionality dialogue, or if you did not enable mixed simulation during the initial installation, you can open the extensions and updates tab dialogues from your user profile. And that is located in the top-right corner of Altium Designer. If you navigate over to the purchase tab, you can click the install button to the right of the mixed simulation system extension. The generic simulation components library will be located in the directory of the installed mixed simulation module. You can access the library from the components panel in any open schematic.

The generic simulation components have some special properties that are different from regular components. When viewing the generic simulation component properties, you will see a special design object in the top left corner simulation generic components. There are several non-relevant fields removed. For example, the source field. Additionally, you are unable to assign additional models, footprints, documentation references to components, and you cannot change the simulation model. The number of parameters for each component is fixed based on the component type and therefore it can't be changed in the properties panel. You are only able to modify the values of the parameters to fit your simulation needs.

If you've used SPICE before, it's likely you have some existing schematics with simulation parameters and Altium Designer 21 provides many improvements to the existing design importers. And this is going to allow you to import schematics to get started quickly. Altium Designer 21 introduces importing LTSPICE schematics and projects in .ASC, and .ASY formats with the import wizard tool. Importing a design creates a new project, and that recognizes the component data and assigns available simulation models. In order to import LTSPICE projects, you will need the LT importer extension, LTSPICE importer extension. And this can once again be installed in the extensions and updates window. The extension contains LTSPICE models for correct linking of the simulator models to component symbols. You can also import OrCAD/PSPICE schematics. Once again, use the import wizard for OrCAD projects with PSPICE schematics.

And these files must be in .DSN and .OLB or .LIB file formats. As seen with the LTSPICE projects, a project will be created identifying the component data and automatically assigning available models. You can use this functionality by selecting the OrCAD check box in the configure platform section of the extensions and updates window. Simulation model libraries with the [inaudible 00:05:56] extension can now open as a local library. Although the internal file content in the text is in SPICE language model description, each model or macro model is interpreted as a library component. When you add a model to a schematic sheet, a symbol is generated automatically. This saves a lot of time when creating a component because you don't need to create a symbol manually and then assign the simulation model.

So this is going to allow you to really quickly create your schematic. You see here in the picture, the first implementation of this functionality gave you a rectangular outline with pins. Now different models will automatically have their own symbol based on the component type. And you'll see an example of this in our demonstration. Okay, let's move forward to the signal sources. You know, signal sources are critical aspect of our simulation circuit. So you can now utilize the properties panel to control important signal source parameters and settings. When you are in the properties panel, you can click on any voltage or current source, and you will see a simulation name and this allows you to define a signal with parameter values that can be reused. So we see here V source, I can use that again and when creating a new source, the source parameters will be linked. So if I make a change to one, it will change in all of the sources with the same stimulus name. A wave form preview is shown to provide an accurate representation of the signal in relation to your set parameters.

The last thing we're going to look at in the list of parameters, this information is fixed and depends on the simulation type. When you change the stimulus type, the corresponding parameter list will change in the properties panel. The DC magnitude, AC magnitude, and AC phase parameters, however, are present for all simulation types and this allows you to run every simulation type with a given stimulus. There are six stimulus types as listed on the left. Each type is going to a different transient signal preview and you'll get some more visibility into how the parameter changes in the properties panel affect the signal source. Here I have defined six sources corresponding to each stimulus type. For this image we're focusing on the single frequency FM stimulus and the parameters I have set on the left-hand side, give us this signal preview. The visual feedback is going to allow you to evaluate the signal shape very quickly and this is going to minimize the occurrence of significant errors in our design.

The stimulus name dropdown list allows us to reuse the stimulus type as I mentioned, and these parameters will all automatically be set according to the information we have already set. This gives us some greater flexibility. It's going to speed up our process as we change between sources and it just in turn makes it easier to analyze the circuit. So now we're going to take a look at the new simulation dashboard. The simulation dashboard, it splits up your simulation workflow into four easy steps. The dashboard itself serves as a management center for everything related to project simulation while giving you that dedicated flow. You can see that it is visually divided into verification, preparation, analysis, set up and run and results. Although the recommended flow is to progress through the steps, you can click on any step to create your own workflow. The simulation dashboard, verifies models and simulator settings. For example, if you're missing models for circuit passives, you can automatically apply generic models that take into consideration existing component parameters. You're also able to add sources and probes directly from this interface.

And the simulation analysis set up is going to allow you to modify simulation settings. You can add output expressions, you can run individual simulation types, and lastly, you can review your results in the final section. This will also allow you to load a setup profile from an existing result. Stepping through all of the steps. Verification is going to run an ERC and simulation model syntax checked. So if any component has any errors, or if the conditions to start the analysis are not satisfied, this aerial will contain corresponding notifications and suggested solutions. Making schematic changes may require you to rerun the verification. Preparation contains the sources, and it also contains probes. The simulation sources sub area is used to add and remove sources and the probes similarly section can allow you to add and remove them as well.

In addition, the probes area allows you to control the color of your probes for ease your visibility. You can see in the second image, the sources and probes can be enabled and disabled from your simulation. You see, I have disabled that source fee one, and it grays it out on my schematic. Once I've completed my preparation, you'll see that if there are issues, they will automatically display, for example, in the last picture where I need to add a source. So you get a suggestion for any issues. If they are resolved, you get a green check mark, and you can begin your simulation. After you have finished preparing and you have your green check marks for verification and preparation, you can define the analysis parameters in analysis set up and run. There are four basic types of analysis. You have operating point, DC sweep, transient, and AC sweep.

These basic analysis types can be augmented with parameter sweeps, temperature sweeps, and Monte Carlo information. So if you select any of these additional sweeps, you can right click on the settings' area and configure the parameter sweep information that you want. Additionally, that area, you can define global parameters and configure settings for the overall simulation if you are a more advanced user. You can start each analysis type individually with the run button, and you are automatically shown the results of the calculation. If it is a longer calculation and you want to make some changes, you are also able to stop the simulation from this panel. An additional functionality is if you're using the operating point analysis, you can change the display on the schematic voltage power and current next slide.

And finally, we have the results. This section will allow you to accumulate different results, view them, load the parameter profile, or delete the results. Only the latest analysis run is saved by default. So if you want to have multiple results, you can press the little lock icon next to a simulation results, and that will lock it in, and it will not be overwritten. You can also use the dropdown menu to review results. And as I mentioned, load the profiles themselves and the parameters, or delete them. The total number of results is shown in the brackets in the section header in this instance, eight. The last thing we're going to talk about is the growing support for different model formats. Currently we've increased the number of models to include analog PSPICE, XSPICE, LTSPICE. I mentioned the ability to recognize a .LIB extension. The .LIB files are recognized as combined subs, circuit models, allowing direct SPICE model library processing in the components panel.

So when it brings in the model information, it parses it and automatically creates a symbol for the majority of component types. This is an older photo you see here in the right, there is a square with the pins. But as I mentioned earlier, the growing number of models are automatically generated. So the biggest thing is currently the support for digital models is under development. You can assign models to any symbol. When you do this, you can double-click and bring up the simulation information. If you're modifying it in the properties panel, you have four types here. You have the server type, which is going to allow you to assign a model from LTM365 Nexus or Concord Pro. You have the local source to assign a model from a local location, like a hard drive or a network drive. You can find models, if you can't find models, you can use the generic component models and that's going to really closely approximate real world models that you already have. So these generic models already have resistance, for example, that all of these values are tied to the symbol itself.

And what's really nice is that you can use active bomb or to replace simulation models with real world components that you've created and to find. Lastly, you have the Okta part source, and this is going to allow you to assign models from the catalog of components from the Okta part database. The simulation model dialogue has multi syntax support. You see here, the model file and the image here, and that's going to automatically recognize and validate the simulation format. The control of the syntax allows you to quickly identify and correct any violations before you actually start your analysis. Together all of this, all of these improvements are going to make it easier to arrange your model configuration. There's also extended pin mapping support to solve the issue when your schematic pins don't match the number of module nodes. Okay, let's switch over to the demonstration.

Let's take a look at this EMPass filter schematic that I created using the generic simulation components. If I open the properties of any of these components, you can see it says simulation generic component, and it has the appropriate parameters necessary for each component type. To place these components I can go to the components panel. There is a library type here simulation generic components that is installed when you install the mixed SIM engine. You have just drag and drop placement, regular placement like you would from just the components panel in general. I can delete that. The only exception here was component Q1. I did not have a generic component for that so I brought in a PSPICE library, library .LIB, and you can see when I drag a component from here, I am a symbol is automatically generated. I did not create any of these symbols.

This is automatically generated from the PSPICE library. Clicking into it, seeing our properties again, you see there is the simulation information. I can select it. If I double-click on it, I can edit it, or I can use the edit button in the bottom right corner. So here you see the pin mapping support. Let's say I have a difference between the schematic and the pin, generally if you made your own schematic, you can do this connection here for yourself. We have server local Octa part, the parameters for us, and we have the model file information. The PSPICE library will be parsed. Generally PSPICE libraries have a lot of different definitions in them, and it will automatically determine the splitting up of the models so that you can place them individually.

Okay, let's go to the simulation dashboard. I can go to simulate, simulation dashboard or shortcuts SD. We begin by doing a verification and ERC is run, and it checks that all of my components have appropriate models. Since these are all generic simulation components, they automatically have the models. We come into the preparation section, and we see here the ability to enable and disable the different sources. I have defined two sources here. I can add voltage current if I would like, I have probes, I will enable them. If I so wish I can change the color of a probe so I can easily identify it throughout my design, I can click it and it'll mask the other values and cross probe over to it. And do shift C to clear that masking and I can simply add any type of probe that I need, or I can remove any type of probe right here, enable, disable.

We are going to start off with a DC sweep. We're going to use V1 and go from zero to 10 at .1001 steps. I have defined an output expression here. You'll see that it is the absolute value of the current from the collector and divided by the absolute value of the base. This is going to give us the current gain. When we multiply by 20 log 10, we will receive that signal in decibels. Okay. So I executed just the single type of analysis DC sweep and I get a plot here. We have all our signals from our probe and our current gain. So in order to make this a little bit easier to interpret, I'm going to create new plots. You see PM to create a new plot. Normally we would name it, but to speed things up, I'm just going to make three plots, three additional plots, and I can just drag and drop the information as I want. So I have the current there, voltage differential. I have the emitter. I'm going to leave the miter there.

And lastly, I'm going to move the current gain over here. Seems I did not put the voltage there. So we have all of them selected. If I click on one, it will just mask that one or mask the other values and I can just see that one by itself. If I click it again, it's cleared or if I have it selected, I can do shift C and clear that filter as well. If I double-click on a wave form, I am able to change the expression. I can use the built in functions here as needed. For example, just to show it, I'm going to remove this value and we could do absolute IB. So you'll notice when I do a function, it will automatically put us in the parenthesis and we can put in that wave. For the name, I will name it current gain, and you see that expression is changed right there.

Additionally, I am going to do a new Y axis. I can select the plot I want and go to plot PY add Y axis, over here, and I can drag over whatever I want to use. Okay. That is now formatted as I want. And I can add additional right here, add wave to plots. So the first thing we're going to do is do the mid voltage divided by the current. And we will name that RM. We're going to go through all of these and add the same information. So I'm going to do the collector minus here, and you'll see these wave forms are net labels that I have already made, add wave to plots, we have our last one. We are going to do base minus and divide that once again by the appropriate current.

Okay. So now we have plotted out all our information. We have the four plots and we see everything as we want to, and I can save this now. I can do control S and save this. Coming back to our design, we have the results. We can lock the results. Here we can do show results, load profile, edit this information, or delete it. Locking this will allow me to once again, run another DC sweep without overriding that result. We will go back to that in a little bit, but for now, let's go over to the AC. You see here, we have these values. I've set it up 100 Hertz to 10 megahertz. You'll notice if you are new to SPICE simulation, the correct format is meg for megahertz or for meg. If you do other information, it does not process appropriately. We have the types linear decade Octa, we're going to with decade and do a thousand points per decade.

I have an output expression here, load divided by in, if I click here, you can see that all of our waves are here for us to utilize. So I wrote it in manually, but I can do load and divided by in. AC for an AC analysis you can do these different functions for it. I'm going to create, and I'm going to run this. We see our peak here. We still have all our probes that we have defined. Going back, I can once again save this, actually, one more thing to show. If I select the wave form, I can do edit wave, and I can change this to magnitude and that is now in DB. So we can see this peak here. I can do wave, and I will add a cursor. So selecting the cursor, I'm able to navigate through and I see the information in the SIM data panel, which as always can be opened in the bottom right corner, you go to panels. And in order to see what's going on here, I can select the cursor and I can do select maximum points.

You see right there it automatically goes to that top point. And I see 98 Hertz, 50 DB. So it's really nice to have these cursors here. If I want to have another one to cursor B and they'll give me a little bit more information. And once again, you select the probe and you do wave and you can get information like that. So I go from A to B and it will give me all of this information, averages, minimums, maximums. Okay. So let's save that and we'll go back to the DC sweep with the addition we are going to do a parameter sweep. So I enable sweep here and go to the settings and I'm going to sweep R3, as you can see here, R3. And it has currently a value of 10K. We're going to go from 1K to 10K, we'll do a step of 2K.

Once again, we have the type linear decade Okta or list so I can list them out. If I want, I could add another parameter, remove the parameter. I have my global parameters. If I want to add here or the advanced section, which we will not be touching today, but it is there. I will select it. And we still have here, my output expression that I will run. And currently I left all the probes on, so let's go back to preparation and I'm going to take these probe values off to clear up this analysis a bit. So I can stop it. I saw I was running there. I could hit stop, and I'm going to run it again. This time it's just going to run my output expression. We see them all here. So we need to do a little bit of processing since we did a sweep. Each value is going to have a P, appended to it P1, all the way to P6, since we did one to 10 and steps of 2K. And so I'm going to do this modification quickly.

We move through all of them. And once again, the 20 log 10 is to change it over into decibels. So we are plotting our current gain with the change in resistance to component R3. This is going to let us analyze if we want to change any of the values, well, I guess in this case, the value of R3, so do shift C and we see all of our plots here. If I wanted to, I could have named them individually, but just for times sake, I have not done that. We have all of our plots here. And once again, if we want, we can, when we select this, we have different information. If I want to zoom in, I can just click and drag and zoom in. I can fit my document again in order to get that visibility.

Okay. So I'm going to save this again. You'll notice this says DC sweep two, going back we have our results. We have DC sweep. The first one we did, we have AC and we have DC sweep two. I can do show results. And I come back to my original results that we plotted out and saved. So this gives me visibility into previous situations. If I had changed a lot of the profile, I can do load profile and it will change my parameter information here. Okay. So that is everything for the demonstration. Okay. I want to thank everyone for their time. I'm going to now open it up to questions. If you have any questions, please, after the webinar, please send me an email at David.haboud@altium.com.

About Author

About Author

David Haboud joined Altium as a Product Marketing Engineer in 2015. He studied electrical engineering, emphasizing computer architecture and hardware/software design at the University of Southern California. As an embedded software engineer in the aerospace industry, his focus on firmware development and data acquisition for auxiliary power units highlighted the importance of cross-functional collaboration. Through his engineering experiences, he discovered his passion for enabling cross-discipline engineers to communicate effectively. In his spare time, he hosts and performs in improvisational and stand-up comedy nights in San Diego, California.

Related Resources

Related Technical Documentation

Back to Home