[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: newbie opamp blues



OK, maybe now you'll give me a little credit. I apologize for not having the time to fiddle with this until I can figure out how to get it work, but I have a LOT of work to do already.

However, I'm not stupid, nor do I just wait for instruction without trying first. I downloaded and installed part files. I downloaded two different projects. I set up a project of my own using the same model as the downloaded ones. I used file and model, as shown in the sample projects. I still got pin errors.

I then asked again. Then I got your email that implies I was negligent in reading the docs and negligent in trying my own. So let's see how your instructions went (especially since I had already tried almost these exact same instructions before I requested more help.)

1) I copied the spice model you sent me into /usr/src/geda-install/share/gEDA/sym/spice because that's where ua741.inc is.
2) I checked /usr/local/geda/share/gEDA/system-gafrc to see if the directory was there. It was.
3) I created a gschem, followed your instructions.
4) I get:


[djlogan@server chapter5]$ batch problem_5_48
gEDA/gschem version 20041228
gEDA/gschem comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.
This is free software, and you are welcome to redistribute it under certain
conditions; please see the COPYING file for more details.

Loading schematic [problem_5_48.sch]
Command line passed = gnetlist -g spice-sdb -o problem_5_48.cir problem_5_48.sch gEDA/gnetlist version 20041228
gEDA/gnetlist comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.
This is free software, and you are welcome to redistribute it under certain
conditions; please see the COPYING file for more details.


Loading schematic [problem_5_48.sch]
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Using SPICE backend by SDB -- Version of 10.9.2004
schematic-type = normal schematic
Error: unknown subckt: xu1 unknown
Note: No ".plot", ".print", or ".fourier" lines; no simulations run
[djlogan@server chapter5]$

just like I did when I tried it on my own. OK, fine, so I didn't follow your instructions exactly. So I copied OP407.inc into my own library. I created my own gafrc, and I put in:

[djlogan@server chapter5]$ cat gafrc
(component-library ".")
[djlogan@server chapter5]$

I modified my circuit to point to: file=/home/djlogan/geda/chapter5/OP07.inc

And I tried it again. I get:

[djlogan@server chapter5]$ batch problem_5_48
gEDA/gschem version 20041228
gEDA/gschem comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.
This is free software, and you are welcome to redistribute it under certain
conditions; please see the COPYING file for more details.

Loading schematic [problem_5_48.sch]
Command line passed = gnetlist -g spice-sdb -o problem_5_48.cir problem_5_48.sch gEDA/gnetlist version 20041228
gEDA/gnetlist comes with ABSOLUTELY NO WARRANTY; see COPYING for more details.
This is free software, and you are welcome to redistribute it under certain
conditions; please see the COPYING file for more details.


Loading schematic [problem_5_48.sch]
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Missing Attributes (refdes and pin number)
Using SPICE backend by SDB -- Version of 10.9.2004
schematic-type = normal schematic
Error: unknown subckt: xu1 unknown
Note: No ".plot", ".print", or ".fourier" lines; no simulations run
[djlogan@server chapter5]$ cat gafrc
(component-library ".")
[djlogan@server chapter5]$


So yes, I'm a bit pissed off that you aren't even giving me credit for trying the obvious. I did that. Before your email and after. Now I can fiddle around for who knows how long and probably eventually figure out what I'm doing wrong. But I'm still working on my own homework, and just don't have the hours that it'll take. You guys know this software inside and out. I presume you can *help* me figure out what I am doing wrong.


Any ideas? I didn't recopy your opamp-1.sym because one already existed. Is the one that already exists defective?

David Logan

Stuart Brorson wrote:

David --



My final statement was that I just don't have time to play around with this and that until I finally hit upon the correct steps for that "aha!".


If you had taken as much time to peruse the docs at:

http://www.brorson.com/gEDA/SPICE/

as you have to write your e-mails, perhaps you'd be done by now!

Perhaps you should check out LTSpice, as somebody else already
suggested.  LTSpice  provides what you want:  A prepackaged SPICE
simulation package with everything already built in.  Get it here:

http://www.linear.com/company/software.jsp



I really need more clear cut instructions on how to build an opamp circuit, with the associated pins.


1. Please find the SPICE-opamp symbol attached below. The symbol below has the correct pinseq attributes for simulating most all opamp models, including the one I attach below.

2.  Save it into your project directory.

3.  Make sure your gafrc file has this line in it:

(component-library ".")

This step will make gschem able to find the symbol using the parts
browser (as long as you are running it in your project directory).

4.  Within gschem, place the opamp symbol on your schematic.

5.  Double click on the symbol to get to the attribute editor.

6.  Change the refdes to U1

7.  Enter a new attribute "file".  Make its value the same as the
SPICE subckt you wish to simulate.  I attach an OP07 .subckt below
which you can cut 'n paste into your project directory.  Make the
"file" attribute point to this file.

8.  In the subckt file, locate the name of the subckt.  The subckt
name occurs after the .subckt declaration at the beginning of the
file.  In the case of the OP07 below, the subckt name is OP07.

9.  Still in the symbol's attribute editor, add a new attribute
"model-name".  Make the model name the name you got from the file, in
this case "OP07".

10. Close the attribute editor.

11.  Create the rest of your schematic.

12.  Netlist using gnetlist -g spice-sdb

13.  You are done.

Stuart

