LiveSPICE, my real time circuit simulator project

Started by dsharlet, November 13, 2013, 09:25:03 PM

Previous topic - Next topic

Rob Strand

QuoteHi all, after 6 years, there are finally some new developments in this project :) First of all, thanks for the kind words in this thread that I never responded to, and the bug reports too! I appreciate all the feedback, positive and negative.

You have a done a great job.   It's seriously a non-trivial exercise.

One idea is to have a "fast" execution mode.   Where you can turn replace voltage dependent capacitances with fixed capacitances.   I was also thinking of kicking out equations for reversed biased junctions but it's not that simple since even a saturated transistor ends up using those equations.    The question is how much can be stripped of reliably and is it worth it.  I know when I do DSP I often simply the model - and it's not noticeable.


QuoteNot SPICE's job.

SPICE assumes all caps are perfect. If you want to save a buck by using a cap that blows-up with backward DC voltage, it is YOUR problem to figure out if the voltage polarity is consistently one way, and which way that is. (SPICE can plot voltage on both sides for you. Maybe even do a V_diff to get the voltage -across- the cap.)

What I do for forum-posts, to save time for busy builders, is copy to a graphics program for annotations including "+" signs.
It's certainly possible to do.    If you were to model an electrolytic cap in spice then you would need to correctly assign the positive terminal just like you do with a diode.

Spice does have the concept of  pin 1 and pin 2 in two pin parts, like resistors, capacitors and inductors.    If you have ever looked at currents through two pins parts it's extremely annoying that spice does not make pin 1 clear in order to determine the direction of current.     For inductors you need to know the "dotted" terminal in order to determine the correct connections for coupled inductors (and transformers).   

IMHO, it *is* helpful showing pin 1 on two pin parts in spice.    IIRC in Pspice you can determine pin 1 by rotating a part.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

dsharlet

Quote from: oddist on December 12, 2020, 02:35:42 PM
Hi - I tried installing Livespice (v12, as v13 was blocked on my computer) and it doesn't allow me to place components myself. I can open one of the sample files, but it still doesn't show up on my screen until I go to Simulation. Then it kind of works, but I can't modify anything because it still isn't in the "schematic" view. Any hints would be much appreciated. I'm running Windows 10 on a rather new HP Envy laptop. Thanks!
Any chance you can share a screenshot or more detailed steps to reproduce the issue? Also, why is the latest version "blocked"?

A possibility is that sometimes the saved state of the application isn't compatible across versions. You could try deleting the %AppData%\Local\LiveSPICE to see if that helps with the issue you are seeing. See https://www.freecodecamp.org/news/appdata-where-to-find-the-appdata-folder-in-windows-10/ for how to find the %AppData% folder.

Quote from: iainpunk on December 12, 2020, 03:25:22 PM
wait, this is an VST like you can add in FL studio???
that's so awesome!!!!!
is it freeware or does it cost some money?

cheers, Iain
It's free, and accordingly, not something I can guarantee support for :)

Quote from: Rob Strand on December 13, 2020, 03:38:50 AM
It's certainly possible to do.    If you were to model an electrolytic cap in spice then you would need to correctly assign the positive terminal just like you do with a diode.
Thanks for the kind words!

The question is, is there a model for an electrolytic capacitor that does something interesting depending on the polarity? I haven't found anything simple on Google. Most of the things I'm finding are things that model the temperature and age of the capacitor, but these aren't things that really make sense in a SPICE simulation... (and don't depend on the polarity anyways). It wouldn't be hard to add some indication of polarity to the capacitor symbol, but at least with the current model, it would just be cosmetic.

The simulation allows you to insert probes to see the voltage at any node, so by placing probes on either side of a capacitor, it should be pretty easy to see which direction a capacitor should be oriented.

ElectricDruid

Quote from: dsharlet on December 14, 2020, 05:14:03 AM
The question is, is there a model for an electrolytic capacitor that does something interesting depending on the polarity?

I don't know about other sims, but I don't think LTSpice bothers with capacitor polarity at all. A 10u cap is just a big 10n cap. They're the same. If you want to model some of the non-ideal behaviour like leakage or whatever, you'd have to add parts to do it.

Rob Strand

