A task scheduler framework for self-powered wireless sensors

A task scheduler framework for self-powered wireless sensors

ISA TRANSACTIONS® ISA Transactions 42 共2003兲 535–545 A task scheduler framework for self-powered wireless sensors Mikael M. Nordman Power Systems Lab...

235KB Sizes 0 Downloads 18 Views

ISA TRANSACTIONS® ISA Transactions 42 共2003兲 535–545

A task scheduler framework for self-powered wireless sensors Mikael M. Nordman Power Systems Laboratory, Helsinki University of Technology, P.O. Box 3000, FIN-02015 HUT, Finland

共Received 31 March 2002; accepted 18 October 2002兲

Abstract The cost and inconvenience of cabling is a factor limiting widespread use of intelligent sensors. Recent developments in short-range, low-power radio seem to provide an opening to this problem, making development of wireless sensors feasible. However, for these sensors the energy availability is a main concern. The common solution is either to use a battery or to harvest ambient energy. The benefit of harvested ambient energy is that the energy feeder can be considered as lasting a lifetime, thus it saves the user from concerns related to energy management. The problem is, however, the unpredictability and unsteady behavior of ambient energy sources. This becomes a main concern for sensors that run multiple tasks at different priorities. This paper proposes a new scheduler framework that enables the reliable assignment of task priorities and scheduling in sensors powered by ambient energy. The framework being based on environment parameters, virtual queues, and a state machine with transition conditions, dynamically manages task execution according to priorities. The framework is assessed in a test system powered by a solar panel. The results show the functionality of the framework and how task execution reliably is handled without violating the priority scheme that has been assigned to it. © 2003 ISA—The Instrumentation, Systems, and Automation Society. Keywords: Wireless sensors; Multitasking; Task scheduler; Ambient energy source

1. Introduction Generally the main problem with existing sensor systems has been the high cost of cabling compared to other system costs 关1兴. The price of sensors, actuators, and other components has continuously gone down, however, the cost of cabling and cable maintenance has not followed this trend. There is therefore a growing interest in wireless sensors, sensors that use short-range radio over a license-free frequency to communicate information to some data-gathering device. Although wireless communication will eliminate the cabling costs new concerns appear with the technology. The communication link is unreliable and there is no wire feeding power to the sensors. These sensors are therefore either battery powered or selfpowered. Self-powered sensors harvest energy

from ambient energy sources, e.g., sunlight, vibrations, temperature differences, or wind. The benefit compared to battery powering is that selfpowering potentially yields an infinite lifetime while batteries must regularly be replaced. However, a battery can be regarded a more reliable energy source than ambient energy where the collectable energy varies over time. Gathering energy in some backup storage, e.g., by charging a capacitor, smoothes these variations out. The capacitor can also be used to regulate and stabilize the power fed to the sensor circuit. Energy is for both sensor types a scarce resource and energy dissipation must thus be minimized. A common energy saving technique is to shut down resources whenever they are not needed 关2兴. In wireless sensors this means at least that the radio transceiver is switched off. However, if energy is

0019-0578/2003/$ - see front matter © 2003 ISA—The Instrumentation, Systems, and Automation Society.

536

Mikael M. Nordman / ISA Transactions 42 (2003) 535–545

Nomenclature

S ␶S

␲ ␳␲ ␧␲

␶␲ t␲ E C( t ) E I( t ) E ␲( t )

A sensor. Duration between two subsequent periodic interrupts that wake the sensor up. A task 共⌸ denotes a set of tasks兲. Task priority. Energy consumed during task execution. Task period 共in integer ticks of ␶ S 兲. Representation of the time that a task ␲ last occurred. The energy stored in a capacitor at time t. Ambient energy at time t. Energy available for a task at time t.

hardly available the processor and the transducer I/O can be switched off too. This poses the problem of when and how the sensor should be woken up again. One solution is to generate wake-up interrupts by electronics that is kept continuously active to sense spontaneous events and to handle periodic interrupts by a clock circuit. Currently there are several ongoing research projects that address the issue of minimizing the energy drain of wireless sensors. For example, the ␮AMPS project focuses on an architecture for power-aware distributed microsensors 关3兴. The PicoRadio project considers development of lowcost nodes that minimize the energy dissipation 关4兴, and the WEBs project studies self-organizing wireless sensor networks 关5兴. All these projects have in common that they study very tiny and highly integrated mass-distributed sensors where the goal is to minimize energy dissipation of communication protocol, CMOS technology, and algorithms. An appealing future prospect is to enable reliable execution of multiple tasks in wireless sensors. Successfully achieving this objective will not only enhance the attractiveness of installing sensors, but also the return on the system investment will increase. However, obtaining reliable multitasking of self-powered wireless sensors is problematic. It is quite impossible to predict the future energy availability and it is thus hard to decide how and when tasks of different priority can be

