# How does this LM337 spice model work?

TL;DR:

How does a VCCS + darlington PNP work effectively like an op-amp?

The following op-amp circuit set the Vout to -1.25 * (1 + R2 / R1). With the resistor values given, it set Vout = -10.05V.

I found that the following circuit did the same job, which is a VCCS + PNP darlington.

Why does this circuit work effectively like an op-amp?

I can figure out the negative feedback here:

1. If R2 goes smaller, V(Adj) goes higher, then I(G1) reduces, then I(Q3e) reduces, therefore V(Vout) = R3 * I(Q3e) also goes higher (closer to GND).
2. If R3 goes smaller, V(Vout) goes higher, V(Vref) - V(Adj) goes larger, then I(G1) increase, then I(Q3e) increases, as the current passes R3 increases, the V(Vout) goes lower. In fact it tries to offset the effect of R3 being smaller.

I don't quite understand why this circuit has such high gain to keep V(adj) and V(Vref) close to only a few micro-volts.

NGSpice file for above circuit:

LM337 simple model
V1 ref Vout 1.25
G1 N001 Vin ref Adj 0.1
Q3 Vin N003 N004 0 QPOUT
Q4 Vin Q4b N003 0 PNP
R10 N001 Q4b 1k
R26 Vin Q4b 200k
R18 N003 Vout 250
R19 N004 Vout .3
V2 Vin 0 -20
R3 Vout 0 100

.op

*.dc R3 10 1000 10
*.print dc v(Vout)

* .options savecurrents
* .dc R2 0 1700 100
* .print dc v(Vout) @G1[i]

.MODEL QPOUT PNP (BF=50)
.MODEL PNP PNP
.end


Long story:

While desining a dual-tracking power supply, I found a LM337 spice model online that seems to work with LTSpice, it is not the official one from TI.com, and I wonder why the model works. The model on github is identical to a post from 2002 August.

I converted the netlist to schematic. It looks like:

It is obviously not modeling the actual schematic, because all datasheets I found for LM337 has NPN darlington as the output stage, not PNP ones.

To focus on DC operating point, I made a simpler version of it, by

1. removing Q5, which limit current,
2. removing C7 and R24,
3. removing D2,

I got the following simpler circuit, which still works according to simulation.

DC param sweep showed that:

1. the output voltage keeps stable when varying R3 (the load), i.e. it's a voltage regulator.
2. the output voltage varies corrsponding to R2 (the adjust res), Vout = 1.25*(1 + R2/R1).

The circuit still works if I change:

1. the value of R10, R26, R18, R19 by 2x
2. BF of Q3 and Q4 by 2x.

It must have high gain with deep negative feedback so that it is not sensitive to component parameters, but I couldn't figure out why.

I don't quite understand why this circuit could keep voltage between Adj and Vout the same as Vref (1.25v). Or, how does a VCCS + darlington PNP work effectively like an op-amp?

• Saying you couldn't figure out something or you don't understand something is not a valid question on this site. Try and keep your question focussed too. Nobody's interested in the big back story about finding the model then modifying it. Maybe start with your simpler circuit to avoid TL;DR. Dec 7, 2021 at 9:15
• @Andyaka Thanks for the suggestion, I updated the question with a TL;DR at the begining. PTAL. Dec 7, 2021 at 17:56

If you'll look in the datasheet you'll see that the whole myriad of transistors can be simplified (roughly) to what you have there: a controlled current source and a Darlington output. The difference is NPN vs PNP, but the current direction is the same. In fact, changing the PNPs to NPNs (with the appropriate topology change) and making the current source -0.1, results in the same output:
If I change the value of the VCCS to -0.1 for the PNP configuration, it stops working, which is to be expected, so I don't know how you got the same result. But your question:
seems a bit strange, especially since your other equivalent schematic is using the [Opamps]/opamp element, which is nothing but a VCCS + C under the hood (see its subcircuit in My Documents/LTspiceXVII/lib/sub/opamp.sub). Which should make things clearer: that opamp is nothing but an error amplifier.