The Snap! Toolkit

Section 5

Results and Evaluation

Just as the implementation of the Snap! system without applying it to a specific sensor networking problem would have failed to demonstrate its usefulness, so the creation of the Skiing With Advanced Technology (SWAT) system would fail to demonstrate the success of Snap! without field testing. SWAT underwent two rounds of testing. The first round occurred in late February, 2000, in Iceland. After analyzing the results of this trip, the knowledge gained went into revising and enhancing SWAT. The second SWAT system was tested in mid-March, 2000. The previous section describes the SWAT systems in detail.

5.1 Field Test: Iceland

The Iceland field test comprised four separate data-gathering sessions. Professor Michael Hawley wore the system for all four sessions. No data were successfully gathered during the first two sessions, due to hardware and software errors described below.

After correcting the bugs, the last two sessions were conducted. The first test session was a short, ten-minute jaunt to verify that SWAT was successfully recording data. The second session was a 2 hour 15 minute trek covering about 5 kilometers. The trail was unbroken, but the instrumented skier did not break trail.

5.1.1 WHAT WENT WRONG

SWAT did not successfully log data during the first two data-gathering sessions. Errors in software prevented packets from successfully arriving at the logger. Additionally, vibration loosened connectors and batteries, causing the nodes to behave erratically. Professor Hawley also demonstrated one of the disadvantages of a wired system. During a long stride, one of Mike's skis crossed over the wires connecting the boot to the ski. The wires severed, preventing further data collection from the boot.

Of the sensors that made up the first implementation of SWAT, only two produced data that were both valid and useful: the accelerometers and the heart rate monitor (figures 16 and 17). The rest of the sensors had either hardware or software errors that were revealed during the field test. The data from the barometric pressure and temperature sensors lacked the most significant byte of a two-byte value, rendering their readings meaningless. The wires connecting the transducers in the boot to their node became damaged before any readings could be recorded from them. The amplifier for the toe angle was not optimally tuned. This led to values that indicated whether the boot was off the ski or on it. The ski orientation node was originally included to provide auxiliary data for a GPS receiver. The data from the ski orientation sensor appears to be valid. Without a GPS receiver, however, and configured to report only a single sample every 30 seconds, the data collected from the node could not lead to any conclusions about the ski dynamics.

The data collected from the accelerometers revealed another deficiency in the system. The input/output modules on the first SWAT system were restricted to the RAM available on the 16F876. This limited the amount of data that the modules could collect and transmit in single sample session. The sampling frequency was insufficient for the rate at which acceleration and the boot angle were changing. Thus, while general characteristics of the ski stride are visible, such as when the skier began or finished a stride, more detailed analysis, such as slippage or distance traveled, is inconceivable.

Finally, a significant limitation of the first version of SWAT was that only one ski was monitored. This meant that very basic information about the skier's stride was not certain, such as if he was following the classic diagonal style, double poling, or skating. The skier's balance and distribution of effort could not be assessed. Overall, the data collected from the single-ski SWAT system was inadequate to provide anything more than a superficial description of the action of the skier and his equipment.

5.1.2 WHAT WENT RIGHT

Despite the deficiencies of the data collected, by the end of the first field test several of the Snap! nodes were functioning as designed. The system collected data reliably from all of the nodes connected to the network; the problem was with the transducers connected (or not connected) to the input/output modules. The log file revealed that at several points during the second test run some of the nodes reset, essentially dropping off the network and reappearing. As designed, the network continued to function correctly whenever these unplanned network reconfigurations occurred.

FIGURE 15: Accelerometer directions The accelerometers recorded three orthogonal axes as labeled here.

FIGURE 16: Iceland SWAT system acceleration The Iceland SWAT system successfully recorded these acceleration data during one sample session, illustrating one stride. The low sampling rate and short sample session time make produce a low resolution graph.

FIGURE 17: Iceland SWAT system heart rate The heart rate graph shows that Professor Hawley alternated between rest and the target aerobic heart rate zone for his age.

The data collected from the accelerometers are not completely without merit. Figure 16 shows one sample group taken from the final test session. The large increase in lengthwise acceleration indicates that the skier began his stride with a rapid forward push. The deceleration as the ski came to rest was not as significant. The change is acceleration in the vertical direction is very slight. This indicates that the skier was most likely not planting the ski sufficiently or that snow conditions were such that a hard plant was unnecessary. A graph of heel pressure would have helped draw the conclusion that the latter conclusion was probably correct: the freshly fallen snow and near-melting temperatures made the snow rather sticky for the depicted sample session.