executed so that low priority tasks will not consume the energy that should be reserved for future tasks having higher priority. This paper proposes a solution to the problem by presenting a task scheduler framework that allows self-powered, wireless sensors to reliably support multitasking. Its core idea is that the sensors themselves are responsible for continuous energy management and schedule the activity of periodic tasks according to a priority scheme. We adopt a conservative approach meaning that the scheduler strictly follows the priority scheme and makes pessimistic predictions regarding the energy that will be available in the near future. The scheduler building blocks are a formal identification of environmental and system parameters affecting the decision making, a virtual queuing system that models the sensor behavior and resources and a set of scheduling conditions, which are formed around the premises given by the other building blocks. 2. Preliminaries 2.1. Low-power versus power awareness Most of the research regarding scheduling tasks in battery-powered or in self-powered systems has been dedicated to low-power designs and algorithms. Some of the results in literature discussing different methods, algorithms, and architectures can be found in Sinha, Potkonjak, Yao, Swaminathan, and Benini 关6 –10兴. However, low-power design promotes minimization of energy consumption on component level and can be regarded inadequate on a system level. A self-powered sensor supporting multitasking must take into consideration the available energy and adjust the task execution pattern accordingly. Hence the sensor must be power aware. Power awareness means that a system makes the best use of the available energy by tracking the energy availability and by adapting the resource usage based on that. The term power aware has, e.g., been used by Liu et al. to describe a system level scheduling technique solving problems found with the Mars Pathfinder 关11兴. Our proposed scheduler framework differs, however, in the approach from the one presented by Liu et al. They use a graph-based tool in a system level context to construct from the specification, timing, and energy constraints for the

Mikael M. Nordman / ISA Transactions 42 (2003) 535–545

scheduler. The scheduler can manage a mission so that the best performance is granted under the premises of available energy. We define a tiny energy framework that is embedded into wireless sensors and must thus meet the memory and computing power constraints imposed by them. Our approach is to model the energy behavior on sensor level and accompany the model with simple scheduling conditions. It does not have the same mission and system level dimensions as systems addressed by Liu et al. 关11兴. Indeed, our framework has been developed with a continuous process in mind where a sensor actively adapts periodic and spontaneous tasks to the available and predicted energy level.

2.2. Assumptions regarding fairness and preemptiveness A system that is driven by a nonstable, nonpredictable energy source can naturally not provide a very high level of fairness between tasks of different priorities. Compared to, e.g., communications traffic theory, where starvation is prevented by sometimes sending low priority traffic at the cost of longer delays for high priority traffic 关12兴, there is a fundamental difference regarding the resource predictability. In the reference case, the future resources 共bandwidth兲 can be predicted. However, the future ambient energy is hardly predictable. Our framework deploys a strict priority policy where fairness is not guaranteed. Hence tasks can experience starvation of an unpredictable duration. This occurs when the energy resources cannot meet the needs of all tasks. We regard it better to acknowledge starvation existence compared to the possibility that a high priority task will not be executable because a low priority task has consumed the energy reserve. Preemptiveness is an issue in multitasking systems, where high priority tasks will overrun low priority tasks that are under execution. In the case of wireless sensors, preemptiveness will happen when some spontaneous event occurs that triggers an aperiodic task. The main problem with handling preemptiveness is the resource uncertainty that appear in wireless sensors. We have addressed preemptiveness as a class of its own that will have resources reserved quite in a similar way as for periodic tasks. The model and the reservation

537

