Download 04_XMesh_RtControls_LowPower

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

IEEE 1355 wikipedia , lookup

Power over Ethernet wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Transcript
XMesh Low-Power MAC Features
Objectives:
 Motivation
 Overall Power Usage Profile
 General Low-Power Approach
 Network Wide Synchronization
 Mica2 Implementation
 MicaZ Implementation
 Interface and Usage
 Labs
 Low-power MAC
 Low-power XMesh
WSN Training: XMesh Route Cntrl - Low Power
1
Feb 2007
Motivation – Mote Energy Consumption
How much power do motes consume?
Processors
Power Consumption
Atmega128L* 8 mA to 10 mA
(active)
20 A (sleep)
MSP430*
5 mA (active)
5 A (sleep)
Radios
Power Consumption
CC2420
19.7 mA (Rx); 17.4
mA (Tx)
1 A (sleep)
CC1000
10.4 mA (Rx); 16.5
mA (Tx)
1 A (sleep)
Combined Total: 20 mA to 30 mA
*8 MHz cpu clock, 32 khz oscillator on
WSN Training: XMesh Route Cntrl - Low Power
2
Feb 2007
Motivation – Battery
How long will motes last on 2 AA alkaline* batteries?
Capacity
Hours
2000 mA-hr 60 to 90
* Note: Alkaline cells are not the only battery,
but their wide availability and price point
makes them a standard by which to
measure performance
WSN Training: XMesh Route Cntrl - Low Power
3
Feb 2007
Motivation – Typical Application
Requirements
Many sensor network applications require battery powered
motes with life times greater than one year.
Most sensor network applications have very low data rates
that do not require continuous processor or network
activity.
Our low power strategy implemented in the MAC layer
 Power cycles the radio while maintaining communication with
neighboring nodes.
WSN Training: XMesh Route Cntrl - Low Power
4
Feb 2007
Motivation -- Estimating Average Current
Sleep

The system is in this state approximately 95% of the time.
Timer0:



This timer service is always running
For the MICAz this timer wakes every 230 msec for 400 µsec,
increments a counter, and goes back to sleep
During this time the processor is using 8 mA of current.
Measure Sensor


Specific to sensor board
Affected by sensor power requirements, number and type of sensors,
sample time and rate
Transmit Data



This occurs at intervals dependent on the sensor system
requirements.
Without a low-power radio strategy the Mote will only last a few days
(as seen in the previous slide)
We can improve battery life with a better strategy.
WSN Training: XMesh Route Cntrl - Low Power
5
Feb 2007
Current Draw of a Mote in Various Modes
Measured averaged current including health
packets: 309 µA
50 msec idle to acquire sensor data
Sensor power on
Sensor Measure Interval
Xmit data
8 mA
WSN Training: XMesh Route Cntrl - Low Power
Timer Service
6
Feb 2007
XMesh Low-Power MAC Features
Objectives:
 Motivation
 General Low-Power Approach
 Network Wide Synchronization
 Mica2 Implementation
 MicaZ Implementation
 Interface and Usage
 Labs
 Low-power MAC
 Low-power XMesh
WSN Training: XMesh Route Cntrl - Low Power
7
Feb 2007
General Strategy – Receiver
Radio On Listening
Device 1
Fixed Period
Radio On Listening
Device 2
(time)
Fixed Period
WSN Training: XMesh Route Cntrl - Low Power
8
Feb 2007
General Strategy – Receiver (text version)
Every node when not transmitting will periodically power on
their radio in receive mode for short durations.
This period is known and fixed through out the network.
WSN Training: XMesh Route Cntrl - Low Power
9
Feb 2007
General Strategy – Sender
Radio Listen
Receives wakes up & packet
Device 1
(Receiver)
Fixed Period
Transmit wake up
Transmit data
Device 2 (Sender)
(time)
Fixed Period
WSN Training: XMesh Route Cntrl - Low Power
10
Feb 2007
General Strategy – Sender (text version)
Before transmitting any data packets, a node will send a
long wake up sequence which spans the duration of the
fixed listening period first.
Any receiving node that hears the wake up sequence will
keep listening until the data packet is received. Otherwise
the listening node will power down the transceiver.
WSN Training: XMesh Route Cntrl - Low Power
11
Feb 2007
XMesh Low-Power MAC Features
Objectives
 Motivation
 General Low-Power Approach
 Network Wide Synchronization
 Mica2 Implementation
 MicaZ Implementation
 Interface and Usage
 Labs
 Low-power MAC
 Low-power XMesh
