IRNAS / ppk2-api-python

Power Profiling Kit 2 unofficial python api.
http://irnas.eu
GNU General Public License v2.0
153 stars 42 forks source link

Current integral is not accurate? #46

Open t-moe opened 3 months ago

t-moe commented 3 months ago

I'm trying to use this library with my PPK2 in order to calculate the total current consumption of my device, by integrating the current samples.

Calculating the integral works and gives me some number, but the number is way off, when comparing it to a 2nd ppk2 running alongside with the original GUI. E.g. when measuring over 20 minutes, I measure 57 Coulomb with the library, compared to 46 Coulomb with the original GUI.

Did someone run into a similar problem? Could it be, that the device is configured differently when used by the nordic GUI? (Spike filter?)

mrx23dot commented 3 months ago

Starting of measurements can give 1A spikes, ignore the beginning, then compare the bottom sleep current with GUI. Also in GUI advanced tab turns smoothing to 1.

Guym142 commented 2 months ago

I'm experiencing the same issue, even when ignoring the spike at the beginning of the measurement.

I have a device that wakes up periodically and I wanted to measure how much charge it takes for every wakeup, measuring through the GUI gave me a consistent measurement every time.

Measuring using a python script and this library gave me very inconsistent results with a range or up to +-10% of what it should be.

I even compared to a different current measurement taken with Keysight equipment and I got the same results as I got using the GUI.

I would really appreciate help on this matter.

t-moe commented 2 months ago

Side note: Apparently you should never put two PPKs in series. According to the nordic guys it could lead to wrong results because of range switching (https://devzone.nordicsemi.com/f/nordic-q-a/113249/nordic-power-profiler-kit-ii-inaccurate-charge-integral ). So always make sure to run the test with GUI / with library separately.

Guym142 commented 2 months ago

Side note: Apparently you should never put two PPKs in series. According to the nordic guys it could lead to wrong results because of range switching (https://devzone.nordicsemi.com/f/nordic-q-a/113249/nordic-power-profiler-kit-ii-inaccurate-charge-integral ). So always make sure to run the test with GUI / with library separately.

In my tests I used only one PPK, and just changed the method of sampling (GUI vs python) It's also important to use the same hardware for this kind of comparison because we want to compare different softwares on the same hardware.

mrx23dot commented 2 months ago

You could try it with constant voltage plus resistor in series with PPK and a good DMM, if that's the same then it's a timing thing. Second one would be a square wave + resistor.