scheme are discussed in conjunction with the framework theory in next section. 3. The framework theory In this section the boundaries of the scheduler framework are first discussed. Next a formal model of the energy constraints and energy availability is presented. This is followed by the scheduler theory and the conditions defined in the framework. 3.1. Framework model The boundaries of the framework are formally defined by the environment parameters, the energy model of the sensor, and the properties of the task model. The framework defines the following environment parameters: 앫 The outage time T O , which is the expected duration of an arbitrary period where no, or a negligible amount of, ambient energy can be harvested. This appears whenever the environment is prevented to supply energy of the format that can be harvested. 앫 The assumed frequency of spontaneous events f s that will activate some aperiodic tasks. The boundaries of the energy model are 앫 The energy in storage at time t. It is assumed that the sensor has a capacitor that stores ambient energy harvested from the environment. Assuming an ideal capacitor at time t with zero power leakage, linear behavior, C capacitance, V ( t ) working voltage, and V f the lowest voltage where the capacitor is useable, the available energy is denoted by 关13兴





V 2f 1 E C 共 t 兲 ⫽ CV 共 t 兲 2 1⫺ . 2 V共 t 兲2

共1兲

앫 The ambient energy that the harvesting electronics can recover at time t, expressed as E I ( t ) . The properties of the task model are defined as follows. Every sensor S generates a wake up interrupt with the period denoted ␶ S . S contains a set ⌸ of tasks ␲ 苸⌸. Every task ␲ can contain a number of subtasks ␲ S that are responsible for different duties. In the definition it is important to note that spontaneously generated tasks are not

538

Mikael M. Nordman / ISA Transactions 42 (2003) 535–545

Fig. 1. Different levels of E I (t) that satisfy average energy needs of prioritized tasks.

distinguished from periodic tasks but both classes have the same properties. When a task is executable, it runs all its subtasks and sends the information gathered forward in one communication transaction. Every task ␲ is assigned a set 具 ␳ ␲ ␧ ␲ ␶ ␲ T ␲ 典 . ␳ ␲ is the task priority. To simplify the scheduler, it is presumed that ᭙ ( ␲ , ␲ ⬘ ) 苸⌸: ␳ ␲ ⫽ ␳ ␲ ⬘ . This means that tasks having equal priority will be handled as subtasks that are wrapped by a main task of the same priority. The energy consumed by executing the task is denoted ␧ ␲ . If the task has a period, it is denoted ␶ ␲ and equals an integer number of ␶ S ticks. T ␲ is the maximum time in which the information gathered by the task will be valid. T ␲ is equivalent to the deadline of a task except that T ␲ is expressed in integers of ␶ ␲ . 3.1.1. Properties of the energy model The objects E C ( t ) and E I ( t ) constitute the energy model. Let us first devote the attention to E I ( t ) . Omitting energy previously stored in the capacitor, the sensor S must at least on average harvest ␧ ␲ energy during the period ␶ ␲ to enable a task ␲. As can be embraced, it is assumed that the capacitance limits are set so that a possible overflow will not prevent a task execution. Because the scheduler follows a priority scheme, high priority tasks will always be executable on the cost of low priority tasks. Hence, on average, for a task ␲ ⬘ with priority ␳ ␲ ⬘ there exists a level of ambient energy that satisfies the energy needs of ␲ ⬘ . This is expressed in Eq. 共2兲 and illustrated in Fig. 1 where the levels above the gray area satisfy Eq. 共2兲,

E ⬘I 共 ␲ ⬘ 兲 ⭓

兺 兵 ␲ 苸⌸: ␳ ⭓ ␳ ␲

␲⬘其

␧␲ . ␶␲

共2兲

Now consider the storable energy. The system is regarded safe if the capacitor has the capacity to

provide energy to the sensor also during ambient energy outage. The minimum level is set by the expected outage duration T O , the assumed frequency of spontaneous events f s , and the intended periodic task execution pattern denoted here as ␲. If the circuit voltage is V C , where V C ⬎V f , ¯␧ ␲ 关 f s 兴 denotes the estimated energy consumption of an aperiodic task, and ¯ ␤ is the estimated energy dissipation per time unit, the absolute minimum capacitance fulfilling the condition can be estimated by

C AM ⫽

2T O 共 ¯␤ ⫹ f s¯␧ ␲ 关 f s 兴 ⫹␧ ␲ / ␶ ␲ 兲 . 共 V C 兲 2 关 1⫺ 共 V f 兲 2 / 共 V C 兲 2 兴

共3兲

