B2 Spice A/D Problems and Solutions
|How do I convert a PSpice model for use in B2 Spice?||
A specific PSPICE specific conversion to look for is how PSPICE denotes resistors, capacitors, and inductors in the .model line. PSPICE uses RES, CAP, and IND where Berkeley SPICE uses R, C, and L respectively. For instance, a resistor model in PSPICE will be something like
rmod RES ...
Also, PSPICE's dependent sources can use a VALUE= syntax and then an equation for the voltage or current. SPICE doesn't have this syntax but the conversion for this is to replace the device with a non-linear source, depending on the original PSPICE device type. For instance:
The "VALUE =" with a "V=" to denote a voltage source because the original device was an "E" voltage controlled voltage source and the "V =" means "voltage equals". If the original device were a current source F or G type device, the instead of "V=", you would use "I ="
Also there are simply some model parameters that just have no SPICE equivalent and must be left out. I don't have a complete list of the non-SPICE syntax but our program will let you know if it doesn't recognize a parameter and then ignore it so really nothing has to be done. But it's worth keeping in mind that the effects of the omission are unknown and must be considered.
The hardest thing to convert is PSPICE's ability to use If-Then equations. There is a convoluted way to use logical syntax in SPICE and one of our users was kind enough to write up a guide on doing so: http://www.beigebag.com/case_logical_1.htm.
These are the most common problems when trying to convert PSpice to Berkeley SPICE and there will probably be more specific problems that are not covered here. PSPICE to Berkeley SPICE conversion is as much art as science and there's no set way to convert all cases of PSPICE to Berkeley SPICE. If you have problems, you can always submit it to us for help.
|Is there any way to speed up my simulation?||
There are a couple of things to try if you believe that the simulation that you're running is going slower than it should.
The first thing to try is to make sure that circuit state animation is turned off. For more information about this, refer to the this FAQ item.
If you have ammeters or voltmeters in your circuit, you can speed up your simulation by turning off the values display. Go to the "Edit->Options" menu and uncheck the "Show part values' option. This will turn off the redraw of the ammeter/voltmeter values as the simulation is running.
Another thing you can do is to try to change your simulation parameters. If you're running a Transient simulation, you can try increasing the step size if you don't mind losing a bit of resolution. Or if you have "use initial conditions" checked when you really don't need to, turn that off. Also in Transient simulation, you can try going to the Miscellaneous Options in the Simulation menu and playing with the minbreak parameter. One of our users reported good results using a value of 1n and increasing from there. Too large a value might result in convergence problems.
Finally, you can try altering the convergence options found under the "Simulations->Convergence Options" menu. By default, we have pre-set some parameters to avoid the most common convergence problems. However, you can try increasing the "reltol" parameter since we've set it to something finer than it needs to be. Try 1e-3 instead of the given 1e-4. But keep in mind that this might affect the accuracy of your simulation. You might need to change your step size to compensate.
|I've just imported a model into the Database and everything went smoothly. When I place it in a circuit and run a simulation, I get an error saying "unrecognized parameter (parameter) - ignored". What's up?||
message means that the simulation engine encountered
a model parameter that isn't recognized by Berkeley
Spice. For instance, the following line will produce
PSPICE notation that can cause problems is PSPICE's
way of denoting resistors, capacitors, and inductors
in the .MODEL line. PSPICE uses RES, CAP, and IND, respectively
while Berkeley SPICE uses R, C, and L, respectively.
Just make these changes and the model should import
correctly. An example is below:
|I'm using v4.2 and a part that I placed on the schematic is shown in red. What does that mean? I ran a simulation and the log says that part XXX doesn't have a simulation model. What does that mean?||
One of the new capabilities of v4.2 was the ability to import and export schematics to Eagle PCB. Part of this process involved importing the Eagle libraries into the B2 Spice database. Most of these Eagle parts don't have a simulation model and aren't meant for simulation, just for schematics. If the part that you're using is shown in red and has the pins X'ed out then the part does not have a simulation model. Parts with no simulation model will also be flagged in the simulation log. The part will be left out of the simulation, which can produce unexpected results.
To get around this, just replace the parts with no simulation models with parts that have them. It might be that there isn't an equivalent part, in which case you'll have to find an alternate part. In the parts browser, you can filter out the non-simulating part by checking the "show only parts with simulation model" check box. This should filter out all the Eagle schematic parts.
|When a simulation is run, an error message appears saying "Illegal type for token...". What does this mean?||This error message could mean a number of things, but the most common problem is that in the circuit a part's value is incorrectly stated, usually using the European convention for decimals. For example, if you're using 4K3 to denote 4.3K, that would cause the error. Just fix the notation and it should proceed without a problem.|
|With version 4.2, Workshop now seems to run much slower than before. What happened?||
One of the new features of version 4.2 is the ability to show animated circuits, i.e., showing voltages and current flow with dynamic symbols and colors. To see an example of this click here. This feature, while very useful, does take up a significant amount of computing power as it redraws the circuit wires with each simulation interval. If you value speed over visuals, you can tu
rn off the animations (which are on by default) by going to the respective simulation setup dialog and unchecking ALL the options in the "Schematic State Display" area.
|Workshop used to work fine but now crashes immediately upon starting. What can I do?||
Version 4.1.2 and earlier: This is probably due to Workshop
saving a corrupted autosave circuit in the previous session.
Now when you try to start Workshop, it tries opening the
corrupted circuit and is crashing as a result. To get
around this, you'll have to remove the setting that tells
workshop to try to open the autosaved document. To do
so, run the Registry Editor by going to the Start menu
and selecting "Run...". Type in "regedit' to run
the registry editor. Navigate to the "HKEY_CURRENT_USER\Software\Beige
Bag Software" branch and look for the "B2 Spice A/D v4
Pro" folder. Click on that to highlight it and then press
the delete key to delete it. Close the registry editor
and try rerunning Workshop. If it still crashes, please
see the note below before contacting
Version 4.1.3: The application now prompts the user before loading autosaved circuits. If you choose to load the autosaved circuit, and the program crashes while loading it, then run the program again and choose NO, i.e. don't load the autosaved circuits.
|Workshop crashes whenever I start the program, open a circuit, print, or at other odd times. What's going on and what's the fix?||We've
had scattered reports of problems of this nature with
A/D v4. From our investigations, it seems that the problem
can be traced back to either old buggy printer drivers
or printer drivers that are conflicting with our program.
In one case, the problem was related to a old buggy video
For version 4.1.2 and later, we've modified the program so that this type of crash now only happens after a printer operation, e.g. print set-up, print, or print-preview. The crash does not necessarily happen during the print operation, but usually occurs soon afterwards. For 4.1.2, we also compiled a partial list of printers/drivers that might conflict with the program and have put warnings into Workshop alerting users if they have a potential problem. For a more detailed write-up on this problem and what to do about it, click here.
|I'm looking for a certain part and it just isn't in the database. How do I get it?||While we strive to have as many parts from as many manufacturers as we can, some parts just aren't available as Spice Models. If you know a certain part from a certain manufacturer is available but isn't in our database, you can import it yourself. Please refer the the help file and do a search for "Creating a Device from a Subcircuit Model Using the New Device from the Text File feature". If you're having problems, let us know and we'll try to help. If you're not sure or just curious if such a part exists, drop us an email asking so. We'll look into it and get back to you.|
|I've imported a model using the Database Editor and have set it up correctly. When I try to simulate how come I get "unknown parameter" errors in the log window?||More often than not, the problem is that the model you've imported is not Berkeley Spice compatible. The Database Editor can convert older Berkeley Spice format but it can't convert from PSpice, IBIS, and some other formats to Berkeley Spice. So if you're having this kind of error, then email us about it and include the model text. We'll see if we can't get something working for you.|
|How do I set up a time dependent switch?||A
time dependent switch has been added in A/D 2000 version
3.0.2. You can upgrade from our tech support page
For users who haven't done so yet here's how to set up
such a switch:
You will need to set up two circuits - one will be your main circuit containing the switch and the other (independent) circuit will contain a simple voltage source set up as a Piece-Wise Linear source and set the change time to whatever you wish and the change voltage to 1.
In your main circuit, use a voltage controlled switch and set its controlling source as the PWL voltage source. When the PWL changes to 1 volt, then the switch should close.
|When I run a simulation, I get errors in the log file that say "no such subcircuit: XXX". What's going on?||In
versions 184.108.40.206 and lower.
Some parts in the database make calls to external (not inside its own subcircuit) subcircuits or models. For one reason or another, the part can't find these external subcircuits and reports the errors that you see in the log. There are actually 2 problems and workarounds.
Users of B2 Spice A/D Lite who don't have the Database Editor that is necessary in adding the missing subcircuits should contact us for further instructions.
This problem should be fixed up in the next revision release.
|Im getting "Timestep too small" errors in the log window. What am I doing wrong?||The
most common problem is that the transient simulator is
giving up too easily. You need to increase the Upper Transient
Iteration Limit (ITL4) in the Convergence Options dialog
box from 10 to 100. If this doesnt solve the problem,
then try 1000 for itl4. If it still doesnt work,
then follow these steps.
|Im getting "Iteration limit reached" errors in the log window. What can I do to fix it?||See above- the same advice should help fix the problem.|
|Im getting "Singular Matrix" errors in the log window. What can I do to fix it?||See above- the same advice should help fix the problem.|
|Im getting "GMIN/Source Stepping failed" errors in the log window. What can I do to fix it?||See above- the advice for getting the operating point analysis to converge should help fix the problem.|
|I have an oscillating circuit that does not simulate properly. What can I do to fix it?||First,
set initial conditions in the circuit. You can do this
in either of two ways. The recommended method is to place
markers in the circuit and set the initial voltage of
the markers by double clicking on the markers and entering
values for initial voltage and then checking the box to
use initial voltage. Some oscillating circuits require
an initial state that is not symmetric. Also, in the transient
simulation set-up window, check the box for Use Initial
If this does not get the circuit to work, then follow the advice in the item above on getting the circuit with switches to simulate.
|How do I perform a temperature sweep?||Set
up a DC Sweep and use temperature as the source name and
leave the property name blank. However, not all parts
are temperature dependent by default. For example, you
must use temperature dependent resistors and set their
TC1 and TC2 parameters in order for the resistor to vary
with temperature. Also, leave the instance-specific temperature
blank if you want the temperature of that instance to
be swept. If you specify the temperature of a resistor,
for example, then the program keeps the temperature of
that resistor at that fixed value even while the temperature
for the circuit is sweeping.
The same principals apply when performing parameterized transient and ac sweeps with temperature as the parameter.
|How do I examine a specific component as it heats up?||Perform
a dc sweep analysis, a parameterized ac sweep, or a parameterized
transient sweep depending on whether you want to observe
the changes to the dc characteristics, ac characteristics,
or transient characteristics of the circuit.
Use the device name whose temperature is to be swept for the source name and the parameter named "temp" if it is available for the property name. If you are sweeping a resistors temperature, then make sure that it is a temperature dependent resistor and give it TC1 (and possibly TC2) values.
|The displayed sine wave signal looks choppy. Can I smooth the shape of it?||Yes, using the Step Ceiling parameter in the transient simulation set-up window. The shape of the curve is influenced by the TMAX parameter. You can set the TMAX parameter as approximately 1/16 of period of a voltage or current source signal.|
|How do I export the results of an analysis to Excel?||
Alternatively, you can select all of the text in the table, then copy it, then open Excel and paste into a worksheet.
|How do I probe a current in the circuit?||You
can splice an ammeter into any wire before running the
simulation and the graph will automatically show the current
for that ammeter.
After the simulation has been run, choose Edit Plot List from the graphs menus and look through it for any signals starting with I(. These are currents and you can add them to the graph. Also, in More Simulation Options, you can Generate Extra Signals. This will add internal transistor currents and other internal device currents to the list of plots available for viewing.
|How do I measure the power across a device?||Place
an ammeter in series with the device and place a voltmeter
across the device. After the simulation is complete, edit
the plot list, and add a plot named power and give it
the expression v(voltmeter) * I(ammeter) with the voltmeter
string replaced with the actual voltmeter name and the
ammeter string replaced with the actual ammeter name.
In the case of an ac circuit analysis, you will need to take into account the fact that the signals are complex. B2 Spice A/D will take care of the complex multiplication behind the scenes for you, but you will still probably want to take the magnitude of the power: mag(v(voltmeter) * I(ammeter))