#63
QuoteI don't know about other sims, but I don't think LTSpice bothers with capacitor polarity at all. A 10u cap is just a big 10n cap. They're the same. If you want to model some of the non-ideal behaviour like leakage or whatever, you'd have to add parts to do it.

QuoteThe question is, is there a model for an electrolytic capacitor that does something interesting depending on the polarity? I haven't found anything simple on Google. Most of the things I'm finding are things that model the temperature and age of the capacitor, but these aren't things that really make sense in a SPICE simulation... (and don't depend on the polarity anyways). It wouldn't be hard to add some indication of polarity to the capacitor symbol, but at least with the current model, it would just be cosmetic.

Normally spice doesn't not care about polarity.   I'm not saying it does!   It was an example that if you had to do it you could.  Its just a symbol and yes for the most part it would be cosmetic.   When I post schematics from from spice sims I often add the +sign like PRR does.

You can create you own models in spice.    People have modelled cap polarized electrolytics and tantalums.  It's not common because you shouldn't be using caps in that way for real designs!

QuoteThe simulation allows you to insert probes to see the voltage at any node, so by placing probes on either side of a capacitor, it should be pretty easy to see which direction a capacitor should be oriented.
There's many ways around it but it's very laborious if you do it a lot.   I often plot expressions of variables in spice, either to check stuff or analyse something.  When you can't see the polarity of the cap (or resistor!) on the schematic the expressions calculate wrong because the variable have the wrong sign.   I've also had a few issues with controlled sources where the voltage is calculated from circuit nodes.   My point is when you check stuff you want things to be clear as possible and you shouldn't be manually fixing signs to be what you *think* it is - imposing what you think it should be is not a valid way to check stuff.    The work around for pspice, when it mattered, was to place the parts with consistent orientations.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

oddist

Quote from: dsharlet on December 14, 2020, 05:14:03 AM
Quote from: oddist on December 12, 2020, 02:35:42 PM
Hi - I tried installing Livespice (v12, as v13 was blocked on my computer) and it doesn't allow me to place components myself. I can open one of the sample files, but it still doesn't show up on my screen until I go to Simulation. Then it kind of works, but I can't modify anything because it still isn't in the "schematic" view. Any hints would be much appreciated. I'm running Windows 10 on a rather new HP Envy laptop. Thanks!
Any chance you can share a screenshot or more detailed steps to reproduce the issue? Also, why is the latest version "blocked"?

A possibility is that sometimes the saved state of the application isn't compatible across versions. You could try deleting the %AppData%\Local\LiveSPICE to see if that helps with the issue you are seeing. See https://www.freecodecamp.org/news/appdata-where-to-find-the-appdata-folder-in-windows-10/ for how to find the %AppData% folder.

Thank you so much - deleting the AppData did the trick and allowed me to reinstall v12 which now works properly on my machine.
V13 is still "blocked" by Windows, saying it may "harm my computer". I can download anyway, which I did, and install. But I can't seem to find the VST file, which I was hoping to use in Presonus Studo One. Thanks again

dsharlet

Quote from: oddist on December 16, 2020, 05:50:21 AM
Thank you so much - deleting the AppData did the trick and allowed me to reinstall v12 which now works properly on my machine.
V13 is still "blocked" by Windows, saying it may "harm my computer". I can download anyway, which I did, and install. But I can't seem to find the VST file, which I was hoping to use in Presonus Studo One. Thanks again
The VST plugin is new in version 13, it didn't exist in version 12.

Regarding the windows blocking issue: I think this is just because this software is very niche/sees little usage, and I don't/can't sign the software. I know this is probably unrealistic, but one workaround for this would be to build it from the source code.

oddist

Thanks again for your reply. I didn't mention in the last post, I actually did install v13 by downloading it with Chrome instead of Edge, then when it still wanted to block the installation I clicked on "run anyway" and it seemed to work.
So my question is, where is the VST app found that I need to point my DAW to?  I assumed it would be in the Program Files folder under LiveSPICE.  I "thought" I remembered reading somewhere that it would be called "LiveSPICEVST, but I can't find that anywhere.  If you or someone else could point me in the right direction, I would be very thankful.
And by the way, it IS indeed an awesome program, and I thank you Very Much for creating this!