SLAAEE6 October 2023 MSPM0L1306 , MSPM0L1306
In this part, equations will be used to show how to do the current detection with dynamic GAIN setting by changing the resistor value of R3 and R4 in Figure 5-1.
Equation 1 shows the OPA1 output voltage. I is the current to be tested. Voffset includes the influence of voltage offset and bias current.
The OPA1 output voltage is recorded as a reference for the current calculation, when I = 0. Here Vref is used to represent it in Equation 2.
When I != 0, the gap between OPA1 output voltage and Vref will be as shown in Equation 3.
After that subtraction, you can remove the Voffset influence and the current can be calculated using Equation 4.
The thing to consider when changing the gain is the Common Voltage(Vc), as changing the gain setting can cause the structure unsymmetrical. If you take Vc into consideration, the OPA1 output voltage can be as shown in Equation 5.
To control the structure mismatch influence, you need to control the voltage level of Vc. That is why you need to assign the MCU GND to be closed to the Rs on the PCB layout.