Author Topic: This LTSpice model for TL431 is bonkers  (Read 1405 times)

0 Members and 1 Guest are viewing this topic.

Offline KonkedoutTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
This LTSpice model for TL431 is bonkers
« on: December 25, 2024, 06:05:36 pm »
I have been looking for an LTSpice model for TL431.  The attached zip contains what I have found, but that one is nuts.

The .asc in the attached .zip has two TL431s in slightly different circuits, but they both somehow generate -525 VDC in a resistive circuit which ramps an applied voltage between +5 to +20 VDC.  This is nuts.

I did edit the .asy file to remove the box around the TL431 as (IMO) that only added visual noise.

Did I do something to screw up the model?  What is wrong here?

FWIW; in crude terms I think of a real TL431 as behaving like an NPN transistor with a precise Vbe = 2.495V. 

Does anyone know what I (or others) did wrong?
« Last Edit: December 25, 2024, 06:07:54 pm by Konkedout »
 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 4086
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #1 on: December 25, 2024, 06:58:37 pm »
Your problem is R2 is connected wrong in the left circuit.

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline KonkedoutTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #2 on: December 25, 2024, 07:08:48 pm »
Thanks but I disagree.  While I admit to lacking modeling expertise, I have been designing power supplies since 1980 and first used the TL431 around then.  I have used them in many switching power supplies.

The circuit on the left is not especially functional as shown but it makes more sense when viewed as driving an optocoupler LED in the feedback of a power supply.  C1 and R4 would be compensation, and U1 serves as a reference + error amplifier.

Even if you were correct, that does not explain the circuit on the right (with U2) doing similar.   There is no way that an IC such as this can create -500V from +20V input, without at least oscillation + charge pump or something like that.
« Last Edit: December 25, 2024, 07:10:51 pm by Konkedout »
 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 4086
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #3 on: December 25, 2024, 07:18:05 pm »
R2 is returned to the voltage source (zero source impedance) thus can't perform any type of regulation without a finite source impedance to work with. Returning R2 to R1 as in the right circuit would allow the 431 to shunt regulate against R1.

Agree the 500V is a model artifact (indicating a behavioral model implementation), and thus one should seriously question the validity of this model.

Maybe look for an alternative 431 mode?

Happy Holidays,

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline KonkedoutTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #4 on: December 25, 2024, 08:03:59 pm »
Thank you.

I enjoy these discussions....U2 on the right is a simple programmable zener.

On the left; R2 and R3 form a feedback divider for sensing Vin in the output of a power supply.  C1 and R4 provide compensation so as to limit the slew rate of the U1 cathode.   R1 would be in series with the LED of an optocoupler.  R1 current = LED current would control phototransistor current which would control the power supply feedback loop and limit the voltage at Vin.  So increasing R1 current would decrease the power supply output.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: This LTSpice model for TL431 is bonkers
« Reply #5 on: December 25, 2024, 08:12:07 pm »
I couldn't get that model to work either.

Try this one.

It can be embedded into the .asc file. Open the model in a text editor, copy it to clipboard. Load the schematic in LTSpice, click on insert SPCIE directive and paste the model into the text box.

There's no need to make your own symbol. You can use one of the symbols which come with LTSpice, but you'll need to edit the .asc file. I used the RH1009. Insert a component, click on [References], then RH009. Save the .asc file. Just add one symbol for now. It can be duplicated later.

Open the .asc file using a text editor, preferably not Notepad, which I've found often doesn't play well with LTSpice, I believe it inserts non-printing characters which LTSpice doesn't like. I use LibraOffice, but try Word.

Fine the reference to RH1009 in the .asc file. It should look something like this:

SYMBOL References\\RH1009 -1664 -384 M0
SYMATTR InstName U1

Insert the following text afterwards:

SYMATTR Value TL431
SYMATTR Value2 TL431

Save the file.

Open the .asc file in LTSpice. Note the RH1009 is now TL431. It can now be copied and used in the simulation.
 
