Hi all,
I'm new here, and to KiCad in general. Trying to come up with a workflow
that'd suit me best, I encountered some limitations. So here I am,
looking for advices on how to lift them, and how to convert my ideas
into contributions suitable for the mainline :)
My troubles revolve mostly around the hierarchical sheets feature. I
want to use them as a kind of reusable components (akin to how I use
libraries when writing software), to avoid copy-pasting parts of
circuits between my projects. So I put the common parts into separate,
"child"-projects (in separate directories) and refer to them as
hierarchical sheets in my "parent" projects. I want the "child" projects
to be self-contained - standalone viewable and testable, and at the same
time, include-able to other, "parent" projects.
It's working in general, but here and there I face a few rough edges.
One of them are simulations, which currently don't work at all in my
"parent" projects. It's not even possible to open the simulator window
there. All I get is the message "Simulation model library not found ...".
I identified as a problem the fact, that relative sim.library paths are
resolved in respect to the current project path only. In my case, it
fails because they've been originally set in a project that's located
elsewhere. So, trying to solve this issue, I've come up with this
(work-in-progress):
https://github.com/mplucinski/kicad-source-mirror/tree/sim
With this change, the search for the library also includes the path of
the sheet. This way, I'm able to use the simulator from a "parent"
project, at least in very basic circuits. However, there's still some
issues I'm not able to solve:
1. It's still not possible to open the "simulation model" window from
the "symbol properties". I don't know, how to access the SCH_SHEET_PATH
from DIALOG_SYMBOL_PROPERTIES (see "FIXME" in the change above).
Logically I'd expect it in SCH_SYMBOL, but I can't see it there (I
probably misunderstand the meaning of this class a bit). Any suggestion?
2. In some projects, I cannot start the simulation from the "parent"
project, regardless of the selected sheet. I get only weird errors like
> Error: Transient op failed, timestep too small
> Error: The operating point could not be simulated successfully.
Which is confusing, because it works fine, if opened from the
"child"-project so all parameters should be accessible. Timestamps are
specified in text labels and "Edit Analysis Tab..." shows that this
value ha been properly imported. Here I'm stuck, because I don't even
know how to analyze this issue (especially since it works fine in some
projects).
3. Is that a good approach in general? Do you see this (and potentially
further fixes in this area) as something useful for the KiCad project?
Thanks,
Mariusz Plucinski