Beigebag FAQ 2

From Emagtech Wiki
Revision as of 21:39, 9 November 2016 by Kazem Sabet (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html>

<head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>B2 Spice AD FAQ</title> <meta name="keywords" content="EDA, simulation, spice simulation, schematic capture, PCB, schematic, electronic, CAD, CAM, Spice, spice software, circuit simulation, circuit design, electronics, ac circuits, DC circuits, transformers, diodes, rectifiers"> <script type="text/javascript" src="Templates/dropdown.js"> </script> </head>

www

<body bgcolor="#FFFFFF" background="images_v5/bgtile_new.gif" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">


<a href="http://www.beigebag.com"><img src="images_v5/bblogo_ds_single.gif" width="375" height="37" border="0" alt="Beige Bag Software"></a>
<a href="http://www.beigebag.com/">Home</a>

<script type="text/javascript"> at_attach("prod_parent", "prod_child", "hover", "y", "pointer"); </script>

<script type="text/javascript"> at_attach("demos_parent", "demos_child", "hover", "y", "pointer"); </script>

<a href="http://www.beigebag.com/tech.htm">Support</a>

<script type="text/javascript"> at_attach("support_parent", "support_child", "hover", "y", "pointer"); </script>


<script type="text/javascript"> at_attach("resources_parent", "resources_child", "hover", "y", "pointer"); </script>

<script type="text/javascript"> at_attach("ordering_parent", "ordering_child", "hover", "y", "pointer"); </script>


B2 Spice A/D Problems and Solutions


             
  • <a href="#q23">How do I convert a PSpice model for use in B2 Spice?</a>
  • <a href="#q22">Is there any way to speed up my simulation?</a>
  • <a href="#q21">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?</a>
  • <a href="#q20">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?</a>
  • <a href="#q19">When a simulation is run,
                         an error message appears saying "Illegal type for token...".  
    
    What does this mean?</a>
  • <a href="#q18">With version 4.2, Workshop
                       now seems to run much slower than before.  What happened?</a> 
    
  • <a href="#q17">Workshop used to work fine
                       but now crashes immediately upon starting.  What can 
    
    I do?</a>
  • <a href="#q16">Workshop crashes whenever I
                       start, open a circuit, print, or at other odd times.  
    
    What's going on and what's the fix?</a>
  • <a href="#q1">I'm looking for a certain part
                       and it just isn't in the database.  How do I get it?</a> 
    
  • <a href="#q2">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?</a>
  • <a href="#q3">How do I set up a time dependent switch?</a>
  • <a href="#q4">When I run a simulation, I get
                       errors in the log file that say "no such subcircuit: 
    
    XXX".  What's going on?</a>
  • <a href="#q5">I’m getting "Timestep
                       too small" errors in the log window. What am I doing 
    
    wrong? </a>
  • <a href="#q6">I’m getting "Iteration
                       limit reached" errors in the log window. What can I do 
    
    to fix it? </a>
  • <a href="#q7">I’m getting "Singular
                       Matrix" errors in the log window. What can I do to fix 
    
    it? </a>
  • <a href="#q8">I’m getting "GMIN/Source
                       Stepping failed" errors in the log window. What can I 
    
    do to fix it? </a>
  • <a href="#q9">I have an oscillating circuit
                       that does not simulate properly. What can I do to fix it? 
    
    </a>
  • <a href="#q10">How do I perform a temperature sweep? </a>
  • <a href="#q11">How do I examine a specific component as it heats up? </a>
  • <a href="#q12">The displayed sine wave signal looks choppy. Can I smooth the shape of it? </a>
  • <a href="#q13">How do I export the results of an analysis to Excel? </a>
  • <a href="#q14">How do I probe a current in the circuit? </a>
  • <a href="#q15">How do I measure the power across a device? </a>

               <center>
                       <a name="q23"></a>How do I convert a PSpice model for 
use in B2 Spice?

<p>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

.model rmod RES ...
whereas Berkeley SPICE will look like
.model rmod R ...

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:

PSPICE:
EFB 12 OUT VALUE={8.822-.4024*V(13,5)+5.250E-3*V(13,5)*V(13,5) -.6667*V(13,5)*V(6,5)}

SPICE:
BEFB 12 OUT V = 8.822-.4024*V(13,5)+5.250E-3*V(13,5)*V(13,5) -.6667*V(13,5)*V(6,5)

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.

<a name="q22"></a>Is there any way to speed up my simulation?

<p>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 <a href="#q18">this FAQ item</a>.

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.

                       <a name="q21"></a>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?

<p>This message means that the simulation engine encountered a model parameter that isn't recognized by Berkeley Spice. For instance, the following line will produce an error:
.MODEL Dbody D Is=125f N=1.023 Rs=1.281 Ikf=18.01 Cjo=46.3p M=.3423
+ Vj=.4519 Bv=60 Ibv=10u Tt=161.6n
>ERROR: unrecognized parameter (ikf) - ignored
Thi
s is because the IKF parameter is a PSPICE parameter and isn't a valid Berkeley SPICE parameter. Workshop will then ignore the parameter and proceed with the simulation. However, the effects of the ignored parameter is unknown and should be kept in mind. You can elect to remove these parameters permanently from the model by using the Database Editor to remove these parameters.

Another 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:
.model rt RES tc1=-0.006 (PSPICE)
.model rt R tc1=-0.006 (Berkeley SPICE)

However, the Database Editor can automatically fix these error automatically in the process of importing the model.

                       <a name="q20"></a>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.

                       <a name="q19">When</a> 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.
                       <a name="q18">With</a> 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 <a href="v4_animation.htm">here</a>.  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.

<a name="q17">Workshop</a>
                       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 <a href="#q16">below</a> before contacting 
                       us. 

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.

<a name="q16">Workshop</a>
                       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 
                       driver.
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 <a href="adv4_pnt_prblms.htm">here</a>.
<a name="q1">I'm</a>
                       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 <a href="mailto:thien@beigebag.com">email</a> 
asking so.  We'll look into it and get back to you.
<a name="q2">I've</a>
                       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 
                       <a
       href="mailto:thien@beigebag.com">email us</a> about it and include the 
                       model text.   We'll see if we can't get something 
working for you.
<a name="q3">How</a> 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 
                       at <a
       href="http://www.beigebag.com/tech.htm">www.beigebag.com/tech.htm</a>.  
                       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.

<a name="q4">When</a>
                       I run a simulation, I get errors in the log file that 
                       say "no 
such subcircuit: XXX".  What's going on?
In
                       versions 3.0.1.1 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.

  1. The database might actually be missing these external subcircuits.  In this case, go to our <a href="tech.htm">Tech Support</a> page (<a href="http://www.beigebag.com/tech.htm">www.beigebag.com/tech.htm</a>) and download the latest database patch or complete database.
  2. Even if the dependent subcircuits are in the database, Workshop still won't recognize them.  In this case, you'll have to right-click on the part that's making the external call, "Edit Simulation Model" (or double click the part), and then click OK.  This should force Workshop to find the dependent subcircuits.
                       <p>Users of B2 Spice A/D  Lite who don't have the 
                         Database Editor that is necessary in adding the missing 
                         subcircuits should <a
href="mailto:info@beigebag.com">contact us</a> for further instructions.

This problem should be fixed up in the next revision release.

<a name="q5">I’m</a>
                       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 doesn’t solve the problem, 
                       then try 1000 for itl4. If it still doesn’t work, 
                       then follow these steps. 
  1. Get the operating point analysis to converge. To do this, you may need to modify convergence options. The relevant convergence options for operating point analysis are itl1, gmin, rshunt, and abstol. First, increase itl1 to 500. If the operating point analysis doesn’t converge, then increase itl1 to 2000. If it still doesn’t converge, then set gmin to 1e-12, and rshunt to 1G. If that doesn’t work, then set abstol to 1e-10. You can play increase gmin, decrease rshunt, and increase abstol until you get convergence, however, be aware that gmin must be small compared to any other conductance in the circuit (including internal transistor conductances) and rshunt must be large compared to any other resistance in the circuit, or else your results may become inaccurate.
  2. After the operating point analysis is working, then retry the transient analysis. If it fails, then you should increase itl4 up to 1000. Eventually, playing around with these convergence options should result in a successful simulation. As a last resort, increase the relative error tolerance (reltol) by a factor of 10, but this will reduce the accuracy of the simulation.
  3. See our user manual or help file for additional information on transient convergence and convergence options.
<a name="q6">I’m
                       </a>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.
<a name="q7">I’m</a>
                       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.
<a name="q8">I’m</a>
                       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.
<a name="q9">I
                       have</a> 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 
                       Conditions.  

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. </font></td> </tr>

<a name="q10">How</a>
                       do I perform a temperature sweep?</td>
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.  
                       <p>The 
                         same principals apply when performing parameterized 
                         transient and ac sweeps with temperature as the parameter. 
                       </td>
                   </tr>
<a name="q11">How</a>
                       do I examine a specific component as it heats up?</td>
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.  
                       <p>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 resistor’s temperature, then make sure 
                         that it is a temperature dependent resistor and give 
                         it TC1 (and possibly TC2) values. 
                       </td>
                   </tr>
<a name="q12">The</a>
                       displayed sine wave signal looks choppy. Can I smooth 
                       the shape of it?</td>
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. </td>
                   </tr>
<a
       name="q13">How</a> do I export the results of an analysis to Excel?</td>
  1. Bring the table of simulation results to the front. If there isn’t a table of results showing, but there is a graph, then go to the view menu and select the item named Table View.
  2. Choose Save As Text… from the file menu and specify a file name.
  3. Start Excel.
  4. In Excel, open the text file.
  5. The Text Import Wizard appears. Select the original data type of "Delimited". Set "Start Import with Row" to a number that will eliminate the header of the text file. Click Next.
  6. For Delimiters, select Tab. Click Next.
  7. Format the columns as General.
  8. Click Finish.
                       <p>Alternatively, you can select all of the text in the 
                         table, then copy it, then open Excel and paste into 
                         a worksheet. 
                       </td>
                   </tr>
<a name="q14">How</a>
                       do I probe a current in the circuit? </td>
You
                       can splice an ammeter into any wire before running the 
                       simulation and the graph will automatically show the current 
                       for that ammeter.  
                       <p>After 
                         the simulation has been run, choose Edit Plot List from 
                         the graph’s 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. 
                       </td>
                   </tr>
<a name="q15">How</a>
                       do I measure the power across a device?</td>
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. 
                        
                       <p>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)) 
                       </td>
                   </tr>
                 </table>
               </center>
             </div>
             <p> 
           </center>
         </div>
<p align="center"> 

         </td>
 </tr>

<a href="http://www.beigebag.com/contact.htm">Contact Us</a>
<a href="http://www.beigebag.com/email_list.htm">Email Updates</a>
<a href="mailto:admin@beigebag.com">Report Errors</a>
Beige
                     Bag Software, Inc., 623 W. Huron, Suite 2, Ann Arbor, MI, 
                     48103
(phone) 734.332.0487 (fax) 734.332.0392 (email) <a href="mailto:info@beigebag.com">info@beigebag.com</a>
© 2005-2011 Beige Bag Software, Inc

   </td>
 </tr>

</table> </body> </html>