29 Palms Demonstration - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

29 Palms Demonstration

Description:

{ if (VAR(node)[(int)i] == nid) { return; All new readings are forwarded out again ... foo- time = VAR(car_time); foo- det = VAR(det); foo- id = TOS_LOCAL_ADDRESS; ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 11
Provided by: jason365
Category:

less

Transcript and Presenter's Notes

Title: 29 Palms Demonstration


1
29 Palms Demonstration
  • The TinyOS code behind the demo

2
Major application blocks
  • Data collection
  • Data analysis
  • Data sharing
  • Time Synchronization
  • Velocity calculation
  • Task Flow/Use
  • Data recording/querying

3
Data collection
  • Periodic events trigger sampling of ADC data
  • Events generated using the CLOCK.comp component.
  • TOS_CALL_COMMAND(TRAFFIC_CLOCK_INIT)(128, 2)
  • void TOS_EVENT(TRAFFIC_CLOCK_EVENT)()
  • Collection is initiated by using ADC.comp
  • TOS_CALL_COMMAND(TRAFFIC_GET_DATA)(MAG_CHANNEL1)
  • char TOS_EVENT(TRAFFIC_CHANNEL1_DATA_EVENT) (int
    data)

4
Data Analysis
  • Raw sensor readings are filtered using IIR
    filters to detect anomalies (like a car passing)
  • ch-gtfirst ch-gtfirst - (ch-gtfirst gtgt 3)
  • ch-gtfirst ch-gtreading
  • Or
  • first (first 7 / 8) reading
  • Or
  • Rn 7Rn-1 READINGn where first/8

5
Data sharing
  • Each device sends data to all surrounding nodes
  • TOS_CALL_COMMAND(TRAFFIC_SUB_SEND_MSG)(TOS_BCAST_A
    DDR,
    AM_MSG(mags_msg), VAR(buffer)
  • Each node keeps a buffer of data points that have
    been collected for this observation
  • Each node check to make sure that an observation
    received isnt duplicated
  • for (i0 i lt n i)
  • if (VAR(node)(int)i nid)
  • return
  • All new readings are forwarded out again
  • CRC check used on all transmissions

6
Time Synchronization
  • Each node broadcasts out its version of the
    current time every 8 seconds
  • Any node that falls behind updated its clock to
    the current time
  • Nodes synchronized to /- 1/32 s
  • Time stored in 32 bits of precision allowing for
    use of wall clock based timing

7
Velocity Calculation
  • Velocity calculated using least squared on data
    points collected
  • Least squares requires inversion of 2x2 matrix
  • Using 16 bit math requires careful choice of
    input data
  • Raw readings are shifted and scaled to prevent
    overflow/underflow
  • Lowest time reading set to 0 and lowest position
    estimation set to 0

8
Must Calculate..
  • Matrix to invert Requires n, ?x2, ?x
  • Matrix inversion requires determinant
    calculation, several multiplies and divides
  • Position estimation of each node.
  • Resulting calculation does not determine the
    actual speed, instead results in two numbers when
    divided result in the speed
  • Prevents underflow over larger range of vehicle
    speeds

9
Data Recording
  • Vehicle detection events are stored into the
    EPROM log
  • CarEvent foo (CarEvent)VAR(read_msg)1.data
  • foo-gtspeed VAR(speed)
  • foo-gttime VAR(car_time)
  • foo-gtdet VAR(det)
  • foo-gtid TOS_LOCAL_ADDRESS
  • TOS_CALL_COMMAND(TRAFFIC_SUB_SEND_MSG)(0xff,19,VA
    R(read_msg)1)
  • TOS_CALL_COMMAND(TRAFFIC_APPEND_LOG)(VAR(read_msg)
    1.data)
  • VAR(max_log)

10
Data Retrieval
  • Data is simultaneously pulled out of the EEPROM
    and onto the radio.

char TOS_EVENT(TRAFFIC_SUB_MSG_SEND_DONE)(TOS_MsgP
tr msg) if(msg (VAR(read_msg)(int)VA
R(read_msg_ptr)))
VAR(entry) if(VAR(entry) lt
VAR(max_log))
TOS_CALL_COMMAND(TRAFFIC_READ_LOG)(VAR(entry),
VAR(read_msg)(int)VAR(read_msg_ptr).data)
VAR(read_msg_ptr) 1
TOS_CALL_COMMAND(TRAFFIC_SUB_SEND_MSG)(TOS_BC
AST_ADDR, AM_MSG(TRAFFIC_READ_MSG), (VAR(re
ad_msg)(int)VAR(read_msg_ptr)))
Write a Comment
User Comments (0)
About PowerShow.com