The heart rate graph in figure 17 gives an indication of when the group took breaks from skiing to either observe and document the surroundings or verify the correct operation of the equipment. The high end of the heart rate is around 135 beats per minute, or 75% of the skier's maximum heart rate1. This rate, within the aerobic conditioning zone for Professor Hawley, indicates that the pace was appropriate for a short workout but not for three hours of sustained tour skiing. This may explain the frequency and duration of the rest stops.

5.1.3 LESSONS LEARNED

The Iceland field test provided the first shakedown of the Snap! implementation. It revealed several hardware and software bugs. Some were fixed in Iceland, others were noted as problems to be solved before the second field test.

Mounting sensors in proximity to snow presents several challenges, such as providing a waterproof case that also allows wires to pass through and keeping the electronics within their operating temperature range. The first SWAT system successfully met these challenges. The box containing the electronics was so bulky, however, that it was uncomfortable for the skier and occupied more space than necessary. Additionally, the wires forming the sensor network proved to be cumbersome to connect and disconnect. They were uncomfortable for the skier and required extra care to prevent breakage. This discomfort and vulnerability to failure provided motivation for developing a wireless network for the revision of SWAT.

5.2 Field Test: Norway

The Norway field test comprised two data gathering sessions. Two SWAT systems were ready for the test; they were identical except for the network modules and connectivity. Professor Michael Hawley wore a system that used the hybrid I2C/wireless network described in Section 4. Matthew Debski, the author of this thesis, wore a system that used I2C as the only connectivity. Both systems employed sensors on both skis and boots. The data gathering sessions consisted of two treks, each 24 kilometers long. The marches were an out-and-back loop to a remote cabin for nighttime accommodations and repair of equipment. The terrain varied from flat to large hills, with one sustained ascent approximately 5 kilometers long. Snow conditions changed from almost pure ice to well-packed trail. Light conditions varied from full-daylight to aurora and moon-lit. Both Snap! systems functioned for both data gathering sessions.

5.2.1 WHAT WENT WRONG

While both Snap! systems successfully recorded information during both sessions, they did not perform completely as desired.

On the entirely I2C system, problems with the cable between the boot flex and heel pressure transducer on one boot prevented collecting any valid information from that node. Additionally, the wire connecting one of the toe angle transducers to its input/output module severed.

The wireless system had a different set of problems. Analysis of the log files indicates that each of the local networks communicated successfully. Also, the networks on the skis and boots communicated among each other, as the packet used to synchronize the sampling sensors on the skis and boots was successfully received by the nodes. However, the distance to the backpack transceiver as well as skier's body being placed in the communication path prevented the data being received by the wireless node in the backpack. Since the logger was in the backpack, the data from the skis was not logged.

Finally, the second version of SWAT featured nodes were enhanced with an addition EEPROM chip. For nodes that sampled their transducers, this allowed a higher sampling rate and a greater number of recorded samples. The larger number of data, in turn, allowed finer analysis of the information returned from these sensors. On the other hand, analysis of the data reveals that the sensors were still under-sampled. The sensors sampled at 20 Hz. Figure 22 shows the data collected from the length and height accelerometers. The waveforms appear choppy; the data from the height axis seems to show a frequency of about 10 Hz. The Nyquist criterion requires a sampling frequency of twice the signal being sampled for accurate reconstruction. The 20 Hz frequency just meets the criterion. To observe the more subtle details of the data, a sampling rate of 50 Hz should have been used. Whether the input/output and network modules would be capable of handling this rate is unknown.

5.2.2 WHAT WENT RIGHT

Many of the weaknesses in the section described above involved specific sensor nodes: for example, the group of sampling sensors was not set to sample quickly enough. A cable inside the boot module was not connected properly. Generally, however, the SWAT system functioned as designed.

A cursory analysis of the results from the two systems suggests that the SWAT system using the wired network, which managed to log the majority of its data, is the correct choice for future systems. In reality, improvements in the wireless network design are likely to render the wired system unnecessary. The wired system is vulnerable to a variety of physical assaults: water, snow, dirt, and dust clog connectors; a sudden fall may sever or dislodge the wires; the cables generally interfere with a complete range of movement. Thus, even the limited success of the wireless system well indicates that the wired system may eventually be discarded.

5.2.3 ANALYSIS OF COLLECTED DATA

Following the Norway field test, a data browsing application was created. The application used the time-stamped series of GPS coordinates superimposed on a map to show the path of the instrumented skier. Choosing a specific point brought up a window showing graphs of the sampled data (accelerometers, boot flex, heel pressure, and boot angle) as well as displays of the static data at that point. Using the application, the characteristics of the skier's stride could be monitored over the course of the entire test.

