1 / 10

29 Palms Demonstration

29 Palms Demonstration. The TinyOS code behind the demo. Major application blocks. Data collection Data analysis Data sharing Time Synchronization Velocity calculation Task Flow/Use Data recording/querying. Data collection. Periodic events trigger sampling of ADC data

caron
Download Presentation

29 Palms Demonstration

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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->first = ch->first - (ch->first >> 3); ch->first += ch->reading; Or first = (first * 7 / 8) + reading; Or Rn = 7*Rn-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_ADDR, 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 isn’t duplicated for (i=0; i < 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 it’s 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->speed = VAR(speed); foo->time = VAR(car_time); foo->det = VAR(det); foo->id = TOS_LOCAL_ADDRESS; TOS_CALL_COMMAND(TRAFFIC_SUB_SEND_MSG)(0xff,19,&VAR(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_MsgPtr msg){ if(msg == &(VAR(read_msg)[(int)VAR(read_msg_ptr)])) { VAR(entry)++; if(VAR(entry) <= 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_BCAST_ADDR, AM_MSG(TRAFFIC_READ_MSG), &(VAR(read_msg)[(int)VAR(read_msg_ptr)])); ………

More Related