Document Sample
LOCALIZATION Powered By Docstoc
					An Ad-hoc Deployable Fine-Grained
Localization System Using IPAQs
     IPAM Seminar Series
     Challenges in Distributed Embedded Systems
     May 22, 2002
     Lewis Girod {}
     Jeremy Elson {}
     Vladimir Bychkovskiy {}
     Deborah Estrin {}

What is Localization

   A mechanism for discovering
    spatial relationships between

Why is Localization Important?

   Large scale embedded systems introduce many
    fascinating and difficult problems…
       This makes them much more difficult to use…
       BUT it couples them to the physical world
   Localization measures that coupling, giving raw
    sensor readings a physical context
       Temperature readings  temperature map
       Asset tagging  asset tracking
       “Smart spaces”  context dependent behavior
       Sensor time series  coherent beamforming

Fine-grained Localization on IPAQ’s

   Why IPAQs?
       Commodity hardware
       Built-in sound capability
       Runs Linux, no significant
        limitations on CPU, RAM
   Drawbacks
       Poor speaker quality
       Speaker and microphone
        are not co-located

System Design
   Several components
       Audio Server:
           Captures and buffers time                 Ranging
            series data                                System
           provides synchronization
            outputs to time synch
                                        Time Synch
       Time Synch:
           Collects observations and
            time references
           Computes and disseminates                Audio Server
            conversion metrics

System Design
   Several components
       Audio Server
       Time Synch                                        Ranging
       Ranging System
           Emits and detects audible
            sound, computes time of
            flight                          Time Synch
       Positioning System
           Central node collects range
            data from distributed nodes
           Position estimation algorithm                Audio Server
            uses domain knowledge

Time Synchronization
       Time synch critical to acoustic ranging
                                            X0       X3                    X5
        Goal: measure distance
         between mics (X3X5)
                                                 X        (T5-T3)*330m/S
        Assume perfect time synch T0
        Assume speed of sound in
         air is known, speaker and       T
         microphones are collinear
         (we’ll relax this next slide)
        Sensors correlate arriving
         signal to reference signal
        Difference in arrival times is T5
         a linear function of additional
         path length of signal.

Time Synchronization
       Relaxing collinearity and speed of sound
                                           X0       IPAQ1   X3                X5   IPAQ2
        The IPAQ has a full-duplex
         sound card, and an integral
         speaker and mic… Suppose               X                (T5-T3)*Vs
         speaker X0 and mic X3 are
         both on the same IPAQ…         T
        Since distance from speaker
         X0 to mic X3 is known, then if
         time T0 is known with perfect T3
        Speed of sound can be
         estimated: Vs=(X3-X0)/(T3-T0) 5
        Mics need not be collinear:
         Distance X5-X0=(T5-T0)*Vs

 Time Synchronization
     But what about imperfect time synch?
         Synch error results directly in                  X0                      X3                X5

          range error: 28 uS/cm… (worse
          if result is a bad estimate of Vs)                    X                       (T5-T3)*Vs
         NTP (Network Time Protocol,
          Mills 1992) is not good enough
             For high-speed, low latency
              LANs, NTP performs well
              because it can estimate RTT
             Not true for low speed networks
              where contention causes large
              (>30 uS) non-deterministic
              sending latencies                       T5
             Empirical results: 802.11 with
              cross-traffic: 50% of timestamps
              are off by over 1ms (~50 cm)1

          et al., Fine Grained Network Time Synchronization using Reference Broadcasts, in submission to OSDI 2002
Inter and Intra-node Synchronization
   Distributed system of sensor nodes
       Distinct nodes need “inter-node” synchronization
           Uses radio channel to relate local clocks of two nodes
           “Multihop” synchronization: composition of time conversions.
       Within a node, there are often many separate clocks that
        need to be related to each other
           Ex. DSP sample clock
           Ex. “Mote” low-power microcontroller board: timestamping of
            radio messages or event detection
       Important assumption: All clocks are locally linear

Inter-node Synchronization
   NTP: Synchronizing by estimation of RTT

                        T1                                O  T1+(T3-T1-T2)/2
                    ?                              O
      T3                                                 contention for channel?
           Mote 1                T2       Mote 2
                                                         sender latency in radio?
                                      ?                  implementation of MAC?
                                                         implementation of radio?

    Why doesn’t NTP work? Problems with measuring RTT over slow networks
    • Many factors introduce non-deterministic latency in transmission channel
    • Some non-deterministic latencies (such as contention) are not Gaussian
    • These might be overcome by timestamping “close to the wire”, but this
      requires intimate knowledge of implementation of lower layers

Inter-node Synchronization
   Key to RBS: Receiver latency is low-variance


             CPU 1            Mote
                                                                            Mote Sender

             CPU 2            Mote                  50kb/S (20uS per bit)

       Reception of broadcasts are closely correlated in real time
       First bit arrives at receivers; some timing variation due to
           propagation delay (1ns/foot)
           variance in detector rise time (signal str, temp, etc) (<.1uS)
           time quantization by Mote clock (0.25 uS)
           outliers caused by RF noise, intermittent system delays

Inter-node Synchronization
   Key idea of “RBS”: Independent of send latency
       Correlate receptions of broadcast messages at different receivers
       Two receivers can be synchronized with a variance determined
        by the latency of the receive side of the system
       From the last slide, low-variance and Gaussian
           Least squares reduces error
           Multihop by composing conversion metrics: error as sqrt(hops)

                                                                Sync to green nodes
                                                                Sync to yellow nodes
                                                                Sync to Y&G nodes

Inter-node Synchronization
   For example:
       Any yellow node (other than the sender) can convert its local time
        to any other yellow node’s time, e.g. Y1 to Y2 or Y2 to Y3.
       Any green node (other than the sender) can convert its local time
        to any other green node’s time, e.g. G1 to G2 or G1 to G3.
       A node receiving from both senders can convert among both
        yellow and green nodes, e.g. G1 to G2, Y1 to Y2, or G1 to Y2

             Y1                                         G1
                                Y3G3                                   Senders
                                                                       Sync to green nodes
                                                                       Sync to yellow nodes
                                              G2                       Sync to Y&G nodes

        Conversion is possible following any path through the graph.

Intra-node Time Synchronization
   Each node has many clocks

    CODEC                                    CPU

When was a particular sample received by the CODEC?
• CPU can timestamp “CODEC Start” command, but
  experiments show that there is sometimes a 200uS latency
• Synchronized “Start” subject to gradual drift if sampling is

                                       CPU           010101001   010101001   010101001   Mote

                                  When was a particular packet received by the Mote?
                                  • Mote can record its counter value when a start
                                    symbol is detected, but counter value must be
                                    related to CPU clock

   Intra-node Time Synchronization
      Each node has many clocks
                                                                                Key Idea: Averaging
                                                                                Conversion metrics are
        CODEC                                         CPU                       computed from many samples,
                                                                                enabling outlier rejection and
                                T1=S1   T0=S0
                                                                                least squares estimation of
    CODEC samples at 48KHz                                                      skew and offset.
    • CPU timestamps DMA transfer complete interrupts
    • Very low variance (<1uS), deterministic 850uS queueing latency
    • Most error is quantization error from 1uS CPU clock granularity
                                                            T0=M0       T1=M1

                                                CPU         010101001   010101001   010101001    Mote
Key Idea: No Disciplining
• Clocks run at natural rate,
  not “disciplined”.            Mote free-running counter at 500KHz
• Time monotonic and            • CPU raises RTS pin, timestamps with CPU clock
  linear in the short term      • RTS causes Mote interrupt, Mote saves clock value and sends
                                  timestamped message to CPU over serial port
                                • Bimodal Gaussian distribution (from varying interrupt latency)

  Inter and Intra Node Sync
      Combining the two modalities
      Observe signal at T1,                                          Observe signal at T2,
       CODEC 1 timebase                                               CODEC 2 timebase

            CODEC 1                                                       CODEC 2
 Convert                                     to Mote2                                    Convert
 to CPU1                                   (RMS 15uS)1                                   to CPU2
(RMS 0uS)                                                                               (RMS 0uS)

             CPU 1               Mote 1                     Mote 2           CPU 2

                       Convert                                                       to determine
                                                                  to CPU2
                      to Mote1                                                     Time Difference
                                                                 (RMS 1uS)
                     (RMS 1uS)            Synchronized by                              of Arrival
                                           Sender Mote