A simple scheduler can be constructed so that it assesses the energy available at task execution time. This scheduler will, however, not allow reliable priority assignment to be made. The task will in practice, independently of assigned priorities, be executed according to the momentary energy that is available. Hence a task with short period and low priority will be preferred over a task with long period but high priority. To avoid that and to enable simple resource management, we have developed a virtual queuing system that represents the capacitor energy and a corresponding energy reservation scheme. Every task ␲ 苸⌸ with priority ␳ ␲ , is assigned a queue q ␲ and a queue quantum q ␲ ( t ) denoting the energy that virtually is reserved for the task. The capacitor is accordingly divided into the following virtual queues/queue classes: 앫 Base queue—This queue is assigned the energy that is needed to successfully operate during an ambient energy outage. The queue size can be derived from Eq. 共3兲 and the queue energy is denoted q B( t ) . 앫 Spont queue—The queue where resources are reserved for spontaneous events during normal operation. It has the same properties and symbols as queues used for periodic tasks. However, as will be discussed later, its reservation scheme is slightly different. 앫 Periodic task queues—A queue q ␲ for every periodic task with priority ␳ ␲ . The queuing system for a sensor is shown in Fig. 2. The clock queue and the task queue show the nonenergy resources used to handle periodic tasks. Aperiodic tasks triggered by spontaneous events have buffered access to the scheduler.

Mikael M. Nordman / ISA Transactions 42 (2003) 535–545

539

and the reservation scheme should reflect that. Therefore, for such a task ␲ * , ␣ ␲ ( 0 ) can be set * equal to ␶ ␲ , and ␣ ␲ ( t ) to 0, where t⫽0. This * * gives the readiness to handle one spontaneous task at anytime. The property of Eq. 共4a兲 allows the scheduler to calculate the energy reserved for a task at any time. This prevents low priority tasks from consuming energy that is reserved for high priority tasks and a priority scheme can reliably be followed. Hence, at time t the energy that is available to task ␲ ⬘ is given by

Fig. 2. The sensor and its capacitor modeled as a queuing system.

3.1.2. Energy reservation scheme Checking the capacitor and the ambient energy has a cost of energy drain. Energy monitoring should thus be done as seldom as possible. Therefore during normal operation it is done in conjunction to task execution. Between task executions, when the sensor is sleeping and only woken up for short duration by periodic clock interrupts 共clock period ␶ S ) , the energy quantum reserved for a task is estimated. The estimation process is straightforward. Every time the sensor is woken up, the quantum is increased by a predefined energy quantity. The quantity is derived as follows. For every task ␲ 苸⌸, there exists a weight function ␣ ␲ ( t ) that gives the proportion of ␧ ␲ that virtually is reserved during every period ␶ S :

q ␲ 共 t⫹ ␶ s 兲 ⫽q ␲ 共 t 兲 ⫹

␧␲ ␣ 共 t 兲. ␶␲ ␲

共4a兲

The function ␣ ␲ ( t ) is chosen so that the following holds:

再冕

t⬎ ␶ ␲

0,

␣ ␲共 t 兲 ⇒

␶␲

0

␣ ␲ 共 t 兲 dt⫽ ␶ ␲ , t⭐ ␶ ␲ .

共4b兲

If ␣ ␲ ( t ) is, e.g., set to 1, the queue quantum q ␲ ( t ) is every ␶ S increased by ␧ ␲ / ␶ ␲ . The weight function ␣ ␲ ( t ) provides a means to manage the speed at which energy is reserved for a task between executions. It also provides a tool to handle spontaneously generated tasks differently than periodic tasks. Spontaneous tasks can occur anytime

E ␲ ⬘ 共 t 兲 ⫽E C 共 t 兲 ⫺



兵 ␲ 苸⌸: ␳ ␲ ⬎ ␳ ␲ ⬘ 其

q ␲ 共 t 兲 ⫺q B 共 t 兲 . 共5兲

