1
\$\begingroup\$

I am trying to optimize the power usage of a custom application (C#) running on an embedded computer (Intel i7, Windows 7). To do so, I am measuring the current that the system requires while running the application.

This current fluctuates; every second I get a different reading using a regular multimeter (Fluke 175). This makes me wonder about the accuracy of the reading.

1) If I would calculate the average of these readings, would this be a good indication of the power usage? Or would I miss high frequency peaks / dips in the current?

2) Could this be solved by taking multiple measurements per second using some sort of current sensor with a microcontroller and averaging the values?

3) If so, what would be a good rate to take measurements at; 10Hz? 1000Hz?

4) Could adding an RC-filter between the current sensor and the ADC of the microcontroller help in some way?

This is my first question on StackExchange, please let me know if I'm making any mistakes.

Edit: The goal is to get a realistic power consumption estimation so we can improve and predict battery life.

\$\endgroup\$
  • 1
    \$\begingroup\$ Could you just measure the CPU usage instead? \$\endgroup\$ – Phil Frost Feb 20 '17 at 14:49
  • 1
    \$\begingroup\$ embedded computer (...Windows 7) Then lots of other processes are also running which will disturb your measurement. Maybe a lot of averaging will give more reliable results although not an instantaneous reading. I am assuming you would need averaging over at least 10 seconds or so. \$\endgroup\$ – Bimpelrekkie Feb 20 '17 at 14:54
  • 1
    \$\begingroup\$ Yeah, CPU-based profiling is definitely the place to start, then looking at whether you can put the system to sleep. Measuring overall wall power gives you v little detail. \$\endgroup\$ – pjc50 Feb 20 '17 at 15:02
  • \$\begingroup\$ @FakeMoustache, the background processes are inseparable part of PC life. So if the background processes dominate over the custom application, then the job is done. If the custom app has significant power draw, then the result is what it is, with background. \$\endgroup\$ – Ale..chenski Feb 21 '17 at 1:02
  • \$\begingroup\$ Thank you for the comments regarding the detail of the measurement. Looking at cpu usage during development seems like a good idea. In the end we want to measure "real-life" power usage during tests that are 15+ minutes, since our systems gathers big chunks of data (couple of GBs) from sensors at rather low intervals (every couple of minutes). \$\endgroup\$ – user139733 Feb 21 '17 at 8:30
1
\$\begingroup\$

If you are trying to calculate things like battery lifetime, then you want the average current or power, depending on how your power supply system works. If the voltage is constant, then simply averaging the current and multiplying this by the fixed voltage yields average power.

The problem you are running into is aliasing. Sampling every second does not give you a valid picture of the current since that current apparently has significant frequency components above 500 mHz. The solution is to either sample so fast that there is little content above half the sampling frequency, or low pass filter the result to remove the content above half the sampling frequency.

The latter is easier, and all you need if you just want to find "average" current consumption. Put a low pass filter between whatever is producing the current signal and where it is sampled.

For example, let's assume you are using a low-value current sense resistor and are measuring its voltage with your voltmeter that samples at 1 Hz. For example, two poles of R-C filtering at 100 mHz should help a lot. Each could be realized with a 10 kΩ resistor in series followed by a 160 µF cap across the signal. Try that and see if it gives you the right combination of not being too jumpy, but still responsive enough.

\$\endgroup\$
  • \$\begingroup\$ Thank you for the tip about adding low-pass filtering. I'm reading up on aliasing, but I'm having difficulty determining what the high(er) frequency components are. Could determining the cross-over frequency of the filter by means of trial and error somehow result in a less accurate measurement? I would average the values over 15+ minutes. \$\endgroup\$ – user139733 Feb 21 '17 at 8:38
  • \$\begingroup\$ @Pow: Anything that isn't a sine has higher frequency components. Sharp edges or blips have especially high frequency content. If you want to average over 15 minutes, then you can be much more aggressive about filtering. If the voltmeter doesn't have average mode, you can do it with a microcontroller and A/D. In that case you literally average 15 minutes of readings digitally. You still need the anti-aliasing filter in front of the A/D though. \$\endgroup\$ – Olin Lathrop Feb 21 '17 at 11:35
1
\$\begingroup\$

The job of optimizing or measuring power of a PC running a particular application is usually done with specialized instruments called "power loggers", like this "HOBO Plug Load Data Logger", or less expensive loggers as UNI. These data loggers usually sample data at AC frequency, and can display the resulting time charts on a connected PC. One usual challenge for this task is to synchronize your running application with the running power chart, to find pieces of code that consume too much.

If this is an embedded PC that runs from DC power, there are DC supplies/loggers, like this nice Agilent N6705 tool.

\$\endgroup\$
  • \$\begingroup\$ Thank you for your recommendations regarding power loggers. \$\endgroup\$ – user139733 Feb 21 '17 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy