My Photo

Recent Comments

« August 2008 | Main | October 2008 »

September 2008

September 16, 2008

Pulling the Plug... Was Tesla Right?

Bookmark and Share

PlugPull_XSmall What if you could simply lay your cell phone and Bluetooth headset on a charger plate and charge it up without wires.  You may very well be doing just that very soon... Now imagine those chargers are everywhere!

The whole idea of powering something without wires goes as far back as Nikola Tesla circa 1891.  His ideas of providing wireless power to equipment located anywhere was a bit "out there", but he had the right idea.  He even made comments that someday, "our machinery will be driven by a power obtainable at any point of the universe."  That brings to mind thoughts of zero point fluctuations and such.  However, I’m diverging... today, my wife has an iPhone and I have a Blackberry - both devices lack a zero-point energy generator, but they do have batteries.  Both devices have good run times, but we always need to plug them in at night or risk running low on power during the day.  This also includes recharging our Bluetooth ear buds...

A new technology called Vertical Fountain Flux inductive charging is about to change the way we charge our mobile devices.  Typical inductive chargers use a high power magnetic flux to pass energy to a device such as a pacemaker (located inside your chest) and charge the batteries.  This type of charging is fairly efficient at close proximity, but can also damage hard drives or erase the magnetic strips on credit cards.

A company called Convenient Power has created technology based on VFF techniques which localize the magnetic field so it exists only between the device under charge and the charger (not everywhere).  This is highly important for magnetic media or other magnetic sensitive devices that are nearby. It appears that the technology is independent of orientation and is capable of charging 20+ watt devices making it fairly universal for most portable equipment.

Now imagine a solar powered VFF charger platform... when nothing is on the top of the surface, solar cells collect ambient light from the house or office and charge onboard batteries or super-capacitors (or a combination of both).  When you return your mobile device for charging, it transfers the energy stored in the platform and charges the device’s batteries.  How cool would that be? A charging station that can be located anywhere there is ambient light and can charge your mobile device without plugging it in... I want one!

I can imagine these types of chargers built into places you visit everyday - for example your car.  I’d love to simply lay my phone down in the console and have it charge up automatically while I drive to work.  Once I arrive I could lay my phone on another charger sitting in my office which was busy charging its own batteries while I was away.  I could finally cut the cord that ties me to wall power.  And as mentioned on Convenient Power’s website, a formal standard for devices to recognize the chargers and use the power would make charging as universal as cellular networks.  No more looking for a compatible charger - they’d be everywhere! 

So let’s get rid of that last meter of power cable and have free charging for all... just like Wi-Fi, maybe there’ll be a little sticker on the window of your favorite coffee establishment that reads, "Free Wi-Po"... just a thought.  Till next time...

September 08, 2008

Metering Your Power Consumption

Bookmark and Share

Power_meter_small In this world of ever increasing energy costs, almost everyone is trying to save where they can.  I’m one of those people that try to watch our electric bills and understand where all the power is going...  only one problem - there is only one meter on the house.  This lonely meter tells me - via my bill each month - how many kilowatt-hours were consumed by our household.  Not really informative enough for me.  This is the equivalent of getting a bank statement with only the total spent for the month... you’d like to know where all that money went, right?

A good start would be to know how much energy is being used during the day in real time as you use it. I’ve heard about these little gadgets that monitor the power going into your house and wirelessly report your consumption in real time.  An example of these devices is the Power Cost Monitor which actually reads out in dollars per hour and total for the month.  This provides you immediate feed-back on the power usage of your home so you can make decisions on how to reduce your consumption.  What a great idea and it can be installed onto your existing meter without the need for an electrician.

So, my first call went to Florida Power & Light to find out what they can do to help me. After getting though the phone gauntlet and arriving at a human being I asked the question "Is there a way for me to read your meters remotely so I can watch our power consumption".  The answer was, "no, and attaching anything to the meter to read it is considered meter tampering - which is a very bad thing".  This first call did not go well and I didn’t really want to have them elaborate on the "which is a very bad thing" part of that answer. I couldn’t believe the utility company didn’t want me to try and save energy by closely monitoring my consumption.