---------------  SPICE-opamp-1.sym  ---------------
v 20050313 1
L 200 0 200 800 3 0 0 0 -1 -1
L 200 800 800 400 3 0 0 0 -1 -1
L 800 400 200 0 3 0 0 0 -1 -1
T 825 150 5 8 0 0 0 0 1
device=OP177
P 200 600 0 600 1 0 1
{
T 50 625 5 8 1 1 0 0 1
pinnumber=3
T 50 625 5 8 0 0 0 0 1
pinseq=1
T 200 600 5 10 0 1 0 0 1
pinlabel=IN+
}
P 200 200 0 200 1 0 1
{
T 50 225 5 8 1 1 0 0 1
pinnumber=2
T 50 225 5 8 0 0 0 0 1
pinseq=2
T 200 200 5 10 0 1 0 0 1
pinlabel=IN-
}
P 800 400 1000 400 1 0 1
{
T 875 425 5 8 1 1 0 0 1
pinnumber=6
T 875 425 5 8 0 0 0 0 1
pinseq=5
T 800 400 5 10 0 1 0 0 1
pinlabel=OUT
}
P 500 200 500 0 1 0 1
{
T 525 50 5 8 1 1 0 0 1
pinnumber=4
T 525 50 5 8 0 0 0 0 1
pinseq=4
T 500 200 5 10 0 1 0 0 1
pinlabel=V-
}
P 500 600 500 800 1 0 1
{
T 525 650 5 8 1 1 0 0 1
pinnumber=7
T 525 650 5 8 0 0 0 0 1
pinseq=3
T 500 600 5 10 0 1 0 0 1
pinlabel=V+
}
T 225 350 9 6 1 0 0 0 1
Op amp
T 200 900 8 10 1 1 0 0 1
refdes=U?
T 400 500 9 6 1 0 0 0 1
V+
T 400 200 9 6 1 0 0 0 1
V-
T 247 533 9 12 1 0 0 0 1
+
T 250 127 9 12 1 0 0 0 1
-
---------------  end of SPICE-opamp-1.sym  ---------------


----------------- OP07 spice model ---------------------
*
* Linear Technology OP07 op amp model
* Written: 08-24-1989 12:35:59 Type: Bipolar npn input, internal comp.
* Typical specs: * Vos=3.0E-05, Ib=1.0E-09, Ios=4.0E-10, GBP=6.0E+05Hz, Phase mar.= 70
* deg, * SR(+)=2.5E-01V/us, SR(-)=2.4E-01V/us, Av= 114 dB, CMMR= 126 dB, * Vsat(+)=2.00V, Vsat(-)=2.00V, Isc=+/-25.0mA, Iq=2500uA
* (input differential mode clamp active)
* * Connections: + - V+V-O .subckt OP07 3 2 7 4 6
* input
rc1 7 80 8.842E+03
rc2 7 90 8.842E+03
q1 80 102 10 qm1 q2 90 103 11 qm2 rb1 2 102 5.000E+02
rb2 3 103 5.000E+02
ddm1 102 104 dm2 ddm3 104 103 dm2 ddm2 103 105 dm2 ddm4 105 102 dm2 c1 80 90 5.460E-12
re1 10 12 1.948E+03
re2 11 12 1.948E+03
iee 12 4 7.502E-06
re 12 0 2.666E+07
ce 12 0 1.579E-12
* intermediate gcm 0 8 12 0 5.668E-11
ga 8 0 80 90 1.131E-04
r2 8 0 1.000E+05
c2 1 8 3.000E-11
gb 1 0 8 0 1.294E+03
* output ro1 1 6 2.575E+01
ro2 1 0 3.425E+01
rc 17 0 6.634E-06
gc 0 17 6 0 1.507E+05
d1 1 17 dm1 d2 17 1 dm1 d3 6 13 dm2 d4 14 6 dm2 vc 7 13 2.803E+00
ve 14 4 2.803E+00
ip 7 4 2.492E-03
dsub 4 7 dm2 * models .model qm1 npn (is=8.000E-16 bf=3.125E+03)
.model qm2 npn (is=8.009E-16 bf=4.688E+03)
.model dm1 d (is=1.486E-08)
.model dm2 d (is=8.000E-16)
.ends OP07
* * - - - - - * fini OP07 * - - - - - * [oamm vn1 8/89]
**
* (C) COPYRIGHT LINEAR TECHNOLOGY CORPORATION 1990
* All rights reserved.
* * Linear Technology Corporation hereby grants the users of this
* macromodel a non-exclusive, nontransferrable license to use this
* macromodel under the following conditions:
* * The user agrees that this macromodel is licensed from Linear
* Technology and agrees that the macromodel may be used, loaned,
* given away or included in other model libraries as long as this
* notice and the model in its entirety and unchanged is included.
* No right to make derivative works or modifications to the
* macromodel is granted hereby. All such rights are reserved.
* * This model is provided as is. Linear Technology makes no
* warranty, either expressed or implied about the suitability or
* fitness of this model for any particular purpose. In no event
* will Linear Technology be liable for special, collateral,
* incidental or consequential damages in connection with or arising
* out of the use of this macromodel. It should be remembered that
* models are a simplification of the actual circuit.
* * Linear Technology reserves the right to change these macromodels
* without prior notice. Contact Linear Technology at 1630 McCarthy
* Blvd., Milpitas, CA, 95035-7487 or telephone 408/432-1900 for
* datasheets on the actual amplifiers or the latest macromodels.
* * -----------------------------------------------------------------------


----------------- End of OP07 spice model  ---------