X-Authentication-Warning: delorie.com: mail set sender to geda-help-bounces using -f X-Recipient: geda-help AT delorie DOT com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=ed34cRViDpQYmBOfcErZ+5sHD/W5lls839kk0VDaPBs=; b=GT3YPTmelNlc/7s4oUYJQQqQd5/z8KewR9apta4Utqm9JX8XPV8hBWkUGAp0y44OoC FQLUR2BC4+pQG9NjHYdHINKf9zrPxBOilMl3bm+2liATzxcEo+rCiHV9nrWvi4wun1/x D9sQ6cF8lttNDLKZ0JUdO9zpOeXZLTPNEI7uN381LSR0w3ct3MzlTdXq8f8t+tg1e2G9 bGvzjbNBxzUaPe9ir/xYLh6SsEMLusw51Y4U0tpdJL5AlRGSZM/hvFdd5gBloeIoy7pK 5vRCtpHcAuQrXJ9E5NHvqQ3jyLaD3TYjwLCIUfdyci0UdCee/2W0qshF4bRawyG6aCf2 1Lyw== X-Received: by 10.180.20.8 with SMTP id j8mr12714101wie.60.1414587935428; Wed, 29 Oct 2014 06:05:35 -0700 (PDT) MIME-Version: 1.0 From: Jack Andrews Date: Thu, 30 Oct 2014 00:05:15 +1100 Message-ID: Subject: [geda-help] newbie: automatic way to find a model To: geda-help AT delorie DOT com Content-Type: multipart/alternative; boundary=bcaec53f370965159905068f6b01 Reply-To: geda-help AT delorie DOT com --bcaec53f370965159905068f6b01 Content-Type: text/plain; charset=UTF-8 Hi, My interest is - bread-boarding some hardware ideas - saving time messing with hardware by using simulation So I ended up looking at [ng]spice and gschem This is my first day and I'm quite pleased with my progress - all credit due to gEDA. I drew up the start of a current mirror in gschem and $ gnetlist -v -g spice-sdb current-mirror #see current mirror in shell script below and the body of the output was: B2 5 7 0V R4 1 unconnected_pin-1 7 5K B1 7 6 12V Q1 2 2 6 unknown Q2 4 2 6 unknown R3 3 5 5K R2 4 3 10K R1 2 1 10K .end In my schematic, I specified Q{1,2} as 2N2222 - but to run ngspice, I seem to need to find the model for 2N2222. I'm sure the question has been asked before: . is there an automated way to find the model for 2N2222? If this is currently done manually, I'd like to contribute some work. (I'm in software by day). Also, note the R4 VARIABLE_RESISTOR is being used as a variable resistor (not a potentiometer) so there is a floating node. What is the best way of drawing what I want? And then, how do I get spice to vary the resistor in 33 steps? Maybe use a VCR voltage-controlled-resistor and vary the voltage control? Starting to get vague now... I'm very encouraged by gschem and looking forward to spending some time learning spice and the gEDA. current-mirror appended below. Regards, Jack v 20130925 2 C 40000 40000 0 0 0 title-B.sym C 50000 44500 1 90 0 resistor-1.sym { T 49600 44800 5 10 0 0 90 0 1 device=RESISTOR T 49700 44700 5 10 1 1 90 0 1 refdes=R1 T 50300 44600 5 10 1 1 90 0 1 value=10K } C 51200 44500 1 90 0 resistor-1.sym { T 50800 44800 5 10 0 0 90 0 1 device=RESISTOR T 50900 44700 5 10 1 1 90 0 1 refdes=R2 T 51400 44700 5 10 1 1 90 0 1 value=10K } C 51200 45400 1 90 0 resistor-1.sym { T 50800 45700 5 10 0 0 90 0 1 device=RESISTOR T 50900 45600 5 10 1 1 90 0 1 refdes=R3 T 51400 45600 5 10 1 1 90 0 1 value=5K } C 50500 43500 1 0 0 2N2222-1.sym { T 51400 44200 5 10 0 0 0 0 1 device=2N2222 T 51400 44000 5 10 1 1 0 0 1 refdes=Q2 } C 50500 43500 1 0 1 2N2222-1.sym { T 49600 44200 5 10 0 0 0 6 1 device=2N2222 T 49600 44000 5 10 1 1 0 6 1 refdes=Q1 } N 49900 44500 50500 44500 4 N 50500 44500 50500 44000 4 N 48400 43500 51100 43500 4 N 48400 43500 48400 44800 4 C 48200 45500 1 270 0 battery-1.sym { T 49100 45200 5 10 0 0 270 0 1 device=BATTERY T 49500 45200 5 10 0 0 270 0 1 symversion=0.1 T 47900 45000 5 10 1 1 0 0 1 value=12V T 47900 45300 5 10 1 1 0 0 1 refdes=B1 } C 50000 45400 1 90 0 resistor-variable-1.sym { T 49100 46200 5 10 0 0 90 0 1 device=VARIABLE_RESISTOR T 49400 45600 5 10 1 1 0 0 1 value=5K T 49600 46000 5 10 1 1 90 0 1 refdes=R4 } N 48400 45500 48400 46900 4 N 48400 45900 49400 45900 4 N 51100 46900 51100 46300 4 N 50000 46900 48400 46900 4 C 50700 46700 1 0 1 battery-1.sym { T 50400 47600 5 10 0 0 0 6 1 device=BATTERY T 50600 46500 5 10 1 1 0 6 1 refdes=B2 T 50400 48000 5 10 0 0 0 6 1 symversion=0.1 T 50300 46500 5 10 1 1 0 6 1 value=0V } N 51100 46900 50700 46900 4 --bcaec53f370965159905068f6b01 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