1These results from “Rene” Mote using slower radio (53uS bit time) and approximate bit timing.
Reported results from the “Mica” stack (20uS bits time) indicate 0.25uS packet timing.   17
The Audio Server
   Useful in general context of time-synched distributed
    audio processing
       Buffers last N seconds’ time series data
       Correlates sample index in buffer to DMA transfer times
       Feeds index/time pairs to timesynch system
   Enables post-facto retrieval of time series data
       Samples synchronized across distributed set of nodes
       Buffering reduces system complexity, relaxing timing
        requirements for control traffic
       Continuous sampling enables detection of passive events
       Allows multiple clients to share audio resources (no
        interference between multiple synchronizers)

Acoustic Ranging System
   Basic idea:
       Sender emits a characteristic acoustic signal
       Receiver correlates received time series with time-offsets
        of reference signal to find “peak” offset
                                                  Degree of correlation as
                                                  a function of time offset
                                                     Amount of Correlation


           Green is reference, Red is measured
               Signals aligned to offset yielding max correlation

                                Time in Samples (20 uS)
                       Correlation function: low noise, high SNR
Degree of Correlation

                                       “Lag” in Samples (20uS)

                       Multipath interference, lower SNR
Degree of Correlation

                                      “Lag” in Samples (20uS)

Modulation Strategies
   One of the obstacles to implementation on the IPAQ
    is the quality of the speaker
       Limited frequency response
       Impulses cause ringing for 100 samples (70 cm)
       Impulse responses not uniform across IPAQs
   Fundamental problems:
       Nonlinear response outside limited range
       Unable to follow phase shifts at high
       Unable to follow rapid frequency shifts
       Poor low frequency response

                                                   Impulse Response
Modulation Strategies                                               In Phase


   Solution:                                       Coded Gap

       Find frequency range that exhibits fairly linear response
       Generate chirps (frequency sweep up and down) at the
        upper end of linear frequency range
       Encode psuedonoise sequence into inter-chirp gaps
   Result:
       Speaker reproduces chirps with high phase accuracy
       Some ringing persists, but mostly at lower frequencies (and
        lower energy levels)
       Compensate for low coding rate with longer sequences

Positioning Algorithms
   Positioning algorithm
       Converts range data into consistent coordinate system
       So far, positioning algorithm developed in simulation
   IPAQ specific domain knowledge
       Speaker and microphone not co-located
       Therefore ranges are not always equal to “reverse range”
   Acoustics-specific domain knowledge
       Acoustic error model
       Major component of error is excess path length caused by
        non-line-of-sight ranges
       Current implementation uses customized mass-spring
        model to compensate for NLOS

Acoustic Error Model
   Components:
       Gaussian error (< 2cm variance)
           Synchronization error
           Detection error (noise in channel)
       Quantization error
           All ranges quantized to CODEC sampling frequency (0.71 cm)
       NLOS error
           Some ranges have a large offset (often meters) caused by
            paths that travel along surfaces and reflected paths
           NLOS error is usually stationary because it is caused by
            stationary environmental conditions.
           Often NLOS error is correlated

Mass Spring Model
   Model
       Nodes are “masses”
       Springs are the measured ranges
   Incremental placement
       Speeds convergence
       Avoids unnecessary underconstrained conditions
   NLOS model
       NLOS always causes an increase in path length
       Choose model that favors shorter paths
       Nonlinear spring model:
           Spring constant larger for “stretch” direction
           Result: Long springs readily compressed by shorter (i.e. more
            believable) springs

Results of Positioning Algorithm on
Simulated Data
                           RMS Position error = 2.8cm
                           RMS Range error = 2.5cm
                           Input noise:
                           • 2cm variance
                           • quantized to 0.71cm
cm                         • 10% NLOS, uniform 0-40cm
                             excess path, uncorrelated



Future Work

   Finish work on tuning detection algorithm for IPAQ
   Link up range outputs to positioning algorithm
   Deploy on 20-30 node testbed and evaluate
   Investigate
       Performance under correlated NLOS conditions
       Effect of orientation of the IPAQs on performance
       Characterization of points as well-constrained or poorly
        constrained – which nodes contribute the most to the
        coordinate system?
       Algorithm for determining node placement


Shared By: