Questions tagged [ngspice]

Anything related to NGSPICE, an open-source SPICE simulation program.

Filter by
Sorted by
Tagged with
5
votes
2answers
1k views

Transient modelling of RC circuit in NGSpice

I'm just starting out with NGSpice, and so far I have been able to model simple DC circuits with only a voltage source and resistors and have gotten the expected currents and voltages. Now I'm trying ...
3
votes
1answer
937 views

Export vector data from ngspice

Is it possible to export vector values or other data from ngspice to a file? It would be nice to use the data in other programs such as octave or gnplot for prettier plots. Thanks
3
votes
1answer
350 views

How and why does this oscillator work?

I am a beginner hobbyist, trying to understand a circuit from an old Radio Shack electronic snap kits game (the game variant I have is "electronics 303", and the circuit is project #202 : ...
2
votes
1answer
2k views

How to save plots in ngspice

Is there a command or an option in the "plot" command that can generate png/jpg images of the plots?
2
votes
1answer
113 views

Simulation issues with a simple 3-phase rectifier circuit

I'm trying to do a ngspice simulation of the currents flowing through a diode bridge and smoothing capacitor from a 3-phase permanent magnet generator. I'm consistently riddled with convergence issues ...
2
votes
1answer
21 views

How to fix ngspice simulation of Cree XLAMP CXB1507

I'm trying to simulate the 36V Cree XLAMP CXB1507 (spice model) using kicad+ngspice. When I try simulate it gives the following error: .model cxb1507 36v d is=6.15257e-19 n=32.22321 rs=9.82504 xti=...
2
votes
3answers
148 views

Measuring transconductance of any circuit

May I know if the following transconductance measurement test circuit is correct because I am getting quite small Gm values ? I suspect that I need to use some derivative function because changing ...
2
votes
1answer
727 views

How do I get an output file out of ngspice

I have this simple netlist First Circuit R1 1 2 3k R2 2 0 6k R3 2 3 4k R4 3 0 2k Vs 1 0 DC 9 Is 3 0 DC 5M .dc .End In the past when running a text based SPICE ...
2
votes
2answers
673 views

NGSPICE messing up BJT characteristics

I'm trying to obtain BJT characteristics in NGSPICE, but for some reason the plots retrace to origin. ...
2
votes
1answer
128 views

ngspice keeps reporting an unknown parameter

I built a circuit in KiCad to simulate the behavior of the Maxim MAX3665. Here is the circuit: ...
2
votes
1answer
129 views

[Last Update]Simulating an RLC circuit with the 1N3880 in ngpice did not show any results or graph

Im trying to do a transient response analysis with ngspice/gnucap and gspice UI of the next RLC circuit (corrected the source polarity), to find the damping effect in the system. That with the next ...
2
votes
1answer
63 views

plot the max slopes of Voltage-Transfer characteristics in ngspice

I have implemented a basic CMOS inverter in ngspice, performing a DC sweep analysis on the input voltage to obtain the Voltage Transfer Curves (Vout vs Vin) at varying Vdd voltages. ...
2
votes
1answer
105 views

How do I model a simple metastable flip-flop in ngspice?

Problem I'm trying to simulate the simplest possible model for a flip-flop: two inverters connected in a circle. I'm using ngspice 31 on Arch Linux. I based my model on the CMOS SOI Inverter example (...
2
votes
1answer
102 views

Is it possible to pass netlist via command line to ngspice instead of using input file?

Is there a way to use ngspice command line without providing a circuit file? ex: passing the circuit as a string within the command line ? EDIT Currently the only way I could use ngspice in command ...
1
vote
2answers
390 views

How to set forward voltage for a diode model in NGSpice?

I am trying to understand the documentation for the diode model, but I could not find how to set the forward voltage value. Can someone help me simulate silicon diode that has a forward voltage of ...
1
vote
1answer
88 views

Why is ngspice showing current as negative?

I have an extremely simple comparator circuit: The voltage at pin 7 goes into positive saturation when a positive input voltage is presented at pin 5. I'm simulating this using SPICE in KiCad. ...
1
vote
1answer
122 views

Correct usage of curly braces in Spice

When are you required to use {} braces around an expression, and when can you optionally use braces? I realise that this is simulator-specific, and different ...
1
vote
1answer
57 views

LTSpice, plot a current–voltage characteristic

I have LTSpice on macOS. I would like to plot in x-axis the voltage v(2) and in y-axis the current I(R1). But, when I add traces ...
1
vote
1answer
106 views

Why won't this low pass filter work in spice?

I just started working with spice and I feel like I'm making some sort of obvious mistake but unsure what. This works fine: ...
1
vote
1answer
130 views

Unknown model type bjt - ignored

I am trying to use Transistor model as in the NGSpice manual 8.2 BJT Models (NPN/PNP): .model QMOD1 BJT level=2 however, I ...
1
vote
1answer
135 views

Current controlled switch with negative current?

I am trying to create a current controlled switch, which opens only at negative current, I tried this approach: ...
1
vote
2answers
133 views

High voltage gain block

Schematic 1 shows a discrete operational amplifier which is used as a gain block to make up to 450V out of 12V. Q3 and Q4 are used to generate a current which is used by the current mirror. This is ...
1
vote
1answer
1k views

measurement of output impedance of a CMOS inverter

I am measuring output impedance of CMOS inverter using ngspice. No matter how I measure the output impedance, the result can never come any close to the following theoretical calculation if I reduce ...
1
vote
2answers
6k views

How to find value of beta = (mu*Cox)(W/L)/2 of MOSFET in ngspice

How to find value of \$\beta = \frac 1 2 \mu \cdot Cox \cdot \frac W L\$ of MOSFET in ngspice? Is there any command that displays that? The 'show' command displays many parameters but it doesn't ...
1
vote
1answer
138 views

NGspice 26 returns result that is 6 orders of magnitude too small for simple depletion MOS test jig

So, I'm trying to diagnose a simulation issue with the IXTT20N50D in CircuitLab, and created a very simple transfer characteristic test jig to do so: ...
1
vote
2answers
238 views

How to simulate simple on/off, Single-Pole-Single-Throw switch?

I am trying to simulate ON, OFF switch in this simple circuit: ...
1
vote
1answer
37 views

ngspice ltvspice netlist compatibility problems

This is my netlist ...
1
vote
1answer
67 views

How to generate triangle shape?

I tried to follow docs, and here is my implementation for triangle pulse: V1 0 1 PULSE(-0.75 0.75 0m 8.335m 8.335m 0 16.67m 0) but the result is: although the ...
1
vote
1answer
175 views

EAGLE - Singular matrix warning in RL circuit simulation

I'm studying for my electrical circuits exam and since Eagle is used for some future exams I thought I could learn it and double-check my calculations by simulating with Eagle. I'm trying to ...
1
vote
3answers
85 views

zero AC gain of CMOS inverter

Why is the following AC analysis of CMOS inverter resulted in zero AC gain (vout/vin) ?
1
vote
1answer
224 views

Periodic Steady State analysis for class C amplifier

I am working on a simple Class C amplifier which is non-linear, therefore conventional AC analysis could not be used. Instead, Periodic Steady State analysis has to be used. The context of this ...
1
vote
2answers
233 views

ngspice pulse remains at 0 volts

I'm trying to simulate a simple pulse generator that gets activated by a voltage source vs. vs starts at ...
1
vote
1answer
1k views

Spice Error: Too few nodes

I am trying to simulate a circuit using .subckt directive in Ngspice-26 to define NAND GATE and NOT gate. I have two separate subckt files for inv and nand as inv.txt and nand.txt which I include in ...
1
vote
0answers
61 views

Is it possible to plot Voltage vs Current in ngspice?

I need to plot the voltage in the Y axis and the current in the X axis in ngspice, like X-Y mode in an oscilloscope. I could not find anything regarding this in the manual. Can this be done? If so, ...
1
vote
0answers
95 views

dc sweep convergence issue for cmos inverter

I am having some convergence issue with DC sweep for a CMOS inverter. To duplicate the exact issue, see the following log as well as the attached netlist files, together with modelcard.nmos and ...
1
vote
0answers
144 views

ngspice .measure syntax in AC + par()

Why do the two netlists give totally different output impedance values ? Netlist 1: ...
1
vote
2answers
113 views

ngSpice Printing a lot of reference values instead of running the simulation

I have a project that uses ngSpice as a shared library. I fed a SPICE file to this project and the same file to ngSpice.exe. The ngSpice.exe finished execution within seconds however, the ...
1
vote
0answers
826 views

How to access parameter values in transient simulation and/or NGSPICE interactive interpreter

I want to make the time-step and stopping-time in a trasient simulation scale automatically by using the parameter values (.PARAM lines) in the netlist. Here is a minimal ngspice etlist to demonstrate ...
0
votes
2answers
4k views

Running ngspice from command line on a Linux and Windows machine.

I have a spice file, SPICE.cir, that I am able to run on a Linux machine from the command line using the command ngspice< SPICE.cir > out.txt where ...
0
votes
1answer
93 views

Why all voltage drop across NMOS MOSFET in ngspice

I am new to the ngspice simulation and when I run a circuit into ngspice, it drops all the voltage across a mosfet but this is not the case when I simulated the same circuit into LTspice. Any help ...
0
votes
4answers
113 views

Why voltage is shifted in my schematic?

I'm learning basics of electronics and trying to get familiar with the common emitter topology. This is my schematic diagram: When I try to simulate it in Kicad I get this: Everything works as I ...
0
votes
2answers
105 views

How to generate schematic visual from Gnucap / Spice files

I am looking at the circuit diagram from here The gnucap description for it is given as ...
0
votes
2answers
41 views

Can LTSPICE compile BSIM4 models

While NGSPICE can compile and run BSIM4 models, I could mot find anywhere reference to LTSPICE being able to run these models. Has anyone tried, and saw that it worked, or knows that this will ...
0
votes
1answer
21 views

Performing measurement on a function of a waveform in NGSPICE

I am trying to perform a simple measurement of the absolute value of a waveform (measuring the waveform itself is working). See source file: ...
0
votes
2answers
377 views

Single terminal voltage source?

I read the documentation of NGSpice, voltage source is mentioned in Chapter 4 with N+ N-, I tried LTspice, I only found voltage source with two terminals. How would a single terminal voltage source ...
0
votes
1answer
220 views

Common-Emitter NPN Transistor Amplifier Simulation Failed

I'm trying to simulate a simple common-emitter transistor amplifier presented as an example in Practical Electronics for Inventors in Qucs. The circuity is identical to the one presented in the book. ...
0
votes
1answer
261 views

Why does a classic envelope detector produce a negative voltage for some periods, when high frequencies are put in?

I'm playing around in ngspice & trying to understand envelope detectors for ham radio. I'm pumping 150Mhz into the circuit described below - I'm expecting it to go positive in proportion to ...
0
votes
1answer
159 views

KiCad netlist output GND not labeled 0 for Ngspice

As the title suggests, I'm having trouble generating netlist from KiCad for Ngspice, the problem being that I can't get KiCad to output a "0" node for "ground". I'm aware that I'm supposed to use the ...
0
votes
2answers
24 views

Reading voltages from ngspice to another program

I am using ngspice for a project and need to do the following: Read a node voltage from the simulation into another program, process it and change another node voltage in the circuit. For example : <...
0
votes
1answer
167 views

KiCad component doesn't match manufacturers model

I am trying to incorporate the ADA4898-2 into my simulation. The KiCad symbol shows up with only 3 pins: 2 input, 1 output, while the actual op amp has two more supply pins: +Vs and -Vs. If I try to ...