Not able to get accurate reading on MPP2

Hello Team,

We are working on a product based on apq8016 and Linaro 18.01.

We have measuring a reading of current on IMON pin on MPP2 and it has some deviation from the actual reading.

Actual - Measured from SW
99 mA - 83952
182 mA - 165096
270 mA - 250062
360 mA - 333558
451 mA - 425286
545 mA - 513780
639 mA - 606390
734 mA - 696354
831 mA - 788964

Please find the attached schematics and suggest how can we reduce the deviation?

Regards,
Parth Y Shah

Check if the results are linear… isn’t it easier to correct in software?

Hi Arun:

To me it looks like the everything is in spec, I’m not sure what you are complaining about.
Did you measure the actual voltage at the input of PMIC with an accurate, high impedance voltmeter? if the input to the ADC is not correct, the conversion will not be correct.

As usual reading the manuals will give you hints. Here are your errors as a percent:

Current Reading Error % Vadc leakage(uA) leakage (Ohms)
99 83952 -15.2 0.099 15.048 152000
182 165096 -9.2 0.182 16.904 92879
270 250062 -7.4 0.27 19.938 73844
360 333558 -7.3 0.36 26.442 73450
451 425286 -5.7 0.451 25.714 57015
545 513780 -5.7 0.545 31.22 57284
639 606390 -5.1 0.639 32.61 51032
734 696354 -5.1 0.734 37.646 51288
831 788964 -5.1 0.831 42.036 50584

Vadc is the expected voltage at the ADC input. The DPS1133 outputs a current at the Imon pin, and this current is converted to a voltage by the 100k resistor. But you are not getting the expected voltages at the input of the ADC, hence some of the current must be leaking to somewhere (the ADC input likely). I have computed the leakage currents and the equivalent leakage resistances.

The PM8916 specifications give two more hints
Untitled
and


as you can see the expected accuracy near the bottom of the range is 6% at best (or 26% at worst). and the lowest reading you have (99mV) is just below the bottom of the range (assuming you are using Ch#17, and not Ch#33). In order to get to the 6% error, you need to calibrate the ADC against CH#9 (0.625Vref) and CH#10 (1.25Vref), otherwise expect 26% error.

The inputs from MPP2 through the MUX and into the ADC are not buffered, you are driving the ADC resistor ladder directly, so I suspect that this is the cause of the ‘leakage’. If you want good accuracy from the MPP inputs to the ADC you need a buffer op-amp between your signal source and the MPP pin.

In addition to calibration, the other thing you can do to quickly improve performance is to change the 10k resistor to a smaller value, I would try 47k Ohms, this should half your error, and get your signals of interest away from the lower limits of the ADC.

I didn’t even factor in the errors of the 1% resistor, or the DPS1133. The DPS1133 datasheet only gives a ‘typical’ Imon output, it doesn’t give an error range, all by itself it could be the entire 5% error.

-Lawrence-

Oops, I found an error in my spreadsheet, the leakage currents and resistances are out by a factor of 10.

Thanks for your quick response, Lawrence.

Are you referring to R162 i.e. 100k?

Thanks.

Hello Lawrence,

According to DPS1133FIA-13 datasheet, We have kept the register value of R162 as 100k to get 1A for 1V. The equation for the same is below as per the datasheet.

Therefore, we won’t be able to change that value.

Can you please explain this in detail?

Regards,
Parth Y Shah

The formula in the the DPS1133 datasheet clearly says “For example, if Rimon is selected as”, clearly you can select any value for Rimon you want. There is no need for 1A to output 1.0V, just apply a scale factor in the SW. You always want to use the entire range of any ADC. In this case the ADC range is 0.3 to 1.7V, hence you want to choose Rimon so that your maximum current (which you have already set with R176 to 1.05A) to be close to 1.7V which is the ADC max input.

As to calibration, you need to read channels channel 9,10, 14 and 15. The ADC will give you some value, but the ADC will not give you exactly 0.0V, 0.625V, 1.25V, and VDD_VADC. You then use these points to do a linear ‘best fit’ to the classic form y=mx+b which you then use to ‘correct’ the values the ADC gives you when you read channel 17.

This is standard procedure when calibrating any ADC. The PM8916 datasheet shows you what to expect on page 56. After you calculate m and b then you need to apply these values to your reading for a calibrated output. This all boils down to what @danielt suggested: correct the values in software. This is the way to dynamically compute what the gain (m) and offset (b) factors are. m and b will be different for every chip.

Before you do anything, read the voltages across R172 with an accurate voltmeter and compare them with the readings you are getting from the ADC. If the input is wrong, you can never get the output right.