LM7805 Analysis and Simulation¶
By Shuo Chen (chenshuo_at_chenshuo.com)
Latest notebook: https://github.com/chenshuo/notes/blob/master/notebooks/LM7805.ipynb
Comments and discussions: https://github.com/chenshuo/notes/discussions
Series of analysis & simulation of IC regulator designed in 1970s:
LM7805 != μA7805¶
https://www.righto.com/2014/09/reverse-engineering-counterfeit-7805.html
In most if not all practices, LM7805 and μA7805 can be used interchangeablly, but their internal schematic are different. Ken Shirriff suspects "manufacturers are constrained by patents, so they use the part numbers they want on the devices they can make."
Two common designs:
- LM7805 $=$ LM340 from National semiconductor. based on LM109/LM309 by Robert Widlar in 1969.
- μA7805 from Fairchild semiconductor, debut in 1971.
$\newcommand{\uv}[1]{V_\mathrm{#1}}\newcommand{\ui}[1]{I_\mathrm{#1}}$The obvious difference is their reference voltage, μA7805 has 4 $\uv{BE}$ on its reference voltage, after temperature compensation $\uv{REF} \approx 4 \times V_\mathrm{g0}\approx 4.8$V. While LM7805 has 3 $V_\mathrm{BE}$ on its reference voltage, so after temperature compensation $\uv{REF} \approx 3 \times V_\mathrm{g0}\approx 3.6$V.
This is a vector graphic, right click and open it in a new tab, then zoom in as you need.
μA7805¶
The current TI datasheet doesn't specify resistor values, check 1971 Fairchild Linear Integrated Circuits Data Catalog instead.
A few notes:
- Unlabelled $R_{21}$ between base of $Q_{15}$ and emitter of $Q_{16}$ didn't exist in 1971 or 1973 datasheets from Fairchild. So it's drawn in dashed lines.
- Value of $R_{16}$ changes between 2kΩ and 6kΩ in different versions of datasheets, the value probably doesn't matter too much though.
- $R_{20}=250$Ω is for 5V output, from this we can estimate the interal reference voltage at base of $Q_6$ is $\dfrac{5}{5+0.25}\times 5.0 = 4.762$V.
- $Q_{16}$ and $Q_{17}$ is Darlinton pair, as the output stage, a.k.a. series pass transistors.
- $Q_{15}$ and current sense resistor $R_{11}$ limits the output current. When in normal operation, $Q_{15}$ is off.
- Zener diode $D_2$ and $Q_{15}$ prevent overvoltage break down of output pass transistors. (It's called "Output Transistor Safe-Area Compensation" in the datasheet.)
- Zener diode $D_1$ and $Q_{14}$ provides overheat protection (called "Thermal-Overload Protection" in the datasheet). When in normal operation, $Q_{14}$ is off.
- Zener diode $D_1$ and $Q_{12}$/$Q_{13}$ is startup circuit, provide initial bias for $Q_1, Q_7, Q_8$ when power up. When in normal operation, $Q_{13}$ is off.
- The rest transistors $Q_1 \dots Q_{11}$ are the core function of voltage reference, error amplifier ($Q_4$, $Q_3$ and $Q_{11}$), current mirror ($Q_8$ and $Q_9$) as active load, etc.
μA7805¶
Simplified schematic¶
Adapted from 1974 Fairchild Voltage Regulator Applications Handbook, p.2-4
Brief analysis:
The main part of the bandgap reference: $Q_1$, $Q_2$ generates $\Delta V_\mathrm{BE}$ on $R_3$, and magnify it on $R_2$. $R_2$ is critical, as the voltage on it $V_\mathrm{R2}$ has positive tempco, to cancel negative tempco of 4 $V_\mathrm{BE}$s.
7805 works in a different way than μA78L05, the latter is traditional: generating stable reference voltage usng bandgap circuit, then comparing output voltage against it.
In 7805, the bandgap reference works "backwards", the whole chip can be viewed as a bandgap reference. The "purpose" of the circuit, including its external load, is maintaining a stable voltage at the base of $Q_6$, which according to literature, it is supposed to be 4.8V, that is $4 \times V_\mathrm{g0}$. What we really want from this circuit, is its "side-effect" of delivering stable 5V voltage output at Vout pin. In other words, the error amplifier made of $Q_3, Q_4, \mathrm{and} Q_{11}$, and the output pass transistors $Q_{16}$ and $Q_{17}$ are all part of the feedback look of the bandgap reference, whose error singal is from collector of $Q_2$.
$Q_4$ and $Q_3$ form a Darlinton pair to amplify the voltage error. I guess the initial design consists $Q_1, Q_2, Q_3$ only, $Q_4$ was added later to increase the gain of error amplifier. With the addition of $Q_4$, the voltage at collector of $Q_2$ increased to 2 $V_\mathrm{BE}$s, to compensate that, $Q_7$ was added to increase the voltage of Q1C to 2 $V_\mathrm{BE}$s as well. Then $R_{10}$ was added (not shown in the simplified schematic) to provide a path for emitter current of $Q_7$ (~132μA). The purpose was to keep the voltage drop on $R_1$ and $R_2$ the same, so that the current ratio on $Q_1$ and $Q_2$ is about $20:1$, 1420μA vs. 75μA.
Feedback loop:
- $Q_6$ and $Q_5$ are emitter followers, $Q_4$ and $Q_3$ are error ampifier, those 4 transistors provides the negative tempco of voltage reference. Canceled by positive tempco on $V_\mathrm{R2}$
- $Q_{11}$ (shown as dashed line in the simplified schematic) is a buffer, also a current amplifier, to minimize/reduce the current changes on $Q_4$ and $Q_3$, bacause $Q_4$ and $Q_3$ also serve as part of the bandgap voltage reference, we want their current stable.
- Suppose load reduced, Vout ↑, Vref ↑, $V_\mathrm{Q6B}$↑, $V_\mathrm{Q5E}$↑, $V_\mathrm{Q4B}$↑, so the error voltage↑
- $V_\mathrm{Q4B}$↑, $I_\mathrm{C4}$ and $I_\mathrm{C3}$ ↑↑, $I_\mathrm{E11}$ ↑↑↑, so $I_\mathrm{B16}$↓, (as $I_\mathrm{E11}+I_\mathrm{B16}+I_\mathrm{R16} = I_\mathrm{C9}$, and $I_\mathrm{C9}$ doesn't change much.)
- $I_\mathrm{B16}$↓, $I_\mathrm{E16}$↓, $I_\mathrm{B17}$↓, $I_\mathrm{E17}$↓↓, Iout↓↓, finally Vout ↓.
Estimating quiescent operating point:
- Assuming all $V_\mathrm{BE}\approx 0.65$V.
- $V_\mathrm{Q1B} = V_\mathrm{Q3B} =0.65$V, $V_\mathrm{Q7B} = V_\mathrm{Q4B} =1.3$V
- $V_\mathrm{R1} = V_\mathrm{R2}\ \Rightarrow\ I_\mathrm{R1} \cdot R_1 = I_\mathrm{R2} \cdot R_2$
- $I_\mathrm{R1} = \dfrac{R_2}{R_1}I_\mathrm{R2} = 20 I_\mathrm{R2}$
- $I_\mathrm{R1} \approx I_\mathrm{C1}$, $I_\mathrm{R2} \approx I_\mathrm{C2}$, so $I_\mathrm{C1} \approx 20 I_\mathrm{C2}$
- $V_\mathrm{R3} = \Delta V_\mathrm{BE} = V_\mathrm{BE1} - V_\mathrm{BE2} = V_\mathrm{T} \ln \dfrac{I_\mathrm{C1}}{I_\mathrm{C2}}$
- $\Delta V_\mathrm{BE} = V_\mathrm{T} \ln 20 \approx 3 V_\mathrm{T} = 77.3$mV
- $V_\mathrm{R2} = \dfrac{R_2}{R_3} \Delta V_\mathrm{BE} = 20 \Delta V_\mathrm{BE} \approx 1.546$V
- $V_\mathrm{Q5E} = V_\mathrm{R2} + V_\mathrm{Q4B} \approx 1.55 + 1.30 = 2.85$V
- $V_\mathrm{REF} = V_\mathrm{Q6B} = V_\mathrm{Q5E} + V_\mathrm{BE5} + V_\mathrm{BE6} \approx 4.15$V
SPICE model¶
I couldn't find a SPICE model, so I made my own for helping analysis.
* UA7805 DC path model
V1 vin 0 10V
Rload out 0 100
* Bandgap reference
R1 q5e q1c 1k
Q1 q1c q1b 0 NPN
Q7 q5e q1c q1b NPN
R10 q1b 0 6k
Q2 q4b q1b r3 NPN
R3 r3 0 1k
R2 q5e q4b 20k
* Error amplifier
Q4 q11b q4b q3b NPN
Q3 q11b q3b 0 NPN
R14 q3b 0 6k
Q11 0 q11b q9c PNP
R16 q9c q11b 6k
* Current mirror
R8 vin q8e 100
R9 vin q9e 100
Q8 q8b q8b q8e PNP
Q9 q9c q8b q9e PNP
* Feedback
Q10 q8b out q10e NPN
Q5 q10e q6e q5e NPN
Q6 out ref q6e NPN
R15 q6e q5e 6k
R19 ref 0 5k
R20 out ref 1.25k
* Output
Q16 vin q9c q17b NPN
Q17 vin q17b q17e NPN 10
R11 q17e out 0.3
R17 q17b out 200
* Start-up
R4 vin q12b 100k
D1 0 q12b DZ
R18 vin q12c 500
Q12 q12c q12b q12e NPN
R5 q12e q13b 3.3k
R6 q13b q14b 2.7k
R7 q14b 0 500
Q13 q8b q13b q5e NPN
.MODEL NPN NPN( IS=5f BF=80 VAF=100 CJC=1P CJE=2P )
.MODEL PNP PNP( IS=2f BF=60 VAF=50 CJC=1P CJE=2P )
.MODEL DZ D(BV=5.6)
* .options savecurrents
This model doesn't have output current limiting or over voltage protection circuits.
@d1[id] = -36.01 uA @q10[ib] = 17.75 uA @q10[ic] = 1478.53 uA @q11[ib] = -18.81 uA @q11[ic] = -1258.61 uA @q12[ib] = 8.85 uA @q12[ic] = 737.29 uA @q13[ib] = -0.00 uA @q13[ic] = 0.00 uA @q16[ib] = 50.07 uA @q16[ic] = 4146.83 uA @q17[ib] = 565.04 uA @q17[ic] = 47118.99 uA @q1[ib] = 17.64 uA @q1[ic] = 1420.20 uA @q2[ib] = 0.93 uA @q2[ic] = 75.08 uA @q3[ib] = 0.45 uA @q3[ic] = 38.27 uA @q4[ib] = 1.16 uA @q4[ic] = 97.18 uA @q5[ib] = 18.53 uA @q5[ic] = 1496.29 uA @q6[ib] = 1.62 uA @q6[ic] = 130.78 uA @q7[ib] = 1.61 uA @q7[ic] = 130.63 uA @q8[ib] = -23.86 uA @q8[ic] = -1431.82 uA @q9[ib] = -22.85 uA @q9[ic] = -1444.12 uA @r10[i] = 113.66 uA @r11[i] = 47684.03 uA @r14[i] = 97.89 uA @r15[i] = 113.87 uA @r16[i] = 116.64 uA @r17[i] = 3631.85 uA @r18[i] = 737.29 uA @r19[i] = 805.44 uA @r1[i] = 1421.81 uA @r20[i] = 807.06 uA @r2[i] = 76.24 uA @r3[i] = 76.02 uA @r4[i] = 44.86 uA @r5[i] = 746.14 uA @r6[i] = 746.14 uA @r7[i] = 746.14 uA @r8[i] = 1455.69 uA @r9[i] = 1466.97 uA @rload[i] = 50360.29 uA out = 5036.03 mV q10e = 4353.91 mV q11b = 5771.47 mV q12b = 5514.02 mV q12c = 9631.36 mV q12e = 4849.91 mV q13b = 2387.65 mV q14b = 373.07 mV q17b = 5762.40 mV q17e = 5050.33 mV q1b = 681.96 mV q1c = 1301.99 mV q3b = 587.34 mV q4b = 1198.93 mV q5e = 2723.81 mV q6e = 3407.03 mV q8b = 9148.40 mV q8e = 9854.43 mV q9c = 6471.34 mV q9e = 9853.30 mV r3 = 76.02 mV ref = 4027.21 mV v1#branch = -54970.62 uA vin = 10000.00 mV
print('Bias current = %.2f mA' % (54.971 - 50.36))
Bias current = 4.61 mA
The following is the simulation result of DC operating point.
Line regulation¶
The datasheet says the typical $\Delta V_\mathrm{OUT}$ is 3mV when $V_\mathrm{IN}$ changing from 7V to 25V. Our model is 1.7mV.
.dc v1 7 25 0.1
Text(0.5, 1.0, 'Line regulation')
delta Vout = 1.69 mV, ratio 0.094 mV / V
Load regulation¶
The datasheet says the typical $\Delta V_\mathrm{OUT}$ is 15mV when $I_\mathrm{OUT}$ changing from 5mA to 1.5A. Our model is 7.6mV.
.dc rload 3 1000 1
Text(0.5, 1.0, 'Load regulation')
delta Vout = 7.58 mV, Output resistance 0.0045 Ohm
Text(0, 0.5, 'Vout (V)')
Vin = 6.00 V, Vout = 4.543 V, Dropout 1.46 V Vin = 6.10 V, Vout = 4.638 V, Dropout 1.46 V Vin = 6.20 V, Vout = 4.733 V, Dropout 1.47 V Vin = 6.30 V, Vout = 4.827 V, Dropout 1.47 V Vin = 6.40 V, Vout = 4.922 V, Dropout 1.48 V Vin = 6.50 V, Vout = 5.000 V, Dropout 1.50 V Vin = 6.60 V, Vout = 5.029 V, Dropout 1.57 V Vin = 6.70 V, Vout = 5.037 V, Dropout 1.66 V Vin = 6.80 V, Vout = 5.037 V, Dropout 1.76 V Vin = 6.90 V, Vout = 5.037 V, Dropout 1.86 V Vin = 7.00 V, Vout = 5.037 V, Dropout 1.96 V
Feedback¶
@q10[ib] 17.756 uA, 17.712 uA, delta -0.043 uA @q10[ic] 1478.852 uA, 1475.309 uA, delta -3.542 uA @q10[ie] -1496.607 uA, -1493.022 uA, delta 3.586 uA @q11[ib] -19.025 uA, -16.310 uA, delta 2.715 uA @q11[ic] -1271.141 uA, -1099.414 uA, delta 171.727 uA @q11[ie] 1290.166 uA, 1115.724 uA, delta -174.443 uA @q16[ib] 38.507 uA, 208.012 uA, delta 169.505 uA @q16[ic] 3192.112 uA, 17161.973 uA, delta 13969.861 uA @q16[ie] -3230.619 uA, -17369.985 uA, delta -14139.367 uA @q17[ib] 33.088 uA, 11912.617 uA, delta 11879.529 uA @q17[ic] 2761.489 uA, 989954.471 uA, delta 987192.982 uA @q17[ie] -2794.577 uA, -1001867.088 uA, delta -999072.511 uA @q1[ib] 17.647 uA, 17.603 uA, delta -0.044 uA @q1[ic] 1420.520 uA, 1416.993 uA, delta -3.527 uA @q1[ie] -1438.167 uA, -1434.596 uA, delta 3.571 uA @q2[ic] 75.086 uA, 75.038 uA, delta -0.048 uA @q2[ie] -76.020 uA, -75.972 uA, delta 0.048 uA @q3[ib] 0.458 uA, 0.420 uA, delta -0.038 uA @q3[ic] 38.501 uA, 35.513 uA, delta -2.988 uA @q3[ie] -38.959 uA, -35.933 uA, delta 3.026 uA @q4[ib] 1.163 uA, 1.153 uA, delta -0.010 uA @q4[ic] 97.215 uA, 96.819 uA, delta -0.396 uA @q4[ie] -98.378 uA, -97.971 uA, delta 0.406 uA @q5[ib] 18.532 uA, 18.488 uA, delta -0.044 uA @q5[ic] 1496.607 uA, 1493.022 uA, delta -3.586 uA @q5[ie] -1515.139 uA, -1511.509 uA, delta 3.630 uA @q6[ic] 130.785 uA, 130.732 uA, delta -0.054 uA @q6[ie] -132.404 uA, -132.349 uA, delta 0.055 uA @q7[ic] 130.632 uA, 130.577 uA, delta -0.054 uA @q7[ie] -132.242 uA, -132.187 uA, delta 0.055 uA @q8[ib] -23.869 uA, -23.809 uA, delta 0.060 uA @q8[ic] -1432.166 uA, -1428.562 uA, delta 3.604 uA @q8[ie] 1456.035 uA, 1452.371 uA, delta -3.664 uA @q9[ib] -22.817 uA, -22.939 uA, delta -0.121 uA @q9[ic] -1444.879 uA, -1439.069 uA, delta 5.810 uA @q9[ie] 1467.696 uA, 1462.007 uA, delta -5.689 uA @r10[i] 113.661 uA, 113.650 uA, delta -0.011 uA @r11[i] 2794.577 uA, 1001867.087 uA, delta 999072.510 uA @r14[i] 97.920 uA, 97.551 uA, delta -0.369 uA @r15[i] 113.872 uA, 113.862 uA, delta -0.010 uA @r16[i] 116.695 uA, 116.031 uA, delta -0.664 uA @r17[i] 3197.531 uA, 5457.368 uA, delta 2259.837 uA @r19[i] 805.507 uA, 804.772 uA, delta -0.735 uA @r1[i] 1422.130 uA, 1418.602 uA, delta -3.527 uA @r20[i] 807.125 uA, 806.390 uA, delta -0.735 uA @r2[i] 76.249 uA, 76.191 uA, delta -0.058 uA @r3[i] 76.020 uA, 75.972 uA, delta -0.048 uA @r8[i] 1456.034 uA, 1452.371 uA, delta -3.664 uA @r9[i] 1467.696 uA, 1462.007 uA, delta -5.689 uA @rload[i] 5036.441 uA, 1006369.621 uA, delta 1001333.180 uA out 5036.441 mV, 5031.848 mV, delta -4.593 mV q10e 4354.317 mV, 4349.787 mV, delta -4.530 mV q11b 5677.925 mV, 6172.910 mV, delta 494.985 mV q12b 5514.025 mV, 5514.025 mV, delta -0.000 mV q12c 9631.356 mV, 9631.356 mV, delta -0.000 mV q12e 4849.905 mV, 4849.905 mV, delta -0.000 mV q13b 2387.646 mV, 2387.646 mV, delta -0.000 mV q14b 373.070 mV, 373.070 mV, delta -0.000 mV q17b 5675.948 mV, 6123.322 mV, delta 447.374 mV q17e 5037.280 mV, 5332.408 mV, delta 295.129 mV q1b 681.965 mV, 681.901 mV, delta -0.064 mV q1c 1302.001 mV, 1301.927 mV, delta -0.074 mV q3b 587.518 mV, 585.306 mV, delta -2.212 mV q4b 1199.144 mV, 1196.704 mV, delta -2.440 mV q5e 2724.131 mV, 2720.530 mV, delta -3.602 mV q6e 3407.362 mV, 3403.699 mV, delta -3.663 mV q8b 9148.360 mV, 9148.792 mV, delta 0.432 mV q8e 9854.397 mV, 9854.763 mV, delta 0.366 mV q9c 6378.094 mV, 6869.097 mV, delta 491.002 mV q9e 9853.230 mV, 9853.799 mV, delta 0.569 mV r3 76.020 mV, 75.972 mV, delta -0.048 mV ref 4027.535 mV, 4023.861 mV, delta -3.674 mV v1#branch -9659.479 uA, -1010812.969 uA, delta -1001153.490 uA vin 10000.000 mV, 10000.000 mV, delta 0.000 mV
Fixing tempco¶
0.33500589559324734
Changing $R_2$
R2 = 31 k, Vout@27C = 6.579 V, delta Vout = 167.9 mV R2 = 30 k, Vout@27C = 6.433 V, delta Vout = 120.4 mV R2 = 29 k, Vout@27C = 6.289 V, delta Vout = 73.1 mV R2 = 28 k, Vout@27C = 6.145 V, delta Vout = 26.4 mV R2 = 27 k, Vout@27C = 6.002 V, delta Vout = -20.1 mV R2 = 26 k, Vout@27C = 5.861 V, delta Vout = -66.2 mV R2 = 25 k, Vout@27C = 5.720 V, delta Vout = -112.0 mV R2 = 24 k, Vout@27C = 5.581 V, delta Vout = -157.4 mV R2 = 23 k, Vout@27C = 5.443 V, delta Vout = -202.4 mV R2 = 22 k, Vout@27C = 5.306 V, delta Vout = -247.1 mV R2 = 21 k, Vout@27C = 5.170 V, delta Vout = -291.2 mV R2 = 20 k, Vout@27C = 5.036 V, delta Vout = -335.0 mV
<matplotlib.legend.Legend at 0x7f05fbb63a10>
# R2 was 20k
r2 = 27
ng.cmd('alter r2 %d' % (r2*1000))
print_op()
out = 6002.43 mV q10e = 5309.48 mV q11b = 6736.01 mV q12b = 5514.02 mV q12c = 9631.36 mV q12e = 4849.91 mV q13b = 2387.65 mV q14b = 373.07 mV q17b = 6736.82 mV q17e = 6019.68 mV q1b = 692.90 mV q1c = 1314.85 mV q3b = 593.50 mV q4b = 1205.16 mV q5e = 3484.24 mV q6e = 4178.00 mV q8b = 9064.39 mV q8e = 9780.98 mV q9c = 7446.98 mV q9e = 9780.26 mV r3 = 84.28 mV ref = 4800.19 mV v1#branch = -66272.01 uA vin = 10000.00 mV
0.020429764616625157
Bring back the output voltage by adjusting $R_{20}$
# R20 was 1.2k
ng.cmd('alter r20 230')
ng.cmd('dc temp 0 100 1')
temp = ng.vector('temp-sweep')
vout = ng.vector('out')
plt.plot(temp, vout)
print(max(vout) - min(vout))
0.01647117642314555
Changing $V_\mathrm{BE}$?
ng.circ('''
V1 vin 0 10V
Rload out 0 100
* Bandgap reference
R1 q5e q1c 1k
Q1 q1c q1b 0 NPN
Q7 q5e q1c q1b NPN
R10 q1b 0 6k
Q2 q4b q1b r3 NPN
R3 r3 0 1k
R2 q5e q4b 20k
* Error amplifier
Q4 q11b q4b q3b NPN 0.1
Q3 q11b q3b 0 NPN 0.1
R14 q3b 0 6k
Q11 0 q11b q9c PNP
R16 q9c q11b 6k
* Current mirror
R8 vin q8e 100
R9 vin q9e 100
Q8 q8b q8b q8e PNP
Q9 q9c q8b q9e PNP
* Feedback
Q10 q8b out q10e NPN
Q5 q10e q6e q5e NPN 0.1
Q6 out ref q6e NPN 0.1
R15 q6e q5e 6k
R19 ref 0 5k
R20 out ref 1.25k
* Output
Q16 vin q9c q17b NPN
Q17 vin q17b q17e NPN 10
R11 q17e out 0.3
R17 q17b out 200
* Start-up
R4 vin q12b 100k
D1 0 q12b DZ
R18 vin q12c 500
Q12 q12c q12b q12e NPN
R5 q12e q13b 3.3k
R6 q13b q14b 2.7k
R7 q14b 0 500
Q13 q8b q13b q5e NPN
* .options savecurrents
.MODEL NPN NPN( IS=5f BF=80 VAF=100 CJC=1P CJE=2P )
.MODEL PNP PNP( IS=2f BF=60 VAF=50 CJC=1P CJE=2P )
.MODEL DZ D(BV=5.6)
''')
ng.cmd('dc temp 0 100 1')
temp = ng.vector('temp-sweep')
vout = ng.vector('out')
plt.plot(temp, vout, label='Area = 0.1')
print(max(vout) - min(vout))
ng.cmd('alter @q3[area] = 0.01')
ng.cmd('alter @q4[area] = 0.01')
ng.cmd('alter @q5[area] = 0.01')
ng.cmd('alter @q6[area] = 0.01')
# print_op()
ng.cmd('dc temp 0 100 1')
temp = ng.vector('temp-sweep')
vout = ng.vector('out')
plt.plot(temp, vout, label='Area = 0.01')
print(max(vout) - min(vout))
plt.legend()
0.21101409673965943 0.09132583609916978
<matplotlib.legend.Legend at 0x7efe1a8a4f10>
LM7805¶
Simplified schematic¶
Estimating DC operating point, ignoring base currents (assuming $\beta \gg 1$).
R4 sets Ic2, R5 sets Ic4:
$\uv{R4} = \uv{B3} \approx \uv{R5} = \uv{B5}$, $\ui{R4}\,R_4\approx \ui{R5}\,R_5$
$\ui{R4}\approx\ui{E2}$, $\ui{R5}\approx\ui{E4}$, $\dfrac{\ui{E2}}{\ui{E4}} \approx\dfrac{R_5}{R_4} = 10.08$
$\uv{BE2}-\uv{BE4} = \uv{T}\ln \dfrac{\ui{E2}}{\ui{E4}} = \uv{T}\ln 10.08$
Similarly, R2 sets Ic3, R7 sets Ic5.
$\uv{R2} \approx \uv{R7}$, because their lower end is $2\uv{BE}$ from GND ($\uv{BE2}+\uv{BE3}\approx\uv{BE7}+\uv{BE8}$), higher end is $\uv{REF} - \uv{BE}$ ($\uv{BE1}\approx\uv{BE6}$)
$\ui{R2}\,R_2\approx \ui{R7}\,R_7$, while $\ui{R2}\approx\ui{C3}$ and $\ui{R7}\approx\ui{C5}$
$\dfrac{\ui{C3}}{\ui{C5}}=\dfrac{R_7}{R_2}=8.68$
$\uv{BE3}-\uv{BE5} = \uv{T}\ln \dfrac{\ui{E3}}{\ui{E5}} = \uv{T}\ln 8.68$
Voltage on R6 $\uv{R6} = \uv{BE2}+\uv{BE3} - \uv{BE4} - \uv{BE5} = \uv{T}\ln\dfrac{R_5\,R_7}{R_4\,R_2} = \uv{T}\ln 87.6\approx 115.4$mV
Voltage on R7 $\uv{R7} = \dfrac{R_7}{R_6}\uv{R6}=16.5\times\uv{R6}\approx 1.90$V
$\uv{REF}= \uv{B1}=\uv{B6} \approx \uv{R7}+3\uv{BE} = 1.90 + 3\times 0.65 = 3.85$V
ng.circ('''
V1 vcc 0 10
Rload out 0 100
X1 vcc 0 out LM7805
.options savecurrents
.SUBCKT LM7805 Vin GND Out
* In GND Out
Q1 q1c fb q1e Q_NPN 0.1
Q2 q1e q2b q3b Q_NPN 0.1
Q3 q4b q3b GND Q_NPN 0.1
C2 q3b q4b 4p
R2 q1e q2b 1.9K
R3 q2b q4b 26
R4 q3b GND 1.2K
R5 q5b GND 12.1K
R6 q5e GND 1K
R7 q6e q7b 16.5K
R8 q9e GND 4K
Q4 q6e q4b q5b Q_NPN 0.1
Q5 q7b q5b q5e Q_NPN 0.1
C1 q7b q10b 20P
Q6 q16b fb q6e Q_NPN 0.1
Q7 q10b q7b q8b Q_NPN 0.1
Q8 q10b q8b GND Q_NPN 0.1
Dq9 q8b q9e D_D
Q10 GND q10b q10e Q_PNP 0.1
R9 q10e q10b 4K
R10 q15b q10e 850
Q11 q11c q11c Vin Q_PNP 0.1
Q11o q15b q11c Vin Q_PNP 0.1
Q12 Vin q12b q17b Q_NPN 0.1
DZ1 GND q12b D_5V6
R1 Vin q12b 80K
Q13 q15b q13b GND Q_NPN 0.1
R13 q13b GND 830
R11 q18b q13b 4.97K
Q14 q15b q14b q14e Q_NPN 1
R14 q14b q16e 380
R15 q14b q16b 1.62K
R19 q14e Out 100
DZ2 q14b dz2k D_5V1
R17 Vin dz2k 16K
Q15 Vin q15b q16b Q_NPN 1
Q16 Vin q16b q16e Q_NPN 10
R16 q16e Out 250m
Q17 q11c q17b q1c Q_NPN 0.1
Q18 q11c q18b q18e Q_NPN 0.1
R12 q17b q18b 7K
R18 q18e q1e 500
R20 Out fb 640
R21 fb GND 2.67K
.MODEL D_5V1 D( IS=10F N=1.16 BV=5.1 IBV=0.5M CJ0 = 1P TT = 10p )
.MODEL D_5V6 D( IS=10F N=1.16 BV=5.6 IBV=5U CJ0 = 1P TT = 10p )
.MODEL Q_NPN NPN( IS=10F NF=1.16 NR=1.16 BF=80 CJC=1P CJE=2P TF=10P TR=1N )
.MODEL Q_PNP PNP( IS=10F NF=1.16 NR=1.16 BF=80 CJC=1P CJE=2P TF=10P TR=1N )
.MODEL D_D D( IS=1F N=1.16 CJ0 = 1P TT = 10p )
.ENDS LM7805
''')
x = print_op(1, 1)
@c.x1.c1[i] = 0.00 uA @c.x1.c2[i] = 0.00 uA @d.x1.dq9[id] = 18.12 uA @d.x1.dz1[id] = -49.22 uA @d.x1.dz2[id] = -0.06 uA @q.x1.q10[ib] = -14.86 uA @q.x1.q10[ic] = -1188.51 uA @q.x1.q10[ie] = 1203.37 uA @q.x1.q11[ib] = -17.84 uA @q.x1.q11[ic] = -1426.88 uA @q.x1.q11[ie] = 1444.72 uA @q.x1.q11o[ib] = -17.84 uA @q.x1.q11o[ic] = -1426.88 uA @q.x1.q11o[ie] = 1444.72 uA @q.x1.q12[ib] = 4.92 uA @q.x1.q12[ic] = 393.64 uA @q.x1.q12[ie] = -398.56 uA @q.x1.q13[ib] = -0.00 uA @q.x1.q13[ic] = 0.00 uA @q.x1.q13[ie] = -0.00 uA @q.x1.q14[ib] = -0.00 uA @q.x1.q14[ic] = 0.00 uA @q.x1.q14[ie] = -0.00 uA @q.x1.q15[ib] = 14.96 uA @q.x1.q15[ic] = 1197.17 uA @q.x1.q15[ie] = -1212.13 uA @q.x1.q16[ib] = 631.50 uA @q.x1.q16[ic] = 50520.31 uA @q.x1.q16[ie] = -51151.81 uA @q.x1.q17[ib] = 18.28 uA @q.x1.q17[ic] = 1462.56 uA @q.x1.q17[ie] = -1480.84 uA @q.x1.q18[ib] = -0.00 uA @q.x1.q18[ic] = 0.00 uA @q.x1.q18[ie] = -0.00 uA @q.x1.q1[ib] = 18.51 uA @q.x1.q1[ic] = 1480.84 uA @q.x1.q1[ie] = -1499.35 uA @q.x1.q2[ib] = 8.59 uA @q.x1.q2[ic] = 686.82 uA @q.x1.q2[ie] = -695.41 uA @q.x1.q3[ib] = 10.04 uA @q.x1.q3[ic] = 803.04 uA @q.x1.q3[ie] = -813.08 uA @q.x1.q4[ib] = 0.90 uA @q.x1.q4[ic] = 72.25 uA @q.x1.q4[ie] = -73.15 uA @q.x1.q5[ib] = 1.33 uA @q.x1.q5[ic] = 106.07 uA @q.x1.q5[ie] = -107.40 uA @q.x1.q6[ib] = 2.20 uA @q.x1.q6[ic] = 176.37 uA @q.x1.q6[ie] = -178.58 uA @q.x1.q7[ib] = 0.26 uA @q.x1.q7[ic] = 20.40 uA @q.x1.q7[ie] = -20.66 uA @q.x1.q8[ib] = 2.54 uA @q.x1.q8[ic] = 203.00 uA @q.x1.q8[ie] = -205.54 uA @r.x1.r10[i] = 1411.92 uA @r.x1.r11[i] = 380.28 uA @r.x1.r12[i] = 380.28 uA @r.x1.r13[i] = 380.28 uA @r.x1.r14[i] = 404.32 uA @r.x1.r15[i] = -404.26 uA @r.x1.r16[i] = 51556.13 uA @r.x1.r17[i] = 0.06 uA @r.x1.r18[i] = -0.00 uA @r.x1.r19[i] = 0.00 uA @r.x1.r1[i] = 54.14 uA @r.x1.r20[i] = 1528.13 uA @r.x1.r21[i] = 1507.41 uA @r.x1.r2[i] = 812.53 uA @r.x1.r3[i] = 803.94 uA @r.x1.r4[i] = 685.37 uA @r.x1.r5[i] = 71.83 uA @r.x1.r6[i] = 107.40 uA @r.x1.r7[i] = 106.33 uA @r.x1.r8[i] = 18.12 uA @r.x1.r9[i] = 208.55 uA @rload[i] = 50028.00 uA out = 5002.80 mV v1#branch = -55054.76 uA vcc = 10000.00 mV x1.dz2k = 9999.02 mV x1.fb = 4024.80 mV x1.q10b = 4555.23 mV x1.q10e = 5389.43 mV x1.q11c = 9160.31 mV x1.q12b = 5668.61 mV x1.q13b = 315.63 mV x1.q14b = 5169.33 mV x1.q14e = 5002.80 mV x1.q15b = 6589.56 mV x1.q16b = 5824.22 mV x1.q16e = 5015.69 mV x1.q17b = 4867.57 mV x1.q18b = 2205.62 mV x1.q18e = 3184.00 mV x1.q1c = 4027.14 mV x1.q1e = 3184.00 mV x1.q2b = 1640.19 mV x1.q3b = 822.44 mV x1.q4b = 1619.29 mV x1.q5b = 869.10 mV x1.q5e = 107.40 mV x1.q6e = 3247.84 mV x1.q7b = 1493.43 mV x1.q8b = 781.18 mV x1.q9e = 72.49 mV
Quiescent current¶
ng.cmd('alter rload 1k')
print_op()
out = 5002.84 mV v1#branch = -10036.89 uA vcc = 10000.00 mV x1.dz2k = 9997.95 mV x1.fb = 4024.83 mV x1.q10b = 4454.26 mV x1.q10e = 5288.64 mV x1.q11c = 9160.31 mV x1.q12b = 5668.61 mV x1.q13b = 315.63 mV x1.q14b = 5146.06 mV x1.q14e = 5002.84 mV x1.q15b = 6494.95 mV x1.q16b = 5749.49 mV x1.q16e = 5004.47 mV x1.q17b = 4867.57 mV x1.q18b = 2205.62 mV x1.q18e = 3184.02 mV x1.q1c = 4027.14 mV x1.q1e = 3184.02 mV x1.q2b = 1640.19 mV x1.q3b = 822.44 mV x1.q4b = 1619.29 mV x1.q5b = 869.10 mV x1.q5e = 107.40 mV x1.q6e = 3247.87 mV x1.q7b = 1493.46 mV x1.q8b = 781.20 mV x1.q9e = 72.50 mV
print(10.03689 - 5.00284)
5.03405
Input¶
Vin = 6.00V, Vout = 4.4677 V Vin = 6.10V, Vout = 4.5664 V Vin = 6.20V, Vout = 4.6651 V Vin = 6.30V, Vout = 4.7637 V Vin = 6.40V, Vout = 4.8619 V Vin = 6.50V, Vout = 4.9580 V Vin = 6.60V, Vout = 5.0014 V Vin = 6.70V, Vout = 5.0029 V Vin = 6.80V, Vout = 5.0029 V Vin = 6.90V, Vout = 5.0028 V Vin = 7.00V, Vout = 5.0028 V
Line regulation¶
0.01970506928827831
[<matplotlib.lines.Line2D at 0x7f2bead16f10>]
0.9663296921011977
[<matplotlib.lines.Line2D at 0x7f2beadf9a50>]
Load regulation¶
ng.cmd('dc rload 3 1000 1')
rload = ng.vector('res-sweep')
vout = ng.vector('out')
iout = vout / rload
plt.plot(iout, vout)
delta = (vout[-1] - vout[0])
print('delta Vout = %.2f mV, in %.4f Ohm' % (1e3 * delta, delta / (iout[0] - iout[-1])))
delta Vout = 1.39 mV, in 0.0008 Ohm
Short-circuit¶
ng.cmd('dc rload 0.1 5 0.1')
rload = ng.vector('res-sweep')
vout = ng.vector('out')
iout = vout / rload
plt.plot(iout, vout)
delta = (vout[-1] - vout[0])
print(vout[0])
0.1716012232593159
Tempco¶
ng.cmd('dc temp 0 100 1')
plt.plot(ng.vector('temp-sweep'), ng.vector('out'))
print(max(ng.vector('out')) - min(ng.vector('out')))
print(119/150)
print(97.6 / 100)
0.09759713480243715 0.7933333333333333 0.976