Hence resource reservation for high priority tasks will overrun reservation for low priority tasks. It is also worthwhile to note that periodic tasks having a higher priority than spontaneous tasks will, according to Eq. 共5兲, overrun the spontaneous task. This is because spontaneous tasks are considered just as one member in ⌸. Hence, to ensure full operation readiness of spontaneous tasks, these should be given a high priority in the framework. When a task has been executed, its corresponding queue quantum q ␲ ( t ) is set to zero and the reservation scheme starts over again from the beginning, which is expressed in Eq. 共4a兲. The information provided by Eqs. 共2兲 and 共5兲 can now be used to derive the conditions of the scheduler. 3.2. Scheduling conditions Let us first consider the information expressed by E C ( t ) and E I ( t ) and the problems that are associated with them as the input information to the scheduler. E I ( t ) expresses the ambient energy that can be harvested. One may argue that measuring this level at task execution will say whether the current ambient energy level is such that the task can be executed. In a way this is right, however, it will make the scheduler sensitive to fluctuations and small energy drops. If, e.g., the ambient energy has been on a high level for a long time and it suddenly drops, the wrong conclusions will be drawn by the scheduler. By also examining E C ( t ) information about the level for a longer period is given and short drops will be smoothed out.

540

Mikael M. Nordman / ISA Transactions 42 (2003) 535–545

Fig. 3. The scheduler viewed as its states and the state transitions.

On the other hand, if only E C ( t ) is regarded as reference, there will be no information concerning the status of the ambient energy level. If it drops very low, the execution of high priority tasks should be assured by suspending low priority tasks. Although there may be energy reserved in the capacitor for low priority tasks this energy should be used as an energy buffer for high priority tasks instead. To make this decision, information about E I ( t ) is needed. The scheduler constitutes of three states; state transition conditions and a monitoring task 共see Fig. 3兲: 앫 Run—The normal state where a task is executed according to its period or events. 앫 Buffered—A state where the task is executable but energy consumption is minimized.

Fig. 4. Buffering and suspension criteria according to E I (t). The left-hand side shows that the studied task potentially can be moved to the Buffered state in the case that the average energy flow is below the level needed to satisfy its needs. The right-hand side shows similarly that if the average energy flow is below the level defined for a task of higher priority, the studied task will potentially be moved to the Suspended state.

앫 Suspended—The task is suspended from further execution. A task can suspend itself only and is practically also responsible for assessing the release condition. 앫 Monitor—A light monitoring task that handles buffered tasks. It makes measurements of either E C ( t ) or E I ( t ) , or both. 3.2.1. State transition Run–Buffered The transfer of task ␲ ⬘ from Run to Buffered occurs if the level of E I ( t ) satisfies all tasks with higher priority than ␲ ⬘ 共limit shown in Fig. 4兲 and the total energy consumed by the task does decrease the energy stored for tasks of higher priority. Formally expressed it becomes

共6兲

The condition is conservative in the meaning that even if the ambient energy level is high, it is assured that the reservation scheme 关see Eqs. 共4兲 and 共5兲兴 for the high priority task is not violated. In this state the task is executable but its energy consumption is minimized. The chosen execution strategy is implementation dependent. Generally a

shorter variant of the task can be executed and the communication transaction can be postponed. The data is stored in a FIFO buffer until the maximum time limit T ␲ ⬘ has been reached. If the buffer is full, tasks are discarded based on their timestamp. This state activates the Monitor. The idea of the Monitor is to make use of possible spare energy or

Mikael M. Nordman / ISA Transactions 42 (2003) 535–545

energy peaks so that undone task duties in the Buffered state 共e.g., data transmission兲 can be performed in case the energy level rises in between the duty cycles of a buffered task. The Monitor regularly checks the status of the energy resources. To minimize the energy drain of this operation it can be done stepwise, e.g., so that capacitor energy is preliminary monitored 共assuming that this consumes less energy than ambient energy monitoring兲. If at a time t,

E ␲ ⬘ 共 t 兲 ⭓q ␲ ⬘ 共 t 兲 ,

共7兲

the ambient energy level can be checked. If it conforms to a level that allows the Monitor to perform

541

the undone duties without breaking the reservation scheme, these can be done. If the Monitor does not succeed, the buffered task will itself be responsible for its data buffer when it is back in the Run state.

3.2.2. State transition Buffered–Run The transition from Buffered to Run occurs whenever the condition expressed in Eq. 共6兲 is invalid and there are no tasks of higher priority that are buffered. This transition can occur whenever a task ␲ ⬘ is executable. It is formally given as

共8兲

Making this check is not as resource consuming as it might seem. The buffered status is first checked, then the energy parameters are evaluated, both just a comparison of two parameters that continuously are being updated. 3.2.3. State transition Run/Buffered–Suspended A task is suspended if the ambient energy drops so low that the energy normally reserved for the task is needed to make up for incomplete energy reservation for tasks of higher priority 共limit shown in Fig. 4兲. Let the executable task be denoted ␲ ⬙ and the task on the next higher priority level ␲ ⬘ . The state transition is expressed as