The following users thanked this post: Konkedout

Offline KonkedoutTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #6 on: December 25, 2024, 08:35:18 pm »
I couldn't get that model to work either.

Try this one.

It can be embedded into the .asc file. Open the model in a text editor, copy it to clipboard. Load the schematic in LTSpice, click on insert SPCIE directive and paste the model into the text box.

There's no need to make your own symbol. You can use one of the symbols which come with LTSpice, but you'll need to edit the .asc file. I used the RH1009. Insert a component, click on [References], then RH009. Save the .asc file. Just add one symbol for now. It can be duplicated later.

Open the .asc file using a text editor, preferably not Notepad, which I've found often doesn't play well with LTSpice, I believe it inserts non-printing characters which LTSpice doesn't like. I use LibraOffice, but try Word.

Fine the reference to RH1009 in the .asc file. It should look something like this:

SYMBOL References\\RH1009 -1664 -384 M0
SYMATTR InstName U1

Insert the following text afterwards:

SYMATTR Value TL431
SYMATTR Value2 TL431

Save the file.

Open the .asc file in LTSpice. Note the RH1009 is now TL431. It can now be copied and used in the simulation.

Thank you!! That whole thing seems to work reasonably now.  I did note that your SYMATTR lines were already inserted.  Maybe you were just indicating what you had done.

Your .asc is using my symbol which is similar to that on a TL431 datasheet.   That is also good.....
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5506
  • Country: va
Re: This LTSpice model for TL431 is bonkers
« Reply #7 on: December 25, 2024, 08:44:14 pm »
Your schematics is still wrong (Zero999 schematics).. This is how it should work, imho..
« Last Edit: December 25, 2024, 08:46:55 pm by iMo »
Readers discretion is advised..
 

Offline KonkedoutTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #8 on: December 25, 2024, 08:55:52 pm »
Well:

