Timing Circuit Spice Model Limitations


 

Hi, I am specifically trying to get accuracy limitations for 555 timer one shot circuits
over T and V.
 
The problem centers on I cannot find, for electrolytic caps, a model that encorporates 
dc bias, T, and V effects on cap. So I can do monte-carlo sims on circuit. Even aging would
be welcome in the model. Values in 10 - 100 uF range would do. Would be great if model
allowed C entry and general rules applied to it.
 
I am also just starting to look for carbon and metal film R's, same considerations.
 
Any help most welcome.
 
Regards, Dana.
 
 


 

I got this model off ChatGPT, possible starting point....
 
* Electrolytic Capacitor Model
.SUBCKT ELECTROLYTIC_CAP C1 C2
* C1 is the capacitance, C2 is a parallel resistance to simulate leakage
* The temperature coefficient and voltage effects can be incorporated with controlled sources
* Parameters
.PARAM C0=100u        * Nominal capacitance at room temperature
.PARAM ESR=0.1       * Equivalent Series Resistance
.PARAM RLEAK=1k      * Leakage resistance
.PARAM TCOEF=0.0039   * Temperature coefficient (for capacitance)
.PARAM VMAX=25       * Maximum voltage rating
.PARAM TEMP=25       * Nominal temperature (in Celsius)
* Capacitance model
C1 N001 0 {C0*(1 + TCOEF*(TEMP - 25))}
* ESR and Leakage
R1 N001 N002 {ESR}
RLEAK N002 0 {RLEAK}
* Voltage dependence (simplified)
* The capacitance reduces as voltage increases; modify as needed
* Here we assume a linear decrease in capacitance over the voltage range
V1 N003 0 DC {V(VCC)}
C2 N003 N004 {C0*(1 + TCOEF*(TEMP - 25)) * (1 - (V(VCC)/VMAX))}
* Connections
VCC N004 0 DC 0
.ENDS ELECTROLYTIC_CAP


 

It's better to upload things like subcircuit files to Files => Temp rather than emailing them.

Go to the web page: https://groups.io/g/LTspice/topics. Click on Files in the list on the left. Then click on Temp. Then click on New Upload in the blue box at top left. Click on Upload File in the drop-down menu. Then send a message to tell us that you did that.

In the sub-circuit, RLEAK = 1k is not realistic. I would expect a good cap to have RLEAK = 1 megohm or even more.

On 2024-10-25 12:51, danadak wrote:
I got this model off ChatGPT, possible starting point....
 
* Electrolytic Capacitor Model
.SUBCKT ELECTROLYTIC_CAP C1 C2
* C1 is the capacitance, C2 is a parallel resistance to simulate leakage
* The temperature coefficient and voltage effects can be incorporated with controlled sources
* Parameters
.PARAM C0=100u        * Nominal capacitance at room temperature
.PARAM ESR=0.1       * Equivalent Series Resistance
.PARAM RLEAK=1k      * Leakage resistance
.PARAM TCOEF=0.0039   * Temperature coefficient (for capacitance)
.PARAM VMAX=25       * Maximum voltage rating
.PARAM TEMP=25       * Nominal temperature (in Celsius)
* Capacitance model
C1 N001 0 {C0*(1 + TCOEF*(TEMP - 25))}
* ESR and Leakage
R1 N001 N002 {ESR}
RLEAK N002 0 {RLEAK}
* Voltage dependence (simplified)
* The capacitance reduces as voltage increases; modify as needed
* Here we assume a linear decrease in capacitance over the voltage range
V1 N003 0 DC {V(VCC)}
C2 N003 N004 {C0*(1 + TCOEF*(TEMP - 25)) * (1 - (V(VCC)/VMAX))}
* Connections
VCC N004 0 DC 0
.ENDS ELECTROLYTIC_CAP
-- 
OOO - Own Opinions Only
Best Wishes
John Woodgate
Keep trying

Virus-free.www.avg.com


 

I am finding that spice file has issues with my simulator, SIMetrix.
 
I have corrected some errors, still struggling.
 
@Woodgate, thanks for the direction in file handling.
 
In retrospect, knowing as a ChatGPT user, that its still not 100% accuracy,
should I upload a file into file area I have not checked out or used ?
 
Regards, Dana.


 

On 25/10/2024 13:51, danadak wrote:
I got this model off ChatGPT, possible starting point....
 