共9兲 When ␲ ⬙ enters the Suspended state, it is prevented from doing any further duties. A question arises, however, whether aperiodic tasks originating from spontaneous events should

be suspended. Considering the nature of spontaneous events and the fact that the framework by Eq. 共3兲 allows spontaneous event handling during energy outage implies that aperiodic tasks should not be suspended. The chosen philosophy is of course implementation specific, but in the formal framework aperiodic tasks are not suspended.

3.2.4. State transition Suspended–Run The transition from Suspended to Run can occur whenever a task is executable. A suspended task is prevented from doing any duties but its period is still running and can be utilized to monitor the transition condition. It shall be noted, however, that if the period is short, the transition condition shall be checked more seldom 共the same holds when several tasks are suspended and the check thus potentially occurs very frequently兲. A task is transferred back to Run if the ambient energy level is feasible, if enough energy is stored and if no other tasks of higher priority are suspended. Formally this state transition is

542

Mikael M. Nordman / ISA Transactions 42 (2003) 535–545

共10兲

To simplify the condition a task cannot return to the Buffered state. Instead, it goes through the Run state and follows condition 共6兲 to the Buffered state. 3.2.5. Special case—E I ( t ) below the minimum threshold If the ambient energy level drops below the level needed by the task of highest priority, the special case of energy outage is being activated. Normal operations are suspended, tasks are prevented from monitoring condition 共10兲 and only the task pattern defined for outage is executed accordingly. The problem with this state is that the ambient energy should on the one hand be monitored so that the system can be woken up with minimum delay whenever the ambient energy level grows. On the other hand, monitoring ambient energy costs energy. A trade-off between the risk of running out of energy and the wake up delay should be assessed. Therefore, let there be a function f T ( x ) expressing the probability distribution of the outage time T O . Let the energy reserved for the monitoring purpose be E M and the energy consumed by the monitoring task ␧ M . A risk level is given by assessing the probability that the outage will last at most t time. The probability is

P共 t 兲⫽

冕 f 共 x 兲dx. t

0

T

共11a兲

By fixing a risk level 1⫺ P ( t ) , the outage time t can be estimated and the period will thus become

␶M⫽

t *␧ M . EM

共11b兲

If the period is unacceptably long, a new risk level must be assessed that meets the delay requirement. 4. Experiment A system of two sensors and a base station was built to evaluate the framework. One of the sensors was equipped with a solar panel and a capacitor that provided the energy. The scheduler was implemented in this sensor. The other sensor was battery powered and it measured, for logging purposes, the illumination of the lamp used to feed power to the solar panel. The system is illustrated in Fig. 5. The main sensor components were a PIC16F877 microcontroller having 8 Kbytes program memory, a 433-MHz transceiver from RF Monolithics, a solar panel 共15 photovoltaic cells兲, and a 1000-␮F capacitor. A photo of a sensor prototype is shown in Fig. 6. Three tasks 共and a monitoring task兲 were defined for the self-powered sensor. The setup was as follows: 앫 Task 1—A task with priority 3 共highest priority兲 and a period of 18 sec. 앫 Task 2—A task with priority 2 and a period of 10 sec. 앫 Task 3—A task with priority 1 共lowest priority兲 and the period 14 sec. 앫 Task 4—The monitor task with a 4 sec period when activated.

Fig. 5. The architecture for a scheduler test with a solarpowered sensor.

The sensor was itself responsible for determining the energy needed by each task and the illumination levels satisfying these requirements. This

Mikael M. Nordman / ISA Transactions 42 (2003) 535–545

543

Fig. 8. The energy in the self-powered sensor expressed as capacitor voltage during the time of the experiments.

Fig. 6. A photo of the sensor prototype that was built and used in the experiments.