Subsequent calls to FP&L also failed to find any advocates for such a device.  So I called the company that distributes the monitors and asked if they had ever heard of such problems.  They did agree that certain states and power utilities will not allow a homeowner to place anything in contact with the physical meter.  The utilities are afraid of people attempting to defraud them and steal power - understandable, but pretty hard core considering our energy crisis.  I would think they would embrace this technology and even sell it to you.  The whole ordeal made me want to run out and buy a complete solar installation and disconnect our house from the grid!  Maybe next year...

So my next option would require monitoring equipment to be installed in my main panel - and that has no effect on the utility since it’s on my side of the meter.  There are devices such as "The Energy Detective" available from the Power Meter Store that installs in your main distribution panel immediately following the meter.  This also has a remote unit that provides several real-time and accumulated power consumption numbers.  There is even a version that provides a computer interface and software to monitor and record your usage... a great feature.

Now that I solved the problem with monitoring the total power used by our home, what about the smaller appliances and systems?  There are devices called "Plug Power Meters" which connect in-line with smaller appliances or electronics.  These are watt meters with plugs and are very handy for looking for phantom or vampire loads - power drains caused by electronics that never completely turn off.  But why do electronics draw power even when off?  Let’s take a look.

Many modern electronic systems have microcontrollers (tiny computers) running inside of them to monitor various functions like remote controls, and front panel switches and buttons.  There may also be a clock or other display which are always on (e.g. your microwave oven digital clock). When you turn off the unit by pressing the power button, the microcontroller turns off various sections of the system, but remains on to monitor other buttons or a remote control.  That part of the system never turns off and continues to use energy.

Also, communications equipment such as a cable box remains in constant contact with the central office to monitor network status, receive commands, and to enable and disable services - even when turned off.  You may find only a slight reduction in power for these types of devices when powered down since they continue to communicate with the cable system.  That’s how my DVR records my shows even when I’ve turned it off (see my previous post "The Case Of The Missing 42 Minutes" ).

Sometimes, it’s simply bad design. Take your phone charger and look at the power consumption when the phone is disconnected. You may find it continues to draw power - maybe even one or more watts.  This is due to a lack of electronics to monitor the load.  When the load (your cell phone) is disconnected, the charger may continue to "try" and charge the phone unaware that it has been unplugged.  Low cost chargers are missing this type of circuitry. A better solution is to actively monitor the load and "disconnect" the system when the load (i.e. the phone) is absent.  A simple push-button can reactivate the charger or very low power stand-by electronics could automatically turn it back on when the phone is reconnected. A simple loop in the cable through the cell phone would work.  When removing the phone from the charger, the circuit would be broken signaling the system to power off.  All of these ideas solve the problem, but with additional cost.

For all of you wondering where those 3000 kilowatts of power went last month, it may be worthwhile to purchase a power monitor and find those offending units.  My breakdown was fairly simple... I live in Florida.  The months of July through September are the hottest often exceeding 95 degrees Fahrenheit during the day.  Air conditioning constantly fights to keep the inside of the house cool and constitutes about 40% - 50% of our usage.  Refrigeration is the next biggest followed by other large appliances (i.e. stove, washer, dryer, etc.).  Interestingly, lighting accounts for only about 20% of the total power usage in our home... however, it’s required every day all year long - unlike the air conditioning.  I need to investigate this more over a year’s period.

An interesting note... I installed automated thermostats on all of our air conditioning units (we have three large systems) and saw a dramatic savings in our power bills.  We paid for all the thermostats in the first 2 months and have been reaping the savings ever since.  It turned out that human error (or lack of memory) was wasting most of our power.  Leaving the temperature set incorrectly while at work or away was the biggest offender.  The new thermostats automatically adjust the temperature when we’re gone to save energy and then readjust the temperature to a comfortable level before we return home.

Hope this gives you something to think about.  Till next time...

September 02, 2008

The Energy Content of Software – Part II

Bookmark and Share

In part one of this series I talked about moving more digital signal processing back to the analog domain to save energy. The savings is accomplished by both reducing processor cycles and by moving the functions to lower power analog solutions.  But what about the software code itself? Does it have energy content and can it be optimized to reduce a system’s power consumption?  The answer to all of these questions is YES.

