Skip to content

Commit

Permalink
Merge pull request #31 from simi1505/simi
Browse files Browse the repository at this point in the history
Read through Xmas update Sec. 8.7 / 11 / 12
  • Loading branch information
hpretl authored Jan 7, 2025
2 parents 6990cfd + 4d55ef5 commit be04fd8
Show file tree
Hide file tree
Showing 7 changed files with 4,609 additions and 5 deletions.
4 changes: 2 additions & 2 deletions content/_sec_basic_ota.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ Being a single-stage amplifier stability is usually not an issue, as only the ou
{{< include ./figures/_fig_ota_se_r2r.qmd >}}
Another popular version is shown in @fig-ota-se-twostage. Here, we have a two-stage amplifier able to provide higher voltage gain. The first stage (the diffpair loaded by a current mirror) is followed by a single-stage common-source amplifier with current-source load. Being a two-stage amplifier with two high-ohmic nodes, stability is a concern, so usually we need some form of compensation (in @fig-ota-se-twostage a very simplistic Miller-compensation using $C_\mathrm{M}$ is shown; often, we would want to implement a more advanced scheme). An advantage of this two-stage amplifier (compared with the simple 5T-OTA) is the dc-balanced load on top of the differential pair, as each side sees a voltage drop from $\VDD$ of one $\VGS$ ($\VGS[3]$ on the left side, $\VGS[5]$ on the right side).
Another popular version is shown in @fig-ota-se-twostage. Here, we have a two-stage amplifier able to provide higher voltage gain. The first stage (the diffpair loaded by a current mirror) is followed by a single-stage common-source amplifier with current-source load. Being a two-stage amplifier with two high-ohmic nodes, stability is a concern, so usually we need some form of compensation. @fig-ota-se-twostage shows a very simplistic Miller-compensation using $C_\mathrm{M}$. Often, we would want to implement a more advanced scheme. Some examples can be found in [@Baker_compensating_OPAMP]. An interesting technique is the indirect compensation with cascoded input differential pairs (see @fig-improved-ota) for higher power supply rejection. An advantage of this two-stage amplifier (compared with the simple 5T-OTA) is the dc-balanced load on top of the differential pair, as each side sees a voltage drop from $\VDD$ of one $\VGS$ ($\VGS[3]$ on the left side, $\VGS[5]$ on the right side).
{{< include ./figures/_fig_ota_se_twostage.qmd >}}
Expand All @@ -326,4 +326,4 @@ $$
V_\mathrm{out} \approx V_\mathrm{ref} \left( 1 + \frac{R_1}{R_2} \right)
$$
if the gain of the OTA is sufficiently high. The quiescent current through $R_{1,2}$ established a minimum load current for the LDO, which is often a good thing for stability. More information on LDOs can be found in [@Razavi_2019_ldo].
if the gain of the OTA is sufficiently high. The quiescent current through $R_{1,2}$ establishes a minimum load current for the LDO, which is often good for stability. More information on LDOs can be found in [@Razavi_2019_ldo].
10 changes: 8 additions & 2 deletions content/_sec_biasing.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,19 @@ $$
V_\mathrm{ref} = \VBE + \frac{R_2}{R_1} \frac{k T}{q} \ln m.
$$
By proper selection of $R_1$, $R_2$ and $n$ we can satisfy @eq-bandgap-voltage-with-temp to result in @eq-bandgap-voltage.
By proper selection of $R_1$, $R_2$ and $m$ we can satisfy @eq-bandgap-voltage-with-temp to result in @eq-bandgap-voltage.
::: {.callout-note title="Improved Bandgap Reference"}
For an improved implementation of @fig-bandgap-simple, the current mirrors should be cascoded, and a startup circuit should be included to guarantee proper operation after enabling it. Further, @eq-vbe-vs-temp and @eq-delta-vbe-vs-temp build on the relationship $I_\mathrm{C} = f(\VBE)$, while we control $I_\mathrm{E}$ in this circuit. If $\beta$ is large then $I_\mathrm{C} \approx I_\mathrm{E}$, but this is not the case for the used PNPs.
:::
The circuit of @fig-bandgap-simple has been implemented in Xschem and is shown in @fig-bandgap-schematic. The current sources have been improved by using cascodes. No base current compensation is implemented, as it is assumed that the $\beta$ of the PNP are similar although they are operated at different emitter current densities. Note the addition of a startup branch with $M_\mathrm{startup}$ which is inactive during normal operation but will inject a startup current if no proper bias point has yet been found. There is no circuitry added for enabling/disabling the circuit, which would also be needed for a practical implementation. As usual, the MOSFET sizing has been done in this [notebook](sizing/sizing_bandgap_simple.ipynb).
The circuit of @fig-bandgap-simple has been implemented in Xschem and is shown in @fig-bandgap-schematic. The current sources have been improved by using cascodes. We are using the low-voltage current mirror type already introduced in @sec-improved-ota. The bias voltages for the cascodes are generated via the voltage drops of $R_3$ and $R_4$, respectively.
No base current compensation for the BJTs is implemented, as it is assumed that the $\beta$ of the PNP are similar although they are operated at different emitter current densities.
Note the addition of a startup branch with $M_\mathrm{startup}$ which is inactive during normal operation but will inject a startup current if no proper bias point has yet been found.
There is no circuitry added for enabling/disabling the circuit, which would also be needed for a practical implementation. As usual, the MOSFET sizing has been done in this [notebook](sizing/sizing_bandgap_simple.ipynb).
The resistors $R_{1-4}$ have been implemented out of unit elements of ca. $5\,\text{k}\Omega$ for optimum matching. Building a bandgap for the first time on silicon likely will show a slightly deviating temperature coefficient, which is why we keep a few dummy resistors around in $R_2$ to compensate the TC in a redesign.
Expand Down
2 changes: 2 additions & 0 deletions content/_sec_differential_ota.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ For differential operation, the differential pair of $M_{1,2}$ is loaded by $R_\