was done by the sensor measuring the illumination and the capacitor energy before and after the first execution of each task. A total of 650 ␮J 共analog to 1.3 V兲 of the capacitor energy was reserved for outage 共becomes a level of 4.3 V because the input voltage of the sensor electronics was set to 3 V兲. The prototype 共nonoptimized兲 implementation with the above described task setup reserved 10% of program memory and consumed 150 ␮J every time a task was executed. Between task executions the scheduler did not increase energy consumption. Test results of the experiments are shown in Figs. 7–10. Fig. 7 gives the illumination as measured every fifth second by the battery-powered sensor. This can be compared to the energy of the self-powered sensor expressed as the capacitor voltage 共maximum 10 V兲 in Fig. 8. Generally the curves follow each other’s characteristics. How-

Fig. 7. The illumination level as a function of time being measured by the battery-powered sensor.

ever, between 8 min 20 sec and 8 min 50 sec the capacitor energy drops without any changes in the illumination. This is on purpose forced by placing a cover over the solar panel. This action has been taken to easily assess the buffering property of the scheduler. Because buffering happens when there is a lack of energy in the capacitor and the capacitance chosen in the test system was quite big, it was easiest to artificially force the capacitor energy down. When the cover is removed 共at 8 min 50 sec兲 the monitoring task finds that there is enough energy in the capacitor and that the illumination is high. This can be seen as the execution of task 4 in Fig. 9, where it at 8 min 50 sec sends the buffered data to the base station. From Fig. 9 it can be denoted that it is task 3 that caused the buffering action to take place. It is idle between 8 min 25 sec and 8 min 52 sec. The execution of task 3 at 8 min and 39 sec did thus fail due to lack of energy and the data has therefore been buffered. The illumination has gradually been dropped from 9 min 40 sec to 11 min 20 sec. This experiment has been done to assess task suspension and to see whether the scheduler can reliably run at low-energy levels without risking the stability of the sensor 共if the input voltage drops below 3 V the sensor will stop functioning兲. As can be seen in Fig. 9, task suspension happens gradually from task 3 共from 9 min 56 sec to 11 min 20 sec兲 to task 2 共from 10 min 34 sec to 11 min 20 sec兲. The activity during this period is of course very low and the capacitor energy has therefore been monitored with an oscilloscope too. A snapshot from the oscilloscope is given in Fig. 11. The tiny ‘‘1’’ in the left bottom corner determines the ground level. Hence the capacitor voltage has been ap-

544

Mikael M. Nordman / ISA Transactions 42 (2003) 535–545

Fig. 9. The task execution pattern for every time unit when the scheduler activated a task. The number above a bar indicates which task is executed.

proximately 5 V during this period 共only slightly more than the required base reservation of 4.3 V兲. When the illumination is increased again, the task execution pattern returns to normal. If the scheduler would not work correctly, the sensor would run out of energy by continuing task executing until the system voltage would drop below 3 V. Fig. 10 shows the dynamics of the energy reservation scheme. When a task execution occurs, the sensor triggers the energy that should be reserved for every task according to the scheme presented in Eq. 共4a兲. Hence, this scheme does not show the actual energy in the capacitor but the desired energy at a moment in time. If, e.g., the time between 10 min 30 sec and 11 min 20 sec is studied, it can be noted that the criteria for suspension are fulfilled. The capacitor voltage drops from 7.5 to 6 V 共according to what can be monitored by the sensor itself, the oscilloscope output in Fig. 11 shows that it actually drops during this period to 5 V兲. The illumination level is very low and the desired

Fig. 10. A view of the dynamic energy reservation and queue management being part of the scheduler.

Fig. 11. A snapshot of the capacitor voltage in the selfpowered sensor during the low illumination level. The snapshot has approximately been taken between 11 min 13 sec and 11 min 25 sec.

