It seems to me that EESchema incorrectly exports transistors into Spice net-lists.
In Spice, the pin order must be CBE, but EESchema seems to export the pins in the order of their pin numbers. The pin numbers change with the transistor physical package (TO126, TO220,…), but the pin order in the Spice net-list must not.
The same problem is probably even with other types of components.
I’m new to KiCad, so there may be a suggested procedure on how to get around this problem. Is there any? Or are there any EESchema component libraries that allow to use the el. schemas both for Spice simulations and PCB layouts? Because it seems to me currently that now I have to choose an el. component symbol according to what I’m planning to do with the schema - different pin-out for simulations, and different pin-out for PCB.
Please file a bug report here: https://bugs.launchpad.net/kicad
This is a somewhat complicated issue since it involves both the eeschema software and possibly the kicad online libraries. Other devs might have a better idea of how to resolve this, whether it is entirely up to the maintainers of the libraries to name pins so that the correct netlist is used or if any modifications at all are required to eeschema. I suspect it will be up to the library maintainers but that would still be an important note which needs to be added to the official documentation.
Filed as https://bugs.launchpad.net/kicad/+bug/1511552
Fortunately, it seems to me that it shouldn’t be complicated to fix the bug as the pin type information is generally available in the KiCad *.lib files.
Unfortunately, it seems to me that the fix won’t be implemented in the early future, as there are hundereds of others bugs waiting to be fixed.
I saw the response on the bug mail list, and wondered if there would be any support for extending the *.lib model syntax to add a named sub-section with alternate pin orderings? The pin ordering in the SPICE section would match the ports of the SPICE primitive or complex model. Would having separate .libs and switching the lib order based on whether you’re going to SPICE or layout work? Is there a better way?
There already is such a directive - the “Spice_Node_Sequence” user field, as
mentioned in the bug. It is not separate in the sense you’re describing it,
i.e. it cannot be put into a .lib file separately from the component. But I
don’t think this matters, as if you use it, you won’t be forced to switch the
lib files as you are describing it. You will be able to use the same .lib file for both
purposes. And I think it’s better this way (encapsulation).