FIGURE 18: SWAT browser The application shown here allowed browsing of the data collected during the Norway field test. The background shows the path taken by the skier, as recorded by the GPS receiver. Choosing a point activates the foreground display, which shows graphs of the accelerometer, toe angle, boot flex, and heel pressure, as well as the single value time, heart rate, ski direction, barometric pressure, and temperature.

This discussion concerns the data from the point shown in figure 18. The same analysis can be applied to any of the points for which data was collected.

FIGURE 19: Ski measurements The ski and boot sensors measured toe angle, boot flex, and heel pressure as depicted here.

5.2.3.1 The skier's stride
FIGURE 20: Skier stride as shown by toe angle The alternating left and right toe angles indicate the rate of the skier's stride.

Figure 20 shows the toe angle over a 3.75 second sampling session. As can be expected, the toe angles alternate between the times they each reach their maximum values. The maximum value of toe angle occurs when the striding leg is completely extended and the skier shifts his weight to the other ski. This weight shift allows the extended ski to lift up and the skier brings it forward. The stride rate can be determined by measuring the time between the two successive peaks from the ski. This particular sample shows that the strides are evenly spaced. However, the skier does not reach the same maximum value in each of the strides indicating that he may lack consistency in stride length.

5.2.3.2 Comparison of toe angle and boot flex
FIGURE 21: Stride analysis with toe angle and boot flex The graphs shows the time relation between maximum boot flex and toe angle. Perhaps a quicker return to a straight foot would result in a faster forward stride.

Figure 21 shows the relation between toe angle and boot flex from a single foot. As the skier extends his rear leg, the boot and foot begin to bend before there is an angle at the toe. This demonstrates the heel being lifted from the ski earlier as well. The boot flex also lags behind the toe angle somewhat after the front of the foot is flattened again. Further study of this graph, in combination with a video analysis, could help the skier optimize the length of his stride. Also, combining this graph with heel pressure could reveal if the skier is transferring his weight in the most effective way.

5.2.3.3. Ski movement
FIGURE 22: Ski motion through acceleration The acceleration data can be integrated to determine efficiency. The dashed lines demarcate the vertical resonation present as the skier lifts the ski to move it forward.

Figure 22 depicts the accelerometer data taken from the left ski during a single sample session. The large values correspond to the lengthwise movement of the ski. These correspond timewise to slightly after the maximum toe angle; after the leg is fully extended, it is brought swiftly forward during the stride. Velocity and position measurements can be computed by integrating the lengthwise curve. Both would be helpful in determining the amount of backwards slip the ski undergoes, an indication of a flaw either in waxing technique, choice of wax, or in the weight distribution of the skier.

The other two values are not perfectly constant. Acceleration along the width of the ski indicates that there is wobble or force being exerted other than in the intended direction of motion. Excessive movement in this direction, not indicated here, would indicate that the skier was wasting energy with an inefficient stride.

The final vector to consider is height. The acceleration due to gravity causes the constant offset that is seen in this direction. These data are especially interesting for two reasons. Most importantly to the technique of the skier, it indicates the force and timing of the lifting of the ski as it is brought forward. At the end of the forward movement, it also demonstrates the planting of the ski. Any upward force exerted while the ski is on the ground could lead to slippage in the lengthwise direction.

The series is also useful to the ski designer. As the ski is picked up, it begins to resonate. This is demonstrated by the fixed frequency of the waveform present in the height graph while there is any acceleration in the lengthwise direction. When the lengthwise acceleration is constant, so is the vertical acceleration. The ski designer can use the information about vibration to choose appropriate materials or evaluate different designs.

The collected data and the analysis presented illustrate the success of the SWAT system in accomplishing the purpose for which it was designed. It is possible to analyze stride components using time-synchronized videotape. However, the quantitative results obtained by the Snap!-enabled SWAT system previously required a customized measurement system. The ski vibration data and the possibility of precise slippage calculation demonstrate some of the value that the SWAT system presents to skiers and ski manufacturers.

5.3 Conclusions

The implementation of two versions of the SWAT system afforded an opportunity to truly evaluate the Snap! system's performance and meeting of the design goals. The design time for the Iceland field test included not only the design and construction of the individual sensor nodes and associated software, but also the time to implement the first version of Snap! In the three weeks between the Iceland and Norway field tests, the first Snap! implementation was enhanced based on the lessons learned from Iceland, new transducers were created and their associated software functions written, and the wireless network was designed from scratch and integrated into the system. The fact that so much was accomplished in so little time is itself testament to Snap!'s success in meeting its design goals.