capacitor energy is between 6.8 and 7.3 V ( 4.3V ⫹queue quantum兲. Generally and as previously discussed in the paper, it is the queuing system that provides the means to reliably assign task priorities and to execute the tasks accordingly. 5. Discussion Wireless sensors have lately gained a big interest in the research community. They are cheap and easy to install compared to traditional sensors and open thus up new possibilities to equip systems with advanced measurement and monitoring sensors. The main problem is the lack of a longlasting power source, while no power is fed over a cable. These sensors are therefore battery powered or self-powered. The beauty with self-powering is that it potentially yields an infinite lifetime, while obviously battery powering has an associated battery management cost. However, the concern with self-powering is how to reliably run applications. Especially self-powered sensors that execute multiple tasks are very sensitive to the ambient energy that continuously must be harvested. In this paper we have presented a framework that addresses the problem of reliable task scheduling in self-powered wireless sensors. The scheduler constitutes a virtual queuing system that is used to predict and assign energy to tasks at any moment in time, task states and state transitions. With the framework and by knowing the stored energy and the ambient energy level it is possible to reliably execute a set of tasks independently of their period and individual energy requirements. A prototype system has been developed. The scheduler has been implemented in one of the sen-

Mikael M. Nordman / ISA Transactions 42 (2003) 535–545

sors, which get its energy from a solar panel. Different experiments have been done in the prototype system that show the feasibility of the framework, how a task switch states according to the energy quantities and that the sensor reliably runs also during periods when the available energy is very scarce. Without the scheduler, the sensor would run out of energy and would not work correctly. The drawback with the proposed scheduler is that it is quite sensitive to an ambient energy source that is in the form of a square pulse. The scheduler will in this case make some wrong conclusions regarding the ambient energy level and the energy stored in the capacitor and will prioritize tasks of high priority even if it is not necessary. A sensor being fed energy by, e.g., a laser beam that is periodically switched on and off will thus not work perfectly. However, most ambient energy sources do not have a clear square pulse form, they change their intensity more slowly. Also, a laser beam source requires that the beam is directed towards the sensor and that the sensor is in the line of sight of the laser source. This is not a feasible assumption for wireless sensors, especially for well distributed ones. Acknowledgments The author wishes to acknowledge the support of Professor Matti Lehtonen at Helsinki University of Technology and Olavi Va¨ha¨ma¨ki at Vaasa Electronics for designing the electronics used in the test system. References 关1兴 Brooks, T., ISA/IEEE Sensors for Industry Conference, Rosemont, Illinois 2001, pp. 73–77. 关2兴 Srivastava, M. B., Chandrakasan, A. P., and Brodersen, R. W., IEEE Trans. Very Large Scale Integr. 共VLSI兲 Syst. 4, 42–55 共1996兲.

545

关3兴 Min, R., Bhardwai, M., Cho, S., Sinha, A., Shih, E., Wang, A., and Chandrakasan, A., IEEE Workshop on Signal Processing Systems, Lafayette, Louisiana, 2000, pp. 581–590. 关4兴 Rabaey, J., Ammer, M., da Silva, J. L., Jr., Patel, D., and Roundry, S., Comput. Mag. 33, 42– 48 共2000兲. 关5兴 Hill, J., Szewczyk, R., Woo, A., Hollar, S., Culler, D., and Pister, K., International Conference on Architectural Support for Programming Languages and Operating Systems, Cambridge, MA, 2000, pp. 12–15. 关6兴 Sinha, A. and Chandrakasan, A., IEEE/ACM International Conference on Computer Aided Design, San Jose, CA, 2001, pp. 458 – 463. 关7兴 Hong, I., Potkonjak, M., and Srivastava, M. B., IEEE/ ACM International Conference on Computer Aided Design, San Jose, CA, 1998, pp. 653– 656. 关8兴 Yao, F., Demers, A., and Shenker, S., The 36th Annual Symposium on Foundations of Computer Science, Milwaukee, WI, 1995, pp. 374 –382. 关9兴 Swaminathan, V. and Chakrabarty, K., ASP-DAC Asia and South Pacific Design Automation Conference, Yokohama, Japan, 2001, pp. 251–254. 关10兴 Benini, L., Bogliolo, A., and DeMicheli, G., IEEE Trans. Very Large Scale Integr. 共VLSI兲 Syst. 8, 299– 316 共2000兲. 关11兴 Liu, J., Chou, P., Bagherzadeh, N., and Kurdahi, F., International Symposium on Hardware/Software Codesign, Copenhagen, Denmark, 2001, pp. 153–158. 关12兴 Kilkki, K., Differentiated Services for the Internet. MacMillan Technical Publishing, London, 1999. 关13兴 Schempp, E. and Jackson, W. D., Intersociety Energy Conversion Engineering Conference, Washington DC, 1996, pp. 666 – 671.

Mikael Nordman 共1974兲 has been with the Power Systems Laboratory at Helsinki University of Technology, Espoo, Finland since 2000. His current position is research scientist. He received his Master’s degree in Computer Science from Helsinki University of Technology in 2000. The main activities of Mikael Nordman include software and telecommunication issues in industrial automation and in power systems.