I’ve had no problem with steps 2 and 4, but I can’t get step 3 to work (BJT simulation). I’ve reproduced the exact same schematic as the screenshot provided in the guide under Eeschema, using only PSPICE devices, except the BC546 which comes from Transistor_BJT. All component values are identical to the screenshot too.
I’ve tried the three models with identical results (both links from the guide, and this one: https://www.diyaudio.com/forums/software-tools/278096-bc546-spice-model.html#post5587810). I’ve tried all permutations of “alternate node sequences” (i.e. pinouts, as described at step 4). I’ve simulated with both a ‘sin(0 1m 500)’ input and a fixed 0V input. Regardless of the input signal, the output is always a short swing in the pV range followed by a 0V flatline. I am using KiCad 5.1.5 (under Linux) and the embedded version of Ngspice (ngspice-31 i believe?)
Can someone help me figure out what I’m not doing right?
Please post the netlist here.
After you have run the simulation, do the following:
Tools->Simulator->Simulation->Show spice netlist…
Mark and copy the netlist and post it here.
In addition to the netlist, can you try taking a screenshot (of the schematic) and pasting it within your response? If it doesn’t let you because you’re new, try a file hosting website and shoot us a link. I suspect a schematic drawing error, and it’ll be easier to pick out visually.
I’m not sure what’s going on. Your netlist (besides the copy/paste screenshot error in the .include line) looks fine to me and simulates fine for me too. Schematic looks good too. I suspect something with how the model is used since I don’t have access to your BC546.mod that’s being referenced. I attached a ZIP of my version of the project in case it helps you figure out what the discrepancy is. If you have the ability to ZIP your own project and upload it, I can take a look at your project as a whole too.
Normally this circuit also has a resistor between the emitter and GND.
(A few hundred Ohms will do. It’s value should be lagger then: R2/Hfe ).
Without this, the base will be “stuck” at 600mV, and the transistor will go into saturation easily, which will prevent it from working as a lineair amplifier.
It’s a freestanding Eeschema file. As a new user, I can’t attach it directly here but here you go: https://we.tl/t-UsiWTvEYQt
I tried simulating with a 500Ω resistor in that position but no difference.
FWIW, this is the output I get. The initial swing peaks just above 129pV, then -32pV, then what’s on screenshot (below). There is also a linear rise from 0V to roughly 2pV during the last 100ns simulated or thereabouts
I downloaded and ran the bjt_example posted here, and it works for me without modification.
Just opened the project, and opened Eechema, then ran the simulator and added V(in) and V(out) signals to the plot.
If you see a plot result in pV or some other nonsensical stuff, it’s usually an error in the schematic or the model, or with pin mapping, version incompatibilies, etc.
When experimenting with something you do not have much experience with, it’s always nice to have a working example such as the bjt_example as posted here.
I do recall something about installing a newer version of ngspice to get it working in KiCad, but 2 weeks ago my regular PC crashed and I’m now typing this on an intermediate, and i’m not sure what exactly is installed here, or if it’s still needed to update ngspice manually (on linux) with the latest stable KiCad version.
Sorry I didn’t know that. Here is the zipped up folder, including the generated project files (both your schematic and mine), as well as some models I’ve tried: https://we.tl/t-HaJ7CGJsok
Strangely, I’ve tried BC546.2.mod (also in zip file) in your project and it works fine too. Your findings point to problems with my model; my findings point to problems with the schematic file?
That’s what’s wrong with my schematic: adding the B hence referring to the correct spice model fixed it. The tutorial specifically points to a BC546B model and makes no mention of this extra step. As a total beginner it threw me off. Might be worth explaining in the tutorial ?
Anyway, problem solved, thanks so much for your help!
It’s not an extra step. You’re supposed to load up the library file, and then select the BC546B from the drop-down selector. I have no idea where your lack of B came from. That drop-down auto-populates with items from all the .model and .subckt statements found within the selected library file.
I’m unable to duplicate that. There shouldn’t be anything manually entered in there in the first place. What happens if you delete the transistor from the schematic and place a new fresh one down? Do you still get the same behavior?