dsharlet / LiveSPICE

Real time SPICE simulation for audio signals
MIT License
419 stars 61 forks source link

koren model fixes #147

Closed Federerer closed 1 year ago

Federerer commented 2 years ago

I've changed grid current calculation to method proposed by Cohen and Helie in [1], [2] that we currently use in Pentodes. Polynomial smoothing helps with stability. I've also noticed, that Koren model gives better fitness e.g: image vs image (images are from this tool) I've added additional parameters to the model to represent the new model variables. Unfortunately, getting correct values for all vacuum types will be difficult, as grid current vs grid voltage plots are not common in old datasheets 😢

Federerer commented 1 year ago

If one of these models is clearly better than the others, we should consider just dropping the rest entirely. It would be nice not to need to expose such details. I guess we still need Koren for pentodes though?

It's not that simple, Koren model is slightly faster and is more precise in terms of model accuracy, but it's also less stable in high gain situations. I think that setting a sensible default (Dempwolf-Zolzer) and leaving the option to change that for more advanced users is nice. BTW. Pentodes are now using Koren model with Cohen-Helie grid current calculation, which helps with the stability. 😉

Federerer commented 1 year ago

When testing this I've noticed how much changes I made to the solve/compile pipeline that we are using. On master, ReaRoute ASIO fails when you change simulation settings or add a probe, because of excessive locking on the real-time thread. I think I have to split my work somehow into a separate PR's because the dynamic parameter work takes longer than expected and there is a lot of stuff in the VST plugin that has to be implemented.

Circuit from https://github.com/dsharlet/LiveSPICE/issues/193 work fine on this branch with extreme amounts of gain.

dsharlet commented 1 year ago

Looks good, thanks!

When testing this I've noticed how much changes I made to the solve/compile pipeline that we are using. On master, ReaRoute ASIO fails when you change simulation settings or add a probe, because of excessive locking on the real-time thread. I think I have to split my work somehow into a separate PR's because the dynamic parameter work takes longer than expected and there is a lot of stuff in the VST plugin that has to be implemented.

I'd definitely prefer to see smaller PRs that can be merged independently. I know that with dynamic parameters though, there's going to be one big PR at some point for that, even if you can peel off some smaller stuff first.