WSN Training: XMesh Route Cntrl - Low Power
12
Feb 2007
General Strategy – Synchronized
Radio Listen
Receives wakes up & packet
Device 1
Fixed Period
Transmit data
Transmit short wake up
Device 2
(time)
Fixed Period
WSN Training: XMesh Route Cntrl - Low Power
13
Feb 2007
General Strategy – Synchronized (text)
If we then synchronize every node to sniff and send at the
same time through out the network, then we do not
always need to send a long wake up sequence.
We can shorten the wakeup sequence to within the
synchronization accuracy and only send synchronization
messages with long preamble.
WSN Training: XMesh Route Cntrl - Low Power
14
Feb 2007
Network Wide Sync – Components




Disseminate time synchronization packets
Establish hierarchy graph
Propagating time stamps
Compensate for oscillator skew/drift over time
WSN Training: XMesh Route Cntrl - Low Power
15
Feb 2007
Network Wide Sync – Disseminate
Time Source (Base)
1 Hop Nodes
2 Hop Nodes
3 Hop Nodes
Note: Arrows indicate transmitter and receiver of time synchronization broadcasts with
long wakeup
WSN Training: XMesh Route Cntrl - Low Power
16
Feb 2007
Network Wide Sync – Disseminate (text)
Time synchronization messages are disseminated through
out the network as local broadcasts.
Every node in the network will periodically send out time
synchronization messages.
Every time synchronization message is sent with a long
wake up sequence to ensure that every node hears the
message.
WSN Training: XMesh Route Cntrl - Low Power
17
Feb 2007
Network Wide Sync – Authority
Time Source (Base)
Authority = 0
1 Hop Nodes
Authority >= 2
2 Hop Nodes
Authority >= 4
3 Hop Nodes
Authority >= 6
WSN Training: XMesh Route Cntrl - Low Power
18
Feb 2007
Network Wide Sync – Authority (text)
Every time synchronization update message contains an authority
value in addition to a time stamp.
The authority value of the base station is always 0. No other node may
have authority equal to 0.
When a node accepts a time stamp in a time update, the Node will
also adopt the authority level + 2.
Nodes will only accept time updates with an authority level lower than
the authority level of the node.
Since time updates are infrequent, oscillator drift over time is tracked
to improve accuracy.
WSN Training: XMesh Route Cntrl - Low Power
19
Feb 2007
Propagating Time Stamps
Queueing Delay
Backoff
Preamble +
Wakeup Sequence
Start
Symbol
Packet Transmission
Transit Delay
RX IDLE / SLEEP
SYNC
Packet Reception
New Time = Time Stamp +
Transit Delay
WSN Training: XMesh Route Cntrl - Low Power
20
Feb 2007
nesC Interface – RadioCoordinator
interface RadioCoordinator
{
/**
* This event indicates that the start symbol has been detected
* and its offset
*/
async event void startSymbol(uint8_t bitsPerBlock, uint8_t offset, TOS_MsgPtr
msgBuff);
/**
* This event indicates that another byte of the current packet has been rxd
*/
async event void byte(TOS_MsgPtr msg, uint8_t byteCount);
/**
* Signals the start of processing of a new block by the radio. This
* event is signaled regardless of the state of the radio. This
* function is currently used to aid radio-based time synchronization.
*/
async event void blockTimer();
}
RadioCoordinator is used for time stamping
Low level MAC features generate interrupts through the RadioCoordinator interface when packet
transmissions are initiated. In this way time stamps can be taken without the ambiguity cause by
undetermined delay in the stack.
WSN Training: XMesh Route Cntrl - Low Power
21
Feb 2007
Compensate For Oscillator Skew/Drift Over Time
TimeSource = Skew * TimeRemote + RemoveOffset
• The worest case skew between any 2
nodes over temperature will not exceed
50ppm.
• Typical skew between nodes is usually
< 10ppm.
• Over a 10 minute interval, worest
case drift will be 6 to 30 ms.
•Essentially every node synchronizes to
the base station, the drift caused by the
crystal can be track and eliminated via
the forum above.
WSN Training: XMesh Route Cntrl - Low Power
22
Feb 2007
XMesh Low-Power MAC Features
Objectives
 Motivation
 General Low-Power Approach
 Network Wide Synchronization
 Mica2 Implementation
 MicaZ Implementation
 Interface and Usage
 Labs
 Low-power MAC
 Low-power XMesh
