Advertisement

Blog

Do your duty when you duty-cycle

They say that power corrupts. I don’t know about that; maybe I’ll let you know when I actually have some. But one thing I have found in electronic system design is that the search for low power corrupts . Corrupts signals, that is. And the scary part is that the people doing the searching often don’t realize it.

With all this talk about IoT and cute little widgets sipping energy frugally from their tiny batteries, everyone is trying to minimize power consumption in electronic systems. The standing current taken by circuit blocks such as amplifiers and converters, for any given level of performance, has fallen steadily over the many years that I’ve been plying the electronics trade. However, it hasn’t fallen fast enough to keep pace with our requirements for long battery life.

And that means that, more and more, system designers are resorting to the ultimate sanction: Duty-cycling.

Now, if you’re reading a Planet Analog blog, you probably know what duty-cycling is. If I had my shiny new copy of the 3rd Edition of The Art Of Electronics in front of me – by the way, when you have finished reading this, order yourself a copy of this, it is the most important book in the electronics pantheon, lexicon, bibliodrome, whatever – I’d look up what H&H have to say about it. But I don’t, so I’ll just tell you what I think, and what I’ve found recently.

My employer (full disclosure: Cypress Semiconductor) recently launched a great crossover product – a mixed-signal system-on-chip with an on-chip Bluetooth Smart radio. It’s exciting, because all the cool analog sensor interfacing stuff I’ve done with colleagues over the past few years can now be bolted seamlessly to your smartphone and thence to the web. Duty-cycling at the radio and digital processing level is intrinsic to the achievement of low power in these modern radio systems; no mystery. So some of our guys wanted to build a little demo system that integrated the radio with some galvanic heart-rate monitoring stuff I’d done a while back.

Hmm, I said, I’m not sure the approach I took was optimum for power consumption. Let me go and think about it, see if I can get the front-end current consumption down.

“Oh, don’t worry, we’re going to duty-cycle the analog too.”

As you might expect, this triggered my “let me explain why you might want to do things differently” mode.

Some kinds of analog circuits can be switched off and back on again with impunity. So-called ‘memoryless’ circuits have a theoretical transfer function that doesn’t refer to previous states. An ideal amplifier is an example. Its output now is a simple linear function of its input now. It’s not a function of its input then, and it’s not a function of its power supply voltage then .

A ‘real’ amplifier will have a finite bandwidth and, as all you Fourier fanatics know, defining a frequency range inherently defines a time interval. Still, most op-amps are up and rarin’ to go not that long after you give them some power, or pull them out of shutdown with a dedicated pin.

What’s an example of a circuit block with memory? (Waits expectantly for many hands in the audience to go up). Well, quelle surprise , a filter. Any circuit that has a response to a sinewave excitation that depends on the frequency of that excitation has a signature in the time domain. Its output is partly dependent on the history of its input.

And that means that it will remember if you, um, mucked around with it a little while ago. This in turn means that you have to be very careful if you decide you are going to duty-cycle it, in your search for reduced power.

The proposal I have seen all too often involves a sensor-processing front end that involves some filtering. It could be highpass filtering, to trim off DC offsets and low frequency disturbances. Or lowpass filtering, to suppress untoward goings-on that might occur if nasty high frequency signals get into your low-sample-rate converter. Especially in the latter case, this will often involve an op-amp or two in some sort of active filter configuration. “When we want to sample the filtered signal, we’ll turn the filter back on.” I’m pretty sure I have heard those exact words.

Now, if the rate at which you intend to switch the filter off and on is way, way lower than the frequencies of interest (either in terms of input signals or filter pole frequencies) you’ll be OK. It’s OK to turn your hi-fi system off at night and back on in the morning. (For some circuits that won’t talk about here, it’s also possible to turn them off and on very much faster than any signals or behaviours of interest; that’s for a future discussion).

But remember this critical rule of thumb: if you switch an active filter on, its output will start out ‘wrong’ – not what a continuously-running filter would be outputting, except by pure chance. The output will only match that of the continuously-running filter (to a specific accuracy) after a time equal to the length of the impulse response (down to a specific accuracy) has passed.

So, for instance, if your filter has an impulse response that takes ten milliseconds to settle down, you need to switch it on at least ten milliseconds before you need to sample its output. Otherwise, you’ll just get an incorrect answer, plain and simple. So, if you want to take a sample every 4.55 ms (regular readers will know why I particularly like the sample rate implied by this), duty-cycling is simply not possible.

So, what guidelines could I give our team? Well, first of all, the op-amps in our new Bluetooth SoC have some very low power modes, which should certainly be explored. The available bandwidth falls as supply current falls, but to be honest, you don’t need much bandwidth to acquire a heart rate signal well.

As far as input lowpass filtering goes, the Filter Wizard advice was, basically, leave it out! Don’t be scared by aliasing. It doesn’t always spoil your measurements And if there Is some mid-frequency noise getting into the signal path, look carefully at what you can do with averaging. Averaging is a filtering process, and, judiciously used, it can really help manage input noise. And the energy consumed by taking a few extra samples is quite small. In all the PSoC 4 family parts, averaging hardware is built right into the ADC, so the firmware doesn’t need to do anything.

What about the large, unstable DC pedestals you so often get from biometric sensors? Well, please don’t build a highpass filter with a low cutoff frequency and then expect it to work when you switch those opamps on and off! The method I favour is to build a digital offset compensation loop that can be started and stopped as needed. Such a loop can make small corrections to input pedestal voltages when the analog subsystem is powered up, and just hold those corrections on a small capacitor when it isn’t.

There it is. Sometimes you don’t need graphs, schematics or equations. Just a few hints gleaned from a lifetime of experience and burnt fingers. And as it happens, our awesome applications guys went on to implement some really neat power-saving implementations. So, next time you’re looking for low power, don’t feel powerless! / Kendall

2 comments on “Do your duty when you duty-cycle

  1. Ken.Coffman
    May 30, 2015

    Ah, Kendall, what a lovely piece you've written. I'm always thinking in terms of state machines where the output depends on the current input and the history of inputs and you nail the point of capturing and holding a pre-power cycle state for intelligent filtering. Well written!

  2. mithrandir
    June 4, 2015

    As always Kendall, an entertaining and informative read.

    I remember doing this a few weeks back to save power and got away with a slightly lower signal amplitude thanks to the fact the response for the system I was testing was a R-C like circuit. Certainly not the best way to do it but works if you have a (more or less) deterministic system and the signal of interest moves way slower than the duty cycling frequency. 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.