5.3.1 SNAP! WEAKNESSES

Overall, Snap! achieved the goals that it set out to accomplish. However, the system was not flawless. The incarnating of one Snap! version and its testing it in two systems revealed some general weaknesses in the design and concept.

5.3.1.1 Use of ASCII
Perhaps the single largest engineering flaw in the system was the choice of ASCII as the means of communicating between nodes. ASCII was chosen to reduce the time spent debugging. The ability of a Snap! constructor to view and understand the traffic on the network should help him determine where bugs occur. Network errors would result in garbled text; mistakes on the input/output module would result in valid characters but bad values.

In reality, the use of ASCII seemed to cause more harm than good. Good engineering practice dictates debugging components separately, then combining them and debugging the system. Thus, a designer should be able to debug the network, ensuring that the network modules are communicating successfully. Then, he can plug the input/output modules into the network modules and test the system again. The choice of ASCII attempted to create a short cut. Instead, the code on the input/output modules became unreasonably complicated. For instance, the data from the orientation sensor for the Iceland SWAT system was encoded in ASCII. In order to store sufficient samples on the input/output module for transmission, as well as perform calculations on the values, the data was converted to integer values and stored. Then, to comply with the Snap! specification, the stored values were converted to ASCII again before transmitting them. A large percentage of code space was used for the conversion functions.

As has already been mentioned, the value of the report field can be used to carry binary data. Another alternative could be to expand the packet definition to include typing of the data in the report payload fields. This would allow the input/output module to report data in the format that is most natural for it, while still allowing other modules to interpret the data.

5.3.1.2 Overkill of Snap!
The Snap! system is designed to allow users almost unlimited flexibility in configuring their system. Even an implementation using the minimal PIC can change dynamically from a master-slave configuration, to publish-subscribe, or to autonomous reporting. The nodes can communicate with each other frequently or never. Network communication can be constant and guaranteed or only intermittent. Systems can contain redundant loggers, multiple displays, and gateways with different connectivity or a single logger and a dozen sensor nodes. The saying "Jack of all trades, master of none," may be applicable to Snap! The system, in providing the flexibility for all of these configurations, also means that it cannot specialize too highly in any single area. For the SWAT system, only one configuration was used. There was almost no need to place the system in any other configuration.

Nevertheless, it must be reemphasized here that Snap! for prototyping different sensor networks quickly. Thus, a user can place the nodes into several different configurations to determine which is the best for a particular application. If the designer then needs a more permanent specialized solution, he can design a custom solution to the problem. Further application of Snap! will reveal if its flexibility is an asset or a liability.

5.3.2 SNAP! CONTRIBUTIONS

The Snap! toolkit provides a means of building sensor networks rapidly. In some design aspects, the system departs from existing systems, while incorporating new ideas and drawing in good concepts from other systems. The result is a toolkit that fills a niche not adequately served by other networking technologies. The main contributions of Snap! are its flexible configurations, aggregating data format, and changeable behaviors.

5.3.2.1 Flexible configurations
The Snap! toolkit does not require that its nodes or modules consist of specific hardware. As long as the modules and nodes function as specified in section three, they form an implementation of the Snap! toolkit. The nodes can be implemented using Pentium processors, custom fabricated integrated circuits, or PICs, as in the example implementation. This allows the node designer great flexibility in choosing hardware appropriate for the particular node task.

5.3.2.2 Aggregating data format
The hierarchical data structure used to communicate across the network and within the node behaviors gives node designers the benefit of abstraction barriers and aggregation. As the data passes through different levels of the network, nodes can create new data types, consuming older ones. Including this idea at the packet level and using ASCII for communication allows easy implementation of a standard technique across engineering design.

5.3.2.3 Changeable behaviors
The dynamically changeable behavior of each node provides the largest contribution. Input/output modules can provide sensor fusion by communicating with other nodes. Nodes can react to the sensed data by changing report rates, setting actuators, or going to sleep. The changeable behaviors of the Snap! system are what truly give it the power and flexibility to meet its functionality requirements and design goals.

5.4 Future work

The current implementation of the Snap! toolkit is not complete. Some of the ideas discussed during the design and specification of the toolkit were not fully laid out in the specification. Also, the Snap! system, designed to be a toolkit for building sensor networks, has only been used to construct two complete systems, one of which was an improvement of the other. There are several areas which further development of the Snap! architecture can explore.

5.4.1 EXTENSION OF SWAT

