LM1117 .lib from TI imported to LTspice not working right?

Thread Starter

jim0000

Joined Oct 28, 2020
130
I used the formula shown below in the datasheet. Ideally I wanted Vout to be 5V. So I made R2 75 ohm and R1 25ohm. Why does the output not regulate or give proper voltage?


1670299648946.png
1670299670533.png
1670299599226.png




EDIT:

I originally downloaded the fixed regulator from TI, but after downloading the adj file it looks like the following. I am still not getting 5V out. Why is that?

1670301834193.png
1670301855178.png
 
Last edited:

Papabravo

Joined Feb 24, 2006
19,592
Your symbol and it's connection to the subcircuit files is suspect. The part appears to have 3 pins labeled Vin, ADJ, and Vout. Your LTspice symbol has four pins labeled IN, OUT, GND_0 and GND_1. Why is that? I may be able to help if you package up your schematic (.asc), the symbol (.asy) and the subcircuit in a .zip file (N.B. .zip ONLY, not .7z or .rar or any other perversion) and post it here.

ETA: In the datasheet there is a functional block diagram in §8.2 showing a GND pin for the fixed regulator and an ADJ pin for the adjustable regulator. I'm going to guess that you should only use one of them at a time and leave the other one floating. I can't say which is which, however. I'd have to dig into the text of the .subckt file and it is late.
 
Last edited:

WBahn

Joined Mar 31, 2012
27,893
I'm not sure why you are seeing exactly what you are seeing, but I'm pretty sure that you downloaded the model for the 1.8 V fixed regulator, in which case the gnd connection is meant to be ground (not the adjustment pin).
 

Thread Starter

jim0000

Joined Oct 28, 2020
130
Your symbol and it's connection to the subcircuit files is suspect. The part appears to have 3 pins labeled Vin, ADJ, and Vout. Your LTspice symbol has four pins labeled IN, OUT, GND_0 and GND_1. Why is that? I may be able to help if you package up your schematic (.asc), the symbol (.asy) and the subcircuit in a .zip file (N.B. .zip ONLY, not .7z or .rar or any other perversion) and post it here.
The file I downloaded from TI is the .lib file I attached. I had to create the symbol using the method below:

I just downloaded the .lib from TI, and then opened it with LTspice. It then shows the screenshot below and I just right clicked ".SUBCKT LM1117_N_1P8_TRANS IN OUT GND_0 GND_1"
to make a spice model from it from the options.

1670300947777.png
 

Attachments

WBahn

Joined Mar 31, 2012
27,893
In looking at the model internals, the subcircuit has lots of components that are tied to 0 (the simulator's 0 V reference node). My guess is that putting 75 Ω between Node 0 and the subcircuit's two ground pins is what is causing the problems.

I don't know why anyone would make a model for a component like this and embed the global ground inside of it. Seems like a really bad idea.
 

WBahn

Joined Mar 31, 2012
27,893
The file I downloaded from TI is the .lib file I attached. I had to create the symbol using the method below:

I just downloaded the .lib from TI, and then opened it with LTspice. It then shows the screenshot below and I just right clicked ".SUBCKT LM1117_N_1P8_TRANS IN OUT GND_0 GND_1"
to make a spice model from it from the options.
You can't just grab the first model file you see. Look at that list of files -- you'll see versions that differ with "1P8", "2P5", 2P85", "3P3", "5P0", and "ADJ". If you look at the datasheet, you'll see that it clearly states that

"The LM1117 is available in an adjustable version, which can set the output voltage from 1.25 to 13.8 V with only two external resistors. In addition, it is available in five fixed voltages, 1.8 V, 2.5 V, 3.3 V, and 5 V "

Notice that they only list four voltages -- I'm willing to bet the fifth fixed voltage is (or was intended to be) 2.85 V. Since there is no mention of that voltage anywhere in the datasheet that I can see, it might be a part that they intended to make and opted not to and missed changing that "five" to "four" in the blurb.

Download the Adjustable model file and see what happens.
 

Thread Starter

jim0000

Joined Oct 28, 2020
130
In looking at the model internals, the subcircuit has lots of components that are tied to 0 (the simulator's 0 V reference node). My guess is that putting 75 Ω between Node 0 and the subcircuit's two ground pins is what is causing the problems.

I don't know why anyone would make a model for a component like this and embed the global ground inside of it. Seems like a really bad idea.
What you said may be
I'm not sure why you are seeing exactly what you are seeing, but I'm pretty sure that you downloaded the model for the 1.8 V fixed regulator, in which case the gnd connection is meant to be ground (not the adjustment pin).
You are right. I download the adj file, and I am still not getting an expected result. Can you look at my post edit?
 

WBahn

Joined Mar 31, 2012
27,893
I think I see what they are doing with the global ground -- they appear to have circuitry in there to control the behavior to make it match the specs better but are doing it in a behavioral way as opposed to trying to model the actual on-die circuitry. Hopefully they have taken pains to isolate that behavioral circuitry from the "real" circuitry (they probably did). This may simply be the only (reasonable) way to do the behavioral modeling.
 

WBahn

Joined Mar 31, 2012
27,893
What you said may be

You are right. I download the adj file, and I am still not getting an expected result. Can you look at my post edit?
PLEASE don't go back and edit posts (other than to fix typos or make other minor changes)!

People that read this thread ten minutes from now are going to be completely confused because the responses you got no longer have any relation to the post they are responding to.

This is a DISCUSSION and it needs to have the continuity and context of a discussion. Add posts with new content to the thread at which they naturally occur.
 

Thread Starter

jim0000

Joined Oct 28, 2020
130
PLEASE don't go back and edit posts (other than to fix typos or make other minor changes)!

People that read this thread ten minutes from now are going to be completely confused because the responses you got no longer have any relation to the post they are responding to.

This is a DISCUSSION and it needs to have the continuity and context of a discussion. Add posts with new content to the thread at which they naturally occur.
Oh okay, my apologies I was thinking it would be easier.
 

WBahn

Joined Mar 31, 2012
27,893
A DC simulation is just doing a DC operating point simulation, which may not be what you think it is.

Try doing a transient simulation and set a parameter for your voltage source value that you step.
 

Thread Starter

jim0000

Joined Oct 28, 2020
130
A DC simulation is just doing a DC operating point simulation, which may not be what you think it is.

Try doing a transient simulation and set a parameter for your voltage source value that you step.
Do you know how to change the voltage parameter? I put .tran 5m and then went to the advanced voltage options, but I didnt see where I could add a DC voltage start and stop point

1670302885767.png
 

Thread Starter

jim0000

Joined Oct 28, 2020
130
A DC simulation is just doing a DC operating point simulation, which may not be what you think it is.

Try doing a transient simulation and set a parameter for your voltage source value that you step.
Without doing the voltage step (I switched it manually just to see if it would work) I got the below result after manually changing the source from around 12V to 13V: So it does seem to work with the .tran command instead. Very strange I wonder why.

1670303051848.png
 

WBahn

Joined Mar 31, 2012
27,893
Inside the model is a node that is specified as having an initial condition of 0 V. That may be causing you problems.

Set your V1 to be a PWL source that ramps from 0 V at t=0 to 15 V at t=15 s and then run a transient simulation for 15 seconds.
 

WBahn

Joined Mar 31, 2012
27,893
Look at the start of that transient simulation. The value at t=0 is what the DC sweep simulation is going to capture as the value for that data point.

I think there is a way to force it to measure the nodes at a specific time after the startup, but I would have to dig around to find it.
 
Top