Re: OT: gEDA, SPICE, electronic cad/simulation
On Sun, Oct 28, 2012 at 11:27:25AM -0600, we recorded a bogon-computron collision of the ru...@bogodyn.org flavor, containing: 3) SPICE (and ng-spice) always uses the first character of a device line to determine the type of the device. While most designers will draw a circuit with an IC in it and give the IC a name like U1, the character u in the first position on a device line means lossy transmission line in spice, not IC. Thus, in your netlist you're simply telling the simulator to create a lossy transmission line using nodes 0, 4, 3 and +9v as its four ports, and it's getting confused by all the extra parameters on the line. My mistake. U is the Uniform Lossy RC line, not the lossy transmission line. The URC device takes 3 nodes and a model name, and so it's used 0, 4, and 3 as the nodes, and then gotten confused about the unknown model named +9v. It then gets confused about the remaining parameters on the line. Point remains the same, you can't specify an IC named U1 in a spice netlist by calling the device U1. You need to use an X subcircuit instantiation line and an associated .subckt subcircuit definition. -- Tom RussoKM5VY SAR502 DM64ux http://www.swcp.com/~russo/ Tijeras, NM QRPL#1592 K2#398 SOC#236http://kevan.org/brain.cgi?DDTNM And, isn't sanity really just a one-trick pony anyway? I mean all you get is one trick, rational thinking, but when you're good and crazy, oooh, oooh, oooh, the sky is the limit! --- The Tick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: OT: gEDA, SPICE, electronic cad/simulation
Date: Sun, 14 Oct 2012 22:26:34 +1000 From: Da Rock freebsd-questi...@herveybayaustralia.com.au Subject: OT: gEDA, SPICE, electronic cad/simulation I'm struggling with this damn gEDA/SPICE thing - I think I have gEDA schem figured, but I can't be sure because I can't test it. For the life of me I can't seem to get my head around it, but then I might just be too tired. Can anyone point out what I'm missing? I open geda, create a sch file (circuit), and then run gnetlist -g spice-sdb sch-file. I then run ngspice (or gspiceui) but it comes up with errors over the 555 (U1) and diodes (d?) I'm running like this: Error on line 9 : d1 2 0 unknown unable to find definition of model unknown - default assumed Error on line 13 : u1 0 4 3 +9v 1 4 5 +9v unknown unable to find definition of model +9v - default assumed unknown parameter (4) I see some folks have tried to answer you, but it seems that it's expected that these models somehow already exist on your system and you're just not finding them. That's not the case. Without seeing the entire netlist, I can't be precise, but there are several important things to know about SPICE and device models: 1) SPICE provides only the infrastructure for simulating diodes, i.e. a module that lets you specify all the parameters of a diode and which will then simulate the circuit using the parameters you provide. A model in this case means a set of parameters, which is specified in a .model card. Basically, your schematic has defined a diode without telling the simulator the name of a model card to look for, so gnetlist has inserted unknown as the model name. You then did not provide a .model unknown d card to define unknown as a diode model. No open-source SPICE-like simulator provides model cards for common devices. You either have to find one from a manufacturer's web site, find one someone has posted on a web site somewhere, or extract the relevant parameters yourself (this list sorted in order of increasing complexity). Commercial spice packages do come with enormous model, libraries, but you pay big, big bucks for those versions. Werner Hoch wrote a system called spicelib for gEDA that attempts to download a large number of spice-compatible models from vendor web sites and massage them to work with ng-spice. I have run it once, and found that it needed a little patching up to make it work on FreeBSD instead of Linux (for example, the md5sum program is used througout, and this doesn't exist on BSD --- I had to hand-edit scripts all over the place to make it use md5 instead). Even so, there are few basic parts in these model libraries. Once in a while I have found cool web sites with hundreds of spice models for common discrete parts. They disappear after a year or five. You *COULD* try adding .model unknown d to your netlist to let ng-spice use all the default parameters for the diode. It might not work well, but it *will* shut up the error. It's what SPICE wound up doing itself when it couldn't find the model named unknown. For details about spice diode models, see, for example, http://www.acsu.buffalo.edu/~wie/applet/spice_pndiode/spice_diode_table.html 2) There is no 555 model in SPICE, ng-spice, or any other spice. Such devices are always simulated by creating a subcircuit model (.subckt). gschem will gleefully create a line in your netlist for such a device, but unless you also provide a subcircuit model for it, you won't be able to simulate it, no way, no how. ng-spice does NOT come with a 555 subcircuit model, nor does geda/gschem. gschem merely provides a symbol for such a device. Try googling for spice 555 model subcircuit and go from there. One post in the thread on this site: http://www.electro-tech-online.com/general-electronics-chat/5806-spice-555-timer.html has a UA555 subcircuit model that you may be able to use, if you make sure that the subcircuit pins match the pins gschem/gnetlist are assigning. 3) SPICE (and ng-spice) always uses the first character of a device line to determine the type of the device. While most designers will draw a circuit with an IC in it and give the IC a name like U1, the character u in the first position on a device line means lossy transmission line in spice, not IC. Thus, in your netlist you're simply telling the simulator to create a lossy transmission line using nodes 0, 4, 3 and +9v as its four ports, and it's getting confused by all the extra parameters on the line. To create a subcircuit instance (which is what you want), you need to use the X device. The format of the X device is: Xname [nodes] subcircuit definition name so, in your case, you would want something like: XU1 0 4 3 +9v 1 4 5 +9v UA555 and a .subckt UA555 card like the one in the post I mentioned in point 2 above. Note
Re: OT: gEDA, SPICE, electronic cad/simulation
2012-10-18 12:40, Da Rock skrev: On 10/16/12 20:38, Bernt Hansson wrote: 2012-10-14 14:26, Da Rock skrev: I'm struggling with this damn gEDA/SPICE thing - I think I have gEDA schem figured, but I can't be sure because I can't test it. For the life of me I can't seem to get my head around it, but then I might just be too tired. Can anyone point out what I'm missing? I open geda, create a sch file (circuit), and then run gnetlist -g spice-sdb sch-file. I then run ngspice (or gspiceui) but it comes up with errors over the 555 (U1) and diodes (d?) I'm running like this: You are using the spice models for those components? geda does not have spice models for diodes and 555 at least not mine. That may be it. Where are they supposed to be located on FreeBSD? If it where up to me /usr/local/share/geda/spice but it is not up to me, that directory does not exist. And I suppose I would need to find where I can get them in the first place :) Well, my guess is gnu.org. I'm not at the office right now, maybe later so I can't check the url. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: OT: gEDA, SPICE, electronic cad/simulation
On 10/16/12 20:38, Bernt Hansson wrote: 2012-10-14 14:26, Da Rock skrev: I'm struggling with this damn gEDA/SPICE thing - I think I have gEDA schem figured, but I can't be sure because I can't test it. For the life of me I can't seem to get my head around it, but then I might just be too tired. Can anyone point out what I'm missing? I open geda, create a sch file (circuit), and then run gnetlist -g spice-sdb sch-file. I then run ngspice (or gspiceui) but it comes up with errors over the 555 (U1) and diodes (d?) I'm running like this: You are using the spice models for those components? geda does not have spice models for diodes and 555 at least not mine. That may be it. Where are they supposed to be located on FreeBSD? And I suppose I would need to find where I can get them in the first place :) Thx ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
OT: gEDA, SPICE, electronic cad/simulation
I'm struggling with this damn gEDA/SPICE thing - I think I have gEDA schem figured, but I can't be sure because I can't test it. For the life of me I can't seem to get my head around it, but then I might just be too tired. Can anyone point out what I'm missing? I open geda, create a sch file (circuit), and then run gnetlist -g spice-sdb sch-file. I then run ngspice (or gspiceui) but it comes up with errors over the 555 (U1) and diodes (d?) I'm running like this: Error on line 9 : d1 2 0 unknown unable to find definition of model unknown - default assumed Error on line 13 : u1 0 4 3 +9v 1 4 5 +9v unknown unable to find definition of model +9v - default assumed unknown parameter (4) Doing analysis at TEMP = 27.00 and TNOM = 27.00 CPU time since last call: 0.040 seconds. Total CPU time: 0.040 seconds. Current dynamic memory usage = 0 bytes, Dynamic memory limit = 32742.316406 MB. Warning: can't parse '0': ignored Warning: can't parse '0': ignored Warning: can't parse '0': ignored Warning: singular matrix: check nodes 1 and 1 Warning: singular matrix: check nodes 1 and 1 Note: starting dynamic Gmin stepping Trying gmin = 1.E-03 Note: One successful Gmin step Trying gmin = 1.E-04 Note: One successful Gmin step Trying gmin = 1.E-05 Note: One successful Gmin step Trying gmin = 1.E-06 Note: One successful Gmin step Trying gmin = 1.E-07 Note: One successful Gmin step Trying gmin = 1.E-08 Note: One successful Gmin step Trying gmin = 1.E-09 Note: One successful Gmin step Trying gmin = 1.E-10 Note: One successful Gmin step Trying gmin = 1.E-11 Note: One successful Gmin step Trying gmin = 1.E-12 Note: One successful Gmin step Trying gmin = 1.E-12 Note: One successful Gmin step Warning: singular matrix: check nodes 1 and 1 Warning: Dynamic Gmin stepping failed Note: starting source stepping Supplies reduced to 0.% Warning: singular matrix: check nodes 1 and 1 Trying gmin = 1.E-02 Note: One successful Gmin step Trying gmin = 1.E-03 Note: One successful Gmin step Trying gmin = 1.E-04 Note: One successful Gmin step Trying gmin = 1.E-05 Note: One successful Gmin step Trying gmin = 1.E-06 Note: One successful Gmin step Trying gmin = 1.E-07 Note: One successful Gmin step Trying gmin = 1.E-08 Note: One successful Gmin step Trying gmin = 1.E-09 Note: One successful Gmin step Trying gmin = 1.E-10 Note: One successful Gmin step Trying gmin = 1.E-11 Note: One successful Gmin step Trying gmin = 1.E-12 Note: One successful Gmin step Note: One successful source step Supplies reduced to 0.1000% Warning: singular matrix: check nodes 1 and 1 Supplies reduced to 0.% Warning: singular matrix: check nodes 1 and 1 Warning: source stepping failed doAnalyses: iteration limit reached run simulation(s) aborted Syntax error: expression not understood 'v(5)-v(+9v) v(3)-v(2) v(5)-v(4) v(+9v) v(1) v(2) v(3) v(4) v(5)'. There is nada on google about any of this - but I suspect it is missing model files or something, and before I go attaching to yet another mailing list, I thought I'd run it by here first as I'm sure there are some who use this and have experience with it on FreeBSD 9. TIA guys ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org