μA78L05 Analysis and Simulation¶
By Shuo Chen (chenshuo_at_chenshuo.com)
Latest notebook: https://github.com/chenshuo/notes/blob/master/notebooks/UA78L05.ipynb
Comments and discussions: https://github.com/chenshuo/notes/discussions
Series of analysis & simulation of IC regulator designed in 1970s:
Schematic¶
There are multiple versions of 78L05, I found at least three:
- Signetics μA78L05 = TI's UA78L05 nowadays. It is the circuit analyzed here.
- Fairchild announced its μA78L05 in 1974 Voltage Regulator Applications Handbook, which employs a different design. It's the same as ST's L78L05
- National LM78L05 seems doesn't use bandgap reference, but a Zener diode.
TI makes both μA78L05 and LM78L05, they are drop-in replacement of each other, but their internal schematics are completely different. Same happens on TI's LM7805, LM340 and μA7805.
"However, it turns out that the part numbers are really just marketing, and have little to do with what's inside the chip." https://www.righto.com/2014/09/reverse-engineering-counterfeit-7805.html
The internal schematic below is from 1977 Signetics Analog Data Manual p.160.
This is a vector graph, right click on it, open in a new tab, then zoom-in as you need.
The resistance values are of course very important. However, the numbering of transistors also reveal some information. IMO, it probably reflects how the circuit was designed.
- First, $Q_1\dots Q_4$ form the bandgap reference. Btw, in my simulation, $Q_4$ is off in normal operation.
- Then, $Q_5\dots Q_8$ made the error amplifier.
- $Q_{12}$ and $Q_{14}$ are the output stage, the pass transistor.
Those 10 transistors construct the DC path, the remaining are auxiliary circuits.
- $Q_{13}$ is current limiting, $R_{10}$ is current sense resistor.
- $Q_{10}$ and $Q_{11}$, with zener diode $Q_{15}$ are start-up circuit.
- $Q_{9} and zener diode $Q_{15}$ are overheat protection
Simplified¶
If we omit all protection and start-up circuits, the DC path is clean and straight forward to understand.
Estimate the reference voltage
- $R_6$ sets the output voltage, Vfb = Vref when balanced.
- μA78Lxx series has maximum output voltage of 15V, so I guess $R_6=14$kΩ when Vout=15V.
- Vfb = $\dfrac{1.4}{1.4+14}\times 15 = 15 / 11 = 1.364$V
- Then Vref = 1.364V
Further simplified¶
The DC path is a basic series regulator made of a reference, an op amp, and a pass transistor, as shown below.
Bandgap voltage reference¶
The bandgap reference made of $Q_1\dots Q_4$ is driven by current through $R_5$, when Vout is set to 5V, $R_5$ should ensure the bandgap have a good tempco.
We now simulate the circuit on the left side of the dotted line.
Print the DC operating point of following SPICE netlist.
ng.circ('''
V1 out 0 5V
R5 out q8b 4k
R1 q8b q1b 1k
R2 q8b q3b 10k
Q1 q1b q1b 0 NPN
Q2 q3b q1b r3 NPN
R3 r3 0 1k
R4 q8b q4b 2k
Q3 q4b q3b 0 NPN
Q4 0 q4b q8b PNP
.model NPN NPN(BF=120 Cje=1p Cjc=2p Rb=40 VAF=80 VAR=50 KF=3.2e-16 AF=1)
.model PNP PNP(BF=60 Cje=1p Cjc=3p Rb=80 VAF=70 VAR=40)
.options savecurrents
''')
print_op(False, True)
@q1[ic] = 585.75 uA @q1[ie] = -590.71 uA @q2[ic] = 59.05 uA @q2[ie] = -59.55 uA @q3[ic] = 259.45 uA @q3[ie] = -261.64 uA @q4[ic] = -0.05 uA @q4[ie] = 0.05 uA @r1[i] = 591.21 uA @r2[i] = 61.24 uA @r3[i] = 59.55 uA @r4[i] = 259.45 uA @r5[i] = 911.95 uA out = 5000.00 mV q1b = 760.99 mV q3b = 739.78 mV q4b = 833.31 mV q8b = 1352.20 mV r3 = 59.55 mV v1#branch = -911.95 uA
The results is shown in following schematic.
$R_5$ sets the current of bandgap circuit, and affects the temperature curve.
Try finding the best $R_5$.
R5 = 3500, Iq = 1036.6 uA, Vref@27C = 1.372 V, delta = 10.14 mV R5 = 3600, Iq = 1008.6 uA, Vref@27C = 1.369 V, delta = 6.70 mV R5 = 3700, Iq = 982.3 uA, Vref@27C = 1.366 V, delta = 3.43 mV R5 = 3800, Iq = 957.6 uA, Vref@27C = 1.361 V, delta = 0.98 mV R5 = 3900, Iq = 934.2 uA, Vref@27C = 1.357 V, delta = -0.78 mV R5 = 4000, Iq = 912.0 uA, Vref@27C = 1.352 V, delta = -2.33 mV R5 = 4100, Iq = 890.8 uA, Vref@27C = 1.348 V, delta = -3.87 mV R5 = 4200, Iq = 870.6 uA, Vref@27C = 1.343 V, delta = -5.47 mV R5 = 4300, Iq = 851.4 uA, Vref@27C = 1.339 V, delta = -7.13 mV R5 = 4400, Iq = 833.0 uA, Vref@27C = 1.335 V, delta = -8.86 mV
<matplotlib.legend.Legend at 0x7fdd48d3ee50>
Looks like $R_5=3850$ might be the best candidate for now.
R5 = 3850, Vref@27C = 1.359 V, max-min = 2.190 mV
Caveat: quote Bob Pease "The Design of Band-Gap Reference Circuits: Trials and Tribulations"
However, there are many ways to get false results in SPICE and other simulation schemes. Most transistor models do not accurately model the shape of the curve of Vbe vs. temperature. https://www.tayloredge.com/reference/Ganssle-Pease/bobpease-bandgap.pdf
Error amplifier and output¶
$R_5$ decides the reference voltage, by setting bias current of bandgap reference, which also sets the tempco curve.
$R_6$ decides the output voltage.
In other words, tempco and Vout can be tuned independently, which made our lives much easier.
SPICE netlist for DC path of μA78L05.
ng.circ('''
V1 vcc 0 10V
* Bandgap reference
R5 out q8b 4k
R1 q8b q1b 1k
R2 q8b q3b 10k
Q1 q1b q1b 0 NPN
Q2 q3b q1b r3 NPN
R3 r3 0 1k
R4 q8b q4b 2k
Q3 q4b q3b 0 NPN
Q4 0 q4b q8b PNP
* Error amplifier
Q5 q5c q6b vcc PNP
Q6 q6b q6b vcc PNP
Q8 q6b q8b q8e NPN
R8 q8e 0 4k
Q7 q5c q7b q8e NPN
R6 out q7b 3.8k
R7 q7b 0 1.4k
* Output
Q12 vcc q5c q14b NPN
Q14 vcc q14b q14e NPN 10
R10 q14e out 2
R11 q14b q13b 500
R12 q13b q14e 200
Rload out 0 1k
.model NPN NPN(BF=120 Cje=1p Cjc=2p Rb=40 VAF=80 VAR=50 KF=3.2e-16 AF=1)
.model PNP PNP(BF=60 Cje=1p Cjc=3p Rb=80 VAF=70 VAR=40)
.options savecurrents
''')
print_op(False)
@q12[ic] = 1121.91 uA @q14[ic] = 5772.24 uA @q1[ic] = 586.59 uA @q2[ic] = 59.08 uA @q3[ic] = 262.83 uA @q4[ic] = -0.07 uA @q5[ic] = -84.77 uA @q6[ic] = -81.54 uA @q7[ic] = 75.67 uA @q8[ic] = 84.31 uA @r10[i] = 6903.25 uA @r11[i] = 1084.65 uA @r12[i] = 1084.65 uA @r1[i] = 592.06 uA @r2[i] = 61.30 uA @r3[i] = 59.58 uA @r4[i] = 262.83 uA @r5[i] = 916.90 uA @r6[i] = 965.68 uA @r7[i] = 965.08 uA @r8[i] = 161.23 uA @rload[i] = 5020.68 uA out = 5020.68 mV q13b = 5251.41 mV q14b = 5793.74 mV q14e = 5034.48 mV q1b = 761.03 mV q3b = 740.11 mV q4b = 827.43 mV q5c = 6570.61 mV q6b = 9290.03 mV q7b = 1351.11 mV q8b = 1353.08 mV q8e = 644.91 mV r3 = 59.58 mV v1#branch = -7063.23 uA vcc = 10000.00 mV
Tune tempco?¶
TODO: write this part
First, read quote from Bob Pease above.
At any rate, we found the best combination is $R_5 = 3.92$kΩ, $R_6=3.82$kΩ.
R5 = 3800, Vout@27C = 5.061 V, delta = 13.14 mV, max-min = 17.59 mV R5 = 3820, Vout@27C = 5.057 V, delta = 10.71 mV, max-min = 15.91 mV R5 = 3840, Vout@27C = 5.053 V, delta = 8.45 mV, max-min = 14.43 mV R5 = 3860, Vout@27C = 5.049 V, delta = 6.33 mV, max-min = 13.14 mV R5 = 3880, Vout@27C = 5.045 V, delta = 4.34 mV, max-min = 12.01 mV R5 = 3900, Vout@27C = 5.041 V, delta = 2.44 mV, max-min = 11.00 mV R5 = 3920, Vout@27C = 5.037 V, delta = 0.61 mV, max-min = 10.11 mV R5 = 3940, Vout@27C = 5.033 V, delta = -1.18 mV, max-min = 10.47 mV R5 = 3960, Vout@27C = 5.029 V, delta = -2.94 mV, max-min = 11.49 mV R5 = 3980, Vout@27C = 5.025 V, delta = -4.69 mV, max-min = 12.55 mV R5 = 4000, Vout@27C = 5.021 V, delta = -6.44 mV, max-min = 13.66 mV R5 = 4020, Vout@27C = 5.017 V, delta = -8.20 mV, max-min = 14.82 mV R5 = 4040, Vout@27C = 5.013 V, delta = -9.97 mV, max-min = 16.02 mV R5 = 4060, Vout@27C = 5.009 V, delta = -11.76 mV, max-min = 17.27 mV R5 = 4080, Vout@27C = 5.004 V, delta = -13.56 mV, max-min = 18.57 mV
[]
Final version¶
After setting $R_5 = 3.92$kΩ to get the best tempco from simulation, we fine tune the output voltage to 5.05V, which is 1% higher than 5V.
This gives us $R_6 = 3.81$kΩ.
* DC path of μA78L05
V1 vcc 0 10V
Rload out 0 1k
* Bandgap reference
R5 out q8b 3.92k
R1 q8b q1b 1k
R2 q8b q3b 10k
Q1 q1b q1b 0 NPN
Q2 q3b q1b r3 NPN
R3 r3 0 1k
R4 q8b q4b 2k
Q3 q4b q3b 0 NPN
Q4 0 q4b q8b PNP
* Error amplifier
Q5 q5c q6b vcc PNP
Q6 q6b q6b vcc PNP
Q8 q6b q8b q8e NPN
R8 q8e 0 4k
Q7 q5c q7b q8e NPN
R6 out q7b 3.81k
R7 q7b 0 1.4k
* Output
Q12 vcc q5c q14b NPN
Q14 vcc q14b q14e NPN 10
R10 q14e out 2
R11 q14b q13b 500
R12 q13b q14e 200
Q13 q5c q13b q13e NPN
R9 q13e out 100
* Startup
R13 vcc q10b 20k
D1 0 q10b DZ
Q10 vcc q10b q10e NPN
R14 q10e q11b 4k
R15 q11b q9b 700
R16 q9b 0 300
Q11 q6b q11b q8e NPN
Q9 q5c q9b q9e NPN
R17 q9e 0 100
.model NPN NPN(BF=120 Cje=1p Cjc=2p Rb=40 VAF=80 VAR=50 KF=3.2e-16 AF=1)
.model PNP PNP(BF=60 Cje=1p Cjc=3p Rb=80 VAF=70 VAR=40)
.model DZ D (BV=5.6)
.options savecurrents
@d1[id] = -214.42 uA @q10[ib] = 7.61 uA @q10[ic] = 949.98 uA @q10[ie] = -957.60 uA @q11[ib] = -0.00 uA @q11[ic] = 0.00 uA @q11[ie] = -0.00 uA @q12[ib] = 9.11 uA @q12[ic] = 1122.73 uA @q12[ie] = -1131.84 uA @q13[ib] = -0.00 uA @q13[ic] = 0.00 uA @q13[ie] = -0.00 uA @q14[ib] = 46.83 uA @q14[ic] = 5827.60 uA @q14[ie] = -5874.43 uA @q1[ib] = 5.00 uA @q1[ic] = 591.28 uA @q1[ie] = -596.29 uA @q2[ib] = 0.50 uA @q2[ic] = 59.22 uA @q2[ie] = -59.72 uA @q3[ib] = 2.39 uA @q3[ic] = 282.16 uA @q3[ie] = -284.55 uA @q4[ib] = -0.00 uA @q4[ic] = -0.30 uA @q4[ie] = 0.30 uA @q5[ib] = -1.39 uA @q5[ic] = -85.35 uA @q5[ie] = 86.74 uA @q6[ib] = -1.39 uA @q6[ic] = -82.13 uA @q6[ie] = 83.53 uA @q7[ib] = 0.60 uA @q7[ic] = 76.24 uA @q7[ie] = -76.84 uA @q8[ib] = 0.65 uA @q8[ic] = 84.92 uA @q8[ie] = -85.57 uA @q9[ib] = -0.00 uA @q9[ic] = 0.00 uA @q9[ie] = -0.00 uA @r10[i] = 6959.44 uA @r11[i] = 1085.01 uA @r12[i] = 1085.01 uA @r13[i] = 221.99 uA @r14[i] = 957.60 uA @r15[i] = 957.60 uA @r16[i] = 957.60 uA @r17[i] = 0.00 uA @r1[i] = 596.79 uA @r2[i] = 61.61 uA @r3[i] = 59.72 uA @r4[i] = 282.16 uA @r5[i] = 941.51 uA @r6[i] = 969.21 uA @r7[i] = 968.60 uA @r8[i] = 162.42 uA @r9[i] = 0.00 uA @rload[i] = 5048.73 uA out = 5048.73 mV q10b = 5560.17 mV q10e = 4787.98 mV q11b = 957.60 mV q13b = 5279.65 mV q13e = 5048.73 mV q14b = 5822.16 mV q14e = 5062.65 mV q1b = 761.24 mV q3b = 741.97 mV q4b = 793.71 mV q5c = 6599.06 mV q6b = 9289.84 mV q7b = 1356.05 mV q8b = 1358.02 mV q8e = 649.66 mV q9b = 287.28 mV q9e = 0.00 mV r3 = 59.72 mV v1#branch = -8292.58 uA vcc = 10000.00 mV
Bias current: 3.24mA
print('%.1f uA' % (8292.58 - 5048.73))
3243.9 uA
Temperature curve:
R5 = 3920, Vout@27C = 5.049 V, max-min = 10.574 mV
Line Regulation¶
Sweeping Vin from 7V to 20V, observing Vout.
.dc v1 7 20 0.1
Datasheet says the typical $\Delta V_\mathrm{out}$ is 32mV.
Our SPICE model is worse than that spec.
Delta Vout = 43.32 mV
TODO: find a way to fix line regulation ratio.
Load Regulation¶
Sweeping Rload from 50Ω to 5000Ω, Iout changes from 100mA to 1mA.
.dc rload 50 5000 1
Datasheet says the typical $\Delta V_\mathrm{out}$ is 15mV.
Our SPICE model matches that spec.
Delta Vout = 14.52 mV
Output current limit¶
Text(0.5, 1.0, 'Output current limiting')
Dropout voltage¶
Sweeping Vin from 0V to 8V, observing Vout.
.dc v1 0 8 0.1
The simulated dropout is ~1.7V, mainly due to Vbe of $Q_{12}$ and $Q_{14}$. This matches datasheet.
Vin = 6.00 V, Vout = 4.43 V, Dropout = 1.57 V Vin = 6.10 V, Vout = 4.53 V, Dropout = 1.57 V Vin = 6.20 V, Vout = 4.63 V, Dropout = 1.57 V Vin = 6.30 V, Vout = 4.73 V, Dropout = 1.57 V Vin = 6.40 V, Vout = 4.82 V, Dropout = 1.58 V Vin = 6.50 V, Vout = 4.91 V, Dropout = 1.59 V Vin = 6.60 V, Vout = 5.00 V, Dropout = 1.60 V Vin = 6.70 V, Vout = 5.04 V, Dropout = 1.66 V Vin = 6.80 V, Vout = 5.05 V, Dropout = 1.75 V Vin = 6.90 V, Vout = 5.05 V, Dropout = 1.85 V Vin = 7.00 V, Vout = 5.05 V, Dropout = 1.95 V Vin = 7.10 V, Vout = 5.05 V, Dropout = 2.05 V Vin = 7.20 V, Vout = 5.05 V, Dropout = 2.15 V Vin = 7.30 V, Vout = 5.05 V, Dropout = 2.25 V Vin = 7.40 V, Vout = 5.05 V, Dropout = 2.35 V Vin = 7.50 V, Vout = 5.05 V, Dropout = 2.45 V
Loose end¶
We simulated the DC path of μA78L05 using NgSpice.
We didn't model any AC characteristics (transient, frequency response, ripple rejection, etc.).
So the SPICE model presented here is not a practical model for simulating μA78L05 in real life, but a tool to study how it works. Especially how its feedback loop worked.
Another SPICE model¶
https://github.com/kafana/ltspice-misc/blob/master/models/regulators.lib#L15C1-L63C12
*78L05 MCE 7-12-95
*78L05 circuit taken from Signetics 1977 Analog Data Book page 160
*5V 100mA Voltage Regulator pkg:TO-92 1,2,3
.SUBCKT 78L05 vin com out
* Bandgap
Q1 q1b q1b com QNPN
Q2 q3b q1b r3 QNPN
Q3 q4b q3b com QNPN
Q4 com q4b q8b QPNP
R1 q8b q1b 1k
R2 q8b q3b 10k
R3 r3 com 1k
R4 q8b q4b 2k
R5 out q8b 2.2k
* Error amp.
Q5 q5c q6b vin QPNP
Q6 q6b q6b vin QPNP
Q7 q5c q7b q8e QNPN
Q8 q6b q8b q8e QNPN
R6 out q7b 4.5k
R7 q7b com 1.4k
R8 q8e com 4k
C1 q7b q5c 20p
* Output
Q12 vin q5c q14b QNPN
Q14 vin q14b q14e QNPN 1
Q13 q5c q13b q13e QNPN
R11 q14b q13b 500
R12 q13b q14e 200
R9 q13e out 100
R10 q14e out 2
* Startup
Q9 q5c q9b q9e QNPN
Q10 vin q10b q10e QNPN
Q11 q6b q11b q8e QNPN
R13 vin q10b 20k
D1 com q10b DZ5V
R14 q10e q11b 4k
R15 q11b q9b 700
R16 q9b com 300
R17 com q9e 100
.MODEL QPNP PNP(IS=1.05E-15 BF=220 VAF=240 IKF=0.1 ISE=1.003E-9
+ NE=4 ISC=1.003E-9 NC=4 RB=3 RE=0.5 RC=0.2 CJE=5.7E-12 VJE=0.75 TF=3.35E-10
+ CJC=4.32E-12 VJC=0.75 TR=1.7E-7 VJS=0.75 KF=4E-15 )
.MODEL QNPN NPN(IS=8.11E-14 BF=205 VAF=113 IKF=0.5 ISE=1.06E-11
+ NE=2 BR=4 VAR=24 IKR=0.225 RB=1.37 RE=0.343 RC=0.137 CJE=2.95E-11
+ TF=3.97E-10 CJC=1.52E-11 TR=8.5E-8 XTB=1.5 )
.MODEL DZ5V D(IS=1E-11 RS=7.708 N=1.27 TT=5E-8 CJO=4.068E-10 VJ=0.75
+ M=0.33 BV=4.946 IBV=0.01 )
.ENDS 78L05
@c.x1.c1[i] = 0.00 uA @d.x1.d1[id] = -253.54 uA @q.x1.q10[ib] = 5.09 uA @q.x1.q10[ic] = 841.09 uA @q.x1.q11[ib] = 0.00 uA @q.x1.q11[ic] = 0.00 uA @q.x1.q12[ib] = 5.82 uA @q.x1.q12[ic] = 961.90 uA @q.x1.q13[ib] = 0.00 uA @q.x1.q13[ic] = 0.00 uA @q.x1.q14[ib] = 35.64 uA @q.x1.q14[ic] = 6667.17 uA @q.x1.q1[ib] = 3.94 uA @q.x1.q1[ic] = 602.30 uA @q.x1.q2[ib] = 0.59 uA @q.x1.q2[ic] = 59.55 uA @q.x1.q3[ib] = 2.50 uA @q.x1.q3[ic] = 356.89 uA @q.x1.q4[ib] = -4.20 uA @q.x1.q4[ic] = -719.02 uA @q.x1.q5[ib] = -0.91 uA @q.x1.q5[ic] = -84.26 uA @q.x1.q6[ib] = -0.91 uA @q.x1.q6[ic] = -83.20 uA @q.x1.q7[ib] = 0.70 uA @q.x1.q7[ic] = 78.44 uA @q.x1.q8[ib] = 0.73 uA @q.x1.q8[ic] = 85.03 uA @q.x1.q9[ib] = 0.00 uA @q.x1.q9[ic] = 0.00 uA @r.x1.r10[i] = 7634.88 uA @r.x1.r11[i] = 932.08 uA @r.x1.r12[i] = 932.08 uA @r.x1.r13[i] = 258.64 uA @r.x1.r14[i] = 846.19 uA @r.x1.r15[i] = 846.19 uA @r.x1.r16[i] = 846.19 uA @r.x1.r17[i] = -0.00 uA @r.x1.r1[i] = 606.83 uA @r.x1.r2[i] = 62.05 uA @r.x1.r3[i] = 60.13 uA @r.x1.r4[i] = 352.69 uA @r.x1.r5[i] = 1745.51 uA @r.x1.r6[i] = 853.67 uA @r.x1.r7[i] = 852.97 uA @r.x1.r8[i] = 164.89 uA @r.x1.r9[i] = 0.00 uA @rload[i] = 5035.70 uA out = 5035.70 mV v1#branch = -8898.08 uA vcc = 10000.00 mV x1.q10b = 4827.24 mV x1.q10e = 4230.93 mV x1.q11b = 846.19 mV x1.q13b = 5237.39 mV x1.q13e = 5035.70 mV x1.q14b = 5703.43 mV x1.q14e = 5050.97 mV x1.q1b = 588.75 mV x1.q3b = 575.12 mV x1.q4b = 490.19 mV x1.q5c = 6303.59 mV x1.q6b = 9350.83 mV x1.q7b = 1194.16 mV x1.q8b = 1195.58 mV x1.q8e = 659.58 mV x1.q9b = 253.86 mV x1.q9e = 0.00 mV x1.r3 = 60.13 mV
# Bias current
8898.08 - 5035.70
3862.38