Tinderbox Power: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
Line 26: Line 26:
= Measurement =
= Measurement =


A [[Media:read_tinderbox.py|Python script]] is provided which connects to the voltmeter over the network and makes one or more sets of measurements. The measurements may be output in XHTML, CSV, Python print, or pretty print formats.
A [[Media:Read-tinderbox.py|Python script]] is provided which connects to the voltmeter over the network and makes one or more sets of measurements. The measurements may be output in XHTML, CSV, Python print, or pretty print formats.


== Script Options ==
== Script Options ==

Revision as of 09:58, 2 January 2008

This page describes the instrumentation of the Tinderbox laptops to measure power, and the scripts used to measure and interpret this information.

Instrumentation

The laptops used for Tinderbox have been instrumented with a number of small value resistors inserted into crucial locations in the power distribution network. By measuring the time average of the voltage across these resistor using a very accurate voltmeter, we obtain a snapshot of the power consumption of the laptop at a particular time.

Each laptop has a different set of locations wired for measurement. We currently have two laptops wired up: a B3 build and a C2 production build. Diagrams of their power distribution networks and the measurement points are available (B3, C2). A configuration file is used to represent this information in a manner which the measurement script can utilize.

Configuration File Format

A laptop is described to the measurement script using a comma separated values (CSV) file describing the instrumentation. This file has a format of:

channel,name,resistance,rail_voltage,rail

where

  • channel is the voltmeter channel (absolute, e.g. 2010, 3020, etc.)
  • name is the name associated with this channel
  • resistance is the resistance of the current sense resistor
  • rail_voltage is the voltage at the high side of the current sense res.
  • rail indicates that a voltage varies, and is measured by another channel. If rail is:
    • 0 - indicates rail_voltage is static and should be used
    • positive number - indicates which rail should be used
    • negative number - indicates that this is a rail voltage

See the example configuration files for the existing [1] and [2] setups.

Measurement

A Python script is provided which connects to the voltmeter over the network and makes one or more sets of measurements. The measurements may be output in XHTML, CSV, Python print, or pretty print formats.

Script Options

This script takes the following options:

  • -f CHANNEL_FILENAME, --file=CHANNEL_FILENAME Filename of tinderbox channel descriptors
  • -a MEASURE_HOST, --addr=MEASURE_HOST DNS name or IP addr of voltmeter
  • -l NUM_LOOPS, --loop=NUM_LOOPS Number of times to loop, taking measurements
  • -c CHANNEL, --channel=CHANNEL Channel to read. For mutiple channels, use x-y,z
  • -H, --html Print out measurements with XHTML markup
  • -R, --raw Print out measurements in raw Python format
  • -C, --csv Print out measurements in comma separated format
  • -n NPLC, --nplc=NPLC Time to wait (in 16mS units) between measuring channels
  • -h, --help Show this help message and exit

Typical usage is:

read_tinderbox.py --html -f tinderboxC2.csv

A subset of the channels specified in the configuration file may be measured using the -c option:

read_tinderbox.py -f tinderboxB3.csv -c 2018
read_tinderbox.py -f tinderboxC2.csv -c 3004-3007
read_tinderbox.py -f tinderboxB3.csv -c 2000,2004-2010,2025

The XHTML markup is suitable either for direct viewing with a browser or further manipulation using XSL.