The new ngspice integration is great (once you figure out how to configure it), but I’m having one problem:
Any simulation-specific stuff (voltage sources, etc) will be included in the PCB netlist as well, which of course is not wanted. One can assign the Oddities:Dummy_Empty footprint, but it will show errors on netlist import and it feels a bit hacky to have those empty footprints that you need to move outside the actual board.
Adding “#” to the reference does not help, since it excludes the component also from the simulator netlist.
Is there any way to exclude a component only from the PCB?
Another issue is when having multiple boards connected together, since breaking the nets with connectors in the schematic also breaks the connections for the simulator. I solved this by adding 0 ohm resistors connecting the pins between the boards, but then again those resistors must be excluded from the PCB netlist.
You could do as many (I always thought - perhaps incorrectly - most) people do and only draw a schematic for the particular section of the circuit which you want to simulate. If you get the results you want then you end up re-drawing that part of the schematic in your final design, but so what.
Sure, to simulate small subsections of a schematic during the design phase, that is probably what most would do. However, it’s quite nice to be able to do simulations also later on in the design, one might have changed some detail and want to see the theoretical effect of it in the simulation.
I have not yet tried the simulator part of Kicad. But if I would use one. I would probably want to go the way of having different schematic hierarchy(?) and simulate parts in those. I would also like to avoid having to redraw stuff. Thats why I use schematic block if i want to reuse something.
I am guessing this is not trivial since i would have connections that extend outside the hierarchical block. For example Input/output. Could this maybe be fixed with an special component that is both an hierarchical label and a simulator primitive for these cases? (VCC/sinus input/load resistor, etc)?
Something like that is probably the de facto standard procedure even with (very expensive) EDA tools that brag about their integrated simulation capabilities.
I don’t think I’ve ever simulated an entire PCB assembly of any significant complexity. My simulations seem to always target functional blocks - the power converter, an active filter, a low noise amplifier, etc. When I lay out a board I typically find several of these blocks on a single board, or (less commonly) a functional block is distributed across two or more boards. (E.g., line filter, transformer and rectifier on one board; with regulators and power converters on another.) My point is that the schematic I draw in EESchema as the initial task for board design is significantly different from the schematic that would drive a simulation.
Even when the schematic from EESchema is suitable for investigating the “design center” basic functionality of a circuit, simulation often investigates “corner cases” and “What if?” questions. Values are often adjusted to represent the worst-case tolerance stackup. Simulated operating temperatures or supply voltages may be set to their extremes. Simulated components may be added, or removed, to represent various operating conditions or even faults. (E.g., suppose a cable becomes disconnected . . . or shorted?) These situations would never appear on a standard EESchema schematic, as we know EESchema today.
Re-drawing things is aggravating, especially when the drawing tools in one program work differently from those in another program. It would definitely be helpful if a circuit simulator and a board layout program shared a common file format for schematics - even if this means creating yet another format for library files, and a special menu selection for "Save Schematic As . . . " some non-native file format. This is conceptually the same as how Microsoft WORD can save a document in its native file format, or the previous Word97 format, or Adobe PDF format, or RTF format, etc. (And some of us can remember when some versions of WORD and WordPerfect could save to each other’s formats.)
That capability would allow you to save a schematic in one application, then open and modify it in another. Perhaps even more useful would be the ability to cut-and-paste from one program’s schematic entry window to another program’s schematic entry. I suspect this would be technically much more challenging.
If one could easily copy and paste between multiple schematics in kicad, it would be easier to have separate schematics for simulation. Or if one could have subsheets that are excluded from PCB?
The concept of parts seems to become a bit more important now. Since now we will have Spice models, symbols, footprints, and 3dmodels.
If we still need to redraw every schematic. I dont really see the point to incorporate a spice simulator into KiCad. But hey, thats only my opinion, and we all know what they say about opinions…
Perhaps it would make sense to add a “PCB_Netlist_Enabled” field (defaults to Y if no such field), similar to the now existing “Spice_Netlist_Enabled”? Spice-specific symbols like voltage sources can then have this field pre-filled in the symbol library.
So far the ngspice integration is very new, I’m hoping that in the future a library of spice models/subcircuits will be bundled with kicad, and that the included symbol library will have proper mapping to these models. As it is now, you’ll need to manually install and assign proper models for each symbol except resistors and caps, and make sure the pin mapping is correct (for example all diodes need “2 1” because they’re reversed compared to standard spice pin order, and all transistors must map to CBE, etc).
To hook up voltage sources and load resistors to connectors, you just need to put a net label on the inputs and outputs. I often do this anyway, since I prefer having connectors and other panel mounted stuff separated on the schematics. Then, you can simply connect a VSOURCE to the label you want.