Abstract:
In certain applications, differential amplifiers with infinite common mode rejection ratios are desirable. However, resistance mismatches due to imperfections in the manufacturing create finite common mode rejection ratio in differential amplifiers degrading their performance. Disclosed are apparatus and method for improving the common mode rejection ratio of practical differential amplifiers.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    This invention relates generally to electronics, and more particularly, to improving the common mode rejection ratio of differential amplifiers. 
         [0003]    2. Description of the Related Art 
         [0004]    A differential amplifier  106  shown in  FIG. 1  ideally amplifies only the difference between the voltages Vip and Vin; however, a practical differential amplifier also amplifies the common mode input voltage. The common mode rejection ratio (CMRR) of a differential amplifier is a performance metric defined as the ratio of the differential gain of the differential amplifier over its common mode gain. What is needed is a differential amplifier with an improved CMRR. 
       SUMMARY OF THE DISCLOSURE 
       [0005]    One embodiment includes an apparatus, wherein the apparatus includes a first circuit configured to generate a bias based at least partly on a common mode voltage of a differential signal provided as an input to a differential amplifier; and a second circuit configured to scale the bias to generate a scaled bias and to selectively provide the scaled bias to a first node or a second node of a first feedback path or a second feedback path of the differential amplifier to improve a common-mode rejection ratio of the differential amplifier. 
         [0006]    One embodiment includes an electronically-implemented method of improving a common mode rejection ratio of a differential amplifier, wherein the method includes generating a bias with a first circuit based at least partly on a common mode voltage of a differential signal provided as an input to the differential amplifier; scaling the bias with a second circuit to generate a scaled bias; selectively providing the scaled bias to a first node or a second node of a first feedback path or a second feedback path of the differential amplifier to improve the common-mode rejection ratio of the differential amplifier. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0007]    These drawings and the associated description herein are provided to illustrate specific embodiments of the invention and are not intended to be limiting. 
           [0008]      FIG. 1  illustrates an example of an application where an embodiment of the invention may advantageously be used to sense a current of interest. 
           [0009]      FIG. 2  illustrates the error in the output signal of a differential amplifier due to having a finite common mode rejection ratio (CMRR). 
           [0010]      FIG. 3  illustrates an embodiment including a compensation circuit for reducing the common mode error of a differential amplifier. 
           [0011]      FIG. 4  illustrates an embodiment of a compensation circuit for reducing the common mode error of a differential amplifier. 
           [0012]      FIG. 5  illustrates a first phase of the configuration of an embodiment used to calibrate the compensation circuit in  FIG. 3  in a first and second phase. 
           [0013]      FIG. 6  illustrates a second phase of the configuration of an embodiment used to calibrate the compensation circuit in  FIG. 3  in a first and second phase. 
           [0014]      FIG. 7  is a waveform plot illustrating one example of calibration for a compensation circuit. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
       [0015]    The following detailed description of certain embodiments presents various descriptions of specific embodiments of the invention. However, the invention can be embodied in a multitude of different ways as defined and covered by the claims. In this description, reference is made to the drawings where like reference numerals may indicate identical or functionally similar elements. 
         [0016]    Having a relatively high common mode rejection ratio can be useful in many situations. For example, it can be desirable to sense current flow to a load. For example,  FIG. 1  shows an arrangement of components that may be found in an electronic device. A class D amplifier  104  used to drive a transducer or speaker  102 . However, due to the floating nature of the outputs of the class D amplifier  104  and the switched output, observation of the output current can be relatively difficult. For example, if the transducer/speaker  102  fails, the failure should be sensed to protect the class D amplifier  104  from damage. 
         [0017]    Problems with the speaker  102  can be detected by sensing the current I shunt  going through a resistor R shunt  connected between the nodes Vin and Vip. An approach for measuring this current is to use a fully differential amplifier  106  having the outputs Vop and Von and the differential gain Gi. The current of interest I shunt  is given by (Vip−Vin)/R shunt . The quantity (Vip−Vin) or the voltage across the resistor R shunt  is given by (Vop−Von)/Gi. Then, I shunt  can be observed as (Vop−Von)/(R shunt . Gi). An analog to digital converter (ADC)  108  may be used to convert the outputs of the differential amplifier to a digital form for further processing. 
         [0018]    The common mode rejection ratio (CMRR) of an amplifier can be degraded by resistor mismatches present due to the imperfections in the manufacturing of the amplifier. A relatively poor CMRR can make the observations of the current Ishunt relatively unreliable.  FIG. 2  demonstrates the effect of having a finite CMRR in the output of the amplifier  220 . With the inputs Vip and Vin both identical, each carrying a signal  202 , the amplifier  220  generates the differential outputs  214 ,  216  due to the finite CMRR. In the example shown in  FIG. 2 , an infinite CMRR may be approached if RS 1 =RS 2  and RF 1 =RF 2  and the amplifier  220  is ideal. However, imperfections in the manufacturing process results in usually RS 1 ≠RS 2  and RF 1 ≠RF 2  causing a differential signal in the outputs of the amplifier  220  even when the input signals are identical. The differential output due to this mismatch is given by: 
         [0000]    
       
         
           
             
               
                 
                   
                     Vod 
                     = 
                     
                       
                         
                           2 
                            
                           
                             Vicm 
                              
                             
                               ( 
                               
                                 
                                   β 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                                 - 
                                 
                                   β 
                                    
                                   
                                       
                                   
                                    
                                   1 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           Vocm 
                            
                           
                             ( 
                             
                               
                                 β 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                               - 
                               
                                 β 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                             
                             ) 
                           
                         
                       
                       
                         
                           β 
                            
                           
                               
                           
                            
                           1 
                         
                         + 
                         
                           β 
                            
                           
                               
                           
                            
                           2 
                         
                       
                     
                   
                   , 
                   
                     
 
                   
                    
                   where 
                   , 
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     1 
                   
                   ) 
                 
               
             
             
               
                 
                   
                     
                       β 
                       
                         1 
                         , 
                         2 
                       
                     
                     = 
                     
                       
                         RS 
                         
                           1 
                           , 
                           2 
                         
                       
                       
                         
                           RS 
                           
                             1 
                             , 
                             2 
                           
                         
                         + 
                         
                           RF 
                           
                             1 
                             , 
                             2 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     2 
                   
                   ) 
                 
               
             
             
               
                 
                   
                     Vicm 
                     = 
                     
                       
                         Vip 
                         + 
                         Vin 
                       
                       2 
                     
                   
                   , 
                   
                     
 
                   
                    
                   and 
                   , 
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     3 
                   
                   ) 
                 
               
             
             
               
                 
                   Vocm 
                   = 
                   
                     Vdd 
                     2 
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     4 
                   
                   ) 
                 
               
             
           
         
       
     
         [0019]    Where Vdd is the supply voltage connected to the amplifier. 
         [0020]      FIG. 3  illustrates an embodiment of the differential amplifier  106 . For a given mismatch present in a differential amplifier A 1 , there exists an amount of current, that if fed to the appropriate feedback network of the differential amplifier A 1 , will compensate for the common mode error, thereby correcting the output of the differential amplifier A 1 . If the difference between the outputs of the differential amplifier A 1 , that is, Vop-Von, is a positive amount for a positive common mode input, then injecting a current Icn into Node B of the non-inverting feedback network, decreases this positive amount. Similarly, if the difference between the outputs Vop-Von is a negative amount for a positive common mode input, then injecting a current Icp into Node A of the inverting feedback network decreases this negative amount. The circuit  310  as part of its own circuitry or logic circuitry (see, for example, block  510  of  FIG. 5 ) can determine and generate the appropriate amount and direction of current used to offset the differential output due to the common mode input. 
         [0021]    The feedback network of the differential amplifier  106  may include the resistors RF 1   a , RF 1   b , RF 2   a , RF 2   b  as shown in  FIG. 3 . In some embodiments, the resistors RF 1   a , RF 2   a  can be several orders of magnitude larger in resistance than the resistors RF 1   b , RF 2   b  respectively. For example, the resistors RF 1   a , RF 2   a  can be 10 to 15 times larger in resistance than the resistors RF 1   b  and RF 2   b  respectively. Choosing these resistor ratios can further improve the common mode rejection performance of the differential amplifier  106 . As a non-limiting example, the resistors RF 1   a , RF 1   b , RF 2   a , and RF 2   b  can be 600, 40, 600 and 40 kilo-ohms respectively. Other applicable amounts of resistance will be readily determined by one of ordinary skill in the art. 
         [0022]      FIG. 4  illustrates an embodiment of the circuit  310 . The V-I converter may be implemented using an amplifier A 2 , a P-channel transistor MP, an N-channel transistor MN, resistors R 1 , R 2 , Rjp, Rjn, a current source  410 , and an N-channel transistor MB to convert the common mode voltage present in the inputs of the amplifier  106  to a current Icm. The amplifier A 2  can be an operational amplifier. At its inverting input, the amplifier A 2  receives the common mode voltage Vocm, which can be obtained by a voltage divider using the resistors R 1  and R 2  between the high and low supply voltages, or in the case of ground referenced amplifiers, between the supply voltage and ground. At its non-inverting input, the amplifier A 2  receives the common mode voltage of the inputs of the differential amplifier  106  through the voltage nodes sjp and sjn, via the resistors Rjp and Rjn. The amplifier A 2  drives the gate of the transistor MP. The amplifier A 2  and transistor MP are in negative feedback loop as a result of which the current Icm is generated based on the common mode input voltage of the differential amplifier  106 . The transistor MP may be biased with a current source  410  and the transistors MN and MB. 
         [0023]    In one embodiment, to set up biasing for the transistor MP, a current mirror arrangement of the transistors MB, MN along with a current source  410  can be used. The diode-connected transistor MB conducts the current Ibias from the current source  410 . If the transistor MN is the same size as the transistor MB, the current through the transistor MN should also be Ibias. The current Ibias, the sizes of the transistors MB, MN and MP can be chosen for all transistors to operate in the saturation region. An exemplary amount of the current Ibias can be 20 micro-amps. Other applicable current amounts will be readily determined by one of ordinary skill in the art. The particular value of the current Ibias can vary based on the expected values of common mode voltage Vocm. The minimum value of the current Ibias depends on the maximum value of the current Icm. When the nodes sjp and sjn are higher in voltage than the common mode voltage Vocm, the direction of the current Icm is from Node  1  to the drain of the transistor MN. The current through the transistor MP is then given by Ibias-Icm. To maintain the transistor MP in saturation the minimum value of the current Ibias is approximately given by the following equation, 
         [0000]    
       
         
           
             
               
                 
                   
                     Ibias 
                      
                     
                       ( 
                       min 
                       ) 
                     
                   
                   ≈ 
                   
                     
                       
                         
                           sjp 
                            
                           
                             ( 
                             max 
                             ) 
                           
                         
                         - 
                         Vocm 
                       
                       Rjp 
                     
                     + 
                     
                       
                         
                           sjn 
                            
                           
                             ( 
                             max 
                             ) 
                           
                         
                         - 
                         Vocm 
                       
                       Rjn 
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     5 
                   
                   ) 
                 
               
             
           
         
       
     
         [0024]    where sjp(max) and sjn(max) are the maximum voltages observed at the inputs of the amplifier A 1  at nodes sjp and sjn. The current Ibias is also chosen to allow for a stable negative feedback loop including the amplifier A 2  and the transistor MP. Other methods of biasing can also be used. 
         [0025]    If the open loop gain of the amplifier A 2  is a high value, the voltage at the non-inverting input of the amplifier A 2  converges to a value near the voltage value at the inverting input of the amplifier A 2 . The voltage at Node  1  should be approximately equal to the common mode voltage Vocm. Therefore, in the arrangement shown in  FIG. 4 , the current Icm is given by: 
         [0000]    
       
         
           
             
               
                 
                   Icm 
                   = 
                   
                     
                       
                         sjp 
                         - 
                         Vocm 
                       
                       Rjp 
                     
                     + 
                     
                       
                         sjn 
                         - 
                         Vocm 
                       
                       Rjn 
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     6 
                   
                   ) 
                 
               
             
           
         
       
     
         [0026]    The current Icm varies with the common mode voltage present at the inputs of the differential amplifier  106 . The current through the transistor MP is Ibias+Icm and the current through the transistor MN is Ibias. A network of binary-weighted transistors MP( 0 ) through MP(N−1) may be arranged to mirror and scale the current through the transistor MP generating a current Idacp. The transistors MP( 0 )-MP(N−1) progressively increase in size, from the least significant bit (LSB) transistor MP( 0 ) being the smallest transistor to the most significant bit (MSB) transistor MP(N−1) being the largest transistor of the group such that each transistor from MP( 0 ) to MP(N−1) conducts twice the amount of current than the smaller transistor before it. However, other weightings can alternatively be used. The drain of each transistor MP( 0 )-MP(N−1) may be connected to a switch of an N-bit pmos switch  402 . If a particular switch is on, the transistor coupled to that switch is coupled to the output, and that transistor mirrors and scales the current through the transistor MP contributing to the current Idacp. Similarly, a network of binary weighted transistors MN( 0 ) through MN(N−1) connected to an N-bit NMOS switch  404  may be arranged to mirror and scale the current through the transistor MN generating a current Idacn. The transistors MN( 0 )-MN(N−1) also progressively increase in size, from the least significant bit (LSB) transistor MN( 0 ) being the smallest transistor to the most significant bit (MSB) transistor MN(N−1) being the largest transistor of the group such that each transistor from MN( 0 ) to MN(N−1) conducts twice the amount of current than the smaller transistor before it. However, other weightings can alternatively be used. 
         [0027]    While illustrated with the amplifier A 2  driving pmos transistors and a current source  410  biasing nmos transistors, in an alternative embodiment, the amplifier A 2  can drive nmos transistors and the current source  410  can be reconfigured to bias pmos transistor. Also, The nmos or pmos transistors described herein can correspond to transistors known as metal-oxide-semiconductor field-effect transistors (MOSFETs). While the terms “metal” and “oxide” are present in the name of the device, it will be understood that these transistors can have gates made out of materials other than metals, such as polycrystalline silicon, and can have dielectric “oxide” regions made from dielectrics other than silicon oxide, such as from silicon nitride or high-k dielectrics. In further alternative embodiments, bipolar transistors can be used instead of nmos or pmos transistors. 
         [0028]    The circuit  310  can use a binary code Q corresponding to the switches in the N-bit pmos and nmos switches. The code Q having N binary digits may determine which switches in the N-bit pmos and nmos switches  402  and  404  are on and which are off. The currents Idacp and Idacn are then given by: 
         [0000]    
       
         
           
             
               
                 
                   
                     I 
                     dacp 
                   
                   = 
                   
                     
                       Q 
                       
                         
                           2 
                           N 
                         
                         - 
                         1 
                       
                     
                      
                     
                       ( 
                       
                         Ibias 
                         + 
                         Icm 
                       
                       ) 
                     
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     7 
                   
                   ) 
                 
               
             
             
               
                 
                   
                     I 
                     dacn 
                   
                   = 
                   
                     
                       Q 
                       
                         
                           2 
                           N 
                         
                         - 
                         1 
                       
                     
                      
                     Ibias 
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     8 
                   
                   ) 
                 
               
             
           
         
       
     
         [0029]    Idacp-Idacn gives the current Idaco: 
         [0000]    
       
         
           
             
               
                 
                   
                     I 
                     daco 
                   
                   = 
                   
                     
                       Q 
                       
                         
                           2 
                           N 
                         
                         - 
                         1 
                       
                     
                      
                     Icm 
                   
                 
               
               
                 
                   ( 
                   
                     Eq 
                     . 
                     
                         
                     
                      
                     9 
                   
                   ) 
                 
               
             
           
         
       
     
         [0030]    The circuit  310  as part of its own configuration or using additional circuitry can determine whether the scaled current may be fed into the inverting or non-inverting feedback circuitry of the amplifier A 1  to best compensate for the common mode error at the output of the amplifier A 1 . In  FIG. 4 , the current Idaco may be fed to the inverting feedback circuitry of the amplifier A 1  via a sign switch  408 , directing the current Idaco to Node A via the current Icp, when the sign switch  408  state is on. On the other hand, the current Idaco may be fed to the non-inverting feedback circuitry of the amplifier A 1  via the sign switch  408 , directing the current Idaco to Node B via the current Icn, when the sign switch  408  state is off. 
         [0031]    A configuration and method for calibrating the amplifier  106  by determining the sign switch  408  state and appropriate code Q is described with reference to  FIGS. 5 ,  6  and  7 . 
         [0032]    The outputs of the differential amplifier A 1  are coupled to the capacitors C 1 , C 2  and provided as inputs to a comparator  512 . The output of the comparator  512  is provided as an input to a control logic circuit  510 , which determines the N-bit binary code Q and the sign switch  408  state. As a non-limiting example, the control logic circuit  510  may be implemented using successive approximation. However, other methods, such as brute force, can alternatively be used. In the illustrated example, two calibration phases are used. However, in alternative embodiments, more than two phases can be used. The difference between the phases provides a stimulus to observe the common-mode error, which can then be reduced via control of the state of the sign switch  408  and the amount of scaling. Phase 1 is a resetting phase, where the inputs of the differential amplifier  106  are grounded, the inputs of the comparator  512  are tied together via switches  506  and  508  and to the common mode voltage Vocm, causing the capacitors C 1  and C 2  to store the offset of the amplifier A 1  and comparator  512  relative to the common mode voltage Vocm. In phase 2, the inputs of the differential amplifier  106  are tied to the high supply voltage, for example, Vdd, and the comparator  512  compares the differential outputs of the amplifier A 1 . The switches  506  and  508  are opened allowing the capacitors C 1  and C 2  to store the voltages at the outputs of the differential amplifier A 1 . As described below, the control logic circuit  510  uses the output of the comparator  512  at the end of phase 2 to determine the value of a binary bit under investigation. To determine the scaling factor to be used, phases  1  and  2  are repeated N times for every bit in the N-bit binary code Q. After the sign switch  408  state and binary code Q are determined the pmos, nmos and sign switches  402 ,  404  and  408  are latched on using those determined values for the duration of the operation of the amplifier  106 . 
         [0033]    The operation of the circuit  310 , comparator  512  and control logic circuit  510  are further explained in an example, using the graphs in  FIG. 7  for a 6-bit binary code Q. The top graph in  FIG. 7  is a plot of a common mode test input voltage applied at the inputs, Vip and Vin of the differential amplifier G 1  versus time in milliseconds (ms). The bottom graph in  FIG. 7  is a plot of the differential voltage, Vop−Von, observed at the outputs of the differential amplifier  106  versus time in milliseconds (ms) as a result of the common mode test input voltage at the inputs, Vip and Vin, of the differential amplifier  106 . The goal is to find the binary code Q and the sign switch  408  state such that the differential output, Vop−Von, observed due to a range of common mode test input voltages at the inputs, Vip and Vin, of the differential amplifier  106 , is zero or nearly zero in response to the range of possible common mode input values. 
         [0034]    When high, the signal “calib” indicates that the calibration process is being performed. When high, the signal “done” indicates completion of the calibration process. The signal sign denotes the sign switch  408  state, determining in which direction the scaled current may be injected. The signal clk denotes the clock signal. During the high clock cycles, phase 1 operations are performed, while phase 2 operations are performed during the low clock cycles. The signal Q denotes which binary code Q is being tested. The value of the signal Q controls which of the transistors of the binary-weighted switches  402 ,  404  are on and which are off. In the illustrated example, a “1” corresponds to on and a “0” corresponds to off. Various settings are tested and either used or rejected. 
         [0035]    Starting from 0.1 ms, the calibration operations begin. From 0.15 ms to 0.2 ms, corresponding to phase 2 of the calibration operations, the binary code Q is 000000 and the sign switch  408  state is 1. The binary code Q of all zeroes means that all switches of the nmos and pmos switches  402  and  404  of  FIG. 4  are off and no current are injected via the circuit  310 . The differential output is near 35 millivolts (mV). This shows that the amplifier  106  under calibration has a common mode error of a positive value, therefore injecting more current into the non-inverting feedback network is needed to pull the differential output down. The sign switch  408  state is then set to 0 to direct the scaled current Icm via the current Icn to Node B. The sign switch  408  state remains the same and different scaled versions of the current Icm are tested using different values of the binary code Q to determine the current Icn needed to compensate for the common mode error observed in the clock cycle 0.15 ms-0.2 ms and to bring the differential output to a near zero value. 
         [0036]    Between 0.25 ms to 0.3 ms, phase 2 operations are performed using the binary code Q=100000. The differential output is pulled to a negative value near −10 mV. This shows that the scaling corresponding to the binary code Q=1000000 injects an excessive amount of current into the non-inverting feedback network. The binary code Q=1000000 corresponds to the most significant bit (MSB) transistors MP(N−1), or in this example MP( 5 ), and MN(N−1), or in this example MN( 5 ), in the on position and conducting through their respective pmos and nmos switches in the N-bit pmos switches  402  and N-bit nmos switches  404 . Since these two transistors pull the differential output too far down into the negative, the process determines not to turn on these transistors for operation and the switches in the pmos and nmos N-bit switches  402  and  404  corresponding to their drains are set to off. The most significant bit in the binary code Q is then reverted back to zero. 
         [0037]    Between 0.35 ms to 0.4 ms, phase 2 calibration operations are performed for the binary code Q=010000. For the binary code Q=010000, the switches in the pmos and nmos N-bit switches corresponding to MP( 4 ) and MN( 4 ) are on. The differential output is pulled down to nearly 15 mV, which is a better common mode rejection performance compared to the initial value of nearly 35 mV. Setting the second bit to 1 is an appropriate value. The value of the second most significant bit is kept at  1 . 
         [0038]    Between 0.45 ms to 0.5 ms, phase 2 calibration operations are performed using the binary code Q=011000. For this code the differential output is pulled down to near 1 mV which is yet a better common mode rejection performance. Setting the third most significant bit to 1 is an appropriate value. The value of the third most significant bit is kept at 1. 
         [0039]    Between 0.55 ms to 0.6 ms, phase 2 calibration operations are performed for the binary code Q=011100. For this code the differential output is pulled down to a negative value. Since the sign switch  408  state is already set at 0 directing the scaled current through the non-inverting feedback network, the codes that lead to a negative differential output voltage are not used since no compensating current can be directed to the inverting feedback network. Setting the fourth most significant bit to 1 was therefore incorrect. This control bit is then kept at  0 . 
         [0040]    Between 0.65 ms to 0.7 ms, phase 2 calibration operations are performed for the binary code Q=011010. For this code the differential output is pulled down into a negative value; therefore, this control bit is kept at 0. 
         [0041]    Between 0.75 ms to 0.8 ms, phase 2 calibration operations are performed for the binary code Q=011001. For this code the differential output is pulled down into a negative value; therefore, this control bit is kept at 0. 
         [0042]    Between 0.85 ms to 0.9 ms, since the last bit tested was the lowest significant bit (LSB), the calibration operations are done and the binary code Q is determined to be 011000 for the amplifier under calibration in this example. For extreme test common mode input voltages tested after 1 ms, using the binary code Q=011000, the differential output remains very near zero, thereby significantly improving the CMRR performance of amplifier  106 .