To prove the point you can examine any modern laptop computer architecture.  Laptop processors are designed to speed up and slow down depending on the system load.  If you are simply idling the CPU by typing a blog post (like I’m doing while I write this), the processor doesn’t need to run at its full processing capacity.  Likewise, the operating system is aware of the processes that are running and adjusts the system accordingly.  All of these advancements provide much longer run times in today’s portable computers.

However, fundamentally the software industry has not embraced the concept of "Code Energy" or how many joules a subroutine or algorithm uses.  Object oriented languages have enabled modular code reuse and tremendously improved the time it takes to create software.  In fact, it’s so easy even this author can create fairly powerful software without spending 20 years perfecting my skill.  This arguably can result in poorly written code - software that is wasteful in both CPU cycles and energy. 

For example, many GUI (Graphical User Interface - pronounced "gooie") routines like a list update can be handled in several ways.  The correct way is to suspend the graphical refresh thread while updating the list.  This action prevents the GUI from continuously trying to refresh the visible list the user sees while the processing thread adds contents to the list.  I see this error many times in software and it’s very annoying. It wastes cycles and slows down the user interface - sometimes to a crawl...  See my Delphi example below of a correct way to update a ListBox object:

Example_routine

Another example is bloated code.  Many times libraries of functions are used to simplify the creation of a software project.  This is an extremely powerful concept allowing great reuse of routines. These libraries can be dynamically loaded or unloaded from memory as needed and can be shared among many programs or processes running simultaneously.  Now imagine you have a library that contains a quick sort routine as well as 100 other routines all packaged into one library (for Windows fans, a DLL or Dynamic Link Library).  This is a precompiled object that stands completely alone and is loaded by calls to the operating system.  If all you wanted is the quick sort routine, the operating system would need to load (and maintain) the entire library of routines since they are a complete unit.  This takes cycles, memory and other resources.  This is the equivalent of buying (and storing somewhere) the entire contents of a clothing shop when all you wanted was a single T-Shirt.

Many software engineers have become complacent with the belief that they’ll always have enough memory, disk space or CPU cycles.  The tools for creating software today are incredibly powerful and allow amazing amounts of code reuse and optimization. It is very easy to become dependant on the tools to make sure our code is written efficiently.  The tool, like a hammer or screw driver, is only as good as the user at the control end.  Poor architecture leads to poor performance and thus, high energy content.

If you turn back the hands of time 30 years to the day when microcontroller systems had 16KB (16,384 bytes) of RAM, engineers were exceptionally creative in building systems that ran efficiently.  They didn’t have object-oriented language tools and any code that was reused was from routines written in ASSEMBLER for that particular processor - not a universal module that could be targeted to any system.  In those days it took years to create complex systems, so with the advent of high-level object-oriented languages such as C++, engineers were quick to adopt them.  Unfortunately, many of these tools were targeted toward code reusability and time to completion - not energy efficiency.

As it turns out, many of these inefficiencies were noted in the poor performance of early operating systems.  The offending routines, usually in the kernel or core of the system, were re-written in highly efficient assembler code and optimized for quicker execution.  This action, in affect, lowered the energy content of the OS kernel and improved the performance of the overall system.  Engineers today don’t necessarily need to hand code every little routine in machine language to get better efficiency from their software.  Let’s look at a list of things that can lower the energy content of software - all of these ideas apply to both embedded systems and full out computer systems and servers.  I’m going to do them in "Letterman Style" ascending order of importance for fun and effect - now, no looking ahead!

10. Use a stop watch : If you want to know exactly how much energy is in your software, measure it.  That is, if the process takes seconds to complete you have a great deal of processing going on.  I like the comparisons of various sorting techniques - Bubble, Bi-Directional Bubble, Selection, Shell, Quick Sort and others.  On large data sets you can actually time how long it takes for these routines to complete and compare one with the other... a stop watch is a handy programming tool.  In this case, shorter is better...

