SLAAEE6 October   2023 MSPM0L1306 , MSPM0L1306

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Hardware Introduction
  6. 3Software Introduction
  7. 4Gauge GUI Introduction
  8. 5Current Detection and Calibration Method
    1. 5.1 MSPM0 OPA Introduction
      1. 5.1.1 OPA input and output limitation
      2. 5.1.2 OPA Accuracy Influence
    2. 5.2 Current Detection Method
    3. 5.3 Current Calibration Method
      1. 5.3.1 (R1+R2)/R2 calibration
      2. 5.3.2 OPA1 Voffset calibration
      3. 5.3.3 R3/(R4+R3) calibration
      4. 5.3.4 Vref calibration
  9. 6Solution Evaluation Steps
    1. 6.1 Step1: Hardware Preparation
    2. 6.2 Step2: Evaluation
  10. 7MSPM0 Gauge Solution Test Results
    1. 7.1 Calibration Test Result
    2. 7.2 Current Detection Result
      1. 7.2.1 Test Under 25°C
      2. 7.2.2 Test Under 0°C
      3. 7.2.3 Test Under 50°C
      4. 7.2.4 Conclusion
    3. 7.3 Current Consumption Test
  11. 8Solution Summery and Improvement Direction
    1. 8.1 Shunter Resistor
    2. 8.2 ADC and its Reference
    3. 8.3 Runtime Calibration

Runtime Calibration

As this demo will only do calibration at first power up, if the temperature changes, the GAIN factor and Voffset are also influenced. If you want to realize runtime calibration, the power-on current cannot be 0, especially for the MCU on system side. The structure in Figure 8-1 can be used.

GUID-651FC440-0B29-40E0-BF5C-F6837248350A-low.jpgFigure 8-1 Runtime Calibration Hardware Structure

In this structure, during calibration, the MOSFET should be enabled. The current across Rs are divided by R4 and R5, which are treated as the common voltage input into the amplifier. From Equation 5, you know that the mismatch between R1, R2, R3 and R4 causes the common voltage to have a large influence on the OPA output. So, you should make sure that R2=R4 and R3=R1. As internal gain has larger gain error (2.7% with GAIN32), use external gain instead.

For Voffset calibration, it can use the Voffset calibrated with internal gain to simulate the real Voffset. For R3/(R3+R4) calibration, it can be done by detection the voltage on ADC channel 7 and ADC channel 13. For (R1+R2)/R2 calibration, you can use a default value at the beginning and do the calibration when the load current is low and the error influence can be ignored. It is not suggested that you use another ADC to detect the voltage across Rs in the calibration to make up the error cause from the load current. First, is that this detection voltage will be positive only when in discharge mode. Second, the tested result is affected by ADC offset error.