This LTSpice model for TL431 is bonkers - Page 1
Forum section: electronics / projects

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 25, 2024, 06:05:36 pm
content: 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 termsI 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?

author: mawyatt
author_rank: Super Contributor
timestamp: December 25, 2024, 06:58:37 pm
content: Your problem is R2 is connected wrong in the left circuit.Best

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 25, 2024, 07:08:48 pm
content: 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.

author: mawyatt
author_rank: Super Contributor
timestamp: December 25, 2024, 07:18:05 pm
content: 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

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 25, 2024, 08:03:59 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: December 25, 2024, 08:12:07 pm
content: 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 , 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 M0SYMATTR InstName U1Insert the following text afterwards:SYMATTR Value TL431SYMATTR Value2 TL431Save the file.Open the .asc file in LTSpice. Note the RH1009 is now TL431. It can now be copied and used in the simulation.

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 25, 2024, 08:35:18 pm
content: Quote from: Zero999 on December 25, 2024, 08:12:07 pmThank 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.....

author: iMo
author_rank: Super Contributor
timestamp: December 25, 2024, 08:44:14 pm
content: Your schematics is still wrong (Zero999 schematics).. This is how it should work, imho..

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 25, 2024, 08:55:52 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: December 25, 2024, 09:10:55 pm
content: Quote from: Konkedout on December 25, 2024, 08:35:18 pmYes, I described what I had done.QuoteAre 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.Quote from: iMo on December 25, 2024, 08:44:14 pmIt 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.Quote from: Konkedout on December 25, 2024, 08:55:52 pmIn that configuration, then there's negative feedback, via the opto-coupler to the switched mode controller.

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 25, 2024, 09:30:30 pm
content: 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%253Dpartmatchesin 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.

author: iMo
author_rank: Super Contributor
timestamp: December 25, 2024, 09:38:16 pm
content: Ok, I see..Below several models with your schematics.. I have a dozen of various 431 models here (coming from Bordodynov library etc).

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 25, 2024, 10:59:32 pm
content: Quote from: iMo on December 25, 2024, 09:38:16 pmCan you post those models (not just images?) or provide a link? Sausage links are tasty but don't help my circuit simulation

author: Zero999
author_rank: Super Contributor
timestamp: December 25, 2024, 11:32:29 pm
content: Quote from: Konkedout on December 25, 2024, 09:30:30 pmI 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 TL431The name of the model used. It can be different to the partSYMATTR Value2 TL431_modelYou 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 13, 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.asyAnother thing which is a bit off-topic is there is also a generic op-amp symbol,  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.Quote from: Konkedout on December 25, 2024, 10:59:32 pmOne 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.

author: Andy Chee
author_rank: Super Contributor
timestamp: December 25, 2024, 11:49:28 pm
content: 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!

author: PCB.Wiz
author_rank: Super Contributor
timestamp: December 26, 2024, 12:04:11 am
content: 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 Referencehttps://www.ti.com/product/TLA431

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 26, 2024, 03:00:12 am
content: Quote from: Andy Chee on December 25, 2024, 11:49:28 pmGive us a link?

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 26, 2024, 03:08:38 am
content: Quote from: PCB.Wiz on December 26, 2024, 12:04:11 amThat one is interesting! But I probably would not gopher it.....

author: RomDump
author_rank: Regular Contributor
timestamp: December 26, 2024, 04:45:16 am
content: Quote from: Konkedout on December 26, 2024, 03:00:12 amRealistic SPICE model for TL431: stability, noise, impedance and performance simulation of TL431 shunt regulatorLtspice Model

author: RoGeorge
author_rank: Super Contributor
timestamp: December 26, 2024, 04:51:18 am
content: Quote from: Konkedout on December 25, 2024, 10:59:32 pmDon'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=webIt's a big library with many, many SPICE models, including a few for 431 based models and circuits.

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 26, 2024, 06:12:08 am
content: Quote from: RoGeorge on December 26, 2024, 04:51:18 amThanks. 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.

author: RoGeorge
author_rank: Super Contributor
timestamp: December 26, 2024, 08:57:17 am
content: 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.

author: RomDump
author_rank: Regular Contributor
timestamp: December 26, 2024, 11:50:19 am
content: Quote from: Konkedout on December 26, 2024, 06:12:08 amDid you click the second link I posted in the thread?

author: iMo
author_rank: Super Contributor
timestamp: December 26, 2024, 12:11:08 pm
content: 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/LTspicehttp://bordodynov.ltwiki.org/You may find my post - here it ishttps://www.eevblog.com/forum/eda/ltspice24-importing-the-a_bordodynovs-lib-and-examples/msg5359154/#msg5359154PS: a 4 minutes long fresh install of the latest LTspice24 and AB lib (Win10) incl. the downloads times, based on the above guide..

author: Zero999
author_rank: Super Contributor
timestamp: December 26, 2024, 01:21:54 pm
content: Quote from: Konkedout on December 26, 2024, 06:12:08 amIt 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.zipI've attached your file with Eugene's model.

author: iMo
author_rank: Super Contributor
timestamp: December 26, 2024, 01:38:26 pm
content: https://www.eevblog.com/forum/eda/ltspice24-importing-the-a_bordodynovs-lib-and-examples/msg5761125/#msg5761125Everything in the LTspice is in its original state after the AB install based on my guide.Nothing there has been "replaced"..The AB lib has been "added" to the existing original libs..

author: Zero999
author_rank: Super Contributor
timestamp: December 26, 2024, 02:42:37 pm
content: To improve portability and ease of use. I extracted the .asc files from TL431.ZIP, pasted Eugene's model into them and replaced all of the custom symbols with RH1009.asy. You can now simply copy and paste them to the schematic, which saves the need for multiple files.

author: Konkedout
author_rank: Frequent Contributor
timestamp: December 26, 2024, 05:40:44 pm
content: * TL431 Eugene Dvoskin model.asc (3.84 kB - downloaded 5 times.)Thanks. That one does seem to work.FWIW I have 3 times tried to download Bordodynov's 20M zip file. Even waiting > 30 minutes with good high speed internet, my laptop always gets stuck with an "Unconfirmed XXXXX.crdownload".So the signal-to-noise ratio out there is not so great....