Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Varistor.lib and upload examples #555

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions examples/ngspice/MESFETs/NE3509.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
* NE3509 packaged FET model
* Model parameters found on-line are garbage
* Modified to get DC to semi work
*
.SUBCKT NE3509 Drain Gate Source
*
L1 D D1 0.5204e-9
L2 G G1 0.6696e-9
L3 Source S 0.2064e-9
L4 D1 Drain 0.2058e-9
L5 G1 G2 0.0029e-9
C1 G1 D1 1.0e-15
C2 G1 Source 65.4e-15
C3 D1 Source 19.9e-15
C4 Gate Source 10.8e-15
C5 Drain Source 144.9e-15
R1 G2 Gate 1.321
*
ZDIE D G S qNE3509M04
*
.MODEL qNE3509M04 NMF(VTO=-0.9754 LAMBDA=0.03 ALPHA=5 BETA=0.22 RS=0.794 RD=1.455 CGD=102.8e-15 IS=0.8956e-12)
*
.ENDS NE3509
48 changes: 48 additions & 0 deletions examples/ngspice/MESFETs/NE3509_sub.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<Qucs Schematic 24.1.0>
<Properties>
<View=-21,89,364,323,3.4359,0,0>
<Grid=10,10,1>
<DataSet=NE3509_sub.dat>
<DataDisplay=NE3509_sub.dpl>
<OpenDisplay=1>
<Script=NE3509_sub.m>
<RunScript=0>
<showFrame=0>
<FrameText0=Title>
<FrameText1=Drawn By:>
<FrameText2=Date:>
<FrameText3=Revision:>
</Properties>
<Symbol>
<.PortSym -30 0 2 0>
<.ID 20 -16 Z>
<.PortSym 0 -30 1 0>
<.PortSym 0 30 3 0>
<Line -10 -15 0 30 #800000 3 1>
<Line -10 -10 10 0 #800000 3 1>
<Line -10 10 10 0 #800000 3 1>
<Line -4 24 8 -4 #000080 2 1>
<Line -16 -5 5 5 #800000 3 1>
<Line -16 5 5 -5 #800000 3 1>
<Line -20 0 10 0 #800000 3 1>
<Line -30 0 10 0 #000080 3 1>
<Line 0 10 0 10 #800000 3 1>
<Line 0 20 0 10 #000080 3 1>
<Line 0 -10 0 -10 #800000 3 1>
<Line 0 -20 0 -10 #000080 3 1>
</Symbol>
<Components>
<Port D 1 100 140 -46 -10 0 0 "1" 1 "analog" 0 "v" 0 "" 0>
<Port G 1 200 140 33 -11 1 2 "2" 1 "analog" 0 "v" 0 "" 0>
<Port S 1 100 200 -46 -10 0 0 "3" 1 "analog" 0 "v" 0 "" 0>
<SpLib X1 1 150 170 -24 50 0 0 "NE3509.cir" 1 "NE3509" 1 "auto" 0 "" 0>
</Components>
<Wires>
<100 140 120 140 "" 0 0 0 "">
<100 200 120 200 "" 0 0 0 "">
<180 140 200 140 "" 0 0 0 "">
</Wires>
<Diagrams>
</Diagrams>
<Paintings>
</Paintings>
54 changes: 54 additions & 0 deletions examples/ngspice/MESFETs/NE3509_sub_Id_Vg.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<Qucs Schematic 24.1.0>
<Properties>
<View=-40,-57,1011,581,1.26019,0,0>
<Grid=10,10,1>
<DataSet=NE3509_sub_Id_Vg.dat>
<DataDisplay=NE3509_sub_Id_Vg.dpl>
<OpenDisplay=0>
<Script=NE3509_sub_Id_Vg.m>
<RunScript=0>
<showFrame=0>
<FrameText0=Title>
<FrameText1=Drawn By:>
<FrameText2=Date:>
<FrameText3=Revision:>
</Properties>
<Symbol>
<.ID -20 -16 SUB>
<Line -20 20 40 0 #000080 2 1>
<Line 20 20 0 -40 #000080 2 1>
<Line -20 -20 40 0 #000080 2 1>
<Line -20 20 0 -40 #000080 2 1>
</Symbol>
<Components>
<GND * 1 60 200 0 0 0 0>
<GND * 1 330 140 0 0 0 0>
<Vdc Vds 1 330 90 18 -26 0 1 "10" 1>
<GND * 1 150 150 0 0 0 0>
<Sub Z1 1 150 100 13 -19 0 0 "NE3509_sub.sch" 1>
<IProbe Ids 1 240 40 -14 -57 1 2>
<.DC DC1 1 20 260 0 46 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0>
<.SW SW1 1 180 260 0 77 0 0 "DC1" 1 "lin" 1 "Vds" 1 "0" 1 "10" 1 "41" 1 "false" 0>
<.SW SW2 1 320 270 0 77 0 0 "SW1" 1 "lin" 1 "Vgs" 1 "-2" 1 "0" 1 "6" 1 "false" 0>
<Vdc Vgs 1 60 150 -69 -22 0 1 "-0.5" 1>
</Components>
<Wires>
<270 40 330 40 "" 0 0 0 "">
<330 120 330 140 "" 0 0 0 "">
<330 40 330 60 "" 0 0 0 "">
<150 40 210 40 "" 0 0 0 "">
<150 40 150 70 "" 0 0 0 "">
<150 130 150 150 "" 0 0 0 "">
<60 180 60 200 "" 0 0 0 "">
<60 100 120 100 "" 0 0 0 "">
<60 100 60 120 "" 0 0 0 "">
<330 40 330 40 "Vds" 350 10 0 "">
<60 100 60 100 "Vgs" 20 70 0 "">
</Wires>
<Diagrams>
<Rect 490 304 386 294 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 0.5 1 1 -1 0.5 1 315 0 225 1 0 0 "" "" "">
<"ngspice/i(vids)" #0000ff 0 3 0 0 0>
</Rect>
</Diagrams>
<Paintings>
</Paintings>
14 changes: 14 additions & 0 deletions examples/ngspice/MESFETs/Statz_dc_mod.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
* Statz MESFET DC model example ngspice manual
*
.SUBCKT STATZ d g s
*
z1 d g s mesfetmod area=1.4
*
.MODEL mesfetmod NMF level=1 vt0=-1.3 lambda=0.03 alpha=3 beta=1.4e-3 rd=1.5 rs=1
*
.ENDS STATZ
*
*MESFET model level 1 is derived from the GaAs FET model of Statz et al.
*DC characteristics defined by VTO, B and BETA which determine the variation of drain current with gate voltage
*ALPHA, which determines saturation voltage
*LAMBDA, which determines the output conductance
49 changes: 49 additions & 0 deletions examples/ngspice/MESFETs/Statz_sub.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<Qucs Schematic 24.1.0>
<Properties>
<View=-391,-130,738,545,1,0,0>
<Grid=10,10,1>
<DataSet=Statz_sub.dat>
<DataDisplay=Statz_sub.dpl>
<OpenDisplay=1>
<Script=Statz_sub.m>
<RunScript=0>
<showFrame=0>
<FrameText0=Title>
<FrameText1=Drawn By:>
<FrameText2=Date:>
<FrameText3=Revision:>
</Properties>
<Symbol>
<.PortSym -30 0 2 0>
<.ID 20 -16 Z>
<.PortSym 0 -30 1 0>
<.PortSym 0 30 3 0>
<Line -10 -15 0 30 #800000 3 1>
<Line -10 -10 10 0 #800000 3 1>
<Line -10 10 10 0 #800000 3 1>
<Line -4 24 8 -4 #000080 2 1>
<Line -16 -5 5 5 #800000 3 1>
<Line -16 5 5 -5 #800000 3 1>
<Line -20 0 10 0 #800000 3 1>
<Line -30 0 10 0 #000080 3 1>
<Line 0 10 0 10 #800000 3 1>
<Line 0 20 0 10 #000080 3 1>
<Line 0 -10 0 -10 #800000 3 1>
<Line 0 -20 0 -10 #000080 3 1>
</Symbol>
<Components>
<Port D 1 100 140 -46 -10 0 0 "1" 1 "analog" 0 "v" 0 "" 0>
<Port G 1 200 140 33 -11 1 2 "2" 1 "analog" 0 "v" 0 "" 0>
<Port S 1 100 200 -46 -10 0 0 "3" 1 "analog" 0 "v" 0 "" 0>
<SpLib X1 1 150 170 -19 54 0 0 "Statz_dc_mod.cir" 1 "STATZ" 1 "auto" 0 "" 0>
</Components>
<Wires>
<100 140 120 140 "" 0 0 0 "">
<100 200 120 200 "" 0 0 0 "">
<180 140 200 140 "" 0 0 0 "">
</Wires>
<Diagrams>
</Diagrams>
<Paintings>
<Text 50 80 12 #aa0000 0 "Correct model file location!">
</Paintings>
54 changes: 54 additions & 0 deletions examples/ngspice/MESFETs/Statz_sub_Id_Vg.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<Qucs Schematic 24.1.0>
<Properties>
<View=10,-55,1058,581,1.26415,1,0>
<Grid=10,10,1>
<DataSet=Statz_sub_Id_Vg.dat>
<DataDisplay=Statz_sub_Id_Vg.dpl>
<OpenDisplay=0>
<Script=Statz_sub_Id_Vg.m>
<RunScript=0>
<showFrame=0>
<FrameText0=Title>
<FrameText1=Drawn By:>
<FrameText2=Date:>
<FrameText3=Revision:>
</Properties>
<Symbol>
<.ID -20 -16 SUB>
<Line -20 20 40 0 #000080 2 1>
<Line 20 20 0 -40 #000080 2 1>
<Line -20 -20 40 0 #000080 2 1>
<Line -20 20 0 -40 #000080 2 1>
</Symbol>
<Components>
<GND * 1 400 140 0 0 0 0>
<Vdc Vds 1 400 90 18 -26 0 1 "10" 1>
<GND * 1 140 200 0 0 0 0>
<GND * 1 220 150 0 0 0 0>
<Sub Z1 1 220 100 20 -16 0 0 "Statz_sub.sch" 1>
<IProbe Ids 1 310 40 -9 -55 1 2>
<.DC DC1 1 60 290 0 46 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0>
<.SW SW1 1 230 290 0 77 0 0 "DC1" 1 "lin" 1 "Vds" 1 "0" 1 "10" 1 "41" 1 "false" 0>
<.SW SW2 1 370 290 0 77 0 0 "SW1" 1 "lin" 1 "Vgs" 1 "-2" 1 "0" 1 "6" 1 "false" 0>
<Vdc Vgs 1 140 150 -78 -22 0 1 "-0.25" 1>
</Components>
<Wires>
<400 120 400 140 "" 0 0 0 "">
<140 180 140 200 "" 0 0 0 "">
<140 100 140 120 "" 0 0 0 "">
<140 100 190 100 "" 0 0 0 "">
<220 130 220 150 "" 0 0 0 "">
<220 40 220 70 "" 0 0 0 "">
<220 40 280 40 "" 0 0 0 "">
<400 40 400 60 "" 0 0 0 "">
<340 40 400 40 "" 0 0 0 "">
<140 100 140 100 "Vgs" 100 70 0 "">
<400 40 400 40 "Vds" 420 10 0 "">
</Wires>
<Diagrams>
<Rect 570 324 386 294 3 #c0c0c0 1 00 1 -1 0.2 1 1 -1 0.5 1 1 -1 0.5 1 315 0 225 1 0 0 "" "" "">
<"ngspice/i(vids)" #0000ff 0 3 0 0 0>
</Rect>
</Diagrams>
<Paintings>
</Paintings>
2 changes: 1 addition & 1 deletion qucs/extsimkernels/qucs2spice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ QString qucs2spice::convert_rcl(const QString& line)
s += " " + lst.takeFirst() + " ";
s1 = lst.takeFirst().remove("\"");
auto idx = s1.indexOf('=');
s += s1.right(s1.size()-idx-1);
s += spicecompat::normalize_value(s1.right(s1.size()-idx-1));
s += "\n";
return s;
}
Expand Down
Loading