(Let's now call it the voltage divider on the left) is tasked to measure Vin (which is our power supply output) against the TL431 FB reference voltage.  The TL431 serves as both a reference and error amplifier. Your version with the upper divider resistor connected to the cathode does not do that, or at least is significantly less accurate.

I designed many switching power supplies in which the output error amplifier closely resembles this.  One exception is that the optocoupler LED needs to be added between the TL431 cathode and the compensation RC.
« Last Edit: December 25, 2024, 08:58:58 pm by Konkedout »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: This LTSpice model for TL431 is bonkers
« Reply #9 on: December 25, 2024, 09:10:55 pm »
I couldn't get that model to work either.

Try this one.

It can be embedded into the .asc file. Open the model in a text editor, copy it to clipboard. Load the schematic in LTSpice, click on insert SPCIE directive and paste the model into the text box.

There's no need to make your own symbol. You can use one of the symbols which come with LTSpice, but you'll need to edit the .asc file. I used the RH1009. Insert a component, click on [References], then RH009. Save the .asc file. Just add one symbol for now. It can be duplicated later.

Open the .asc file using a text editor, preferably not Notepad, which I've found often doesn't play well with LTSpice, I believe it inserts non-printing characters which LTSpice doesn't like. I use LibraOffice, but try Word.

Fine the reference to RH1009 in the .asc file. It should look something like this:

SYMBOL References\\RH1009 -1664 -384 M0
SYMATTR InstName U1

Insert the following text afterwards:

SYMATTR Value TL431
SYMATTR Value2 TL431

Save the file.

Open the .asc file in LTSpice. Note the RH1009 is now TL431. It can now be copied and used in the simulation.

Thank you!! That whole thing seems to work reasonably now.  I did note that your SYMATTR lines were already inserted.  Maybe you were just indicating what you had done.
Yes, I described what I had done.

Quote
Your .asc is using my symbol which is similar to that on a TL431 datasheet.   That is also good.....
Are you sure? I'm pretty sure it uses RH1009.asy, It should be easy to tell because your symbol is a little larger. LTSpice also ignores the description in the .asc file and uses the one in the .asy file, so you can find out for sure by right clicking it. If it says Programmable Shunt Regulator TL431, then it's your symbol, whereas if it says 2.5V Adjustable Reference, then it's the RH1009.asy.

Your schematics is still wrong (Zero999 schematics).. This is how it should work, imho..
It depends on what he wants to do. I though U1 was supposed to be a comparator, with some filtering, in which case it's correct. If it's a shunt regulator, then yes, it's wrong and your modification is right.

Well:

(Let's now call it the voltage divider on the left) is tasked to measure Vin (which is our power supply output) against the TL431 FB reference voltage.  The TL431 serves as both a reference and error amplifier. Your version with the upper divider resistor connected to the cathode does not do that, or at least is significantly less accurate.

I designed many switching power supplies in which the output error amplifier closely resembles this.  One exception is that the optocoupler LED needs to be added between the TL431 cathode and the compensation RC.
In that configuration, then there's negative feedback, via the opto-coupler to the switched mode controller.
« Last Edit: December 25, 2024, 11:06:25 pm by Zero999 »
 

Offline KonkedoutTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #10 on: December 25, 2024, 09:30:30 pm »
A comparator function implies binary switching...but my drawing on left uses it as an error amplifier with analog output.

See the Figure 9.5 in the datasheet: 

https://www.ti.com/lit/ds/symlink/tl431.pdf?ts=1708404301053&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FTL431%253FkeyMatch%253D%2526tisearch%253Dsearch-everything%2526usecase%253Dpartmatches

in which R1 R2 measure the output voltage, and increasing TL431 cathode current decreases the output voltage.  They have only a 10 nF capacitor for compensation.  But...in broad brush terms that is the MO of my circuit on left.

As for the symbol:  It seems the newer DS shows a box around it but for me that is only visual noise.  To me the symbol is the same as that for the RH1009.  I am not measuring the symbol with dial caliper.  What I do not like is the default LTSpice box symbol for any new model where you do not draw a symbol.  That is visually less clear.   I like triangles for op amps, BJT symbols for BJTs, and TL431 symbols for TL431.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5506
  • Country: va
Re: This LTSpice model for TL431 is bonkers
« Reply #11 on: December 25, 2024, 09:38:16 pm »
Ok, I see..
Below several models with your schematics.. I have a dozen of various 431 models here (coming from Bordodynov library etc).
« Last Edit: December 25, 2024, 10:22:59 pm by iMo »
Readers discretion is advised..
 

Offline KonkedoutTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #12 on: December 25, 2024, 10:59:32 pm »
Ok, I see..
Below several models with your schematics.. I have a dozen of various 431 models here (coming from Bordodynov library etc).

Can you post those models (not just images?) or provide a link?   Sausage links are tasty but don't help my circuit simulation :)
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: This LTSpice model for TL431 is bonkers
« Reply #13 on: December 25, 2024, 11:32:29 pm »
What I do not like is the default LTSpice box symbol for any new model where you do not draw a symbol.  That is visually less clear.   I like triangles for op amps, BJT symbols for BJTs, and TL431 symbols for TL431.
I agree. Fortunately LTSpice comes with a range of symbols which are easy to reuse by editing the .asc file. Failing that, you can make your own.

A few things I forgot to mention above about the .asc file:

The part number which appears next to the symbol on the schematic is denoted by the following statment:
SYMATTR Value TL431

The name of the model used. It can be different to the part
SYMATTR Value2 TL431_model

You might need to change the first line of the model to reflect the pin order of the symbol.

For example, in the file I posted previously:

.SUBCKT  TL431 3  2  1

3, 2 & 1 are the spice nodes used inside the model. The comment above tells you it's cathode, anode, reference.

Their order, depends on the pin order of the symbol. This can be found by opening and right clicking on the pins.
LTSpice\lib\sym\References\RH1009.asy

Another thing which is a bit off-topic is there is also a generic op-amp symbol, [OpAmps] opamp2, which is designed for use with any model. Insert it and right click on opamp2 to change it to the name of the model.
Ok, I see..
Below several models with your schematics.. I have a dozen of various 431 models here (coming from Bordodynov library etc).

Can you post those models (not just images?) or provide a link?   Sausage links are tasty but don't help my circuit simulation :)
One thing to note is that often models are optimised for different things. In some cases the transient response is important, for others it's temperature stability etc. All models lie to some extent.
 

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 1375
  • Country: au
Re: This LTSpice model for TL431 is bonkers
« Reply #14 on: December 25, 2024, 11:49:28 pm »
FWIW, I’ve been mucking around with Eugene Dvoskin’s TL431 model lately. Learning more about control loop stability than I really set out to do!
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2076
  • Country: au
Re: This LTSpice model for TL431 is bonkers
« Reply #15 on: December 26, 2024, 12:04:11 am »
I see TI recently added a new '431, but I've not seen LTSpice models for this yet ?

 TLA431, TLA432 All-Capacitor Stable Precision Programmable Reference     https://www.ti.com/product/TLA431
 

Offline KonkedoutTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #16 on: December 26, 2024, 03:00:12 am »
FWIW, I’ve been mucking around with Eugene Dvoskin’s TL431 model lately. Learning more about control loop stability than I really set out to do!

Give us a link?
« Last Edit: December 26, 2024, 03:03:29 am by Konkedout »
 

Offline KonkedoutTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #17 on: December 26, 2024, 03:08:38 am »
I see TI recently added a new '431, but I've not seen LTSpice models for this yet ?

 TLA431, TLA432 All-Capacitor Stable Precision Programmable Reference     https://www.ti.com/product/TLA431

That one is interesting!  But I probably would not gopher it.....
 

Offline RomDump

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: This LTSpice model for TL431 is bonkers
« Reply #18 on: December 26, 2024, 04:45:16 am »
FWIW, I’ve been mucking around with Eugene Dvoskin’s TL431 model lately. Learning more about control loop stability than I really set out to do!

Give us a link?

Realistic SPICE model for TL431: stability, noise, impedance and performance simulation of TL431 shunt regulator

Ltspice Model
--
RomDump
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6972
  • Country: ro
Re: This LTSpice model for TL431 is bonkers
« Reply #19 on: December 26, 2024, 04:51:18 am »
Ok, I see..
Below several models with your schematics.. I have a dozen of various 431 models here (coming from Bordodynov library etc).

Can you post those models (not just images?) or provide a link?   Sausage links are tasty but don't help my circuit simulation :)

Don't wait for somebody else to chew the sausages for you.  The secret is to right click on the words above, 'Bordodynov library', and eventually to add the 'download' word to any preferred search engine you may use, something like this:
https://duckduckgo.com/?q=Bordodynov+library+download&t=ffab&ia=web

It's a big library with many, many SPICE models, including a few for 431 based models and circuits.
« Last Edit: December 26, 2024, 04:57:49 am by RoGeorge »
 

Offline KonkedoutTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: us
Re: This LTSpice model for TL431 is bonkers
« Reply #20 on: December 26, 2024, 06:12:08 am »
Ok, I see..
Below several models with your schematics.. I have a dozen of various 431 models here (coming from Bordodynov library etc).

Can you post those models (not just images?) or provide a link?   Sausage links are tasty but don't help my circuit simulation :)

Don't wait for somebody else to chew the sausages for you.  The secret is to right click on the words above, 'Bordodynov library', and eventually to add the 'download' word to any preferred search engine you may use, something like this:
https://duckduckgo.com/?q=Bordodynov+library+download&t=ffab&ia=web

It's a big library with many, many SPICE models, including a few for 431 based models and circuits.

Thanks.  But I have encountered a lot of stuff under the category of 'Bordodynov library' and I copied a bunch into a Word document some time ago.  The problem is that many of the links do not seem to work.  I think I have heard that there were copyright issues.  That and...generally it seems that finding stuff with Google searches is much more difficult than it used to be, perhaps due to the same advertising links repeating themselves on every page..

And when I try to follow the link for the model by Eugene Dvoskin I get this, which appears to be saying that the page is available but it is unavailable.  The page (shown in the image) does not take me to any models so far as I can tell.
« Last Edit: December 26, 2024, 06:22:47 am by Konkedout »
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6972
  • Country: ro
Re: This LTSpice model for TL431 is bonkers
« Reply #21 on: December 26, 2024, 08:57:17 am »
I've downloaded the libraries from this page, I think:
http://www.bordodynov.ltwiki.org/
though, it was many years ago and can't say for sure where from I've got mine.

If at first it is not clear how to install it, either manually copy/paste only the component(s) of interest, or read for how to add the Bordodynov's library to an existing LTspice install (or other kind of SPICE).

No idea if there are copyright issues with that library, I'm using LTspice for hobby projects so I don't care much about copyright of SPICE models.  My guess is the copyright is OK, because that library is known for many years now, and still available online.
« Last Edit: December 26, 2024, 08:59:57 am by RoGeorge »
 

Offline RomDump

  • Regular Contributor
  • *
  • Posts: 119
  • Country: ca
Re: This LTSpice model for TL431 is bonkers
« Reply #22 on: December 26, 2024, 11:50:19 am »
And when I try to follow the link for the model by Eugene Dvoskin I get this, which appears to be saying that the page is available but it is unavailable.  The page (shown in the image) does not take me to any models so far as I can tell.

Did you click the second link I posted in the thread?
--
RomDump
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5506
  • Country: va
Re: This LTSpice model for TL431 is bonkers
« Reply #23 on: December 26, 2024, 12:11:08 pm »
I had a post on how to install the Bordodynov lib into the latest LTspice.. It is a couple of minutes exercise.
Bordodynov is an active member of the LTspice's groups.io, btw..
https://groups.io/g/LTspice
http://bordodynov.ltwiki.org/

You may find my post - here it is

https://www.eevblog.com/forum/eda/ltspice24-importing-the-a_bordodynovs-lib-and-examples/msg5359154/#msg5359154

PS: a 4 minutes long fresh install of the latest LTspice24 and AB lib (Win10) incl. the downloads times, based on the above guide..


« Last Edit: December 26, 2024, 12:58:06 pm by iMo »
Readers discretion is advised..
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20281
  • Country: gb
  • 0999
Re: This LTSpice model for TL431 is bonkers
« Reply #24 on: December 26, 2024, 01:21:54 pm »
Ok, I see..
Below several models with your schematics.. I have a dozen of various 431 models here (coming from Bordodynov library etc).

Can you post those models (not just images?) or provide a link?   Sausage links are tasty but don't help my circuit simulation :)

Don't wait for somebody else to chew the sausages for you.  The secret is to right click on the words above, 'Bordodynov library', and eventually to add the 'download' word to any preferred search engine you may use, something like this:
https://duckduckgo.com/?q=Bordodynov+library+download&t=ffab&ia=web

It's a big library with many, many SPICE models, including a few for 431 based models and circuits.

Thanks.  But I have encountered a lot of stuff under the category of 'Bordodynov library' and I copied a bunch into a Word document some time ago.  The problem is that many of the links do not seem to work.  I think I have heard that there were copyright issues.  That and...generally it seems that finding stuff with Google searches is much more difficult than it used to be, perhaps due to the same advertising links repeating themselves on every page..

And when I try to follow the link for the model by Eugene Dvoskin I get this, which appears to be saying that the page is available but it is unavailable.  The page (shown in the image) does not take me to any models so far as I can tell.
It was a bit of information overload. Not all the links on those websites work.

Here's a link to the zip file.
https://web.archive.org/web/20180710082533/http://www.audio-perfection.com/wp-content/uploads/TL431.zip

I've attached your file with Eugene's model.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf