Page 176 - Anatomy of a Robot
P. 176

07_200256_CH07/Bergren  4/10/03  3:30 PM  Page 161
                                                                     ENERGY CONTROL AND SOFTWARE 161
                            are better than others for this task. The point is, if the processor is designed to enable
                            the energy control you require, then it probably has special-purpose hardware built in.
                            Often, software drivers for the energy control hardware are already available. The over-
                            all  energy  control  algorithm  must  take  advantage  of  these  processor  features.
                            Attempting to circumvent them or to use them in nonstandard ways will likely mean
                            ruination. The processor designers probably had a difficult time getting things right and
                            it is easy to break their design. Stick to the basics and don’t be afraid to call the proces-
                            sor company.


                            CENTRALIZATION

                            Try to centralize the energy code. To function properly, energy control software must
                            often be spread over most of the software in the robot’s computer. Portions of the code
                            are in the flash memory boot code, the operating system, and the application code. As
                            the code spreads out like this, it starts to get “holes” in it. It becomes more fragile in
                            terms of its capability to provide proper energy control. Simultaneously, if multiple pro-
                            grammers are involved, programming discipline becomes more difficult. We must pro-
                            vide a simple, understandable application programmer’s interface (API) that will attend
                            to energy control properly. Fortunately, a couple of remedies are available:

                                Keep it tight  If the API code is written from the ground up, try to keep the API
                                 small and confined to the lowest levels of code (the Basic Input/Output System
                                 [BIOS] and a few drivers).
                                Keep it simple  If you must build your own processor drivers, and can get away
                                 with it, don’t try to implement every feature the processor offers. Get the most
                                 aggressive power-saving features of the processor working well first. If the other
                                 features are also desirable, add them later if you can.

                              Now we should look at strategies for power control. Where do we start?
                              It makes sense to start with the specifications. While the specifications are being
                            written, we will probably have a sense of how difficult the energy control problem will
                            be. It makes sense, right then, to look at energy control in a larger sense and decide on
                            the overall approach. The government even has specific programs to encourage the
                            industry to decrease energy consumption (see www.energystar.gov).
                              Semiconductor companies and operating system companies work together to provide
                            a coordinated approach to power control. As an example, the community defining the PC
                            architecture has done this over the years. Committees meet once a year to ratify the
                            changes that all parties will make in their designs and publish documents specifying the
                            changes. The Windows Hardware Engineering Conference (WiNHEC) is one of these
                            committees (www.microsoft.com/winhec/default.mspx).
   171   172   173   174   175   176   177   178   179   180   181