Gas station without pumps

2013 July 7

2-op-amp instrumentation amp

Filed under: Circuits course — gasstationwithoutpumps @ 20:50
Tags: , , , , , , , ,

Last summer, I tried building an instrumentation amp using the MCP6002 op amps and external discrete resistors, and ended up with an amplifier that had terrible common-mode rejection, which is why I decided to use the INA126P instrumentation amp chip for the Blinky EKG boards and for the instrumentation amp protoboards.

I think I’d like to revisit that idea though, to see if I can make a cheaper Blinky EKG.  If I put together a Blinky EKG kit with the current design, the parts would cost about $9.30 (buying quantities of 100). The mist expensive single part is the instrumentation amp at$2.44.  If I could get the 2-op amp instrumentation amp to work using discrete components, I might be able to save most of that.  Replacing them MCP6002 dual op amp with an MCP6004 quad op amp and 4 more resistors would cost about 22¢ rather than $2.44, bring the parts cost down to around$7.07.

I could also reduce the price by using surface-mount devices (SMDs) instead of through-hole components. An instrumentation amp like the INA826 (\$1.34 in 100s) would be a good choice if I went with SMDs. But if I used SMDs, the Blinky EKG would probably have to be a finished product rather than a kit, which would add substantial manufacturing costs, especially for things like a case, which could be omitted in a kit. The idea of a blinky board is to be an easy soldering project for beginners, so I’m not sure that a pre-assembled blinky EKG has much appeal for me (which is not to say there is no market for it, just that I’m not particularly interested in designing for that market).

I looked at my old post and realized that I had miscomputed the gain for the differential signal, and never computed the gain for the common-mode signal.  If the resistors are perfectly matched, the common-mode gain is 0, but without the laser trimming that makes the instrumentation amp chips so expensive, we’re not going to get perfect matching.  The classic approach of adding trimpots takes up too much space and ends up costing almost as much as using an instrumentation amp chip.

So the rest of this post is dedicated to better understanding the 2-op-amp instrumentation amp.  I drew a schematic of a possible design, in order to have names for the parts and signals.

Schematic drawn with SchemeIt and captured as a screenshot. The native exports into PNG and PDF formats were useless, because SchemeIt messed up the Unicode character Ω. I also had to do this as a 24-bit PNG, because WordPress.com seems to mess up 8-bit PNGs (they look fine when editing, but not in the Preview.)

To analyze the circuit assuming ideal op amps (so the voltage difference between the two inputs of the op amp is 0), we need to look at the current through each resistor:

$I_{1} = (V_{out} - V_{p}) /R_{1}$
$I_{2} = (V_{p} - V_{mid}) /R_{2}$
$I_{3} = (V_{mid} - V_{m}) /R_{3}$
$I_{4} = (V_{m} - V_{ref}) /R_{4}$
$I_{gain} = (V_{p} - V_{m}) /R_{gain}$

We also have that
$I_{1} = I_{2}+ I_{gain}$ and $I_{4} = I_{3} + I_{gain}$, by Kirchhoff’s current law.

We can add to get $I_{1} + I_{4} = I_{2} + I_{3} + 2 I_{gain}$, which can be expressed as
$(V_{out} - V_{p}) /R_{1} + (V_{m} - V_{ref}) /R_{4} =$
$(V_{p} - V_{mid}) /R_{2} + (V_{mid} - V_{m}) /R_{3} + 2 (V_{p} - V_{m}) /R_{gain}$

If $R_{1}=R_{4}$ and $R_{2}=R_{3}$, then we can multiply both sides by $R_{1}$ to get
$V_{out}-V_{ref} - (V_{p}-V_{m}) = R_{1} (V_{p}-V_{m}) (1/R_{2} +2 /R_{gain})$,
or
$\frac{V_{out}-V_{ref}}{V_{p}-V_{m}} = 1+ R_{1}/R_{2} + 2 R_{1}/R_{gain}$.

For the values in the schematic above the differential gain is 6.6 + 112kΩ/Rgain.