9. Use a power meter : This is really important for embedded applications, but can apply to most systems.  The power meter should be a chart recording type (digital or analog) and calibrated to the range of the system.  You can actually watch when the supply power fluctuates due to sections of the system turning on or off or system clocks speeding up or slowing down.  Oh, you don’t dynamically control the subsystems in your project to save energy?  Bad programmer... what have we been talking about here?

8. Ask your colleagues : Has anyone in your department ever done something like this before? I’ve heard stories of engineers sitting one cube apart where one of them has worked on a similar project and the other never knew.  Ask around your department before you start writing code - maybe someone perfected the ideal and highly optimized routine for you to use...

7. Think of CPU cycles as money : Imagine having one million dollars available and you need to build a project using those funds.  What if, at the end of the project, any money left over was yours to keep?  How would you spend the money while building the project - I’d imagine very frugally... Think of your computer cycles the same way.  Remember, cycles are not free and neither is memory or communication bandwidth.  These all have finite costs associated with them - and they all draw power.

6. Know your operating system : This is one of my biggest pet peeves! I cannot tell you how many times I’ve seen code written that intentionally works around the benefits built into the OS and runs completely unreliably or with abysmal performance - and thus, high energy content.  I mentioned a few examples above, but the list could include hundreds of examples if someone gave me the time!

5. Learn your language : Just because you can write a simple hashing routine doesn’t mean you fully understand the programming language you are using.  I, for one, don’t always know every OS call or library routine - and that’s all right since that’s what reference documents are for.  However, you should know the best way to code a solution to a problem. Just like a written language, there are ways to communicate things that are more efficient and precise.  I find badly written code so often it makes me wonder if these programmers ever went to school to learn how to write code!  Poorly written code wastes energy...

4. Change your perspective : This is true for many problem-solving ventures.  A new or fresh perspective can sometimes expose methods that are superior to those used in the past.  I often find myself taking a coffee break, or simply walking around for a while when I’m looking for a software bug or before starting a new design. Have someone else look at it as well.  I once had my wife look at some broken code (she is not an engineer or programmer) to see if she could find anything that seemed out of place.  She noticed that when letters and numbers appeared in parentheses (an "if" test), there were always two equal signs... except in one.  There was the problem - a valid line of code that didn’t do what I wanted! I had looked at that code for days and never saw the flaw.

3. Improve your hardware knowledge : Software engineers may sometimes feel that all they need to know is software. Knowing more about the effects of your code on the performance of the system is absolutely a requirement - no options here.  For example, our cable company recently "upgraded" our set-top boxes with "new and improved" software.  Not only does this new release lack important functions that were previously there, but the overall performance is much slower - and all on the same hardware as we’ve been using!  Bad programmers...

2. Be modular : Once you’ve taken all the bloat out of your routines, clean up the entry and exit points to allow encapsulation.  Why waste all that great coding?  Even with my primitive coding skills, I’ve created routines that have simple entry and exit points.  Some I never thought I’d use again. But every once in a while I find a great piece of code in my stash of routines which saves hours of re-engineering the same solution!

1. Understand your tools : I cannot stress this point enough!  The tools that compile and assemble your high level object oriented code into machine code have many options to control the process.  Sometimes you want to optimize for space and other times you may want to optimize for performance - these are trade-offs. The tool sometimes will include diagnostic code in the compile to make debugging easier... did you remember to take it out in the final distribution?  I know these sound like simple things, but I’m sure there’s a large amount of production code out there that was released with the wrong flags set during the compile... we all get busy and forget things!

0. (Bonus) Always document EVERYTHING : You thought I was ranting on the tools issues - this is my biggest complaint when I look at some else’s code.  If you did something clever - TELL ME...  If you know that setting a bit in the processor during a particular operation lowers the power, make a note to why you did it.  Encapsulate your routines as well.  Tell me a story about why this routine exists - why was it important enough to encapsulate?  Oh, I could rant on this all day, but this is about saving energy - not hair on my head (it’s too late for that now).

I’m sure you have similar rants and raves or simply good ideas on how to write efficient code.  Do share if you have some!  Hope you enjoyed this two-part series and gained some insights on how to lower the energy content of your software.  Till next time...