WSN Training: XMesh Route Cntrl - Low Power
23
Feb 2007
Implementation
The wake sequence is implemented differently between the
MICA2 and MICAz platforms.
The MICA2 platform uses a byte radio
 The wake up sequence is implemented by increasing the
preamble of the data packet.
The MICAz platform uses a packet based radio
 The length of packets is fixed
 Long preambles are implemented as series of small packets
WSN Training: XMesh Route Cntrl - Low Power
24
Feb 2007
MICA2 Implementation – Unsynchronized
time
125 ms
Sender
125 ms
125 ms
preamble
data
Receiver
data
Receiver
data
WSN Training: XMesh Route Cntrl - Low Power
25
125 ms
Feb 2007
MICA2 Implementation – Unsynchronized
(text)
Long Preamble:

Every data packet will be sent with an extended preamble as
the wake up sequence.

In this example the preamble length is 140 ms.
Algorithm:
1. Wake up 8 times per second
2. Sniff radio channel
3. If preamble, receive data
4. If clear, send if needed, else sleep
WSN Training: XMesh Route Cntrl - Low Power
26
Feb 2007
MICA2 Implementation – Synchronized
time
125 ms
Sender
125 ms
125 ms
data
preamble
Receiver
data
Receiver
data
WSN Training: XMesh Route Cntrl - Low Power
125 ms
27
Feb 2007
MICA2 Implementation – Synchronized (text)
Algorithm
 Every node in the network synchronizes to sniff and send at the
same moments
 In this example it is every 125 msec.
 Senders and receivers are synchronized so data packets do not
need long preambles.
Preamble
type
Duration
Usage
Long
140 ms
Allows arbitrary new nodes to join mesh network
Short
25 ms
Optimizes power when sending to nodes already in
mesh
Standard
2 ms
Optimizes communication speed for nodes talking to
base
WSN Training: XMesh Route Cntrl - Low Power
28
Feb 2007
MICA2 Implementation – Synchronized
time
125 ms
Sender
125 ms
125 ms
preamble data
Receiver
data
Receiver
data
WSN Training: XMesh Route Cntrl - Low Power
125 ms
29
Feb 2007
MICA2 Implementation – Sniff Timing
Timing of Wake-up Check
Radio RX Power-up
ADC Sample and
Hold Completion
146 us Radio on
time
Quiet Channel Average
RF Shutdown
ADC
Conversion
Start
Wake-up Threshold
ADC Conversion
Complete
RSSI Output
82 us ADC
Conversion
Time
Fast Channel check: 140 µsec
WSN Training: XMesh Route Cntrl - Low Power
30
Feb 2007
MICA2 Implementation – Sniff Current Draw
WSN Training: XMesh Route Cntrl - Low Power
31
Feb 2007
MICA2 Implementation -- Performance
Testbed: 20 MICA2
Expected Lifetime
 Majority of the nodes 2 hops
from the base station
Estimated battery lifetime
 1.2 years @ 3-minute reporting
intervals
 Battery life depends on type of
sensor(s) attached to node.
WSN Training: XMesh Route Cntrl - Low Power
0
20
40
60
80
100
4.5
4
3.5
3
2.5
2
1.5
1
0.5
0
120
Years
Surge Time Sync (20 nodes)
Reporting Interval
32
Feb 2007
MICAz Implementation -- Unsynchronized
Sender
τ
Receiver
τ
Sniff for activity
Transmit Wakeup
packet sequence
Transmit data
packet
Rx Wake Up + Data
Packets
WSN Training: XMesh Route Cntrl - Low Power
33
Link Lvl Ack
Rx Link Lvl Ack
Feb 2007
MICAz Implementation -- Text
Long Preamble:
 Every data packet will be sent with a wake up sequence
composed of a series of short packets.
 In this example the sequence length is 135 ms.
Algorithm:
 Wake up 8 times per second
 Sniff radio channel
 If any packets detected, receive data
 If clear, send if needed, else sleep
WSN Training: XMesh Route Cntrl - Low Power
34
Feb 2007
MICAz Implementation – Sniff Current Draw
WSN Training: XMesh Route Cntrl - Low Power
35
Feb 2007
MICAz Implementation
Moteworks 2.0
 Only asynchronous low power available for MICAz
 Synchronized version available in MW 2.2
Estimated battery lifetime
 400 A @ 8 sniffs per second and no traffic
 700 A @ one sensor sample and send per 3 minutes
 ~4 month on two AA alkaline cells
 Battery life depends on type of sensor(s) attached to node.
WSN Training: XMesh Route Cntrl - Low Power
36
Feb 2007
Lab on Low-Power MAC
Applications:
 CountSend
 CountReceive
WSN Training: XMesh Route Cntrl - Low Power
37
Feb 2007
Lab – Part 1: Low Power MAC
Background
 The low power features of XMesh is implemented in the MAC layer.
 It is thus possible to enable low power in applications that do not use a
networking layer.
 In this lab we will compile two programs, CountSend and CountReceive
to use a low-power MAC.
File Location
 CountSend: Moteworks/apps/general/CountSend
 CountRecv: Moteworks/apps/general/CountReceive
Notes
 This lab requires two Motes
 We recommended that you enable low power is via the route,lp flag
at compile time for both applications
 The following examples assumes a MIB510 on COM1 therefore adjust
as necessary
WSN Training: XMesh Route Cntrl - Low Power
38
Feb 2007
Lab Step 1: High Power MAC Compile & Flash
Example for MICAz being flashed on a MIB520
$ cd /opt/Moteworks/apps/general/CountSend
$ make micaz route,hp install mib520,COM<#>
After flashing is
done, remove
Mote 1 and attach
Mote 2 to MIB
$ cd /opt/Moteworks/apps/general/CountReceive
$ make micaz route,hp install mib520,COM<#>
Example for MICA2 being flashed on a MIB520
$ cd /opt/Moteworks/apps/general/CountSend
$ make mica2 route,hp install mib520,COM<#>
After flashing is
done, remove
Mote 1 and attach
Mote 2 to MIB
$ cd /opt/Moteworks/apps/general/CountReceive
$ make mica2 route,hp install mib520,COM<#>
But use the appropriate <programmer> and COM port# or IP Address
WSN Training: XMesh Route Cntrl - Low Power
39
Feb 2007
Lab Step 2: Low Power MAC Compile & Flash
Example for MICAz being flashed on a MIB520
$ cd /opt/Moteworks/apps/general/CountSend
$ make micaz route,lp install mib520,COM<#>
After flashing is
done, remove
Mote 1 and attach
Mote 2 to MIB
$ cd /opt/Moteworks/apps/general/CountReceive
$ make micaz route,lp install mib520,COM<#>
Example for MICA2 being flashed on a MIB520
$ cd /opt/Moteworks/apps/general/CountSend
$ make mica2 route,lp install mib520,COM<#>
After flashing is
done, remove
Mote 1 and attach
Mote 2 to MIB
$ cd /opt/Moteworks/apps/general/CountReceive
$ make mica2 route,lp install mib520,COM<#>
But use the appropriate <programmer> and COM port# or IP Address
WSN Training: XMesh Route Cntrl - Low Power
40
Feb 2007
Lab Notes: Low Power Enabling an XMesh App
Usage
 The low power feature can be enable in any XMesh-enabled application
in the same manner.
 Go to any application that is XMesh enabled and use the route,lp flag
during compilation.
 For instance, try it with MyApp_Mesh
Notes
 The low power feature is meant for applications that run at low duty
cycles
 There is always a trade off between sampling rate, duty cycle, and power.
 For example is not feasible to expect a high sampling data rate and high
duty cycle application to last very long running solely on batteries.
WSN Training: XMesh Route Cntrl - Low Power
41
Feb 2007
Q&A
WSN Training: XMesh Route Cntrl - Low Power
42
Feb 2007