Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing SPICE Macro Models into LiveSPICE #206

Open
standard-librarian opened this issue Oct 28, 2023 · 3 comments
Open

Importing SPICE Macro Models into LiveSPICE #206

standard-librarian opened this issue Oct 28, 2023 · 3 comments

Comments

@standard-librarian
Copy link

standard-librarian commented Oct 28, 2023

Question:
Considering my limited knowledge of SPICE simulations, I'd appreciate it if I could know how to import/export subcircuits in liveSPICE.

Additional Information:
I've tried to take (.cir or .spice.txt) file (can be found here: AD8411A SPICE Macro Model), add them to the Components folder. It gave me the devices with the .models lines rather than the single macro model (.subskt).

@dsharlet
Copy link
Owner

Supporting more SPICE models is something I've wanted to do (#22), but haven't gotten to in part because it is a long tail of challenging cases to support. It's not something that can be done "completely" I don't think.

Another issue with it is that I think even really simple SPICE models would push the limits of LiveSPICE. I think big components like this need approximating to make practical for real time simulation. It looks like this example has 20+ non-linear component. We can maybe simulate this model by itself, but not much else at the same time. This is especially unfortunate because looking at the datasheet, it looks like at least a bunch of the non-linear components are emulating an op-amp. So to make this component more practical in LiveSPICE, we'd want to model that op-amp at a higher level, all of this is not something readily automated.

@standard-librarian
Copy link
Author

I came across the concept of Lookup Tables (LUTs) and their potential for enabling realtime simulations. Although I lack the necessary domain knowledge, I’m intrigued by the possibility of integrating LUTs into liveSPICE.

@dsharlet
Copy link
Owner

It's possible there are interesting ways to approximate parts of circuits, but there is a huge set of possible solutions to consider, and I think any one of them is a serious research project, unless we can find a specific technique that is well documented enough to implement.

I'm a bit skeptical of LUTs specifically for two reasons:

  • The dimensionality gets crazy quickly. For example, AD8411A looks like it would have 5-7 pins. With that many dimensions, it's hard to have a detailed LUT.
  • Capacitors introduce state. It's not clear to me how to handle this with a LUT, which is stateless. Maybe by adding more dimensions to the LUT, but that seems like a step in the wrong direction. Perhaps it's surprising, but there are a few capacitors in the AD8411A spice model.

If I were to start working on this today, I'd probably pursue some tiny recurrent MLP like neural network. The recurrence could hopefully handle the statefulness of capacitors. But as I mentioned above, this is a serious research project, maybe there is some existing research that can be implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants