Thursday, December 29, 2011

LOW COST DAC IS ALTERNATIVE TO EXPENSIVE PRECISION RESISTORS IN HIGH SIDE CURRENT SENSING

In typical current sensing applications a two or three amp differential amplifier is used to measure the voltage drop across a current sensing resistor. There are several key design trade-offs to be taken into consideration when implementing high side current sensing.  As with most measurement/control circuits, overall accuracy is critical and the nature of high side current sensing circuits requires precision resistors to minimize errors. In this discussion we will explore the most significant error source and a cost effective solution.

The current sensing resistors are kept low for two key reasons:
  1. Minimize power dissipation.  The power dissipated by the current sensing resistor is expressed as P = I2R, therefore when power dissipated is minimized by smaller resistance values
  2. Increase the output compliance voltage by minimizing the IR voltage drop across the current sense resistor. A lower resistance value decreases the voltage drop across the sense resistor which permits the output voltage to get closer to the power supply rail.
The low differential voltage across the current sense resistor means that other error sources have to be minimized.  Modern low cost op amps and instrumentation amps have made great progress toward the ideal amplifier but still lack the performance required for high side current sense applications. Figure 1 shows a two-amplifier configuration which permits the inputs to exceed the power supply rails but has a relatively low input impedance that can introduce linearity errors.  The three-amplifier circuit of Figure 2 has high input impedance but the input voltage is limited to the power supply rails (or less). 

Common Mode Rejection Ratio (CMRR), expressed in dB, is often a substantial source of error in this application and its non-linear nature can be frustrating to the uninformed engineer.  Simply put, CMRR is the ratio of the op amp’s input voltage to output voltage, expressed in dB when both inputs are at the same voltage.  There are two sources of common mode error, the op amp itself and the errors in the resistors. The three-amp circuit is greatly affected by both error sources. The two-amp circuit eliminates the amplifiers common mode error but the resistors remain as a significant error source.

CMRR is calculated as: 20*log (VCM/VOUT). 
Where: VCM is the common mode voltage and VOUT is the output error voltage.

In Figure 1 the gain of A1 is typically 1 or less depending on the maximum common mode voltage.  If the input voltage exceeds the power supply voltage then the gain of A1 is proportionally less than 1.  Common mode error chiefly comes from the gain error in A1 and matching errors of R1 and R5.  With most modern op amps other error sources are typically insignificant except in the most demanding applications.

Figure 1

In the circuit of Figure 2 the CMRR is controlled by the matching of resistor pairs R1 and R2, R3 and R4 and R5 and R6 and the common mode error of A3. The best CMRR can be achieved by making A1 and A2 unity gain buffers and amplification done in A3. This minimizes the CMRR of A3 because the commonmode voltage of A3 is kept small.



Figure 2

Traditional Solutions and Their Limitations
In both circuits using 5% or 1% resistors is completely out of the question at almost any common mode voltage.  Potentiometers being electro-mechanical devices generally do not have the desired long-term performance and the low tempco required for precision circuits and do not lend themselves to automated calibration. Likewise, manually selecting resistors or other manual calibrations are costly time consumers.  Programmable resistors do not have the resolution required for good common mode in high voltage applications. Resistors with 0.1% are relatively cheap and easy to get but are still not adequate, as you will soon see to keep CMRR in check.  A good design based assumes that resistor errors are going to combine over the entire temperature range and cause the maximum error.

For example, let’s say a current sensing application has a 10V common mode voltage with 1V max across the current sense resistor.  The measurement system has a 10V input range and the gain of the current sensing circuit has a gain of 10. For the circuit in Figure 1 the combined errors of 0.1% resistors will typically yield 200mVoutput error or 2% error.  In the Figure 2 circuit the combined errors of 0.1% resistors will typically yield a 500mV (5%) error.  These numbers were empirically derived by observing typical errors for resistors.  There are many factors beyond the scope of this article that affect the distribution of resistance errors but assuming worse case errors over the full temperature range would double these errors. 

Resistor tolerances of 0.01% would be required to get less than 0.2% for Figure 1 or 0.5% error in figure 2.  Precision resistors become very costly ($20 or more) and have long lead times once you drop below 0.1% accuracy.  Further reducing the differential sense voltage aggravates the common mode errors and the effects of other error sources but this is sometimes a tradeoff that has to be made with higher currents.

Most of the commercially available instrumentation amps have typical CMRR of 86dB and, with selection, a CMRR of 120dB can be achieved.  Although these are worthy figures, the errors are still too high when resolving differential input voltages below 1V. 

At 86dB CMRR a 1V differential signal on top of 10V common mode will have a 0.1% error in addition to all other error sources. Generally, current sensing applications require even smaller differential voltages for several reasons.  In higher current applications self-heating of the current sense resistor can cause temperature-induced errors.  Losses in the current sense circuit also require the power supply voltages to be increased to accommodate the voltage drop across the sense resistor.  A 1-ohm current sense resistor, with 1 amp flowing through it, will drop 1 volt and dissipate 1 watt.  The power dissipated by the sense resistor is E2/R and a fractional voltage drop dramatically reduces the power dissipation.  For this reason voltages under 1V are desirable.  To maintain accuracy over the entire voltage range requires good common mode rejection.