* Electrolytic Capacitor Model
.SUBCKT ELECTROLYTIC_CAP C1 C2
* C1 is the capacitance, C2 is a parallel resistance to simulate leakage
* The temperature coefficient and voltage effects can be incorporated with controlled sources
* Parameters
.PARAM C0=100u        * Nominal capacitance at room temperature
.PARAM ESR=0.1       * Equivalent Series Resistance
.PARAM RLEAK=1k      * Leakage resistance
.PARAM TCOEF=0.0039   * Temperature coefficient (for capacitance)
.PARAM VMAX=25       * Maximum voltage rating
.PARAM TEMP=25       * Nominal temperature (in Celsius)
* Capacitance model
C1 N001 0 {C0*(1 + TCOEF*(TEMP - 25))}
* ESR and Leakage
R1 N001 N002 {ESR}
RLEAK N002 0 {RLEAK}
* Voltage dependence (simplified)
* The capacitance reduces as voltage increases; modify as needed
* Here we assume a linear decrease in capacitance over the voltage range
V1 N003 0 DC {V(VCC)}
C2 N003 N004 {C0*(1 + TCOEF*(TEMP - 25)) * (1 - (V(VCC)/VMAX))}
* Connections
VCC N004 0 DC 0
.ENDS ELECTROLYTIC_CAP
Sorry to disappoint you and ChatGPT, but this won't work. You can't use node voltages in normal capacitor values. Even if it did, presumably VCC is a fixed voltage, so the capacitance wouldn't actually change according to the voltage across the terminals. If the node used (VCC) were actually the voltage across the terminals, consider what would happen when it was reversed biased - the capacitance would get bigger, such that it would be twice the capacitance at VCC=-VMAX as it was at VCC=0!

For temperature variation of capacitance, which normally wouldn't be expected to change dynamically, that is already dealt with in the default capacitor. Please read the Help chapter on capacitors.

For non-linear capacitors, there is a variation of the standard one called the charge-controlled model. This uses the special variable "x" to denote the voltage across the terminals. This is also covered in the Help chapter.

For some worked examples of this, go to the group Homepage > Files and type "non-linear capacitor" in the search box and click on the magnifying glass.

--
Regards,
Tony



 

A capacitor model that includes nonlinear effects is a totally different animal than an ordinary capacitor model.  It's not nearly as simple as just adding a few parameters.
 
I would not trust ChatGPT for anything LTspice-related.  I'm sorry if I disappoint you, but it just is not smart enough.  "Starting point" is one thing, but then you must apply your own skills to fix everything ChatGPT got wrong.
 
I have seen a few articles on the 'net about constructing and using SPICE models for temperature- and voltage-dependent capacitors.  The last time I saw one was a few years ago, and it was quite good.  I remember adding a reference to the article here in this forum.
 
It seems ludicrous to talk about precision timing and "555" or electrolytic capacitors in the same context.
 
As for aging, I think any Monte Carlo-like simulation takes care of that.
 
This group is not about SIMetrix.
 
Andy
 
 


 

On Fri, Oct 25, 2024 at 08:45 AM, danadak wrote:
In retrospect, knowing as a ChatGPT user, that its still not 100% accuracy,
should I upload a file into file area I have not checked out or used ?
 
This is a group for discussing things that may not work right, or that are still being developed.  Yes, you definitely can upload files into the Files area that are not 100% thoroughly checked out and verified.  But remember that this is a public forum and thousands of people can see what you upload, so use discretion about that.
 
As for sources like ChatGPT, I would prefer it if you not blindly use something that was not given at least an eyeball check first.
 
Andy
 
 


 

For sure on ChatGPT. I regularly use and help train it for its mistakes.


 

On Fri, Oct 25, 2024 at 07:47 AM, Andy I wrote:
It seems ludicrous to talk about precision timing and "555" or electrolytic capacitors in the same context.
Agree. The investigation is at another forum where I am working on showing a
poster his solution for timing needs cascading 2 555's is the opposite of precision.
The 555 is very much like the 8051 micro, should have gone away 30+ years ago.
They are the bad penny in the industry from many measures, especially in todays world.
 
I do use LTSpice. Simetrix was sim of choice at Analog Devices until they bought
LT a few years ago. I have a private opinion on that move. But I am not here to wrap the
flag around myself on simulators, I often find no one tool satisfies all activity, they
all offer something, and mostly the same.
 
 
 
 


 

Back to original need, anyone have a decent spice model for Electrolytic including
T and V and Leakage and.....? Recognizing they come in different chemistries and
construction. That aspect not important in my request.
 
I would be grateful.
 
Regards, Dana.