As soon as we implement a two-stage amplifier we need to look into stability. We likely have more than two poles, and in the case of the amplifier in @fig-diff-ota-resload we have a low-frequency pole at the drains of $M_{1,3}$ and $M_{2,5}$ and a further low-frequency pole at the output. Any additional pole will add further phase shift making stability critical. We now need a method to stabilize this amplifier and thus we will look into *Miller compensation*.

Of course, loop gain analysis of differential OTAs can and should be carried out. An exemplary testbench where the loop gain is simulated with Rosenstark's, Middlebrook's, and Tian's method can be found [here](xschem/ota-differential_tb-loopgain.sch). Note that there is no underlying circuit right now and it should only show how it could be done.

## Miller Compensation

A popular way to stabilize a multi-pole feedback-system is to make one pole dominant, and try to shift the other poles to sufficiently high frequencies, that we have enough [phase margin](https://en.wikipedia.org/wiki/Phase_margin) in the closed-loop system. We may strive for $60^\circ$ as this will only cause a minor peaking in the frequency response [@Gray_Meyer_5th_ed].
Expand Down
5 changes: 4 additions & 1 deletion references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
%% Saved with string encoding Unicode (UTF-8)
@online{Baker_compensating_OPAMP,
author={R. J. Baker},
title={Bad Circuit Design 3 - Compensating an Op-Amp},
url={https://cmosedu.com/cmos1/bad_design/bad_design3/bad_design_3.htm}}

@article{Razavi_2021_bandgap,
author = {Razavi, Behzad},
Expand Down
65 changes: 65 additions & 0 deletions xschem/ota-differential.sym
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
v {xschem version=3.4.6 file_version=1.2}
G {}
K {type=subcircuit
format="@name @pinlist @symname"
template="name=x1"
}
V {}
S {}
E {}
L 4 80 20 100 20 {}
L 4 80 -20 100 -20 {}
L 4 20 -100 20 -80 {}
L 4 -80 40 -60 40 {}
L 4 -80 -40 -60 -40 {}
L 4 -7.5 -45 -7.5 -40 {}
L 4 -7.5 -40 -7.5 -35 {}
L 4 -12.5 -40 -7.5 -40 {}
L 4 -7.5 -40 -2.5 -40 {}
L 4 -7.5 40 -2.5 40 {}
L 4 -12.5 40 -7.5 40 {}
L 4 -20 -60 -20 0 {}
L 4 -20 0 -20 60 {}
L 4 -40 -40 -20 -40 {}
L 4 -40 40 -20 40 {}
L 4 -60 -40 -40 -40 {}
L 4 -60 40 -40 40 {}
L 4 -20 -60 40 -30 {}
L 4 -20 60 40 30 {}
L 4 40 -30 40 30 {}
L 4 40 20 80 20 {}
L 4 40 -20 80 -20 {}
L 4 0 50 0 80 {}
L 4 0 -80 0 -50 {}
L 4 20 -80 20 -40 {}
L 4 -80 0 -60 0 {}
L 4 -60 -0 -20 0 {}
L 4 27.5 -20 32.5 -20 {}
L 4 22.5 -20 27.5 -20 {}
L 4 27.5 15 27.5 20 {}
L 4 27.5 20 27.5 25 {}
L 4 22.5 20 27.5 20 {}
L 4 27.5 20 32.5 20 {}
L 7 0 -100 0 -80 {}
L 7 0 80 0 100 {}
B 5 97.5 17.5 102.5 22.5 {name=voutp dir=out}
B 5 97.5 -22.5 102.5 -17.5 {name=voutn dir=out}
B 5 17.5 -102.5 22.5 -97.5 {name=di_amp_core_en dir=in}
B 5 -82.5 37.5 -77.5 42.5 {name=vinn dir=in}
B 5 -82.5 -42.5 -77.5 -37.5 {name=vinp dir=in}
B 5 -2.5 -102.5 2.5 -97.5 {name=VDD dir=inout}
B 5 -2.5 97.5 2.5 102.5 {name=VSS dir=inout}
B 5 -82.5 -2.5 -77.5 2.5 {name=Vcm dir=in}
P 4 5 -60 -80 80 -80 80 80 -60 80 -60 -80 {}
T {voutp} 117.5 1 0 1 0.2 0.2 {}
T {voutn} 117.5 -39 0 1 0.2 0.2 {}
T {di_amp_core_en} 112.5 -92.25 2 0 0.2 0.2 {}
T {vinn} -90 21 0 0 0.2 0.2 {}
T {vinp} -90 -59 0 0 0.2 0.2 {}
T {@symname} 39.875 114 0 0 0.2 0.2 {}
T {@name} 40 90.5 0 0 0.2 0.2 {}
T {VDD} -10 -104 0 1 0.2 0.2 {}
T {VSS} -30 104 2 1 0.2 0.2 {}
T {Differential
OTA} 77.5 -77.5 0 1 0.19 0.19 {}
T {Vcm} -90 -19 0 0 0.2 0.2 {}
Loading

0 comments on commit be04fd8

Please sign in to comment.