Measuring energy consumption in embedded systems
4 mins read
Ultra low power embedded systems challenge engineers working on system integration, as well as hardware and software designers optimising for energy efficiency.
An energy measurement system that enables them to understand the effect of the different improvements supports their development and debug efforts.
Energy measurement systems in such applications are usually powered from a DC supply and are subject to current profiles via numerous power modes, a supply current with a huge dynamic range and fragmented non periodical task responses. Energy efficiency achieved via these methods can extend the operating time of portable equipment using primary or secondary batteries.
Another area is energy harvesting applications that need very careful optimisation. The ability to measure energy consumption accurately and to optimise it for various conditions widens the application of energy harvesting products.
Such systems allow engineers to see energy consumption during hardware and software development. Enhancements to the product's activity profile, as well as the impact of such additions, can be measured based on the energy demand. An integrated development environment can also offer energy related debug support.
For most cases, relative energy consumption is the key value. In ultra low energy applications, many short interrupts or other events are major contributors to energy consumption. The measurement system needs to catch such events in order to enable the development of energy efficient designs.
Expectations
Electrical energy is defined by three factors: voltage; current; and time. The formula is usually simplified to E = V * I * t which may or may not cover the real conditions in the application system. Most energy measurement systems measure voltage and current with discrete components like a/d converters.
Any precise measurement of energy requires a power integrating sensor – integral over v(t) and i(t) – with high resolution and dynamic range. The precision of time is less of a challenge and the time delta (t1 – t0) can be considered to be no more than microseconds.
The supply voltage in embedded systems is typically stable enough that no significant error will be introduced to the energy measurement result. The voltage ripple on such power supplies is minimal and in the mV range. Capacitors are placed close to the terminal of the embedded processor for sourcing high current peaks and keeping the voltage stable.
A shunt resistor and operational amplifier convert the current flowing through the shunt resistor into a voltage to be digitised with the A/D converter.
The energy can be measured using the product of current i(t) and time. A variant of this method is to replace the energy, ?E, consumed while keeping the voltage V(t) stable.
Firstly, the focus is on voltage, current and time. Many embedded systems use power supplies which feature an output capacitor and have good dynamic load regulation. Such power supplies can be based on LDOs or DC/DC converters. Other systems use primary or secondary batteries. Even if these have a higher dynamic resistance, they can deliver a stable supply voltage.
The V-I-t method uses A/D converters to acquire voltage and current data. The A/D conversion used to measure the supply voltage level for the energy calculation is precise enough to match accuracy requirements. A 12bit A/D converter usually has an ENOB of more than 11bit and delivers results to an accuracy of 0.5%.
Calculating energy consumption
Measuring current in ultra low power systems is influenced by highly dynamic current profiles. The dynamic range of power modes is shown for some MCUs in table 1. The resolution can be considered to be better than 1ppm and 10nA.
There are two common approaches for calculating energy usage.
The V-I-T method
Here, the basic measurement circuit uses a current sensing resistor, a precision amplifier with two sensitivity ranges, an A/D converter and a timer.
As shown in fig 1, the timer controls a finite state machine (FSM) or a programmable controller, which triggers the A/D conversion that measures the supply current and voltage. The FSM or controller selects the gain of the amplifier system. The amplifier system can be built upon different implementation ideas, resolving the different gain requirements. Different gain settings are needed due to the large dynamic range of ultra low energy applications.
There are two possible designs. In the first, one amplifier is used and the controller decides to select low gain or high gain. This method requires gain-select delay and hysteresis control for proper the gain decision.
A second option is to use two amplifiers and convert both outputs. For the final energy consumption, the highest valid value can be used in the calculation.
An important factor is timing resolution and the precision of the current signal path. The discrete sampling of A/D results has an upper limit of conversions per second and the accuracy of energy measurement depends on the activity profile of the application.
The ▲E method
The ▲E method uses an element to store energy to power the application. The simplest electrical component is a capacitor, where electrical energy is defined by its capacitance and the voltage across the terminals. The energy consumption is the voltage drop at the capacitor per time unit.
The basic principle is to accumulate all individual delta charge (▲E) events during that period. The capacitor element in this approach is the integrator, delivering the current to the high dynamic system load, and is independent of the current's waveform.
Conclusion
Both methods have their strengths and weaknesses. If the main objective is to design software and hardware to make the best use of the available energy, the ?E method has the advantage of integrating the current over time. However, the V-I-T method allows the peak current to be observed, as long as the events are of long enough duration to be sampled effectively by the A/D converter. The bandwidth of the current-voltage op amp system and the conversion rate define the system's accuracy.
Energy measurement using the V-I-T method requires very fast, high resolution amplifiers and A/D converters with sufficient bandwidth in ultra low power applications.
The programmable amplifier requires fast load change detection and response down to the nA range. The ultra low power burst mode principle – which is the key to such ultra low power applications – is the driver for these requirements and poses challenges to develop the energy measurement system with acceptable resolution and accuracy level.
The ?E method uses the integration capability for common passive components – a capacitor in this instance – to avoid the challenge and cost of highly precise electronic components and circuits. The consumed charge is reported individually or accumulated, with the number of recharges allowing the amount of energy used to be determined. A slowly changing supply voltage – typical in such applications – can be measured with simple A/D converters.
Energy measurement is the most effective method to optimise applications for effective consumption by streamlining both software algorithms and hardware requests.
Effective energy measurement techniques allow battery life to be improved significantly and opens the doors to a wider range of energy sensitive applications.
Peter Weber is an MSP430 quality engineer, while Johann Zipperer is involved in MSP430 new product definition. Both are with Texas Instruments EMEA.