Error Correction Using a Multiplying DAC
The circuit in Figure 3 solves the common mode problem by inserting an inexpnsive multiplying DAC in one of the amplifier legs.  Using a 12 bit DAC like the MAX531 from Maxim you can achieve better than 140dB common mode rejection using relatively inexpensive 0.1% resistors.  The circuit applies +/-1% adjustment in 212 or 4096 increments.  This translates to 0.0002% increments in accuracy.  The ratio of R5/R6 determines the adustment range.  Thus R5/R6 = 2K/200K = 0.01 or 1%. The maxmum reference voltage for the MAX531 is +/-2.048V for bipolar +/-5V supplies. The outputs of A1 and A2 should be scaled down accordingly. 

Figure 3

In effect the multiplying DAC multiplies the resistance of R7 which is parallel to R4.  With a DAC code of 800 (hex) R7 is virtually infinite. Resistor R7 becomes “negative” because the DAC inverts its input voltage.  On a well laid-out board, with all gain control resistors in close proximity to each other, the temperature coefficient of the DAC will determine accuracy over temperature.

Table 1 shows the input code vs. output voltage for the MAX531. When the INPUT_CODE is set to 800 hex the DAC is virtually out of the circuit.  An INPUT_CODE of FFF hex changes the output by +1%.  When the INPUT_CODE is 0, the output is changed by –1%.  In this circuit, the gain change of the +input is proportional to the change in the DAC code.  Calibration is done by tieing the inputs together; setting the input to zero volts; setting the DAC to 800 hex; measureing the output (VI) with a meter capable of making sub-mV measurements; set the inputs to max input voltage (max_v); measure the output again (V2). 


INPUT_CODE = 800(hex) – error_code * 100 = 800(hex) - (4096 * (V1-V2) / max_v) *100


Table 1
INPUT_CODE
hex  / decimal
DAC OUTPUT VOLTAGE
+Input Gain Change
R6 Effective Resistance
FFF / 4096
 REF_IN*(4096-2048)/2048 = REF_IN
+1.0%
200K
E00 / 3584
 REF_IN*(4096-3584)/2048 = .25Ref_IN
+0.75%
264K
C00 / 3072
 REF_IN*(4096-3072)/2048 = .50Ref_IN
+0.5%
398K
A00 / 2560
 REF_IN*(4096-2560)/2048 = .75Ref_IN
+0.25%
798K
800 / 2048
 REF_IN*(4096-2048)/2048 = 0
0.0%
¥
600 / 1536
-REF_IN*(4096-1536)/2048 = -.75Ref_IN
-0.25%
-798K
400 / 1024
-REF_IN*(4096-1024)/2048 = -0.5Ref_IN
-0.5%
-398K
200 / 512
-REF_IN*(4096-512)/2048 = -0.25Ref_IN
-0.75%
-264K

When V1-V2 is positive the gain of the -INPUT is less than the gain of the +INPUT and a smaller INPUT_CODE is required to make the output to balance the inputs.  Conversely, when  V1-V2  is negative the gain of the –INPUT is greater than the +INPUT and a larger INPUT_CODE is required to balance the inputs. As the DAC only affects the gain by +/-1% max, the error_code is multiplied by the ratio (R7/R6).  When properly set the output will change by less than 2uV per common mode volt and for a 20V common mode input the output error will be under 40uV.  That is a 25x improvement over Figure 2 using resistors that cost 20 cents each instead of resistors that cost 20 dollars each!

PC Board Layout Considerations
One of the objectives of this article is to keep the cost of this solution low.  One of the cost drivers for precision resistors is the temperature coefficient.  Following some simple layout practices inexpensive 100PPM resistors will suffice.
1.    Thermally isolate the current sensing circuits from the power circuits.  This not only reduces common mode errors due to temperature but also other errors due to temperature sensitivity. Keep in mind that power and ground planes conduct heat. 
2.    Place the resistor pairs close together so that they are kept at the same temperature.  Equal temperature rises on the resistors means they will change at close rates.
3.    For each value of resitor, try to keep them from the same lot.  Since resistor lots are usually processed with the same equipment it is reasonable to expect that resistors from the same lot will have similar thermal and electrical characteristics.  

Summary
The primary source of errors in high side current sensing is CMRR and cannot be easily resolved by using precision components.  In high volume production, precision resistor costs can drive the circuit cost up exponentially.  Common mode errors are non-linear and aren’t readily remedied by software solutions.  By using a multiplying DAC in one of the legs of the sensing circuit differential gain errors can be programmed out of the circuit effectively eliminating CMRR errors due to gain errors.  The DAC is much lower cost than precision resistors.  Precision resistors typically achieve their tempco by increased area and the PC Board real estate required by the DAC can be compensated for by using higher tempco resistors which further reduce costs.  Using the DAC also eliminates the unreliable and labor intensive trim pots and manual resistor selection.  Overall, this solution provides a cost effective solution that lends itself to automated calibration to the not so simple problem of common mode error.



No comments:

Post a Comment