My int= erest is
=C2=A0- bread-boarding some hardware ideas
=C2=A0- saving t= ime messing with hardware by using simulation

So I ended up looking = at [ng]spice and gschem

This is my first day and I'm= quite pleased with my progress - all credit due to gEDA.

I dr= ew up the start of a current mirror in gschem and

$ gnetlist -v -g = spice-sdb current-mirror=C2=A0=C2=A0 #see current mirror in shell script be= low

and the body of the output was:

B2 5 7 0V
R4 1 unconne= cted_pin-1 7 5K
B1 7 6 12V
Q1 2 2 6 unknown
Q2 4 2 6 unknown
= R3 3 5 5K=C2=A0
R2 4 3 10K=C2=A0
R1 2 1 10K=C2=A0
.end

<= /div>In my schematic, I specified Q{1,2} as 2N2222 - but to run ngspice, I = seem to need to find the model for 2N2222.=C2=A0 I'm sure the question = has been asked before:

=C2=A0 . is there an automated way to f= ind the model for 2N2222?

If this is currently done manua= lly, I'd like to contribute some work.=C2=A0 (I'm in software by da= y).=C2=A0

Also, note the R4 VARIABLE_RESISTOR is being u= sed as a variable resistor (not a potentiometer) so there is a floating nod= e.=C2=A0 What is the best way of drawing what I want?=C2=A0 And then, how d= o I get spice to vary the resistor in 33 steps?=C2=A0 Maybe use a VCR volta= ge-controlled-resistor and vary the voltage control?=C2=A0 Starting to get = vague now...

I'm very encouraged by gschem and lookin= g forward to spending some time learning spice and the gEDA.

<= div>current-mirror appended below.

Regards,

Jack

v 20130925 2
C 40000 4000= 0 0 0 0 title-B.sym
C 50000 44500 1 90 0 resistor-1.sym
{
T 49600 = 44800 5 10 0 0 90 0 1
device=3DRESISTOR
T 49700 44700 5 10 1 1 90 0 1=
refdes=3DR1
T 50300 44600 5 10 1 1 90 0 1
value=3D10K
}
C 5= 1200 44500 1 90 0 resistor-1.sym
{
T 50800 44800 5 10 0 0 90 0 1
d= evice=3DRESISTOR
T 50900 44700 5 10 1 1 90 0 1
refdes=3DR2
T 51400= 44700 5 10 1 1 90 0 1
value=3D10K
}
C 51200 45400 1 90 0 resistor= -1.sym
{
T 50800 45700 5 10 0 0 90 0 1
device=3DRESISTOR
T 5090= 0 45600 5 10 1 1 90 0 1
refdes=3DR3
T 51400 45600 5 10 1 1 90 0 1
= value=3D5K
}
C 50500 43500 1 0 0 2N2222-1.sym
{
T 51400 44200 5= 10 0 0 0 0 1
device=3D2N2222
T 51400 44000 5 10 1 1 0 0 1
refdes= =3DQ2
}
C 50500 43500 1 0 1 2N2222-1.sym
{
T 49600 44200 5 10 0= 0 0 6 1
device=3D2N2222
T 49600 44000 5 10 1 1 0 6 1
refdes=3DQ1<= br>}
N 49900 44500 50500 44500 4
N 50500 44500 50500 44000 4
N 484= 00 43500 51100 43500 4
N 48400 43500 48400 44800 4
C 48200 45500 1 27= 0 0 battery-1.sym
{
T 49100 45200 5 10 0 0 270 0 1
device=3DBATTER= Y
T 49500 45200 5 10 0 0 270 0 1
symversion=3D0.1
T 47900 45000 5 = 10 1 1 0 0 1
value=3D12V
T 47900 45300 5 10 1 1 0 0 1
refdes=3DB1<= br>}
C 50000 45400 1 90 0 resistor-variable-1.sym
{
T 49100 46200 = 5 10 0 0 90 0 1
device=3DVARIABLE_RESISTOR
T 49400 45600 5 10 1 1 0 0= 1
value=3D5K
T 49600 46000 5 10 1 1 90 0 1
refdes=3DR4
}
N = 48400 45500 48400 46900 4
N 48400 45900 49400 45900 4
N 51100 46900 5= 1100 46300 4
N 50000 46900 48400 46900 4
C 50700 46700 1 0 1 battery-= 1.sym
{
T 50400 47600 5 10 0 0 0 6 1
device=3DBATTERY
T 50600 4= 6500 5 10 1 1 0 6 1
refdes=3DB2
T 50400 48000 5 10 0 0 0 6 1
symve= rsion=3D0.1
T 50300 46500 5 10 1 1 0 6 1
value=3D0V
}
N 51100 4= 6900 50700 46900 4

--bcaec53f370965159905068f6b01--