delorie.com/archives/browse.cgi   search  
Mail Archives: geda-help/2014/10/29/09:06:11

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 <effbiae AT gmail DOT com>
Date: Thu, 30 Oct 2014 00:05:15 +1100
Message-ID: <CAJvHTNzU26FpikzGkmkx6xcZawUZWMFSKkfeSnHALhZ8j5RFGQ@mail.gmail.com>
Subject: [geda-help] newbie: automatic way to find a model
To: geda-help AT delorie DOT com
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

<div dir=3D"ltr"><div><div><div><div><div><div>Hi,<br></div><div><br>My int=
erest is <br>=C2=A0- bread-boarding some hardware ideas<br>=C2=A0- saving t=
ime messing with hardware by using simulation<br><br>So I ended up looking =
at [ng]spice and gschem<br></div><br></div>This is my first day and I&#39;m=
 quite pleased with my progress - all credit due to gEDA.<br><br></div>I dr=
ew up the start of a current mirror in gschem and <br><br>$ gnetlist -v -g =
spice-sdb current-mirror=C2=A0=C2=A0 #see current mirror in shell script be=
low<br><br>and the body of the output was:<br><br>B2 5 7 0V<br>R4 1 unconne=
cted_pin-1 7 5K<br>B1 7 6 12V<br>Q1 2 2 6 unknown <br>Q2 4 2 6 unknown <br>=
R3 3 5 5K=C2=A0 <br>R2 4 3 10K=C2=A0 <br>R1 2 1 10K=C2=A0 <br>.end<br><br><=
/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&#39;m sure the question =
has been asked before:<br><br></div>=C2=A0 . is there an automated way to f=
ind the model for 2N2222?<br><br></div><div>If this is currently done manua=
lly, I&#39;d like to contribute some work.=C2=A0 (I&#39;m in software by da=
y).=C2=A0 <br><br></div><div>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...<br><br></div><div>I&#39;m very encouraged by gschem and lookin=
g forward to spending some time learning spice and the gEDA.<br><br></div><=
div>current-mirror appended below.<br></div><div><br></div><div>Regards,<br=
><br><br>Jack<br></div><div><div><div><div><br>v 20130925 2<br>C 40000 4000=
0 0 0 0 title-B.sym<br>C 50000 44500 1 90 0 resistor-1.sym<br>{<br>T 49600 =
44800 5 10 0 0 90 0 1<br>device=3DRESISTOR<br>T 49700 44700 5 10 1 1 90 0 1=
<br>refdes=3DR1<br>T 50300 44600 5 10 1 1 90 0 1<br>value=3D10K<br>}<br>C 5=
1200 44500 1 90 0 resistor-1.sym<br>{<br>T 50800 44800 5 10 0 0 90 0 1<br>d=
evice=3DRESISTOR<br>T 50900 44700 5 10 1 1 90 0 1<br>refdes=3DR2<br>T 51400=
 44700 5 10 1 1 90 0 1<br>value=3D10K<br>}<br>C 51200 45400 1 90 0 resistor=
-1.sym<br>{<br>T 50800 45700 5 10 0 0 90 0 1<br>device=3DRESISTOR<br>T 5090=
0 45600 5 10 1 1 90 0 1<br>refdes=3DR3<br>T 51400 45600 5 10 1 1 90 0 1<br>=
value=3D5K<br>}<br>C 50500 43500 1 0 0 2N2222-1.sym<br>{<br>T 51400 44200 5=
 10 0 0 0 0 1<br>device=3D2N2222<br>T 51400 44000 5 10 1 1 0 0 1<br>refdes=
=3DQ2<br>}<br>C 50500 43500 1 0 1 2N2222-1.sym<br>{<br>T 49600 44200 5 10 0=
 0 0 6 1<br>device=3D2N2222<br>T 49600 44000 5 10 1 1 0 6 1<br>refdes=3DQ1<=
br>}<br>N 49900 44500 50500 44500 4<br>N 50500 44500 50500 44000 4<br>N 484=
00 43500 51100 43500 4<br>N 48400 43500 48400 44800 4<br>C 48200 45500 1 27=
0 0 battery-1.sym<br>{<br>T 49100 45200 5 10 0 0 270 0 1<br>device=3DBATTER=
Y<br>T 49500 45200 5 10 0 0 270 0 1<br>symversion=3D0.1<br>T 47900 45000 5 =
10 1 1 0 0 1<br>value=3D12V<br>T 47900 45300 5 10 1 1 0 0 1<br>refdes=3DB1<=
br>}<br>C 50000 45400 1 90 0 resistor-variable-1.sym<br>{<br>T 49100 46200 =
5 10 0 0 90 0 1<br>device=3DVARIABLE_RESISTOR<br>T 49400 45600 5 10 1 1 0 0=
 1<br>value=3D5K<br>T 49600 46000 5 10 1 1 90 0 1<br>refdes=3DR4<br>}<br>N =
48400 45500 48400 46900 4<br>N 48400 45900 49400 45900 4<br>N 51100 46900 5=
1100 46300 4<br>N 50000 46900 48400 46900 4<br>C 50700 46700 1 0 1 battery-=
1.sym<br>{<br>T 50400 47600 5 10 0 0 0 6 1<br>device=3DBATTERY<br>T 50600 4=
6500 5 10 1 1 0 6 1<br>refdes=3DB2<br>T 50400 48000 5 10 0 0 0 6 1<br>symve=
rsion=3D0.1<br>T 50300 46500 5 10 1 1 0 6 1<br>value=3D0V<br>}<br>N 51100 4=
6900 50700 46900 4<br><br></div></div></div></div></div>

--bcaec53f370965159905068f6b01--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019