To look at common-mode gain, it is best to solve the pair of equations for the currents I1 and I4. Being lazy, I used maple to do the algebra:

solve( { (vout-vp)/r1= (vp-vmid)/r2 + (vp-vm)/rgain, (vm-vref)/r4=(vmid-vm)/r3+(vp-vm)/rgain, \
vor=vout-vref}, {vout,vor,vmid});
simplify(taylor(subs(vp=vcomm+vdiff/2+vref, vm=vcomm-vdiff/2+vref, rhs(%[3])),vdiff));


which produced

vcomm (-r2 r4 + r1 r3)
- ---------------------- +
r2 r4

2 r1 rgain r4 + r2 rgain r4 + 2 r1 r2 r4 + 2 r1 r4 r3 + r1 r3 rgain
------------------------------------------------------------------- vdiff
2 r2 rgain r4



that is,

$V_{out}-V_{ref} = V_{common} \left(1- \frac{R_{1} R_{3}}{R_{2}R_{4}}\right) + V_{diff} \frac{R_{1}}{R_{2}}\left(1 +\frac{R_{2}}{2 R_{1}} + \frac{R_{2}}{R_{gain}} + \frac{R_{3}}{R_{gain}} + \frac{R_{3}}{2 R_{4}}\right)$,
where $V_{diff} = V_{p}-V_{m}$, and $V_{common} = \frac{V_{p}+V_{m}}{2} - V_{ref}$

We can check for some copying errors by simplifying with $R_{1}=R_{4}$ and $R_{2}=R_{3}$, where we get a common-mode gain of 0, and differential gain of $\frac{R_{1}}{R_{2}} + 1 + \frac{2 R_{1}}{R_{gain}}$. Note that the common-mode gain is independent of the value of Rgain, and depends only on the matching of the other resistors.

If R1 and R3 are 1% low, and R2 and R4 are 1% high, then the common-mode gain is 0.039. If R1 and R3 are 1% high, and R2 and R4 are 1% low, then the common-mode gain is –0.041. If you prefer thinking in decibels, the common-mode rejection with 1% tolerance resistors could be as poor as 27.8dB (compared to 80dB to 90dB for an INA126P chip).

I’ll have to make some measurements later this week to see how large the common-mode noise on the EKG signals really is. Of course, it is likely to be highly variable, depending on the electrodes and the wiring to them, but ball-park estimates would be useful.

If the AC common-mode voltage is ±200mV and we have worst-case resistor values, then we would have a ±8mV common-mode output from the instrumentation amp. With the lowest differential amplification (6.6 at Rgain=∞), a 1mV EKG signal would be smaller than the common-mode noise. Such a large common-mode voltage would easily justify the expense of the instrumentation amp chip.  (Note: large DC common-mode voltages don’t matter, as the DC-blocking capacitor I used after the instrumentation amp can eliminate them.)

If the AC common-mode voltage is only ±1 mV, then the Blinky EKG could probably work even with very poor common-mode rejection in the instrumentation amp, and building it out of op amps and discrete resistors is feasible.

1. […] in 2-op-amp instrumentation amp, I worked through the analysis of the differential gain and common-mode gain for an instrumentation […]

Pingback by 3-op-amp instrumentation amp | Gas station without pumps — 2013 July 8 @ 15:03

2. […] 2-op-amp instrumentation amp, I […]

Pingback by Common-mode noise in EKG | Gas station without pumps — 2013 July 8 @ 18:00

3. […] and discrete resistors was unlikely to be reliable.  I discovered (after doing calculations for 2-op-amp and 3-op-amp designs) that 1% tolerance on the resistors would produce poor common-mode rejection. […]

Pingback by Some failed designs | Gas station without pumps — 2013 July 10 @ 12:22

4. […] won’t repeat that presentation here (there’s a condensed, early version of it in a previous blog post).  I’ve not actually lectured on the 2-op-amp design before the instrumentation-amp lab, in […]

Pingback by Instrumentation amp from op amps still fails | Gas station without pumps — 2014 June 26 @ 17:02

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at WordPress.com.