SWAT served as the first implementation of the Snap! toolkit. As such, most of the work and research surrounding it was devoted to testing of Snap! itself. The purpose of Snap!, however, is to enable the construction of networks such as SWAT. Thus, given that a system for recording a great deal of information from a cross-country skier and his skis is available, it is possible to conduct experiments previously not possible. Section one described skiers in the Birkebeiner wearing systems designed to compare elite athletes to novices, providing both with feedback on how to improve. SWAT makes such a study possible. Another extension would be to outfit several different brands and designs of skis with the SWAT system. Allowing skiers of different body types and skill levels to use the systems before purchasing skis would aid them in their choice of model and likely increase their enjoyment of the sport.

5.4.2 FULL IMPLEMENTATION OF ALL OPCODES AND VARIABLES

As noted in section 4, the first implementation of Snap! did not include all the variables laid out in the design; only a set needed to create a functional implementation was included. A thorough examination of the entire Snap! design would be aided by the addition of the extra variables. The extra variables allow the system to better adapt to changing conditions. They also make possible additional types of Snap! nodes that are not possible using the current limited implementation.

One of the most significant changes to the Snap! implementation is the inclusion of the Find opcode. The Find opcode is included in the description of the Snap! architecture in section 3. Allowing nodes to query the network to discover nodes of certain types or properties potentiates the building of more intelligent systems. Systems with self-discovery can be capable of dynamically reconfiguring themselves or altering their behavior based on their composition.

The addition of the Find opcode and the refinement of its definition reside in a broad area of research. Both Sun Microsystems's Jini [citation][www site] and the MIT Media Lab's Hive [citation][www site] include methods for discovering the behavior of nodes on a network. Work in this area would not only affect Snap! but would likely impact networks generally.

5.4.3 ADDITION OF PLANNED PERIPHERALS

The Snap! toolkit design does not dictate which particular nodes comprise a sensor network. The two SWAT systems consisted exclusively of nodes that either sensed or logged data. Implementing two other specific types of nodes would greatly expand the usefulness of almost any network that incorporated them: a long-distance communication node and a Configurator node.

A long-distance communication, or gateway, node would allow a Snap! network to communicate with other types of networks. One example is a cellular modem that sends the packets to a host on the Internet. Once received, the host could publish them on the World Wide Web for real-time viewing. The gateway should be bi-directional, allowing viewers to communicate to the Snap! network. Thus, a Snap! weather station in a remote location could indicate that its batteries were running low. Remote users could then decide whether to activate a secondary power source remotely or actually visit the station to assess conditions. Coaches monitoring athletic performance could send feedback on how the athlete could best modify his tactics given current physiological conditions.

A Configurator node could be based upon a Personal Digital Assistant (PDA). The Configurator would attach to the Snap! network whenever its designer wished to view its current state. The Configurator would have the ability to access the variables of each node and display them. The Configurator could also download new behaviors in whatever language is appropriate for the Snap! implementation. Attachment could occur when first applying power to verify that all nodes are working correctly or during operation to determine the current readings reported by the sensors. The Configurator could also be left attached for a greater duration, serving as a general-purpose display to a network user or wearer.

5.4.4 MIGRATION TO OTHER PLATFORMS

The current Snap! implementation uses the relatively low-computation-power PIC16F876. Some of the implemented nodes on the SWAT system, such as the accelerometers, stretched the available RAM and code space to its limits. While the code on this node certainly could have been tightened, Snap! is supposed to facilitate rapid production of prototype networks. Forcing a Snap!-network designer to wrangle his code into a space that is too small does overlap with this goal.

Additionally, other input/output modules may require more computation power, such as one that interfaces to a digital still or video camera. Furthermore, a designer who wishes to explore the ability to use mobile code or emergent behaviors of the network modules may wish to use a behavior language that is more complicated than one capable of being implemented on a PIC.

Snap! is designed to be flexible yet powerful enough to be implemented on a variety of hardware systems. Implementing a second, more computationally powerful version of Snap! would provide a further test of the design, while also enhancing the collection of nodes available to network creators.

5.4.5 USE FOR OTHER APPLICATIONS

Using the Snap! toolkit to create other networks is the best test of its design. The toolkit is designed to facilitate the rapid construction of networks. If no networks besides SWAT are ever built using Snap!, then the system is almost useless. Certainly the construction of SWAT as a single-purpose system, without creating the general Snap! hardware and software would have taken less time. The greatest area of future work, then, is to use Snap! to build multitudes of sensor networks, determining their successes and failures, and pushing the architecture to new heights.

bibliography

Section 4 - A First Implementation

Send comments to the author