01.06.2015 Views

A Performance Analysis System for the Sport of Bowling

A Performance Analysis System for the Sport of Bowling

A Performance Analysis System for the Sport of Bowling

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The Pennsylvania State University<br />

The Graduate School<br />

Capital College<br />

A PERFORMANCE ANALYSIS SYSTEM FOR<br />

THE<br />

SPORT OF BOWLING<br />

A Master's Project and Paper in Computer Science<br />

by<br />

Donald J. Hake II<br />

Submitted in Partial Fulfillment <strong>of</strong> <strong>the</strong><br />

Requirements <strong>for</strong> <strong>the</strong> Degree <strong>of</strong><br />

Master <strong>of</strong> Science<br />

April 2002<br />

©2002 Donald J. Hake II


ABSTRACT<br />

Current technology <strong>of</strong>fers precious little to <strong>the</strong> serious bowler in search <strong>of</strong> ways to<br />

analyze and improve <strong>the</strong>ir 1 game. All existing methods acquire some type <strong>of</strong> "external"<br />

view <strong>of</strong> <strong>the</strong> ball (from <strong>the</strong> bowler's perspective) as it rolls down <strong>the</strong> lane. The goal <strong>of</strong><br />

such systems is to quantify <strong>the</strong> various factors (release velocity, rotation rate, ball l<strong>of</strong>t<br />

distance, etc.) that contribute to <strong>the</strong> ball's reaction and, ultimately, to <strong>the</strong> bowler's<br />

per<strong>for</strong>mance. However, not only are <strong>the</strong>se externally-based methods time-consuming,<br />

inconvenient, and/or expensive to install and use, but <strong>the</strong>y each have <strong>the</strong>ir own inherent<br />

limitations resulting from <strong>the</strong>ir external view <strong>of</strong> <strong>the</strong> ball.<br />

This paper presents <strong>the</strong> results <strong>of</strong> research and preliminary development <strong>for</strong> a system that<br />

is based on capturing an "internal" view (from <strong>the</strong> bowling ball's perspective) <strong>of</strong> <strong>the</strong><br />

velocity, spin, and l<strong>of</strong>t imparted to <strong>the</strong> ball during <strong>the</strong> bowler's delivery, and <strong>the</strong><br />

subsequent reaction <strong>of</strong> <strong>the</strong> ball on its journey from <strong>the</strong> foul line to <strong>the</strong> pins.<br />

The system described herein is comprised <strong>of</strong> several components: a small,<br />

microprocessor-based sensor module that resides in <strong>the</strong> ball and collects and records<br />

sensor data; an external wireless communication module <strong>for</strong> uploading <strong>the</strong> raw data from<br />

<strong>the</strong> sensor module; and a PC or PDA-based s<strong>of</strong>tware application that stores, analyzes, and<br />

presents that data in a fashion useful to <strong>the</strong> bowler.<br />

Such a personal bowling per<strong>for</strong>mance assessment and analysis system will help fill <strong>the</strong><br />

void that currently exists between <strong>the</strong> limited number <strong>of</strong> techniques available <strong>for</strong><br />

evaluating and improving <strong>the</strong> bowler's overall skill set, consistency <strong>of</strong> execution, and<br />

ability to accurately assess lane conditions.<br />

1 In <strong>the</strong> absence <strong>of</strong> a standard set <strong>of</strong> gender-neutral pronouns, <strong>the</strong> author uses "<strong>the</strong>y", "<strong>the</strong>m", and "<strong>the</strong>ir" as<br />

<strong>the</strong> gender-neutral <strong>for</strong>ms <strong>of</strong> "s/he", "him/her", and "his/her" throughout <strong>the</strong> document.


TABLE OF CONTENTS<br />

Section I: Introduction, Background, and Motivation.................................................................1<br />

1.1 Statement <strong>of</strong> <strong>the</strong> Problem ................................................................................................1<br />

1.2 Introduction to <strong>the</strong> Physics <strong>of</strong> <strong>Bowling</strong>...........................................................................3<br />

1.3 Scope <strong>of</strong> <strong>the</strong> Paper/Project ..............................................................................................4<br />

1.3.1 Investigative Feasibility Phase ............................................................................4<br />

1.3.2 Product Development Phase................................................................................5<br />

1.4 Overview <strong>of</strong> <strong>the</strong> Feasibility Phase...................................................................................5<br />

Section II: Collecting <strong>the</strong> Data - The SMARTDOT Module........................................................7<br />

2.1 Design Basis....................................................................................................................7<br />

2.2.1 Ease <strong>of</strong> Use..........................................................................................................9<br />

2.2.2 Size, Weight, and Impact on <strong>the</strong> Balance <strong>of</strong> <strong>the</strong> Ball..........................................9<br />

2.2.3 Cost....................................................................................................................10<br />

2.2.4 Power Consumption ..........................................................................................10<br />

2.2.5 Convenience <strong>of</strong> Installation and Removal.........................................................10<br />

2.3 Sensing Requirements ...................................................................................................11<br />

2.3.1 Sensing Rotation <strong>of</strong> <strong>the</strong> Ball (Angular Velocity) ..............................................11<br />

2.3.2 Sensing Release, Lane Impact, and Pin Impact.................................................12<br />

2.3.3 Measuring Time and Recording Data ...............................................................12<br />

2.3.4 Communications................................................................................................14<br />

2.4 Capabilities....................................................................................................................14<br />

2.4.1 Ambient Light Sensor .......................................................................................15<br />

2.4.2 Pressure/Impact Sensor .....................................................................................15<br />

2.4.4 Clock .................................................................................................................15<br />

2.5 Hardware Implementation.............................................................................................16<br />

2.5.1 Hardware Configuration....................................................................................16<br />

2.5.2 Hardware Operation Overview .........................................................................18<br />

2.6 Hardware/S<strong>of</strong>tware Interaction Design Considerations................................................19<br />

2.6.1 Microprocessor Clock Frequency .....................................................................19<br />

2.6.2 Sampling Rate ...................................................................................................19<br />

2.6.3 Baud Rate ..........................................................................................................21<br />

2.7 Embedded S<strong>of</strong>tware Design and Operation ..................................................................21<br />

2.7.1 S<strong>of</strong>tware Design Considerations .......................................................................21<br />

2.7.2 Start-Up .............................................................................................................24<br />

2.7.3 Pre-Sampling.....................................................................................................24<br />

2.7.4 Wave<strong>for</strong>m Discrimination and Validation ........................................................24<br />

2.7.5 The Ball is Rolling ............................................................................................25<br />

2.7.6 Sampling Modes................................................................................................25<br />

2.7.7 Shutdown...........................................................................................................25<br />

2.7.8 Communication with <strong>the</strong> COMM Wand ...........................................................26<br />

2.7.9 Communication Protocol...................................................................................26<br />

2.7.10 Commands.........................................................................................................27<br />

iii


2.8 <strong>Per<strong>for</strong>mance</strong>...................................................................................................................28<br />

2.8.1 Detecting Release..............................................................................................29<br />

2.8.1 Detecting Release..............................................................................................29<br />

2.8.2 Detecting Impacts..............................................................................................29<br />

2.8.3 Wave<strong>for</strong>m Discrimination and Validation ........................................................30<br />

2.8.4 Wave<strong>for</strong>m Shape ...............................................................................................32<br />

2.8.5 Communications................................................................................................33<br />

2.8.6 Battery Life........................................................................................................33<br />

2.9 Future Work ..................................................................................................................34<br />

2.9.1 Microprocessor..................................................................................................34<br />

2.9.2 Communications................................................................................................35<br />

2.9.3 Sample Memory and Multiple Wave<strong>for</strong>ms.......................................................35<br />

2.9.4 Data Compression .............................................................................................36<br />

2.9.5 Module Training................................................................................................38<br />

2.9.6 Adjustable Sampling Parameters.......................................................................38<br />

2.10 Summary .......................................................................................................................39<br />

Section III: Analyzing <strong>the</strong> Data - The MASTER Application ...................................................40<br />

3.1 Raw Data <strong>Analysis</strong> ........................................................................................................40<br />

3.1.1 The "Ideal" Wave<strong>for</strong>m ......................................................................................40<br />

3.1.2 The "Real" Wave<strong>for</strong>m .......................................................................................41<br />

3.2 Filtering <strong>the</strong> Raw Data ..................................................................................................44<br />

3.3 Finding Revolutions and Angular Velocity...................................................................46<br />

3.4 Linear Velocity, Distance, and Coefficient <strong>of</strong> Friction.................................................50<br />

3.4.1 Finding <strong>the</strong> Linear Velocity <strong>of</strong> <strong>the</strong> Ball.............................................................52<br />

3.4.2 Finding <strong>the</strong> Distance from <strong>the</strong> Foul Line ..........................................................53<br />

3.4.3 Finding <strong>the</strong> Coefficient <strong>of</strong> Friction....................................................................54<br />

3.5 Assumptions and Error <strong>Analysis</strong>...................................................................................55<br />

3.5.1 Distance.............................................................................................................55<br />

3.5.2 Time...................................................................................................................56<br />

3.5.3 External Forces and Friction .............................................................................57<br />

3.6 Implementation, <strong>Per<strong>for</strong>mance</strong>, and Accuracy ...............................................................58<br />

3.6.1 Implementation and <strong>Per<strong>for</strong>mance</strong> .....................................................................59<br />

3.6.2 Accuracy............................................................................................................61<br />

3.6.2 Accuracy............................................................................................................62<br />

3.6.3 The "Perfect" Game to Analyze ........................................................................63<br />

3.7 Future Work ..................................................................................................................64<br />

3.7.1 Algorithms.........................................................................................................64<br />

3.7.2 End-User MASTER S<strong>of</strong>tware ............................................................................65<br />

3.8 Summary - MASTER <strong>Analysis</strong> ......................................................................................66<br />

Bibliography..............................................................................................................................67<br />

Appendix A - SMARTDOT Module Embedded S<strong>of</strong>tware Flowcharts................................... A-1<br />

Appendix B - SMARTDOT Module Source Code...................................................................B-1<br />

Appendix C - SMARTDOT Module Command Timing Diagrams .........................................C-1<br />

Appendix D - MASTER "<strong>Analysis</strong>" Calculations Source Code.............................................. D-1<br />

Appendix E - 300 Game MASTER Screen Captures...............................................................E-1<br />

iv


LIST OF FIGURES<br />

Figure 2-1 SMARTDOT Module Cut-Away View .............................................................8<br />

Figure 2-2a Lane Layout and Overhead Lighting ..............................................................13<br />

Figure 2-2b Ambient Light Wave<strong>for</strong>m...............................................................................13<br />

Figure 2-3 SMARTDOT Module Block Diagram .............................................................17<br />

Figure 2-4 SMARTDOT Module S<strong>of</strong>tware Architecture ..................................................22<br />

Figure 2-5 EEPROM Memory Map ................................................................................23<br />

Figure 2-6 MASTER "Raw Data" Screen Capture ...........................................................28<br />

Figure 2-7 Raw Data Release Region (400 ms) ...............................................................29<br />

Figure 2-8 Raw Data Impact Region (800 ms) ................................................................30<br />

Figure 2-9 Raw Data Release Region (800 ms) ...............................................................31<br />

Figure 2-10 10-Pin Shot, "Raw Data" Screen Capture ......................................................31<br />

Figure 2-11 Wave<strong>for</strong>m Shape, Impact Region (800 ms) ...................................................32<br />

Figure 2-12 Data Compression Record Format..................................................................37<br />

Figure 2-13 Data Compression Translation Table .............................................................38<br />

Figure 3-1 MASTER "Raw Data" Screen Capture ...........................................................42<br />

Figure 3-2 Raw Data Release Region (800 ms) ...............................................................43<br />

Figure 3-3 Raw Data in Impact Region (800 ms).............................................................43<br />

Figure 3-4 MASTER "Spectrum" Screen Capture ............................................................44<br />

Figure 3-5 MASTER "Wave<strong>for</strong>m" Screen Capture ...........................................................46<br />

Figure 3-6 Maxima and Minima Location Interpolation .................................................48<br />

Figure 3-7 MASTER "<strong>Analysis</strong>" Screen Capture ..............................................................49<br />

Figure 3-8 MASTER <strong>Analysis</strong> Calculations Data Flow Diagram ....................................58<br />

Figure 3-9 Effects <strong>of</strong> Roll Out, "<strong>Analysis</strong>" Screen Capture .............................................59<br />

Figure 3-10 Pin Deck Phase Shift, Impact Region (800 ms) .............................................60<br />

Figure 3-11 Effects <strong>of</strong> Phase Shift, "<strong>Analysis</strong>" Screen Captures .......................................61<br />

Figure 3-12 300 Game <strong>Analysis</strong> Summary ........................................................................63<br />

Figure A-1a Start-Up Task Flowchart ..............................................................................A-2<br />

Figure A-1b Pre-Sampling Task Flowchart ......................................................................A-2<br />

Figure A-2 Light Sample ISR Flowchart ........................................................................A-3<br />

Figure A-3 Sampling Task Flowchart.............................................................................A-4<br />

Figure A-4 Discrimination Task Flowchart ....................................................................A-5<br />

Figure A-5 Communication Task Flowchart ..................................................................A-6<br />

Figure A-6 Wand Detection ISR Flowchart ...................................................................A-7<br />

Figure A-7 UART Receive Task Flowchart ...................................................................A-8<br />

Figure A-8 Bit Sample ISR Flowchart............................................................................A-9<br />

Figure A-9 Receive Time Out ISR Flowchart ................................................................A-9<br />

Figure A-10 Shutdown Task Flowchart ..........................................................................A-10<br />

Figure C-1 Upload Command Timing Diagram .............................................................C-2<br />

Figure C-2 Mode Command Timing Diagram ...............................................................C-3<br />

Figure C-3 Configuration Command Timing Diagram ..................................................C-4<br />

Figure E-1 300 Game - "Raw Data" Screen Captures ....................................................E-2<br />

Figure E-2 300 Game - "Spectrum" Screen Captures .....................................................E-4<br />

Figure E-3 300 Game - "<strong>Analysis</strong>" Screen Captures.......................................................E-6<br />

v


ACKNOWLEDGEMENTS<br />

The idea <strong>for</strong> <strong>the</strong> SMARTDOT system evolved from a conversation I had with some fellow<br />

teammates on <strong>the</strong> way back from <strong>the</strong> Pennsylvania State <strong>Bowling</strong> Championships in<br />

Johnstown in May <strong>of</strong> 1988. I'd like to thank Mike Wolfrom and Dave Zelger <strong>for</strong> raising <strong>the</strong><br />

issue <strong>of</strong> how to accurately measure <strong>the</strong> rotational rate <strong>of</strong> a bowling ball. It has been through<br />

seeking an answer to that seemingly simple question that this body <strong>of</strong> work has taken shape.<br />

In 1988, <strong>the</strong> technology was simply not available to implement <strong>the</strong> various solutions that came<br />

to mind. In <strong>the</strong> ensuing four years, <strong>the</strong> question stayed with me, and <strong>the</strong> technology<br />

eventually caught up. I began developing <strong>the</strong> first SMARTDOT module prototype in May <strong>of</strong><br />

1992, and SMARTDOT captured its first wave<strong>for</strong>m on April 11, 1993. I designed and built<br />

that first prototype without prior knowledge <strong>of</strong> <strong>the</strong> nature <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m it was designed to<br />

capture. Since <strong>the</strong>n, numerous iterations <strong>of</strong> <strong>the</strong> module's hardware and embedded s<strong>of</strong>tware<br />

have been required to get <strong>the</strong> module to <strong>the</strong> point where it truly per<strong>for</strong>ms its function in a<br />

"transparent" fashion.<br />

Soon after <strong>the</strong> success <strong>of</strong> <strong>the</strong> initial prototype, I placed <strong>the</strong> project on <strong>the</strong> back burner as I<br />

became engaged, and <strong>the</strong>n married, and <strong>the</strong>n purchased a house, and eventually assumed o<strong>the</strong>r<br />

career obligations that kept me from returning to <strong>the</strong> pursuit <strong>of</strong> this research. It was with my<br />

return to Penn State in June <strong>of</strong> 1998 in my quest <strong>for</strong> this Master's Degree in Computer Science<br />

at Penn State Harrisburg that I decided to dust <strong>of</strong>f SMARTDOT and get back to work on it.<br />

I must thank Dr. Thang Bui, Dr. Timothy Wahls, and Dr. Linda Null <strong>for</strong> <strong>the</strong>ir collective<br />

exuberance and enthusiasm in teaching. Without <strong>the</strong>ir obvious interest in <strong>the</strong> success and<br />

welfare <strong>of</strong> <strong>the</strong>ir students, I would not have been drawn to Penn State Harrisburg, nor as driven<br />

to achieve all that I have within <strong>the</strong>ir program. I have been a Penn State student, in one <strong>for</strong>m<br />

or ano<strong>the</strong>r, at three different campuses, <strong>for</strong> more than a quarter <strong>of</strong> a century, and <strong>the</strong>ir<br />

department is <strong>the</strong> finest that I have known.<br />

Thanks again to Dr. Null <strong>for</strong> not only serving as my advisor and <strong>for</strong> appreciating my sense <strong>of</strong><br />

humor, but also <strong>for</strong> her willingness to step outside <strong>of</strong> her normal areas <strong>of</strong> expertise and into<br />

"my" world <strong>of</strong> 8-bit embedded s<strong>of</strong>tware. Thanks also to Dr. Seth Wolpert and Dr. Pavel<br />

Naumov <strong>for</strong> reviewing this manuscript and serving on <strong>the</strong> <strong>the</strong>sis committee.<br />

I must thank my friends and family <strong>for</strong> <strong>the</strong>ir collective support, understanding, and tolerance<br />

throughout <strong>the</strong> years that I have been immersed in this Master's program and obsessed with<br />

this project. I promise to <strong>the</strong>m, in <strong>the</strong> near future, that I will emerge from my <strong>of</strong>fice and be<br />

able to focus on issues o<strong>the</strong>r than SMARTDOT and <strong>the</strong> current status <strong>of</strong> my Master's degree.<br />

Lastly, special praise must go to my wife Sandy, who has tolerated not only my obsession<br />

with this project over <strong>the</strong> decade <strong>of</strong> its existence, but has also been consistently supportive <strong>of</strong><br />

my ef<strong>for</strong>ts towards its development. She has been <strong>the</strong>re through every major milestone. In<br />

addition, over <strong>the</strong> past four years, her support <strong>of</strong> my pursuit <strong>of</strong> this degree has been steadfast<br />

and unwavering, even while I was taking six and nine credits a semester, and especially as I've<br />

spent untold hours at my computer composing this paper. She has brought me breakfast,<br />

lunch, and dinner at my desk so that I could continue working, and has never complained<br />

about <strong>the</strong> time she has lost to this passion <strong>of</strong> mine. Without her support and her<br />

encouragement, this project, this paper, and this degree would not have been possible.<br />

vi


SECTION I: INTRODUCTION, BACKGROUND, AND MOTIVATION<br />

1.1 STATEMENT OF THE PROBLEM<br />

<strong>Bowling</strong> is <strong>of</strong>ten considered a game <strong>of</strong> accuracy, but it is actually a game <strong>of</strong> errors. The<br />

goal <strong>of</strong> any experienced bowler is to find <strong>the</strong> optimal combination <strong>of</strong> style, equipment,<br />

and lane adjustments that creates <strong>the</strong> widest margin <strong>of</strong> error while still allowing <strong>the</strong><br />

bowler to consistently deliver <strong>the</strong> ball to <strong>the</strong> pocket with sufficient <strong>for</strong>ce, angle, and<br />

"action" to generate strikes. Success with this strategy requires a combination <strong>of</strong> factors:<br />

<strong>the</strong> bowler's natural talent and ability, refined by a generous amount <strong>of</strong> coaching and<br />

practice; experience with "reading" lane conditions and making adjustments to <strong>the</strong><br />

inevitable changes in those conditions; and <strong>the</strong> selection and use <strong>of</strong> <strong>the</strong> proper ball(s).<br />

<strong>Bowling</strong> balls are available in a variety <strong>of</strong> weights, balances, hardnesses, and surfaces.<br />

Those four variables combine to determine when and how much <strong>the</strong> ball hooks, and how<br />

hard it hits <strong>the</strong> pins. The bowler selects a bowling ball based on his or her bowling style<br />

and <strong>the</strong> current lane "condition", which is created by <strong>the</strong> distribution <strong>of</strong> oil on <strong>the</strong> lanes.<br />

There is a great deal <strong>of</strong> friction generated between <strong>the</strong> ball and <strong>the</strong> lane surface as <strong>the</strong> ball<br />

rolls down <strong>the</strong> lane, at a velocity that can approach 20 mph, with a rotational rate that<br />

regularly exceeds 300 rpms. To protect <strong>the</strong> finish <strong>of</strong> <strong>the</strong> lane, special lane-dressing oil is<br />

regularly applied to <strong>the</strong> first 30 to 40 feet <strong>of</strong> <strong>the</strong> lane. The oil can also be applied with a<br />

varying density across and down <strong>the</strong> lane to affect <strong>the</strong> "playability" <strong>of</strong> <strong>the</strong> lane, making it<br />

easier or more difficult <strong>for</strong> <strong>the</strong> ball to reach <strong>the</strong> strike pocket. The repeated action <strong>of</strong><br />

bowling balls rolling down <strong>the</strong> lane redistributes <strong>the</strong> oil over time, changing <strong>the</strong> oil<br />

pattern as a bowling match progresses. The effects <strong>of</strong> that change can be quite<br />

noticeable, sudden, and dramatic [13].<br />

Of primary concern to all bowlers is quickly and correctly adjusting to <strong>the</strong> inevitable<br />

changes in <strong>the</strong> oil pattern over <strong>the</strong> course <strong>of</strong> a bowling match. The bowling ball is <strong>the</strong><br />

bowler's "oil sensor" <strong>for</strong> determining where <strong>the</strong> lane oil is (and isn't), as well as where <strong>the</strong><br />

oil is "going". Based solely on observing <strong>the</strong> ball's reaction to <strong>the</strong> lane, <strong>the</strong> bowler<br />

adjusts to <strong>the</strong> ever-changing lane condition by drawing upon past experience with <strong>the</strong><br />

results <strong>of</strong> various adjustments made under similar circumstances. These adjustments<br />

usually involve lateral changes in <strong>the</strong> starting location on <strong>the</strong> approach and/or <strong>the</strong> target<br />

on <strong>the</strong> lane, an increase or decrease in <strong>the</strong> speed <strong>of</strong> <strong>the</strong> ball, and/or a switch to a ball that<br />

hooks more, or less, or sooner, or later, etc. The bowler may also opt to change <strong>the</strong><br />

amount <strong>of</strong> turn, lift, and/or spin <strong>the</strong>y apply to <strong>the</strong> ball during release, with <strong>the</strong> intention <strong>of</strong><br />

changing <strong>the</strong> amount <strong>the</strong> ball hooks or curves as it rolls down <strong>the</strong> lane.<br />

If <strong>the</strong> bowler does not release <strong>the</strong> ball with consistent amounts <strong>of</strong> speed, l<strong>of</strong>t, lift, and turn<br />

(<strong>the</strong> variables that directly affect <strong>the</strong> ball's reaction with <strong>the</strong> lane), it is particularly<br />

difficult <strong>for</strong> <strong>the</strong>m to accurately assess <strong>the</strong> condition <strong>of</strong> <strong>the</strong> lanes, let alone how that<br />

condition is changing. It has always been difficult to accurately quantify a bowler's<br />

relative level <strong>of</strong> consistency. It has been equally difficult to quantify and compare <strong>the</strong><br />

relative per<strong>for</strong>mance <strong>of</strong> different types <strong>of</strong> bowling balls.<br />

1


Historically, <strong>the</strong> only technique readily available has been <strong>for</strong> <strong>the</strong> bowler to videotape<br />

<strong>the</strong>ir delivery and <strong>the</strong> subsequent reaction and path <strong>of</strong> <strong>the</strong> ball, followed by a slow and<br />

tedious frame-by-frame analysis to determine <strong>the</strong> release, hook, and roll characteristics <strong>of</strong><br />

<strong>the</strong> ball. However, videotape does not allow <strong>for</strong> <strong>the</strong> direct and accurate measurement <strong>of</strong><br />

ball speed, ball l<strong>of</strong>t, rotation rate, and revolutions. Videotape also does not lend itself to<br />

side-by-side, frame-by-frame comparison <strong>of</strong> multiple shots.<br />

The ABC (American <strong>Bowling</strong> Congress) has recently deployed CATS (Computer Aided<br />

Tracking <strong>System</strong>). CATS relies heavily on instrumenting <strong>the</strong> lane with numerous<br />

position and velocity sensors in conjunction with high-speed video analysis. However,<br />

this system is only available on a handful <strong>of</strong> lanes around <strong>the</strong> country (ABC headquarters<br />

in Milwaukee and <strong>the</strong> National <strong>Bowling</strong> Stadium in Reno), along with several portable<br />

installations [12].<br />

Brunswick Corporation developed a patented system called BowlerVision ® , which is<br />

capable <strong>of</strong> providing some <strong>of</strong> <strong>the</strong> same analyses as CATS, combining a system <strong>of</strong> built-in<br />

sensors with high-speed video capture. However, BowlerVision ® is only available on a<br />

limited basis around <strong>the</strong> country, is expensive to use, and is not portable [2,3].<br />

There are several recent patents that describe various generic methods <strong>for</strong> detecting <strong>the</strong><br />

speed, spin, and/or curve <strong>of</strong> a projectile, missile, or ball. All <strong>of</strong> those patents, however,<br />

involve one or more shortcomings in realizing truly practical and cost-effective<br />

implementations as commercially viable products with regard to bowling.<br />

US Patent 5,526,326 (June 11, 1996) details a "Speed Indicating Ball", which measures<br />

<strong>the</strong> time <strong>of</strong> flight <strong>of</strong> a ball using a contact switch <strong>for</strong> release (throw) and a piezoelectric<br />

switch <strong>for</strong> impact (catch). The device is designed <strong>for</strong> use in a baseball, and requires <strong>the</strong><br />

thrower to hold down a button until <strong>the</strong> ball is released. The device calculates release<br />

velocity through time-<strong>of</strong> flight calculations over a predetermined distance (pitcher's<br />

mound to home plate), and presents <strong>the</strong> results on a built-in display [4]. Due to <strong>the</strong><br />

method <strong>of</strong> release detection, <strong>the</strong> thrower must alter <strong>the</strong>ir normal grip when throwing <strong>the</strong><br />

ball. The weight <strong>of</strong> <strong>the</strong> device with respect to <strong>the</strong> ball affects <strong>the</strong> balance <strong>of</strong> <strong>the</strong> ball, thus<br />

impacting <strong>the</strong> nature in which it curves. Also, due to <strong>the</strong> fragile nature <strong>of</strong> <strong>the</strong> built-in<br />

display, <strong>the</strong> device cannot be used in actual competition (a baseball game).<br />

US Patent 5,761,096 (June 2, 1998) describes a "Speed-sensing projectile" that uses an<br />

interior mechanical inertial switch to detect release (requiring no external button), and <strong>the</strong><br />

same inertial switch to detect <strong>the</strong> cessation <strong>of</strong> movement. This device also has a built-in<br />

display that presents <strong>the</strong> speed <strong>of</strong> <strong>the</strong> ball based on time-<strong>of</strong>-flight in<strong>for</strong>mation over a fixed<br />

distance, and was originally intended <strong>for</strong> use in a baseball [5]. This device has a similar<br />

impact on <strong>the</strong> balance <strong>of</strong> <strong>the</strong> ball as <strong>the</strong> "Speed indicating Ball", and also is precluded<br />

from use in actual competition.<br />

US Patent 6,151,563 (November 21, 2000) presents <strong>the</strong> most comprehensive <strong>of</strong> devices<br />

with regard to bowling. It describes a device that is capable <strong>of</strong> measuring <strong>the</strong> speed, spin<br />

rate, and curve <strong>of</strong> a moving object, and specifically mentions applicability to both<br />

baseball and bowling. The device uses magnetic field sensors to detect <strong>the</strong> rotation <strong>of</strong> <strong>the</strong><br />

ball within <strong>the</strong> earth's magnetic field. It supplements <strong>the</strong>se readings with input from<br />

multiple accelerometers that indicate <strong>the</strong> inertial <strong>for</strong>ces acting on <strong>the</strong> ball. The device has<br />

no direct display; instead it transmits <strong>the</strong> collected data in real-time to an external<br />

2


eceiver that stores, processes, and displays <strong>the</strong> data <strong>for</strong> <strong>the</strong> user [6]. Although<br />

comprehensive in nature, <strong>the</strong> device is expensive to implement and must be installed in<br />

<strong>the</strong> center <strong>of</strong> <strong>the</strong> ball at <strong>the</strong> time <strong>of</strong> its manufacture.<br />

As <strong>of</strong> this writing, no devices <strong>of</strong> <strong>the</strong> nature described in <strong>the</strong> patent literature have been<br />

brought to market with regards to bowling. Between <strong>the</strong> inconvenience, expense, and<br />

narrow availability <strong>of</strong> external (instrumented lane) solutions, and <strong>the</strong> dearth <strong>of</strong> internal<br />

solutions, it remains particularly difficult <strong>for</strong> a bowler to accurately and adequately assess<br />

<strong>the</strong> various impacts that changes in bowling style and bowling equipment have on <strong>the</strong>ir<br />

game. Without such timely and consistent feedback on changes in wrist and hand<br />

position, arm swing, stance, and grip, as well as changes in equipment (ball type, weight,<br />

balance, and/or surface), <strong>the</strong> bowler generally participates in a guessing game when<br />

assessing <strong>the</strong> effectiveness and usefulness <strong>of</strong> any <strong>of</strong> <strong>the</strong>se considerations.<br />

The in<strong>for</strong>mation presented in this paper has been ga<strong>the</strong>red with <strong>the</strong> intention <strong>of</strong><br />

developing an inexpensive, portable, user installable and replaceable per<strong>for</strong>mance<br />

analysis system geared towards <strong>the</strong> individual bowler. The system captures, quantifies,<br />

and analyzes <strong>the</strong> impetus <strong>the</strong> bowler applies to <strong>the</strong> ball, as well as <strong>the</strong> subsequent<br />

interaction <strong>of</strong> <strong>the</strong> ball with <strong>the</strong> lane surface from <strong>the</strong> point <strong>of</strong> release to <strong>the</strong> point <strong>of</strong><br />

impact with <strong>the</strong> pins. This system is hereafter referred to as SMARTDOT.<br />

The SMARTDOT system consists <strong>of</strong> <strong>the</strong> following components: an in-situ sensor module<br />

(<strong>the</strong> SMARTDOT module) that resides in <strong>the</strong> ball and collects sensor data; a wireless<br />

communication link (<strong>the</strong> COMM wand); and a PDA or PC-hosted MASTER s<strong>of</strong>tware<br />

application that uploads, archives, analyzes, and displays <strong>the</strong> data captured by <strong>the</strong> in-situ<br />

sensor module.<br />

1.2 INTRODUCTION TO THE PHYSICS OF BOWLING<br />

The only <strong>for</strong>ce <strong>of</strong> any significance that acts upon a bowling ball after <strong>the</strong> ball is released<br />

is <strong>the</strong> <strong>for</strong>ce due to friction generated between <strong>the</strong> ball and <strong>the</strong> lane (this <strong>for</strong>ce varies a<br />

great deal due to <strong>the</strong> variations in oil distribution on <strong>the</strong> lane). A bowler invariably<br />

releases a ball at an initial linear velocity greater than that which would result from <strong>the</strong><br />

ball's initial angular velocity. In o<strong>the</strong>r words, <strong>the</strong> distance <strong>the</strong> ball travels during one<br />

complete revolution <strong>of</strong> <strong>the</strong> ball is greater than <strong>the</strong> circumference <strong>of</strong> <strong>the</strong> ball (<strong>the</strong> ball is<br />

skidding or sliding). The bowler also imparts an axis <strong>of</strong> rotation to <strong>the</strong> ball that is tilted<br />

or turned from normal, which is intended to make <strong>the</strong> ball hook towards <strong>the</strong> pocket. It is<br />

<strong>the</strong> interaction <strong>of</strong> <strong>the</strong> linear and angular velocities with <strong>the</strong> frictional <strong>for</strong>ce acting between<br />

<strong>the</strong> ball and <strong>the</strong> lane that causes <strong>the</strong> ball to hook.<br />

As <strong>the</strong> ball travels down <strong>the</strong> lane, <strong>the</strong> frictional <strong>for</strong>ce also causes <strong>the</strong> ball to slow down.<br />

As long as <strong>the</strong> ball is skidding, friction acts to transfer some <strong>of</strong> <strong>the</strong> ball's linear<br />

momentum into angular momentum, decreasing <strong>the</strong> linear velocity while increasing <strong>the</strong><br />

angular velocity. A small (but not insignificant) percentage <strong>of</strong> <strong>the</strong> ball's linear<br />

momentum is also lost due to <strong>the</strong> heat, noise, and vibration generated as <strong>the</strong> surfaces <strong>of</strong><br />

<strong>the</strong> ball and <strong>the</strong> lane rub against each o<strong>the</strong>r. If <strong>the</strong> linear and angular velocities resolve<br />

<strong>the</strong>mselves completely, <strong>the</strong> ball is no longer sliding (it has rolled out), and <strong>the</strong> frictional<br />

<strong>for</strong>ce now causes both <strong>the</strong> angular and linear velocities <strong>of</strong> <strong>the</strong> ball to decrease in direct<br />

proportion to each o<strong>the</strong>r [9,12,13].<br />

3


By measuring <strong>the</strong> time between release and impact, and noting <strong>the</strong> duration <strong>of</strong> each<br />

revolution <strong>of</strong> <strong>the</strong> bowling ball, it is possible to derive <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> ball <strong>for</strong><br />

each revolution, and <strong>the</strong> energy necessary to induce this change in angular velocity. The<br />

average linear velocity <strong>of</strong> <strong>the</strong> ball and <strong>the</strong> changes in <strong>the</strong> ball's angular velocity during <strong>the</strong><br />

course <strong>of</strong> <strong>the</strong> shot can <strong>the</strong>n be combined with certain assumptions regarding energy<br />

conservation and friction to derive <strong>the</strong> linear velocity and longitudinal location <strong>of</strong> <strong>the</strong> ball<br />

at any instant. Using <strong>the</strong> same criteria, it is also possible to derive <strong>the</strong> varying frictional<br />

<strong>for</strong>ce that acts between <strong>the</strong> ball and <strong>the</strong> lane. Section III gives a <strong>for</strong>mal presentation <strong>of</strong><br />

<strong>the</strong> assumptions, physics, and ma<strong>the</strong>matics that are used to extract this in<strong>for</strong>mation from<br />

<strong>the</strong> SMARTDOT sensor data.<br />

1.3 SCOPE OF THE PAPER/PROJECT<br />

The overall project development breaks down into two distinct phases: an investigative<br />

feasibility phase and a product development phase. This paper presents <strong>the</strong> results <strong>of</strong> <strong>the</strong><br />

feasibility phase.<br />

1.3.1 Investigative Feasibility Phase<br />

The feasibility phase has focused on developing working prototypes <strong>of</strong> each component<br />

<strong>of</strong> <strong>the</strong> system - <strong>the</strong> in-situ SMARTDOT sensor module, <strong>the</strong> wireless communications link,<br />

and a PC-based data analysis tool, called <strong>the</strong> MASTER. The major tasks have been:<br />

• Building a working prototype <strong>of</strong> <strong>the</strong> SMARTDOT module that con<strong>for</strong>ms to all <strong>of</strong><br />

<strong>the</strong> physical constraints <strong>the</strong> in-situ sensor module is required to meet - <strong>the</strong>se<br />

constraints are presented in detail later in <strong>the</strong> paper. This task also determined <strong>the</strong><br />

extent to which adequate embedded s<strong>of</strong>tware could be developed that fit within<br />

<strong>the</strong> constraints <strong>of</strong> <strong>the</strong> embedded microprocessor's resources while still per<strong>for</strong>ming<br />

all <strong>of</strong> <strong>the</strong> tasks essential to <strong>the</strong> success <strong>of</strong> <strong>the</strong> system. The working prototype<br />

serves as pro<strong>of</strong>-<strong>of</strong>-concept <strong>for</strong> <strong>the</strong> in-situ sensor module, while it simultaneously<br />

has served as <strong>the</strong> data acquisition plat<strong>for</strong>m <strong>for</strong> characterizing <strong>the</strong> response <strong>of</strong> <strong>the</strong><br />

on-board sensors to <strong>the</strong> ambient conditions <strong>the</strong>y sense.<br />

• Building <strong>the</strong> COMM wand - a prototype wireless communications device that<br />

serves as <strong>the</strong> physical link between <strong>the</strong> SMARTDOT module and <strong>the</strong> PC-hosted<br />

MASTER s<strong>of</strong>tware. A custom communications protocol also had to be<br />

implemented in both <strong>the</strong> SMARTDOT module and <strong>the</strong> MASTER application so<br />

that <strong>the</strong>y could communicate via <strong>the</strong> COMM wand.<br />

• Developing <strong>the</strong> MASTER program - a preliminary PC-based communications and<br />

analysis s<strong>of</strong>tware package that interacts with <strong>the</strong> prototype SMARTDOT module<br />

through <strong>the</strong> COMM wand, uploads <strong>the</strong> acquired sensor data, and facilitates<br />

analysis and graphical presentation <strong>of</strong> that data. This version <strong>of</strong> <strong>the</strong> MASTER<br />

s<strong>of</strong>tware is actually a tool geared toward cataloging <strong>the</strong> uploaded wave<strong>for</strong>ms,<br />

analyzing those wave<strong>for</strong>ms, identifying appropriate data-analysis techniques, and<br />

implementing those techniques to extract useful in<strong>for</strong>mation from <strong>the</strong> data.<br />

4


1.3.2 Product Development Phase<br />

The product development phase will put to practice <strong>the</strong> discoveries from <strong>the</strong> feasibility<br />

phase, both in refinement <strong>of</strong> <strong>the</strong> SMARTDOT module's capabilities, and in <strong>the</strong><br />

development <strong>of</strong> a PC-based (and possibly a PDA-based) GUI s<strong>of</strong>tware application <strong>for</strong> <strong>the</strong><br />

end-user. The major tasks <strong>of</strong> <strong>the</strong> development phase will be to:<br />

• Refine <strong>the</strong> operation <strong>of</strong> <strong>the</strong> SMARTDOT sensor module to generalize its design<br />

and per<strong>for</strong>mance <strong>for</strong> a wide range <strong>of</strong> bowlers. Such refinements will be derived<br />

from <strong>the</strong> analysis <strong>of</strong> data ga<strong>the</strong>red in <strong>the</strong> feasibility phase <strong>of</strong> <strong>the</strong> development, as<br />

well as from data collected during additional testing by o<strong>the</strong>r bowlers.<br />

• Develop a GUI-based s<strong>of</strong>tware application that interacts with <strong>the</strong> SMARTDOT<br />

module, and uploads, catalogs, analyzes, and presents <strong>the</strong> data in a <strong>for</strong>m useful to<br />

<strong>the</strong> bowler. This application could take two <strong>for</strong>ms: a full-featured, PC-hosted,<br />

Windows ® -based application, and a compact PDA-based application.<br />

1.4 OVERVIEW OF THE FEASIBILITY PHASE<br />

The SMARTDOT system consists <strong>of</strong> a custom hardware module integrated with custom<br />

embedded s<strong>of</strong>tware that interacts with a PC-based user application through a (currently)<br />

custom wireless communications device. The "intelligence" <strong>of</strong> <strong>the</strong> SMARTDOT system<br />

is distributed across two portions <strong>of</strong> s<strong>of</strong>tware: <strong>the</strong> SMARTDOT module embedded<br />

s<strong>of</strong>tware, and <strong>the</strong> PC-hosted MASTER application.<br />

The SMARTDOT module is designed to collect sufficient data with a fine enough<br />

granularity that <strong>the</strong> MASTER s<strong>of</strong>tware can per<strong>for</strong>m accurate and meaningful analysis <strong>of</strong><br />

that data. The paper discusses <strong>the</strong> design assumptions, constraints, capabilities, and<br />

per<strong>for</strong>mance <strong>of</strong> <strong>the</strong> in-situ data collection module, and <strong>the</strong> underlying assumptions and<br />

techniques used to analyze and present <strong>the</strong> data in <strong>the</strong> MASTER s<strong>of</strong>tware, as well as <strong>the</strong><br />

conclusions drawn from <strong>the</strong> analysis <strong>of</strong> <strong>the</strong> data acquired in this phase <strong>of</strong> <strong>the</strong> project, and<br />

suggestions <strong>for</strong> fur<strong>the</strong>r development.<br />

The key to <strong>the</strong> feasibility <strong>of</strong> <strong>the</strong> system was <strong>the</strong> initial development <strong>of</strong> <strong>the</strong> in-situ sensor<br />

module. Without <strong>the</strong> means to ga<strong>the</strong>r sensor data from <strong>the</strong> perspective <strong>of</strong> <strong>the</strong> ball,<br />

development <strong>of</strong> <strong>the</strong> remainder <strong>of</strong> <strong>the</strong> system would have been extraneous. Consequently,<br />

<strong>the</strong> feasibility portion <strong>of</strong> <strong>the</strong> project encompassed <strong>the</strong>se distinct stages:<br />

• Designing and building a viable hardware plat<strong>for</strong>m <strong>for</strong> <strong>the</strong> in-situ SMARTDOT<br />

sensor module and implementing <strong>the</strong> COMM wand hardware.<br />

• Developing <strong>the</strong> embedded s<strong>of</strong>tware <strong>for</strong> <strong>the</strong> SMARTDOT module, including <strong>the</strong><br />

communications protocol between <strong>the</strong> module and <strong>the</strong> MASTER application. This<br />

portion <strong>of</strong> <strong>the</strong> feasibility phase is presented in Section II, "Collecting <strong>the</strong> Data -<br />

The SMARTDOT Module".<br />

• Analyzing <strong>the</strong> data <strong>the</strong> module collected in order to reveal <strong>the</strong> types <strong>of</strong> useful<br />

in<strong>for</strong>mation that could be extracted from that data. To that end, <strong>the</strong> MASTER<br />

program was developed, which has served as <strong>the</strong> preliminary communications,<br />

data analysis, and presentation application. Section III, "Analyzing <strong>the</strong> Data - The<br />

MASTER Application", presents this portion <strong>of</strong> <strong>the</strong> feasibility phase in detail.<br />

5


Prior to <strong>the</strong> start <strong>of</strong> this project (May 1992), <strong>the</strong>re were no references in <strong>the</strong> literature or<br />

<strong>the</strong> various patent databases to any previous attempts to develop this kind <strong>of</strong> internal<br />

system. Brunswick Corporation has since developed a robot that can throw a bowling<br />

ball with repeatable and precise amounts <strong>of</strong> speed, spin, and axis turn and tilt, but <strong>the</strong><br />

subsequent response <strong>of</strong> <strong>the</strong> ball is still measured with external sensors [9]. It is certainly<br />

possible that one or more <strong>of</strong> <strong>the</strong> various bowling ball manufacturers may have developed<br />

proprietary means <strong>for</strong> internally assessing <strong>the</strong> per<strong>for</strong>mance <strong>of</strong> <strong>the</strong>ir products. If that is <strong>the</strong><br />

case, <strong>the</strong>y have chosen to retain that in<strong>for</strong>mation in <strong>the</strong> <strong>for</strong>m <strong>of</strong> trade secrets.<br />

With no prior research to fall back on, it was necessary to design and build an initial<br />

sensor module simply to establish that it was physically possible to construct such a<br />

device within <strong>the</strong> extremely limited confines <strong>of</strong> its intended environment. A reliable and<br />

inexpensive means <strong>for</strong> transferring data in a wireless (non-contact) fashion from <strong>the</strong><br />

module to a PC also had to be developed.<br />

Those two tasks were completed as an initial part <strong>of</strong> <strong>the</strong> feasibility study. The paper<br />

presents relevant background and details <strong>of</strong> <strong>the</strong> hardware that are essential to<br />

understanding <strong>the</strong> design and development <strong>of</strong> <strong>the</strong> embedded s<strong>of</strong>tware, and/or <strong>the</strong> analysis<br />

<strong>of</strong> <strong>the</strong> raw data collected. However, an exhaustive presentation on <strong>the</strong> hardware is not<br />

within <strong>the</strong> scope <strong>of</strong> this paper.<br />

Since <strong>the</strong> wave<strong>for</strong>m that SMARTDOT was attempting to capture had apparently never<br />

be<strong>for</strong>e been seen, <strong>the</strong> first prototype module was also designed as a flexible data<br />

collection device. That first module was intended to serve as both <strong>the</strong> bowling ball's eye<br />

and its memory as it looked out through <strong>the</strong> finger hole and recorded what it saw while<br />

<strong>the</strong> ball rolled down <strong>the</strong> lane. The basic assumptions and design <strong>for</strong> <strong>the</strong> embedded<br />

s<strong>of</strong>tware <strong>for</strong> <strong>the</strong> SMARTDOT module have been developed based on <strong>the</strong> analysis <strong>of</strong> that<br />

captured data.<br />

With <strong>the</strong> feasibility <strong>of</strong> <strong>the</strong> hardware established, <strong>the</strong> real problem at hand has been largely<br />

one <strong>of</strong> s<strong>of</strong>tware engineering. Although <strong>the</strong> module works as intended, this version has<br />

been developed solely through <strong>the</strong> author's personal use and input. The development<br />

phase <strong>of</strong> <strong>the</strong> project will involve a refinement <strong>of</strong> <strong>the</strong> sensor module, as described later in<br />

<strong>the</strong> paper, followed by a limited beta test among a collection <strong>of</strong> bowlers with different<br />

styles and capabilities. A subsequent refinement <strong>of</strong> <strong>the</strong> module's embedded s<strong>of</strong>tware will<br />

most likely follow to accommodate variations discovered during <strong>the</strong> beta test.<br />

As <strong>for</strong> <strong>the</strong> PC-hosted MASTER s<strong>of</strong>tware, <strong>the</strong> paper reports <strong>the</strong> results <strong>of</strong>, and <strong>the</strong><br />

conclusions drawn from, <strong>the</strong> various types <strong>of</strong> data analysis per<strong>for</strong>med on <strong>the</strong> raw data<br />

collected during this phase <strong>of</strong> development. The MASTER program was developed as a<br />

custom data analysis and presentation application to facilitate review <strong>of</strong> sensor data under<br />

a real-world scenario (i.e., during real practice sessions at a local bowling center), and to<br />

apply <strong>the</strong> in<strong>for</strong>mation extraction techniques presented in Section III <strong>of</strong> <strong>the</strong> paper. Based<br />

on this preliminary analysis package, high-level design suggestions <strong>for</strong> <strong>the</strong> development<br />

<strong>of</strong> <strong>the</strong> end-user application are included at <strong>the</strong> end <strong>of</strong> Section III.<br />

6


SECTION II: COLLECTING THE DATA - THE SMARTDOT MODULE<br />

This section presents, in detail, <strong>the</strong> initial development, current implementation, and<br />

future considerations <strong>of</strong> <strong>the</strong> in-situ SMARTDOT sensor module. Discussions <strong>of</strong> <strong>the</strong><br />

design constraints, <strong>the</strong> hardware implementation, and <strong>the</strong> embedded s<strong>of</strong>tware<br />

implementation (including flowcharts, timing diagrams, and a memory map) are<br />

included, along with an assessment <strong>of</strong> <strong>the</strong> prototype's per<strong>for</strong>mance. Suggestions <strong>for</strong><br />

future refinements to <strong>the</strong> module's hardware and s<strong>of</strong>tware are also given.<br />

2.1 DESIGN BASIS<br />

The in-situ sensor module, at a minimum, must be a capable <strong>of</strong> detecting release <strong>of</strong> <strong>the</strong><br />

ball, rotation <strong>of</strong> <strong>the</strong> ball, and <strong>the</strong> ball's impact with <strong>the</strong> pins. It must also have an accurate<br />

"clock" with which to time-stamp those occurrences. For <strong>the</strong> system to be economically<br />

viable, a major premise behind <strong>the</strong> in-situ sensor module rests on <strong>the</strong> assumption that <strong>the</strong><br />

ball's rotation can be accurately inferred by observing <strong>the</strong> amount <strong>of</strong> ambient light<br />

impinging on a particular point on <strong>the</strong> surface <strong>of</strong> <strong>the</strong> ball as <strong>the</strong> ball rolls down <strong>the</strong> lane,<br />

and that an inexpensive device can be developed that fits unobtrusively into <strong>the</strong> ball <strong>for</strong><br />

<strong>the</strong> purpose <strong>of</strong> recording this data. Since all modern bowling centers have overhead<br />

lighting <strong>of</strong> some type, a source <strong>of</strong> ambient light is always present (except <strong>for</strong> <strong>the</strong> novelty<br />

<strong>of</strong> "moonlight" or "glow" bowling).<br />

Figure 2-1 provides a cut-away view <strong>of</strong> <strong>the</strong> SMARTDOT sensor module installed in a<br />

bowling ball. For <strong>the</strong> following reasons, <strong>the</strong> ideal place to install <strong>the</strong> module is under a<br />

finger insert in an existing finger hole:<br />

• To optimize <strong>the</strong> dynamic range <strong>of</strong> <strong>the</strong> ambient light incident on <strong>the</strong> sensor<br />

module, <strong>the</strong> module should be placed so that it alternately rotates through <strong>the</strong><br />

shadow <strong>the</strong> ball casts on <strong>the</strong> lane, and <strong>the</strong>n up towards <strong>the</strong> lighted ceiling. The<br />

finger holes generally follow this line <strong>of</strong> rotation.<br />

• If <strong>the</strong> module is installed in an existing finger hole, it is not necessary to drill an<br />

additional hole, or modify <strong>the</strong> ball in any way.<br />

• Finger insert holes have a standard diameter, allowing <strong>for</strong> a standard size<br />

(diameter) module. The sensor module has been made small enough that minimal<br />

additional material must be removed from <strong>the</strong> ball in order to install it,<br />

simplifying <strong>the</strong> installation procedure. This location also allows <strong>for</strong> easy<br />

replacement <strong>of</strong> <strong>the</strong> module's battery.<br />

• Locating <strong>the</strong> module in close proximity to a finger hole facilitates detecting <strong>the</strong><br />

removal <strong>of</strong> <strong>the</strong> bowler's finger from that hole, which is necessary <strong>for</strong> accurately<br />

detecting release <strong>of</strong> <strong>the</strong> ball during <strong>the</strong> bowler's delivery.<br />

• Locating <strong>the</strong> module below <strong>the</strong> surface <strong>of</strong> <strong>the</strong> ball af<strong>for</strong>ds a good deal <strong>of</strong><br />

protection from <strong>the</strong> extreme <strong>for</strong>ces that <strong>the</strong> surface <strong>of</strong> <strong>the</strong> ball experiences when<br />

impacting <strong>the</strong> lane, <strong>the</strong> pins, <strong>the</strong> pit cushion, <strong>the</strong> gutter, and when being handled<br />

by an automatic ball return.<br />

7


SMARTDOT Module Cut-Away View<br />

CL<br />

1.375"<br />

Finger<br />

Insert<br />

Piezoelectric<br />

Film<br />

Light Sensor<br />

(TSL251)<br />

Transmit<br />

LED's<br />

Crystal<br />

(3.6864 MHz)<br />

Printed Circuit<br />

Board (PCB)<br />

µProcessor<br />

(87C752)<br />

0.375"<br />

6V Lithium<br />

Battery<br />

0.938"<br />

0.969"<br />

Figure 2-1: SMARTDOT Module Cut-Away View<br />

8


2.2 Design Constraints<br />

The feasibility <strong>of</strong> <strong>the</strong> SMARTDOT system rests on being able to create an in-situ sensor<br />

module that is small, inexpensive, light-weight, convenient to install and remove, and<br />

does not affect <strong>the</strong> balance <strong>of</strong> <strong>the</strong> ball nor interfere with <strong>the</strong> bowler's normal delivery or<br />

release motions. These design constraints are interrelated and are discussed below.<br />

2.2.1 Ease <strong>of</strong> Use<br />

Ideally, <strong>the</strong> module must be "invisible" to <strong>the</strong> bowler. It should not alter <strong>the</strong> manner in<br />

which <strong>the</strong> bowler grips or releases <strong>the</strong> ball, nor should <strong>the</strong> bowler be able to tactilely<br />

detect <strong>the</strong> presence <strong>of</strong> <strong>the</strong> module. The operation <strong>of</strong> <strong>the</strong> module must have no impact on<br />

<strong>the</strong> bowler's normal routine and, except <strong>for</strong> uploading data from <strong>the</strong> device <strong>for</strong> analysis,<br />

<strong>the</strong>re should be no interaction required from <strong>the</strong> bowler.<br />

2.2.2 Size, Weight, and Impact on <strong>the</strong> Balance <strong>of</strong> <strong>the</strong> Ball<br />

The module must be placed in a hole drilled in <strong>the</strong> ball, which can affect both <strong>the</strong> weight<br />

and <strong>the</strong> balance <strong>of</strong> <strong>the</strong> ball. The module does have some intrinsic weight and placing <strong>the</strong><br />

module in <strong>the</strong> hole drilled <strong>for</strong> it <strong>of</strong>fsets some <strong>of</strong> <strong>the</strong> weight removed from <strong>the</strong> ball, but <strong>the</strong><br />

density <strong>of</strong> <strong>the</strong> module will most likely differ from that <strong>of</strong> <strong>the</strong> ball. The closer <strong>the</strong> module<br />

is placed to <strong>the</strong> surface <strong>of</strong> <strong>the</strong> ball (<strong>the</strong> shallower <strong>the</strong> hole is drilled), <strong>the</strong> greater any<br />

difference in density affects <strong>the</strong> dynamic balance <strong>of</strong> <strong>the</strong> ball. However, a deeper hole<br />

removes more material, also impacting <strong>the</strong> weight and balance. The location <strong>of</strong> <strong>the</strong> hole<br />

relative to <strong>the</strong> finger holes also impacts <strong>the</strong> static and dynamic balance <strong>of</strong> <strong>the</strong> ball.<br />

It is possible to minimize <strong>the</strong>se effects by placing <strong>the</strong> module in one <strong>of</strong> <strong>the</strong> existing finger<br />

holes. With <strong>the</strong> module sized and designed to per<strong>for</strong>m its intended function while located<br />

at <strong>the</strong> bottom <strong>of</strong> a finger hole, an additional hole is unnecessary. Also, <strong>the</strong> module has<br />

less <strong>of</strong> an impact on <strong>the</strong> inertial balance <strong>of</strong> <strong>the</strong> ball if it can be located fur<strong>the</strong>r below <strong>the</strong><br />

surface, especially if its overall weight <strong>of</strong>fsets <strong>the</strong> weight <strong>of</strong> any extra material removed<br />

from <strong>the</strong> finger hole.<br />

The vast majority <strong>of</strong> bowlers <strong>of</strong> <strong>the</strong> caliber that would benefit from <strong>the</strong> SMARTDOT<br />

system utilize replaceable plastic or rubber finger inserts. These inserts fit into a finger<br />

hole with a standard diameter <strong>of</strong> 31 / 32 " (.969"). Allowing <strong>for</strong> tolerance and clearance, <strong>the</strong><br />

module must <strong>the</strong>n fit on a circular printed circuit board (PCB) no more than 30 / 32 " (.938")<br />

in diameter.<br />

Finger holes are generally drilled only as deep as is necessary to fully accept <strong>the</strong> finger<br />

insert. Inserts are 1 3 / 8 " (1.375") to 1 1 / 2 " (1.5") high, and require a similar depth hole. In<br />

order to limit <strong>the</strong> depth to which <strong>the</strong> finger hole must be drilled to accommodate <strong>the</strong><br />

module, <strong>the</strong> module's height must be kept to a minimum.<br />

The overall height <strong>of</strong> <strong>the</strong> SMARTDOT module prototype shown in Figure 2-1 is 0.375"<br />

( 3 / 8 "). The volume <strong>of</strong> material that must be removed from <strong>the</strong> ball to accommodate <strong>the</strong><br />

module is:<br />

(.969 / 2) 2 · π · 0.375 = .277 in 3 .<br />

The specific gravity <strong>of</strong> <strong>the</strong> weight block material (<strong>the</strong> area where <strong>the</strong> finger holes are<br />

normally drilled) is generally 1.5 to 2.0, thus <strong>the</strong> weight <strong>of</strong> <strong>the</strong> material to be removed<br />

(assuming a density <strong>of</strong> 0.578 oz 3<br />

/ in <strong>for</strong> a specific gravity <strong>of</strong> 1.0) is 0.24 oz to 0.32 oz (7-9<br />

grams). The SMARTDOT module prototype weighs 7 grams, resulting in a net loss to <strong>the</strong><br />

9


all <strong>of</strong> 2 grams or less. Given that a simple plastic case enclosing <strong>the</strong> module will<br />

contribute an additional 2-3 grams, <strong>the</strong> total weight <strong>of</strong> <strong>the</strong> module with case approximates<br />

<strong>the</strong> weight <strong>of</strong> <strong>the</strong> material removed, resulting in an essentially neutral impact on <strong>the</strong><br />

weight and balance <strong>of</strong> <strong>the</strong> ball.<br />

2.2.3 Cost<br />

Good bowling balls now cost in excess <strong>of</strong> $150. A reasonable target retail price <strong>for</strong> <strong>the</strong><br />

SMARTDOT module is approximately one-quarter to one-third <strong>of</strong> that, or no more than<br />

$50. Assuming normal margins and distribution channels places <strong>the</strong> target production<br />

cost in <strong>the</strong> range <strong>of</strong> $12.50-$15.00. The target production cost determines <strong>the</strong> means and<br />

methods that can be used to detect <strong>the</strong> action <strong>of</strong> <strong>the</strong> ball (<strong>the</strong> type and number <strong>of</strong> sensors),<br />

as well as <strong>the</strong> technology used to implement <strong>the</strong> module, i.e., <strong>the</strong> type <strong>of</strong> microprocessor<br />

and its on-board resources, <strong>the</strong> size and type <strong>of</strong> data memory, <strong>the</strong> means <strong>of</strong><br />

communicating with <strong>the</strong> outside world, and <strong>the</strong> costs associated with <strong>the</strong> battery, case<br />

design, and assembly. The estimated production cost <strong>of</strong> <strong>the</strong> SMARTDOT module<br />

prototype is currently $13.50.<br />

2.2.4 Power Consumption<br />

Although <strong>the</strong> module is readily accessible, battery life must be long enough that <strong>the</strong><br />

bowler is not frequently <strong>for</strong>ced to replace <strong>the</strong> battery. Limiting <strong>the</strong> energy requirements<br />

<strong>of</strong> <strong>the</strong> module extends <strong>the</strong> battery life, while also limiting <strong>the</strong> size (height) <strong>of</strong> <strong>the</strong> battery,<br />

which is important, since <strong>the</strong> battery comprises a significant fraction <strong>of</strong> <strong>the</strong> height and<br />

weight <strong>of</strong> <strong>the</strong> module.<br />

Ideally, <strong>the</strong> module will spend most <strong>of</strong> its time in a micro-power standby state. It wakes<br />

up as <strong>the</strong> bowler releases <strong>the</strong> ball, monitors and records <strong>the</strong> output <strong>of</strong> its sensors while <strong>the</strong><br />

ball is rolling down <strong>the</strong> lane, and <strong>the</strong>n returns to standby mode soon after <strong>the</strong> ball hits <strong>the</strong><br />

pins. The only o<strong>the</strong>r time <strong>the</strong> module should wake up is to upload <strong>the</strong> sensor data it has<br />

collected to <strong>the</strong> MASTER application.<br />

Lithium coin cells are <strong>the</strong> most appropriate battery technology <strong>for</strong> <strong>the</strong> module. They are<br />

round (as is <strong>the</strong> module), light, thin, inexpensive, readily available in standard sizes, and<br />

have a high energy density and cell voltage (3-3.6 volts). The SMARTDOT module<br />

prototype uses two 3-volt BR2016 lithium coin cells, which collectively weigh 3-4 grams<br />

(a little over half <strong>of</strong> <strong>the</strong> module's total weight, and contribute a little over one-third<br />

(0.13") to <strong>the</strong> overall height.<br />

2.2.5 Convenience <strong>of</strong> Installation and Removal<br />

Since <strong>the</strong> module has a user-replaceable battery, it must be convenient to install and<br />

remove. By placing <strong>the</strong> module underneath a removable finger insert, <strong>the</strong> bowler has<br />

ready access to <strong>the</strong> module, requiring no special equipment <strong>for</strong> installation or removal.<br />

10


2.3 SENSING REQUIREMENTS<br />

The module must be able to sense when <strong>the</strong> ball is released, when it hits <strong>the</strong> lane, when it<br />

hits <strong>the</strong> pins, and <strong>the</strong> ball's angular velocity as it rolls down <strong>the</strong> lane. The module must<br />

be able to accurately sense <strong>the</strong> passage <strong>of</strong> time, and to record time-stamped samples <strong>of</strong><br />

<strong>the</strong> light wave<strong>for</strong>m and <strong>of</strong> <strong>the</strong> impacts <strong>the</strong> ball experiences. It also must be able to sense<br />

<strong>the</strong> presence <strong>of</strong> <strong>the</strong> communication device and contain a transceiver <strong>of</strong> some type so that<br />

<strong>the</strong> module can transfer in<strong>for</strong>mation to/from <strong>the</strong> MASTER application.<br />

The ease-<strong>of</strong>-use, size, cost, and power consumption criteria, combined with locating <strong>the</strong><br />

module underneath a finger insert, limit <strong>the</strong> types <strong>of</strong> sensors that <strong>the</strong> module can employ.<br />

2.3.1 Sensing Rotation <strong>of</strong> <strong>the</strong> Ball (Angular Velocity)<br />

Several methods have been considered to directly sense <strong>the</strong> rotation (angular velocity) <strong>of</strong><br />

<strong>the</strong> ball using passive techniques (measuring some response to ambient conditions):<br />

• Sensing <strong>the</strong> changing orientation <strong>of</strong> <strong>the</strong> ball in <strong>the</strong> earth's magnetic field.<br />

• Sensing <strong>the</strong> changing orientation <strong>of</strong> <strong>the</strong> ball in <strong>the</strong> earth's gravitational field.<br />

• Measuring <strong>the</strong> angular acceleration directly with an accelerometer.<br />

• Measuring <strong>the</strong> ambient light falling on a fixed point on <strong>the</strong> ball.<br />

Honeywell makes an integrated two-axis magnetometer (HMC1052) that physically fits<br />

<strong>the</strong> application, but <strong>the</strong> cost ($18) and peak current draw (~400 mAmps) are both<br />

prohibitive [17]. Analog Devices makes a dual-axis tilt sensor/accelerometer<br />

(ADXL202E) that also fits <strong>the</strong> application, both in size and power requirement, but its<br />

cost (~$15 in 1000 piece quantities) makes it too expensive <strong>for</strong> this application, although<br />

it could be used <strong>for</strong> a later upscale version <strong>of</strong> <strong>the</strong> module [15].<br />

The main thrust <strong>of</strong> <strong>the</strong> research <strong>for</strong> this project centers on <strong>the</strong> fourth, albeit less obvious,<br />

alternative. Besides presenting <strong>the</strong> feasibility <strong>of</strong> <strong>the</strong> in-situ sensor module, this paper<br />

demonstrates that a photometric sensor placed at <strong>the</strong> bottom <strong>of</strong> a finger hole, underneath<br />

a finger insert, can be used to accurately sense <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> ball.<br />

TAOS (Texas Advanced Optical <strong>System</strong>s) makes a series <strong>of</strong> small, inexpensive, lowpower,<br />

integrated visible light detectors (TSL25x) that suit <strong>the</strong> application [23]. In<br />

addition, <strong>the</strong> same light sensor can also be used to detect <strong>the</strong> moment <strong>of</strong> release (indicated<br />

by a sudden transition from dark-to-light), and serve as <strong>the</strong> receiver <strong>for</strong> an IR-based<br />

wireless communications scheme. Refer to Figure 2-1 <strong>for</strong> <strong>the</strong> orientation <strong>of</strong> <strong>the</strong> light<br />

sensor in relation to <strong>the</strong> finger insert.<br />

An increasing light level is seen as <strong>the</strong> finger hole revolves up to face <strong>the</strong> ceiling, while a<br />

decreasing light level is sensed as <strong>the</strong> finger hole revolves toward <strong>the</strong> lane. Peaks in <strong>the</strong><br />

light wave<strong>for</strong>m occur at <strong>the</strong> top <strong>of</strong> each revolution (defined as <strong>the</strong> orientation <strong>of</strong> <strong>the</strong> ball<br />

when <strong>the</strong> finger holes are facing toward <strong>the</strong> ceiling), and valleys occur at <strong>the</strong> bottom <strong>of</strong><br />

each revolution (defined as <strong>the</strong> orientation <strong>of</strong> <strong>the</strong> ball when <strong>the</strong> finger holes are closest to<br />

<strong>the</strong> lane). In developing <strong>the</strong> light-sensor based module, it was <strong>the</strong> author's belief that <strong>the</strong><br />

ambient light level <strong>the</strong> sensor "sees" as <strong>the</strong> ball rotates would roughly transcribe a<br />

sinusoidal shape, and that <strong>the</strong> sampled and digitized light wave<strong>for</strong>m could be stored,<br />

11


uploaded, processed, and analyzed in such a way as to yield results useful to <strong>the</strong> bowler.<br />

See Figures 2-2a and 2-2b <strong>for</strong> an example <strong>of</strong> <strong>the</strong> module installed in <strong>the</strong> ball and rolling<br />

down <strong>the</strong> lane. The dotted lines emanating from <strong>the</strong> finger hole indicate <strong>the</strong> module's<br />

"viewing angle" <strong>for</strong> ambient light.<br />

2.3.2 Sensing Release, Lane Impact, and Pin Impact<br />

As previously presented, in order to limit <strong>the</strong> size <strong>of</strong> <strong>the</strong> battery, <strong>the</strong> module should<br />

remain in an ultra-low power "sleep" state whenever <strong>the</strong> ball is not being held by <strong>the</strong><br />

bowler, or rolling down <strong>the</strong> lane. For <strong>the</strong> module to detect that <strong>the</strong> ball has been released,<br />

it must have some means <strong>for</strong> identifying that <strong>the</strong> bowler has removed <strong>the</strong>ir fingers from<br />

<strong>the</strong> ball. The light sensor could be used <strong>for</strong> this purpose, since <strong>the</strong> bottom <strong>of</strong> <strong>the</strong> finger<br />

hole is dark while <strong>the</strong> bowler's finger is in <strong>the</strong> hole, and light(er) when <strong>the</strong> finger is<br />

removed. However, to accomplish this task, <strong>the</strong> TSL251 must remain powered, even<br />

while <strong>the</strong> module is asleep. This is not possible at <strong>the</strong> ultra-low standby current level (~1<br />

µAmp) that is required <strong>for</strong> extended battery life.<br />

The module also requires a means to detect impact with <strong>the</strong> pins (which also gives it <strong>the</strong><br />

capability <strong>of</strong> detecting impact with <strong>the</strong> lane). This "impact" sensor has been implemented<br />

with a piezoelectric plastic film made from PVDF (polyvinylidene fluoride) [19]. This<br />

film is inexpensive, durable, and requires no external power to generate a voltage signal<br />

strong enough to wake up <strong>the</strong> module. Since it is piezoelectric, when pressure is applied<br />

to <strong>the</strong> film, <strong>the</strong> film responds by producing a voltage proportional to <strong>the</strong> rate-<strong>of</strong>-change <strong>of</strong><br />

<strong>the</strong> pressure applied. With a piece <strong>of</strong> this film inserted between <strong>the</strong> outside <strong>of</strong> <strong>the</strong> finger<br />

insert and <strong>the</strong> wall <strong>of</strong> <strong>the</strong> finger hole, it can sense not only <strong>the</strong> lane and pin impacts, but<br />

also <strong>the</strong> bowler applying pressure to <strong>the</strong> insert. Since <strong>the</strong> film detects changes in<br />

pressure, and not <strong>the</strong> applied static pressure, it can be placed between <strong>the</strong> insert and <strong>the</strong><br />

finger hole wall without concern that <strong>the</strong> static pressure <strong>of</strong> that placement might set <strong>of</strong>f<br />

<strong>the</strong> module. Refer to Figure 2-1 <strong>for</strong> <strong>the</strong> position <strong>of</strong> <strong>the</strong> piezoelectric film sensor.<br />

Since <strong>the</strong> bowler must apply significant pressure to <strong>the</strong> insert during release, <strong>the</strong> impact<br />

sensor also serves to wake up <strong>the</strong> module immediately be<strong>for</strong>e release. The light sensor is<br />

<strong>the</strong>n used to detect <strong>the</strong> moment <strong>of</strong> release by looking <strong>for</strong> a rapid increase in <strong>the</strong> light<br />

level, from near or total darkness, to some higher level <strong>of</strong> light (or lesser level <strong>of</strong><br />

darkness).<br />

2.3.3 Measuring Time and Recording Data<br />

The microprocessor supplies <strong>the</strong> clock to measure time, and coordinates all <strong>of</strong> <strong>the</strong> various<br />

activities required to make <strong>the</strong> module work. A stable time-source, currently a miniature<br />

quartz crystal, serves as <strong>the</strong> basis <strong>for</strong> <strong>the</strong> microprocessor's clock. Additional external<br />

non-volatile memory (EEPROM) is required <strong>for</strong> storing <strong>the</strong> sampled light wave<strong>for</strong>m, <strong>the</strong><br />

impact data, and any configuration parameters that are required.<br />

12


Pin Deck Light<br />

Foul Line<br />

Figure 2-2a: Lane Layout and Overhead Lighting<br />

Release Point<br />

(finger removed<br />

from insert)<br />

Sampled Light<br />

Wave<strong>for</strong>m<br />

Foul Line<br />

Impact with Lane<br />

Pin Deck Light<br />

Impact with Head Pin<br />

Figure 2-2b: Ambient Light Wave<strong>for</strong>m<br />

13


2.3.4 Communications<br />

The SMARTDOT module must transfer <strong>the</strong> data it collects to an external device <strong>for</strong><br />

archival, analysis, and display. The module must be able to detect <strong>the</strong> presence <strong>of</strong> <strong>the</strong><br />

external communications device, and both receive commands from it, and transmit data<br />

to it. Communications occur in a non-contact (wireless) fashion, and a light-based<br />

(infrared) communications scheme is used. The on-board transceiver consists <strong>of</strong> <strong>the</strong><br />

previously described light sensor and two visible red (660 nm) LEDs. An algorithm has<br />

been developed that relies on <strong>the</strong> on-board transceiver to detect <strong>the</strong> presence <strong>of</strong> <strong>the</strong><br />

external communications device (COMM wand), and initiate communication.<br />

2.4 CAPABILITIES<br />

The module is intended to detect and record (at least some <strong>of</strong>) <strong>the</strong> major <strong>for</strong>ces that <strong>the</strong><br />

ball experiences. A bowler attempts to exert various <strong>for</strong>ces on a bowling ball during<br />

delivery, to varying degrees, in a controlled manner. These <strong>for</strong>ces are:<br />

• Lift: Force applied to cause <strong>the</strong> ball to rotate about a primary axis relative to <strong>the</strong><br />

finger holes. The more lift that is applied to <strong>the</strong> ball at release, <strong>the</strong> faster <strong>the</strong> ball<br />

rotates as it travels down <strong>the</strong> lane.<br />

• Turn: The amount by which <strong>the</strong> axis <strong>of</strong> rotation <strong>of</strong> <strong>the</strong> ball is rotated away from<br />

normal with respect to <strong>the</strong> length <strong>of</strong> <strong>the</strong> bowling lane. The more turn that is<br />

applied at release, <strong>the</strong> more <strong>the</strong> ball has <strong>the</strong> potential to hook.<br />

• Tilt: The amount by which <strong>the</strong> axis <strong>of</strong> rotation is tilted away from parallel with<br />

<strong>the</strong> lane surface. The amount <strong>of</strong> tilt directly impacts how long <strong>the</strong> ball delays<br />

(skids or slides) be<strong>for</strong>e starting to hook.<br />

• Velocity: The speed and direction with which <strong>the</strong> ball leaves <strong>the</strong> bowler's hand.<br />

The higher <strong>the</strong> velocity, <strong>the</strong> harder <strong>the</strong> ball hits <strong>the</strong> pins, but <strong>the</strong> less it hooks. The<br />

velocity consists <strong>of</strong> a large x-coordinate component (towards <strong>the</strong> pins) and a small<br />

(but not insignificant) y-component (towards ei<strong>the</strong>r gutter). The x-component is<br />

always positive, originating at <strong>the</strong> foul line and running towards <strong>the</strong> pins. The y-<br />

component can be negative (toward <strong>the</strong> right gutter <strong>for</strong> a right-handed bowler) or<br />

positive (toward <strong>the</strong> left gutter <strong>for</strong> a right-hander).<br />

• L<strong>of</strong>t: The distance <strong>the</strong> ball travels (in <strong>the</strong> air) be<strong>for</strong>e it first makes contact with<br />

<strong>the</strong> lane after release. A bowler can control <strong>the</strong> amount a ball hooks by altering<br />

<strong>the</strong> distance <strong>the</strong> ball is l<strong>of</strong>ted be<strong>for</strong>e it hits <strong>the</strong> pins. More l<strong>of</strong>t generally means<br />

less hook.<br />

The basic premise behind <strong>the</strong> SMARTDOT module is that two sensors, an ambient light<br />

sensor and a piezoelectric pressure/impact sensor, combined with an accurate time<br />

source, are sufficient to accurately capture <strong>the</strong> amount <strong>of</strong> lift applied to <strong>the</strong> ball (<strong>the</strong><br />

angular velocity), <strong>the</strong> moment <strong>of</strong> release, and <strong>the</strong> various times <strong>of</strong> impact with <strong>the</strong> lane<br />

and <strong>the</strong> pins. It was not expected that this combination <strong>of</strong> sensors would be capable <strong>of</strong><br />

reliably capturing <strong>the</strong> amount <strong>of</strong> turn, tilt, or <strong>the</strong> y-component <strong>of</strong> <strong>the</strong> ball's velocity.<br />

14


2.4.1 Ambient Light Sensor<br />

The ambient light sensor serves three purposes:<br />

• It senses when <strong>the</strong> bowler has released <strong>the</strong> ball. A finger in <strong>the</strong> insert blocks<br />

ambient light from reaching <strong>the</strong> module. When <strong>the</strong> ball is released, a sudden<br />

increase in <strong>the</strong> ambient light level is detected.<br />

• It detects <strong>the</strong> revolution <strong>of</strong> <strong>the</strong> ball as it rolls down <strong>the</strong> lane. The light sensor,<br />

located on <strong>the</strong> top side <strong>of</strong> <strong>the</strong> SMARTDOT module PCB, "looks" out through <strong>the</strong><br />

finger insert and "sees" <strong>the</strong> ambient light as <strong>the</strong> ball rolls down <strong>the</strong> lane. It was<br />

presumed that <strong>the</strong> ambient light level <strong>the</strong> sensor sees would be brighter when <strong>the</strong><br />

module faces upward (toward <strong>the</strong> ceiling), since <strong>the</strong> lights are located <strong>the</strong>re, and<br />

darker when <strong>the</strong> module faces downward (toward <strong>the</strong> lane surface).<br />

It was fur<strong>the</strong>r presumed that <strong>the</strong> light wave<strong>for</strong>m <strong>the</strong> module sees would be<br />

roughly sinusoidal in nature, exhibiting peaks when <strong>the</strong> module faces <strong>the</strong> ceiling,<br />

and valleys when <strong>the</strong> module faces <strong>the</strong> lane. Counting <strong>the</strong>se peaks and valleys<br />

results in <strong>the</strong> total number <strong>of</strong> revolutions (to within ½ revolution) that <strong>the</strong> ball<br />

underwent during its traversal <strong>of</strong> <strong>the</strong> lane. By measuring <strong>the</strong> time between peaks<br />

(and/or valleys), it is <strong>the</strong>n possible to calculate <strong>the</strong> angular velocity (rpms) <strong>of</strong> <strong>the</strong><br />

ball <strong>for</strong> any given revolution. Fractional revolutions (immediately following<br />

release, and immediately be<strong>for</strong>e impact) can be extrapolated from <strong>the</strong> angular<br />

velocity <strong>of</strong> <strong>the</strong> closest complete revolution, hopefully resulting in a resolution <strong>of</strong><br />

30° <strong>of</strong> rotation, or better than 0.1 revolution.<br />

• It receives serial data from <strong>the</strong> communications module.<br />

2.4.2 Pressure/Impact Sensor<br />

The pressure/impact sensor serves <strong>the</strong>se purposes:<br />

• It wakes up <strong>the</strong> module when finger pressure is applied to <strong>the</strong> insert - indicating<br />

that <strong>the</strong> bowler is holding <strong>the</strong> ball, and preparing <strong>for</strong> delivery and release.<br />

• It senses <strong>the</strong> moment(s) <strong>of</strong> impact with <strong>the</strong> lane - ball l<strong>of</strong>t distance.<br />

• It senses <strong>the</strong> moment(s) <strong>of</strong> impact with <strong>the</strong> pins.<br />

• It senses that <strong>the</strong> ball has rolled over a finger hole (<strong>the</strong> ball "hops" when it rolls<br />

over one <strong>of</strong> <strong>the</strong> finger holes, since <strong>the</strong> hole acts like a flat spot on <strong>the</strong> ball).<br />

2.4.4 Clock<br />

The microprocessor's time-base serves <strong>the</strong> following purposes:<br />

• It generates <strong>the</strong> ambient light sample timer.<br />

• It provides a time-stamp <strong>for</strong> <strong>the</strong> impacts that <strong>the</strong> piezoelectric film sensor detects.<br />

• It generates <strong>the</strong> baud rate(s) <strong>for</strong> <strong>the</strong> communications transceiver.<br />

• It generates several precise time intervals and time out functions required <strong>for</strong><br />

coordination <strong>of</strong> <strong>the</strong> various microprocessor tasks.<br />

15


2.5 HARDWARE IMPLEMENTATION.<br />

The following is a summary <strong>of</strong> <strong>the</strong> SMARTDOT module's hardware configuration and an<br />

overview <strong>of</strong> <strong>the</strong> hardware <strong>the</strong>ory <strong>of</strong> operation. A working prototype <strong>of</strong> <strong>the</strong> SMARTDOT<br />

sensor module (based on this hardware configuration) has been used under real-world<br />

conditions (placed in a ball and rolled down <strong>the</strong> lane) <strong>for</strong> a total <strong>of</strong> about 500 frames (~50<br />

games).<br />

2.5.1 Hardware Configuration<br />

A summary <strong>of</strong> <strong>the</strong> major hardware components and <strong>the</strong>ir respective features is given<br />

below. See Figure 2-3 <strong>for</strong> a block diagram <strong>of</strong> <strong>the</strong> prototype SMARTDOT module.<br />

Microprocessor - Phillips 87C752 [21]<br />

• Intel 8051-based core.<br />

• Crystal Frequency - 3.6864 MHz (3.26 µsec instruction cycle).<br />

• 64 bytes on-board RAM (including general purpose registers and stack space).<br />

• 2 Kbytes on-board program EPROM.<br />

• 8-bit Analog-to-Digital Converter (130 µsec conversion time @ 3.6864 MHz).<br />

• 16-bit auto reload timer.<br />

• Additional fixed timer (300 Hz @ 3.6864 MHz).<br />

• Interrupts (timers, external, ADC).<br />

• Idle mode.<br />

Light Sensor - TAOS TSL251 Light-to-Voltage Converter [23]<br />

• Output: 60 mV/(µW/cm 2 ), 7.5 µsec rise/fall time.<br />

Memory - Microchip 24C04 Serial I 2 C EEPROM (4096 bits, 512 x 8) [20]<br />

• 8 byte page write.<br />

• 10 msec maximum write time per page.<br />

• 400 kHz maximum clock rate.<br />

Amp Sensors Piezoelectric Film Sensor [19]<br />

• Responds to changes in pressure.<br />

Maxim MAX931 Ultra-Low Power Comparator [18]<br />

• Current draw:


9<br />

28<br />

8<br />

RST V CC<br />

V CC<br />

5<br />

6<br />

hyst 7<br />

3<br />

+<br />

ref<br />

V DD<br />

MAX931 Out<br />

4<br />

-<br />

GND<br />

V-<br />

2<br />

1<br />

8<br />

1<br />

2<br />

7<br />

PR V DD<br />

D-FF Q<br />

CLK<br />

D Q<br />

V SS CLR<br />

4<br />

6<br />

8<br />

5<br />

3<br />

23<br />

20<br />

19<br />

87C752<br />

SDA<br />

SCL<br />

P0.3 (SHUTDOWN_PIN)<br />

INT0 (IMPACT_PIN)<br />

AV CC<br />

7<br />

8<br />

5<br />

6<br />

7<br />

3<br />

2<br />

1<br />

SDA<br />

SCL<br />

A 2<br />

A 1<br />

A 0<br />

24C04<br />

V SS<br />

4<br />

T1<br />

SMARTDOT MODULE<br />

BLOCK DIAGRAM<br />

V+<br />

Battery Ground<br />

Microprocessor Ground<br />

Light Sensor Ground<br />

Signal Lines<br />

2<br />

V DD<br />

TSL251<br />

GND<br />

1<br />

Out<br />

3<br />

6<br />

13<br />

18<br />

24<br />

P0.2 (TRX_PIN)<br />

ADC0 (LITE_INPUT_PIN)<br />

AV SS<br />

P0.4 (LITE_PWR_PIN)<br />

X 2 X 1 V SS<br />

10 11<br />

12<br />

Figure 2-3<br />

17


2.5.2 Hardware Operation Overview<br />

Figure 2-3 depicts a combination block diagram and pseudo-schematic detailing <strong>the</strong><br />

physical connectivity <strong>of</strong> <strong>the</strong> SMARTDOT module's hardware components. The following<br />

discussion presents <strong>the</strong> <strong>the</strong>ory <strong>of</strong> operation <strong>of</strong> <strong>the</strong> module's hardware, and refers to <strong>the</strong><br />

components shown in <strong>the</strong> block diagram.<br />

The piezoelectric film sensor (T1) serves as both <strong>the</strong> "wake-up" sensor and impact<br />

detector, and is connected to <strong>the</strong> negative input (-) <strong>of</strong> an ultra-low power comparator<br />

(MAX931). Bias <strong>for</strong> <strong>the</strong> positive (+) input is provided by a voltage divider connected to<br />

<strong>the</strong> MAX931's internal 1.18V reference, with hysteresis provided through connection to<br />

<strong>the</strong> '931's "hyst" pin.<br />

The MAX931's output is connected to <strong>the</strong> asynchronous preset <strong>of</strong> a single, low-power<br />

CMOS D flip-flop (D-FF). Pressure applied to <strong>the</strong> insert is transferred to T1, generating<br />

a voltage spike that triggers <strong>the</strong> comparator, <strong>for</strong>cing <strong>the</strong> state <strong>of</strong> <strong>the</strong> D-FF to a logical '1'.<br />

The Q output <strong>of</strong> <strong>the</strong> D-FF transitions to <strong>the</strong> low (0) state, providing ground to <strong>the</strong><br />

remainder <strong>of</strong> <strong>the</strong> module, which causes <strong>the</strong> Philips 87C752 microprocessor to "wake-up"<br />

and begin executing its program. The comparator output is also connected to an external<br />

interrupt on <strong>the</strong> '752 (labeled IMPACT_PIN) so that <strong>the</strong> microprocessor can record any<br />

subsequent activity (additional finger pressure, impact with <strong>the</strong> lane, impact with <strong>the</strong><br />

pins, etc.) sensed by T1.<br />

With a 3.6864 MHz crystal, <strong>the</strong> 87C752 draws ~3 mAmps while running, but through use<br />

<strong>of</strong> <strong>the</strong> '752's IDLE mode between light samples, <strong>the</strong> average current drawn is reduced to<br />

less than 2 mAmps. When <strong>the</strong> '752 reaches <strong>the</strong> point where it is time to shutdown, it<br />

clocks a logical '0' into <strong>the</strong> D-FF (<strong>the</strong> 'D' input is tied to ground and <strong>the</strong> CLK pin is<br />

positive edge triggered), <strong>the</strong> Q output returns to <strong>the</strong> high (1) state, which removes ground<br />

from <strong>the</strong> microprocessor portion <strong>of</strong> <strong>the</strong> circuit, putting <strong>the</strong> module back to "sleep". The<br />

powered portion <strong>of</strong> <strong>the</strong> module (<strong>the</strong> comparator and <strong>the</strong> D-FF) draws less than 1 µA<br />

while <strong>the</strong> module is in sleep mode.<br />

The output <strong>of</strong> <strong>the</strong> TSL251 light-to-voltage converter is connected to <strong>the</strong> '752's on-board<br />

ADC (at LITE_INPUT_PIN) and <strong>the</strong> '251's ground is controlled by <strong>the</strong> microprocessor<br />

through LITE_PWR_PIN. The TSL251 draws about 800 µA when powered, and since<br />

<strong>the</strong> light wave<strong>for</strong>m is sampled, ra<strong>the</strong>r than continuously monitored, <strong>the</strong> '752 turns <strong>of</strong>f<br />

(removes ground from) <strong>the</strong> TSL251 between samples and <strong>the</strong>n enters a power-reducing<br />

IDLE mode until <strong>the</strong> next sample time.<br />

The TSL251 also serves as <strong>the</strong> receiver portion <strong>of</strong> <strong>the</strong> IR communications transceiver.<br />

The transmit portion <strong>of</strong> <strong>the</strong> IR transceiver is comprised <strong>of</strong> two LED's and a resistor that<br />

limits <strong>the</strong> LED current to ~500 µA, driven by TRX_PIN. Since <strong>the</strong> transmit LEDs are<br />

only lit during a '0' pulse, and <strong>the</strong>re is generally an equal distribution <strong>of</strong> 0's and 1's in a<br />

transmission, <strong>the</strong> average transmit current is ~250 µA.<br />

The 24C04 serial EEPROM stores <strong>the</strong> configurable parameters and <strong>the</strong> collected sensor<br />

data (impacts and light wave<strong>for</strong>m samples) in nonvolatile memory. It draws<br />

approximately 1 mA during a write operation, and ~300 µA during a read operation. The<br />

24C04 draws negligible current while idle (not being accessed).<br />

18


2.6 HARDWARE/SOFTWARE INTERACTION DESIGN CONSIDERATIONS<br />

There are a number <strong>of</strong> areas where <strong>the</strong> design decisions <strong>for</strong> <strong>the</strong> hardware and <strong>the</strong><br />

embedded s<strong>of</strong>tware are interdependent. These issues are presented next.<br />

2.6.1 Microprocessor Clock Frequency<br />

The clock frequency directly affects <strong>the</strong> current drawn by <strong>the</strong> microprocessor: <strong>the</strong> lower<br />

<strong>the</strong> clock frequency, <strong>the</strong> less current <strong>the</strong> 87C752 draws from <strong>the</strong> battery. The lowest<br />

standard oscillator frequency that supports <strong>the</strong> sample rate, <strong>the</strong> serial communications<br />

baud rates, and <strong>the</strong> processing demands <strong>of</strong> <strong>the</strong> application is 3.6864 MHz. The internal<br />

clock frequency <strong>for</strong> <strong>the</strong> 87C752 is 1 / 12 <strong>of</strong> <strong>the</strong> oscillator frequency, resulting in an<br />

instruction time <strong>of</strong> 3.26 µsec (307,200 instructions per second) <strong>for</strong> a 3.6864 MHz crystal.<br />

Quartz crystals and ceramic resonators are available in standard frequencies <strong>for</strong><br />

microprocessors. Crystals easily can maintain an accuracy (over <strong>the</strong>ir temperature range)<br />

<strong>of</strong> 200 ppm (.03%), while ceramic resonators (cheaper and smaller) typically run in <strong>the</strong> 1-<br />

2% range. During <strong>the</strong> feasibility phase, a crystal has been used to enhance <strong>the</strong> accuracy<br />

<strong>of</strong> <strong>the</strong> sample clock, with <strong>the</strong> hope <strong>of</strong> switching to a ceramic resonator, in combination<br />

with some clock calibration s<strong>of</strong>tware, as part <strong>of</strong> <strong>the</strong> development phase.<br />

2.6.2 Sampling Rate<br />

The 87C752 microprocessor contains an 8-bit ADC with a conversion time <strong>of</strong> 130 µsec<br />

(~7600 Hz) at <strong>the</strong> clock frequency <strong>of</strong> 3.6864 MHz. It is important to minimize <strong>the</strong><br />

sample rate, since <strong>the</strong> amount <strong>of</strong> data collected directly affects <strong>the</strong> amount <strong>of</strong> external<br />

data memory required. Complicating matters, EEPROM technology has a fairly slow<br />

write speed (5-10 msec per page write), thus presenting <strong>the</strong> possibility that <strong>the</strong> rate <strong>of</strong><br />

writing data to memory might not keep pace with <strong>the</strong> production <strong>of</strong> data to be written.<br />

Also, it is desirable to run <strong>the</strong> microprocessor in IDLE mode as much as possible, since it<br />

cuts <strong>the</strong> current draw in half, and <strong>the</strong> light sensor (TSL251) and <strong>the</strong> '752's on-board ADC<br />

can be turned <strong>of</strong>f between sample times. The higher <strong>the</strong> sample rate, <strong>the</strong> more time <strong>the</strong><br />

microprocessor must spend collecting and processing data, which shortens <strong>the</strong> life <strong>of</strong> <strong>the</strong><br />

battery.<br />

Data must also be collected from <strong>the</strong> impact sensor, but this is a different process. An<br />

impact can occur asynchronous to <strong>the</strong> time <strong>of</strong> a light sample, with a much shorter<br />

duration than <strong>the</strong> sample period. There<strong>for</strong>e, impact detection is interrupt driven. By<br />

limiting <strong>the</strong> stored value <strong>of</strong> <strong>the</strong> light samples to <strong>the</strong> range 0-127 (0x00-0x7F), <strong>the</strong> impact<br />

data <strong>for</strong> a sample can be stored in <strong>the</strong> high-order bit <strong>of</strong> <strong>the</strong> sample byte, thus associating<br />

each impact with <strong>the</strong> light sample during which <strong>the</strong> impact occurred.<br />

The primary factors in determining an appropriate sampling rate are <strong>the</strong> maximum<br />

angular velocity (rpms), <strong>the</strong> minimum and maximum linear velocities (ball speed), and<br />

<strong>the</strong> amount <strong>of</strong> memory available <strong>for</strong> <strong>the</strong> storage <strong>of</strong> captured data.<br />

• Maximum RPMs: According to tests conducted by <strong>the</strong> ABC (American <strong>Bowling</strong><br />

Congress), <strong>the</strong> best bowlers, those that average greater than 210, generate an<br />

average rotational rate <strong>of</strong> about 300 rpms (5 Hz) at release. In fact, <strong>the</strong> ABC<br />

found a direct correlation between average score and angular velocity [12].<br />

There is an upper bound on <strong>the</strong> number <strong>of</strong> revolutions <strong>the</strong> ball can make. If <strong>the</strong><br />

ball did not skid at all, it would travel 27 inches per revolution, while revolving<br />

19


almost 27 times between <strong>the</strong> foul line and <strong>the</strong> head pin. The ball would also have<br />

to be thrown at over 25 miles an hour <strong>for</strong> <strong>the</strong> rotational rate to reach 1000 rpms.<br />

Those values are extreme, but <strong>the</strong>y allow an upper limit <strong>of</strong> 1000 rpms (16.7 Hz) to<br />

be set as <strong>the</strong> maximum angular velocity.<br />

The vast majority <strong>of</strong> bowling establishments utilize fluorescent lighting.<br />

Preliminary testing with <strong>the</strong> TSL251 revealed that <strong>the</strong> sensor is responsive enough<br />

to detect <strong>the</strong> 120 Hz optical ripple <strong>of</strong> <strong>the</strong> overhead fluorescent lights. This ACinduced<br />

ripple becomes part <strong>of</strong> <strong>the</strong> ambient light level, and could cause a<br />

problem, since <strong>the</strong> pseudo-sinusoidal target wave<strong>for</strong>m must be extracted from <strong>the</strong><br />

ambient light. However, <strong>the</strong> AC ripple is confined to a narrow band at 120 Hz,<br />

while <strong>the</strong> desired fundamental wave<strong>for</strong>m is <strong>of</strong> a much lower frequency.<br />

Sampling <strong>the</strong> wave<strong>for</strong>m at a frequency less than twice <strong>the</strong> 120 Hz ripple could<br />

result in "aliasing" <strong>the</strong> 120 Hz content down into <strong>the</strong> frequencies <strong>of</strong> interest (< 20<br />

Hz). And sampling at a frequency o<strong>the</strong>r than a harmonic multiple <strong>of</strong> 120 Hz<br />

could introduce harmonic variations into <strong>the</strong> raw wave<strong>for</strong>m that <strong>the</strong> module must<br />

<strong>the</strong>n deal with, since it certainly won't have <strong>the</strong> processing capabilities to digitally<br />

filter <strong>the</strong> data. Sampling at a harmonic multiple <strong>of</strong> 120 Hz, such as 240 Hz, and<br />

storing <strong>the</strong> average <strong>of</strong> two consecutive samples (yielding a net 120 Hz data rate),<br />

averages out <strong>the</strong> AC ripple. The frequency <strong>of</strong> <strong>the</strong> AC ripple exceeds <strong>the</strong> target<br />

wave<strong>for</strong>m by at least a factor <strong>of</strong> 7 (in <strong>the</strong> extreme case), but is actually closer to a<br />

factor <strong>of</strong> 15-20. Hence, <strong>the</strong> 120 Hz ripple should not interfere with data collection<br />

as long as an appropriate sample frequency is chosen, allowing <strong>for</strong> a resolution <strong>of</strong><br />

at least 18°-24° <strong>of</strong> rotation.<br />

• Ball Speed: The vast majority <strong>of</strong> bowlers, even at <strong>the</strong> 200+ average level,<br />

generate an average ball speed <strong>of</strong> less than 20 mph (~30 fps). At 30 fps, it takes at<br />

least 2 seconds <strong>for</strong> <strong>the</strong> ball to travel from <strong>the</strong> foul line to <strong>the</strong> head pin (60 feet).<br />

For a ball speed <strong>of</strong> 30 fps and a net sampling frequency <strong>of</strong> 120 Hz, <strong>the</strong> ball travels<br />

3" per sample period, good enough <strong>for</strong> 0.4% resolution over 60 feet. The vast<br />

majority <strong>of</strong> bowlers generate ball speeds greater than 10 mph (15 fps), especially<br />

those that average greater than 180. At 15 fps, it takes <strong>the</strong> ball 4 seconds to<br />

completely traverse <strong>the</strong> lane, or 480 samples at 120 Hz.<br />

• Data Memory: The hardware <strong>for</strong> <strong>the</strong> prototype SMARTDOT module was<br />

originally specified in January <strong>of</strong> 1993. At that time, <strong>the</strong> highest serial memory<br />

density readily available that was cheap enough to be practical was a 4096 bit<br />

(512 x 8) chip. This size memory is only big enough to capture a single roll <strong>of</strong> <strong>the</strong><br />

ball. Af<strong>for</strong>dable serial EEPROM memory density has increased dramatically<br />

since <strong>the</strong> SMARTDOT module prototype was designed, and <strong>the</strong> "Sample Memory"<br />

section details <strong>the</strong> implications <strong>of</strong> using a higher memory density.<br />

For <strong>the</strong> prototype module, ambient light sample data is produced faster than it can<br />

be consumed by single byte writes to <strong>the</strong> EEPROM. However, <strong>the</strong> EEPROM can<br />

handle 8 samples at a time, with a 10 msec max write time. A sample is produced<br />

every 8.333 msecs (120 Hz), and a circular sample buffer is used to accumulate 8<br />

consecutive samples <strong>for</strong> writing to <strong>the</strong> EEPROM. The EEPROM per<strong>for</strong>ms <strong>the</strong><br />

actual write in <strong>the</strong> background, after <strong>the</strong> data has been input to its write buffer.<br />

The 87C752 can continue collecting data in <strong>the</strong> circular buffer without having to<br />

wait <strong>for</strong> <strong>the</strong> EEPROM to finish storing <strong>the</strong> data.<br />

20


2.6.3 Baud Rate<br />

The module communicates with <strong>the</strong> outside world through a serial IR interface using<br />

standard baud rates. A s<strong>of</strong>tware UART had to be implemented <strong>for</strong> <strong>the</strong> SMARTDOT<br />

module, since <strong>the</strong> 87C752 does not have an on-board hardware UART. The 3.6864 MHz<br />

crystal supports both <strong>the</strong> 240 Hz sampling rate, and running <strong>the</strong> s<strong>of</strong>tware UART at all <strong>of</strong><br />

<strong>the</strong> standard baud rates up to 38400 baud.<br />

The rise/fall time <strong>of</strong> <strong>the</strong> TSL251 limits <strong>the</strong> module's reception rate to 600 baud, which is<br />

not a problem, since <strong>the</strong> module receives little in<strong>for</strong>mation compared to what it must<br />

transmit. On <strong>the</strong> transmit (upload) side, <strong>the</strong> entire contents <strong>of</strong> memory (512 bytes) must<br />

be uploaded rapidly so as not to inconvenience <strong>the</strong> user. At <strong>the</strong> 38400 baud rate, <strong>the</strong><br />

entire contents <strong>of</strong> memory can be uploaded in less than a second.<br />

2.7 EMBEDDED SOFTWARE DESIGN AND OPERATION<br />

This section presents a detailed description <strong>of</strong> <strong>the</strong> SMARTDOT module's embedded<br />

s<strong>of</strong>tware operation. The module's s<strong>of</strong>tware architecture is shown in Figure 2-4, which<br />

diagrams <strong>the</strong> interrelation <strong>of</strong> <strong>the</strong> major s<strong>of</strong>tware tasks, and <strong>the</strong>ir interaction with <strong>the</strong><br />

interrupt service routines (ISR's). The following s<strong>of</strong>tware description and <strong>the</strong><br />

architecture diagram both make reference to flowcharts <strong>for</strong> <strong>the</strong> embedded tasks and<br />

interrupt service routines, which are included in Appendix A. The actual assembly code<br />

is thoroughly documented, and has been included in Appendix B.<br />

2.7.1 S<strong>of</strong>tware Design Considerations<br />

Due to <strong>the</strong> cost and physical size constraints <strong>of</strong> <strong>the</strong> application, <strong>the</strong> SMARTDOT module<br />

relies on a relatively simple hardware design. The complexity <strong>of</strong> <strong>the</strong> module is contained<br />

within its embedded s<strong>of</strong>tware and <strong>the</strong> efficient use <strong>of</strong> <strong>the</strong> microprocessor's on-board<br />

resources and peripherals. The 87C752 microcontroller has severe constraints on both its<br />

on-board program EPROM (2048 bytes) and RAM (64 bytes). The RAM space also<br />

includes <strong>the</strong> general-purpose registers, <strong>the</strong> bit addressable space, and any required stack<br />

space.<br />

Although 'C' compilers are available <strong>for</strong> <strong>the</strong> 87C752, <strong>the</strong>y are notoriously spaceinefficient,<br />

and 'C' makes heavy use <strong>of</strong> <strong>the</strong> stack. Due to <strong>the</strong> limited sizes <strong>of</strong> <strong>the</strong> code and<br />

data spaces, <strong>the</strong> embedded s<strong>of</strong>tware was implemented in Intel 51 assembly language,<br />

with careful attention paid to <strong>the</strong> maximum depth <strong>of</strong> procedure calls, and with minimal<br />

parameter passing via <strong>the</strong> stack. The required stack space has been held to 16 bytes,<br />

allowing <strong>for</strong> a call depth <strong>of</strong> four (two-byte return addresses and two additional bytes<br />

(usually ACC and PSW) PUSHed onto <strong>the</strong> stack <strong>for</strong> each call).<br />

The application is both event and interrupt driven, with pre-emptive, round robin<br />

multitasking used on a limited basis to implement task time-outs, sampling, and<br />

discrimination between "valid" wave<strong>for</strong>ms, attempts to communicate, and spurious<br />

activations. Microprocessor interrupts are used <strong>for</strong> acquiring regular light wave<strong>for</strong>m<br />

samples, <strong>for</strong> impact detection, <strong>for</strong> implementation <strong>of</strong> <strong>the</strong> s<strong>of</strong>tware UART, and <strong>for</strong> keeping<br />

accurate track <strong>of</strong> time. Event driven (polled) tasks include detection <strong>of</strong> release and<br />

detection <strong>of</strong> <strong>the</strong> COMM Wand. Semaphores are used <strong>for</strong> task synchronization.<br />

21


SMARTDOT Module S<strong>of</strong>tware Architecture<br />

SLEEP MODE<br />

Wake Up on<br />

Pressure Applied to<br />

Insert<br />

Not DARK enough<br />

at start-up<br />

START-UP TASK (Figure A-1A)<br />

Initialize Module<br />

Check Start-Up LITE Level<br />

Enable Interrupts<br />

Waited too long <strong>for</strong><br />

RELEASE<br />

PRE-SAMPLING TASK (Figure A-1B)<br />

Wait <strong>for</strong> Sample (IDLE)<br />

Check <strong>for</strong> RELEASE<br />

Select Active Scratch Pad<br />

Write to EEPROM (8 pre-samples)<br />

RELEASE<br />

detected<br />

RELEASE not detected<br />

LIGHT SAMPLE ISR<br />

(Figure A-2)<br />

Reached END <strong>of</strong><br />

Sample Space<br />

Scratch Pad END and<br />

sampling disabled<br />

SAMPLING TASK (Figure A-3)<br />

Wait <strong>for</strong> Sample (IDLE)<br />

Write to EEPROM (every 8 samples)<br />

Check <strong>for</strong> END <strong>of</strong> Sample Space<br />

Check <strong>for</strong> END <strong>of</strong> Scratch Pad<br />

Check <strong>for</strong> Sampling Enabled<br />

In TEST mode,<br />

wave<strong>for</strong>m VALID, and<br />

sampling disabled<br />

DISCRIMINATION TASK (Figure A-4)<br />

Check <strong>for</strong> Valid Wave<strong>for</strong>m<br />

Check <strong>for</strong> Test Mode<br />

Check <strong>for</strong> Sampling Enabled<br />

Wave<strong>for</strong>m invalid and<br />

not in TEST mode<br />

Wave<strong>for</strong>m is still VALID<br />

In TEST mode with<br />

sampling enabled<br />

COMMUNICATION TASK (Figure A-5)<br />

Wait <strong>for</strong> DARK (IDLE)<br />

Contact WAND<br />

Wait <strong>for</strong> LITE (IDLE)<br />

Acknowledge WAND<br />

Get Command<br />

(UART Receive Task - Figure A-7)<br />

Process Command<br />

(UART Receive Task - Figure A-7)<br />

Check <strong>for</strong> Command Retry<br />

Done trying<br />

Continue trying<br />

WAND DETECTION ISR<br />

(Figure A-6)<br />

BIT SAMPLE ISR<br />

(Figure A-8)<br />

RECEIVE TIME OUT ISR<br />

(Figure A-9)<br />

SHUTDOWN TASK (Figure A-10)<br />

Done Sampling<br />

Save Run Time<br />

Back to Sleep<br />

Figure 2-4<br />

22


Configuration settings and <strong>the</strong> sampled light wave<strong>for</strong>m are stored in <strong>the</strong> external serial<br />

EEPROM. Sample memory is divided into three parts: two scratch pad areas, and a main<br />

sample area. While <strong>the</strong> previously collected wave<strong>for</strong>m is stored across one <strong>of</strong> <strong>the</strong> scratch<br />

pads and <strong>the</strong> main sample memory, <strong>the</strong> o<strong>the</strong>r scratch pad is used to store potential<br />

wave<strong>for</strong>m data while <strong>the</strong> module decides whe<strong>the</strong>r <strong>the</strong> wave<strong>for</strong>m is <strong>the</strong> result <strong>of</strong> a ball<br />

rolling down <strong>the</strong> lane, or from some o<strong>the</strong>r activation (communications or spurious<br />

impact). Each scratch pad holds 600 msecs (72 samples) <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m, including <strong>the</strong><br />

8 pre-samples taken immediately prior to release. The remainder <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m (up to<br />

2933 msecs or 352 samples) is stored in main sample memory. Figure 2-5a shows <strong>the</strong><br />

logical layout <strong>of</strong> external memory.<br />

SDM_DATE_CODE<br />

[year]<br />

000h<br />

SDM_DATE_CODE<br />

[week]<br />

001h<br />

SDM_SERIAL_NO<br />

[HI byte]<br />

002h<br />

SDM_SERIAL_NO<br />

[LO byte]<br />

003h<br />

SDM_CFG_BYTE<br />

(see Figure 2-5b below)<br />

004h<br />

SDM_SAMPLE_END<br />

(end <strong>of</strong> digitized wave<strong>for</strong>m)<br />

005h<br />

SDM_RUN_TIME<br />

[HI byte]<br />

006h<br />

SDM_RUN_TIME<br />

[LO byte]<br />

007h<br />

SDM_ACTIVATION_CNT<br />

[HI byte]<br />

008h<br />

SDM_ACTIVATION_CNT<br />

[LO byte]<br />

009h<br />

SDM_BALL_CNT<br />

[HI byte]<br />

00Ah<br />

SDM_BALL_CNT<br />

[LO byte]<br />

00Bh<br />

SDM_AUTO_GROUPS<br />

(Discrimination routine)<br />

00Ch<br />

SDM_GROUP_SIZE<br />

(Discrimination routine)<br />

00Dh<br />

SDM_HYSTERESIS<br />

(Discrimination routine)<br />

00Eh<br />

SDM_RELEASE_LEVEL<br />

(light level <strong>for</strong> release)<br />

00Fh<br />

010h SDM_SCRATCH_PAD_0 Sample Scratch Pad 0 017h<br />

(72 bytes - 600 msec Sample time)<br />

• • •<br />

• • •<br />

050h<br />

057h<br />

058h SDM_SCRATCH_PAD_1 Sample Scratch Pad 1 05Fh<br />

(72 bytes - 600 msec Sample time)<br />

098h<br />

• • •<br />

• • •<br />

09Fh<br />

0A0h SDM_SAMPLE_BGN Main Sample Space 0A7h<br />

(352 bytes - 2933 msecs Sample time)<br />

1F8h<br />

• • •<br />

• • •<br />

1FFh<br />

Figure 2-5a: EEPROM Memory Map<br />

7 6 5 4 3 2 1 0<br />

Unused Auto Mode Sample Bit New Ball Bit Active Scratch Pad Overflow Test Mode Unused<br />

0 - Single<br />

1 - Auto<br />

0 - Disabled<br />

1 - Enabled<br />

0 - Old Data<br />

1 - New Data<br />

SDM_CFG_BYTE<br />

0 - Scratch Pad 0<br />

1 - Scratch Pad 1<br />

0 - No<br />

1 - Yes<br />

0 - No<br />

1 - Yes<br />

Figure 2-5b: SDM_CFG_BYTE Layout<br />

23


2.7.2 Start-Up<br />

The SMARTDOT module spends <strong>the</strong> vast majority <strong>of</strong> its time in an ultra-low power sleep<br />

mode, which draws less than 1 µAmp. Finger pressure applied to <strong>the</strong> insert wakes <strong>the</strong><br />

module from its sleep. Since <strong>the</strong> bowler's finger must still be in <strong>the</strong> insert immediately<br />

after start-up, if SMARTDOT detects too much light at start-up, <strong>the</strong> release is presumed to<br />

be invalid (<strong>for</strong> instance, caused by ano<strong>the</strong>r ball striking it on <strong>the</strong> ball return), and <strong>the</strong><br />

module shuts down (goes back to sleep).<br />

If it is dark enough after start-up, SMARTDOT continues sampling <strong>the</strong> ambient light<br />

level, waiting <strong>for</strong> <strong>the</strong> release <strong>of</strong> <strong>the</strong> ball (indicated by <strong>the</strong> measured light level exceeding a<br />

configurable "release" level). The release process takes several seconds, while <strong>the</strong><br />

bowler picks up <strong>the</strong> ball from <strong>the</strong> ball return and subsequently delivers it to <strong>the</strong> lane<br />

during <strong>the</strong>ir approach. If release is not detected within one second <strong>of</strong> activation, <strong>the</strong><br />

module shuts down. Since <strong>the</strong> bowler grips <strong>the</strong> inserts throughout <strong>the</strong>ir approach, <strong>the</strong><br />

module may experience several "false" start-ups be<strong>for</strong>e <strong>the</strong> actual release occurs. Refer<br />

to Figure A-1a (Start-Up Task Flowchart) <strong>for</strong> <strong>the</strong> sequence <strong>of</strong> events at module start-up.<br />

2.7.3 Pre-Sampling<br />

As part <strong>of</strong> <strong>the</strong> actual release, <strong>the</strong> bowler applies significant pressure to <strong>the</strong> inserts<br />

immediately be<strong>for</strong>e release. The module is again activated (several hundred milliseconds<br />

be<strong>for</strong>e release), giving SMARTDOT sufficient time to see <strong>the</strong> ambient light release point.<br />

Since <strong>the</strong> module detected a valid pre-release light level at start-up, it looks <strong>for</strong> <strong>the</strong><br />

release light level <strong>for</strong> up to one second. While waiting <strong>for</strong> release, <strong>the</strong> module stores <strong>the</strong><br />

pre-release light samples in an 8-byte circular buffer. This "pre-sampling" allows <strong>the</strong><br />

MASTER application to identify <strong>the</strong> precise moment <strong>of</strong> release. See Figure A-1b (Pre-<br />

Sampling Task Flowchart) <strong>for</strong> <strong>the</strong> pre-sampling sequence <strong>of</strong> events.<br />

The wave<strong>for</strong>m is sampled at 240 Hz, but <strong>the</strong> sample data is collected and stored at a 120<br />

Hz rate. In order to cancel <strong>the</strong> effects <strong>of</strong> <strong>the</strong> 120 Hz AC ripple superimposed on <strong>the</strong><br />

wave<strong>for</strong>m by <strong>the</strong> overhead fluorescent lights, two consecutive 240 Hz samples are<br />

averaged toge<strong>the</strong>r to yield a single 120 Hz sample. The maximum stored sample value is<br />

clipped to 127 (0x7F) so that <strong>the</strong> high-order bit <strong>of</strong> each sample is available <strong>for</strong> storing <strong>the</strong><br />

impact status <strong>for</strong> that sample. Refer to Figure A-2 (Light Sample ISR Flowchart).<br />

2.7.4 Wave<strong>for</strong>m Discrimination and Validation<br />

The SMARTDOT module always runs in one <strong>of</strong> two major operational states: it samples,<br />

validates, and stores <strong>the</strong> ambient light wave<strong>for</strong>m; or it communicates with <strong>the</strong> COMM<br />

wand. While <strong>the</strong> module samples and stores <strong>the</strong> wave<strong>for</strong>m, it also executes a routine that<br />

discriminates between wave<strong>for</strong>ms that result from <strong>the</strong> ball rolling down <strong>the</strong> lane, <strong>the</strong><br />

MASTER attempting to make contact, and spurious activations.<br />

After detecting <strong>the</strong> actual release <strong>of</strong> <strong>the</strong> ball, <strong>the</strong> module continues to sample <strong>the</strong><br />

wave<strong>for</strong>m and collect data in its 8-byte RAM sample buffer (<strong>the</strong> same one used <strong>for</strong><br />

storing <strong>the</strong> pre-samples), transferring <strong>the</strong> buffer contents to <strong>the</strong> active scratch pad in<br />

external EEPROM while scanning <strong>the</strong> sampled data <strong>for</strong> a pattern consistent with <strong>the</strong> ball<br />

rolling down <strong>the</strong> lane. If <strong>the</strong> presence <strong>of</strong> a "valid" wave<strong>for</strong>m (one that looks like <strong>the</strong> ball<br />

is rolling) is not detected within 600 msecs (72 samples plus <strong>the</strong> 8 pre-samples) following<br />

release, <strong>the</strong> module automatically switches from sampling <strong>the</strong> wave<strong>for</strong>m to its<br />

communication routines, and attempts to contact <strong>the</strong> COMM wand. Refer to Figure A-3<br />

(Sampling Task Flowchart) and Figure A-4 (Discrimination Task Flowchart).<br />

24


2.7.5 The Ball is Rolling<br />

If <strong>the</strong> wave<strong>for</strong>m is still valid after 600 msecs (when <strong>the</strong> active EEPROM scratch pad has<br />

been filled) and sampling is enabled (see "Sampling Modes" below), <strong>the</strong> module begins<br />

overwriting <strong>the</strong> previous wave<strong>for</strong>m data stored in <strong>the</strong> main sample memory in EEPROM<br />

with <strong>the</strong> data from <strong>the</strong> wave<strong>for</strong>m it is currently sampling. The module continues to<br />

sample, store, and validate <strong>the</strong> new wave<strong>for</strong>m <strong>for</strong> up to 3.533 seconds (424 samples),<br />

depending upon <strong>the</strong> sampling mode currently selected.<br />

2.7.6 Sampling Modes<br />

The SMARTDOT module can execute three different sampling modes: AUTO mode,<br />

SINGLE mode, and TEST mode. Bits 1, 5, and 6 <strong>of</strong> SDM_CFG_BYTE, shown in<br />

Figure 2-5b, are used to store <strong>the</strong> sampling mode. Also, refer again to Figure A-3<br />

(Sampling Task Flowchart) and Figure A-4 (Discrimination Task Flowchart).<br />

• AUTO mode enables <strong>the</strong> module to automatically capture every valid wave<strong>for</strong>m it<br />

detects. If <strong>the</strong> previously captured wave<strong>for</strong>m is not uploaded to <strong>the</strong> COMM wand<br />

be<strong>for</strong>e <strong>the</strong> next valid wave<strong>for</strong>m is detected, <strong>the</strong> previous data is overwritten with<br />

<strong>the</strong> new data. Since <strong>the</strong> module always stores <strong>the</strong> wave<strong>for</strong>m <strong>of</strong> <strong>the</strong> most recent<br />

ball rolled, this mode is useful when <strong>the</strong> bowler wants to upload <strong>the</strong> latest<br />

wave<strong>for</strong>m, based on <strong>the</strong> observation <strong>of</strong> an interesting or unusual ball reaction,<br />

without having to interact with <strong>the</strong> module be<strong>for</strong>e every shot.<br />

• SINGLE mode enables <strong>the</strong> module to store a new wave<strong>for</strong>m only after <strong>the</strong><br />

previous wave<strong>for</strong>m has been uploaded to <strong>the</strong> COMM wand. Uploading <strong>the</strong><br />

previous data automatically enables capture <strong>of</strong> <strong>the</strong> next valid wave<strong>for</strong>m. If <strong>the</strong><br />

previous data has not been uploaded, <strong>the</strong> module will not capture a new<br />

wave<strong>for</strong>m. This mode is useful when <strong>the</strong> bowler wants to look at specific shots<br />

(such as <strong>the</strong> first ball <strong>of</strong> each frame), but doesn't want to be required to upload <strong>the</strong><br />

data in <strong>the</strong> middle <strong>of</strong> a frame.<br />

• TEST mode enables <strong>the</strong> module to capture a wave<strong>for</strong>m only when it has been<br />

expressly instructed to do so. On <strong>the</strong> first valid release following each receipt <strong>of</strong><br />

<strong>the</strong> TEST command, <strong>the</strong> module bypasses <strong>the</strong> wave<strong>for</strong>m discrimination and<br />

validation routine and unconditionally samples <strong>the</strong> resulting wave<strong>for</strong>m <strong>for</strong> <strong>the</strong><br />

maximum 3.533 seconds. This mode is useful <strong>for</strong> recording events that fall<br />

outside <strong>of</strong> <strong>the</strong> module's current definition <strong>for</strong> a valid wave<strong>for</strong>m.<br />

2.7.7 Shutdown<br />

Ra<strong>the</strong>r than require <strong>the</strong> module to collect data <strong>for</strong> <strong>the</strong> full sample time <strong>of</strong> 3.533 seconds,<br />

<strong>the</strong> discrimination and validation routine is used to limit <strong>the</strong> total run time <strong>of</strong> <strong>the</strong> module.<br />

The module shuts down when <strong>the</strong> first <strong>of</strong> two shutdown conditions occurs: ei<strong>the</strong>r <strong>the</strong> end<br />

<strong>of</strong> <strong>the</strong> sample space is reached at 3.533 seconds, or <strong>the</strong> wave<strong>for</strong>m discrimination routine<br />

determines that <strong>the</strong> wave<strong>for</strong>m has become invalid, signifying that <strong>the</strong> ball has stopped<br />

rolling (entered <strong>the</strong> pit at <strong>the</strong> end <strong>of</strong> <strong>the</strong> lane). Once <strong>the</strong> module detects a shutdown, it<br />

updates <strong>the</strong> total run time, <strong>the</strong> activation count, and <strong>the</strong> ball count, and goes back to sleep.<br />

Refer to Figure A-10 (Shutdown Task Flowchart).<br />

25


2.7.8 Communication with <strong>the</strong> COMM Wand<br />

Communications with <strong>the</strong> module are conducted over a wireless, infrared (IR) interface,<br />

using <strong>the</strong> TSL251 as <strong>the</strong> receiver, and two surface-mount LED's as <strong>the</strong> transmitter. Since<br />

<strong>the</strong> 87C752 does not contain an on-board hardware UART, a s<strong>of</strong>tware UART has been<br />

implemented. The s<strong>of</strong>tware UART con<strong>for</strong>ms to several design constraints specific to <strong>the</strong><br />

SMARTDOT module hardware.<br />

Baud Rates: Due to <strong>the</strong> limited response time <strong>of</strong> <strong>the</strong> TSL251, and <strong>the</strong> relatively<br />

slow conversion rate <strong>of</strong> <strong>the</strong> '752's ADC at <strong>the</strong> module's clock frequency, reliable<br />

reception is only possible up to 600 baud. The communication protocol between <strong>the</strong><br />

module and <strong>the</strong> COMM wand is designed such that <strong>the</strong> module normally receives<br />

single character transmissions from <strong>the</strong> wand. Consequently, <strong>the</strong> 600 baud reception<br />

rate does not create a communications bottle-neck. Since <strong>the</strong> COMM wand can<br />

receive at a much higher baud rate than <strong>the</strong> SMARTDOT module, <strong>the</strong> module<br />

transmits to <strong>the</strong> COMM wand at up to 38400 baud (ano<strong>the</strong>r limitation imposed by <strong>the</strong><br />

module's clock frequency).<br />

Data Frame: A 12-bit serial protocol is used on transmission: 1 START bit, 8 DATA<br />

bits, 1 PARITY bit (EVEN), and 2 STOP bits. An 11-bit protocol (using a single<br />

STOP bit) is used <strong>for</strong> reception. This imbalance in STOP bits guarantees a minimal<br />

extra dead space between back-to-back characters, and allows <strong>for</strong> clock skew between<br />

<strong>the</strong> module and <strong>the</strong> COMM wand.<br />

Bit Sampling: The TSL251 and <strong>the</strong> 87C752's ADC are used <strong>for</strong> serial reception.<br />

The light wave<strong>for</strong>m is sampled at 4800 Hz (8 samples per bit time), and <strong>the</strong> middle<br />

four samples <strong>of</strong> each bit determine <strong>the</strong> value (0 or 1) <strong>for</strong> that bit. Ignoring <strong>the</strong> first<br />

two and last two bit samples allows <strong>for</strong> some clock skew between <strong>the</strong> transmit baud<br />

rate <strong>of</strong> <strong>the</strong> COMM wand and <strong>the</strong> receive baud rate <strong>of</strong> <strong>the</strong> module. A count <strong>of</strong> two or<br />

more DARK middle samples constitutes a logical '1', o<strong>the</strong>rwise <strong>the</strong> bit is considered a<br />

logical '0'. The bias is toward <strong>the</strong> DARK samples since <strong>the</strong> COMM wand's presence<br />

over <strong>the</strong> finger insert creates a dark ambient condition. As long as <strong>the</strong> COMM wand<br />

is held relatively close to <strong>the</strong> insert, <strong>the</strong> background remains dark enough <strong>for</strong> <strong>the</strong><br />

module to discriminate between <strong>the</strong> light pulses (0's), and <strong>the</strong> ambient background<br />

level (1's). A noise margin is also built into <strong>the</strong> bit-sampling scheme. There is a gap<br />

established between <strong>the</strong> DARK and LITE levels, with <strong>the</strong> transition point switched<br />

between <strong>the</strong> two depending on <strong>the</strong> value <strong>of</strong> <strong>the</strong> last sample received, creating a digital<br />

hysteresis function. Refer to Figure A-7 (UART Receive Task Flowchart) and Figure<br />

A-8 (Bit Sample ISR Flowchart).<br />

2.7.9 Communication Protocol<br />

All communications with <strong>the</strong> module are initiated by pressing on <strong>the</strong> insert, and <strong>the</strong>n<br />

placing <strong>the</strong> COMM wand over <strong>the</strong> insert, covering <strong>the</strong> opening. The bowler has one<br />

second to remove <strong>the</strong>ir finger from <strong>the</strong> insert, and ano<strong>the</strong>r second following release to<br />

cover <strong>the</strong> insert with <strong>the</strong> COMM wand. If ei<strong>the</strong>r <strong>of</strong> <strong>the</strong>se conditions is not met, <strong>the</strong><br />

module shuts down and must be reactivated.<br />

Upon activation, <strong>the</strong> module waits <strong>for</strong> release to occur, as previously described. When it<br />

identifies a release condition, it looks <strong>for</strong> a valid wave<strong>for</strong>m. In <strong>the</strong> case <strong>of</strong> a COMM<br />

wand transmission, <strong>the</strong> module discovers that <strong>the</strong> ball is not rolling within 600 msecs<br />

(through <strong>the</strong> discrimination and validation routine), switches to <strong>the</strong> COMM wand<br />

detection routine, and waits <strong>for</strong> up to one second <strong>for</strong> <strong>the</strong> insert to become dark (become<br />

26


covered by <strong>the</strong> wand). When <strong>the</strong> module detects <strong>the</strong> appropriate level <strong>of</strong> darkness, it<br />

assumes <strong>the</strong> COMM wand is in place, and transmits a specific "HI" character to <strong>the</strong> wand.<br />

An ASCII 'U' (0x55 - 01010101b) is used as <strong>the</strong> "HI" character because it requires an<br />

alternating light level <strong>of</strong> 38400 Hz to be detected, which is highly unlikely to occur under<br />

ambient light conditions.<br />

If <strong>the</strong> COMM wand is actually in place over <strong>the</strong> insert, it receives <strong>the</strong> "HI" character, and<br />

responds with a NULL character at 600 baud. The NULL character (0x00) appears to <strong>the</strong><br />

module as a light pulse <strong>of</strong> a fairly precise length (~16.7 msec - 10 consecutive '0' bit<br />

times, including <strong>the</strong> START bit and <strong>the</strong> EVEN parity bit) in an o<strong>the</strong>rwise dark ambient<br />

background, ano<strong>the</strong>r condition that is unlikely to occur under ambient conditions. The<br />

module waits <strong>for</strong> up to 200 msecs to receive <strong>the</strong> COMM wand's acknowledgment. If <strong>the</strong><br />

module does not receive a valid acknowledgement light pulse within this time, it<br />

retransmits <strong>the</strong> "HI" character, and waits <strong>for</strong> <strong>the</strong> COMM wand's response. The module<br />

tries to contact <strong>the</strong> COMM wand three times be<strong>for</strong>e assuming <strong>the</strong> wand is not present, at<br />

which time it shuts down. Refer to Figures A-5 (Communication Task Flowchart), A-6<br />

(Wand Detection ISR Flowchart), and A-9 (Receive Time Out ISR Flowchart).<br />

If <strong>the</strong> module receives a valid light pulse, it transmits ano<strong>the</strong>r "HI" character to <strong>the</strong><br />

COMM wand, at which point a "conversation" ensues between <strong>the</strong> SMARTDOT module<br />

and <strong>the</strong> COMM wand. If <strong>the</strong> protocol fails at anytime, or a reception error is detected, <strong>the</strong><br />

module aborts <strong>the</strong> conversation and tries to reestablish communications with <strong>the</strong> COMM<br />

wand from <strong>the</strong> beginning, <strong>for</strong> a total <strong>of</strong> three attempts, be<strong>for</strong>e finally shutting down.<br />

2.7.10 Commands<br />

The MASTER program can issue various commands through <strong>the</strong> COMM wand to <strong>the</strong><br />

module to retrieve data, to select <strong>the</strong> module's sampling mode, and to configure certain<br />

module parameters shown in Figure 2-5a. Be<strong>for</strong>e <strong>the</strong> bowler can view <strong>the</strong> wave<strong>for</strong>m <strong>the</strong><br />

SMARTDOT module has captured, <strong>the</strong> MASTER must upload that data from <strong>the</strong> module<br />

by issuing <strong>the</strong> TRANSMIT command, which instructs <strong>the</strong> module to transmit <strong>the</strong> contents<br />

<strong>of</strong> its data memory.<br />

As an example, <strong>the</strong> protocol <strong>for</strong> uploading data from <strong>the</strong> module to <strong>the</strong> MASTER is:<br />

MODULE: "HI" 'U' (0x55) @ 38400 baud - "Are you <strong>the</strong>re?"<br />

MASTER: NULL 0x00 @ 600 baud - "I'm Here"<br />

MODULE: "HI" 'U' (0x55) @ 38400 baud - "Clear to Send"<br />

MASTER: 'T' "Transmit" mnemonic @ 600 baud<br />

MODULE: 'T' Echoed back to MASTER @ 38400 baud<br />

MASTER: 'XON' 0x11 @ 600 baud, MASTER is ready to receive data<br />

MODULE: EEPROM contents 512 bytes @ 38400 baud<br />

To accommodate baud rate switching in <strong>the</strong> MASTER, <strong>the</strong> SMARTDOT module inserts a<br />

delay between each reception from <strong>the</strong> MASTER and subsequent transmission to <strong>the</strong><br />

MASTER. Including <strong>the</strong> delays, <strong>the</strong> entire upload process still takes less than a second.<br />

Appendix C includes timing diagrams <strong>for</strong> <strong>the</strong> individual command protocols: Figures C-1<br />

(Upload Command), C-2 (Mode Command), and C-3 (Configuration Command).<br />

27


2.8 PERFORMANCE<br />

Approximately 500 frames (about 50 games) have been thrown with various versions <strong>of</strong><br />

<strong>the</strong> SMARTDOT module installed in several different bowling balls. To this point, <strong>the</strong><br />

author has been <strong>the</strong> sole user <strong>of</strong> <strong>the</strong> device and his bowling style has been <strong>the</strong> sole source<br />

<strong>of</strong> input <strong>for</strong> developing <strong>the</strong> embedded s<strong>of</strong>tware <strong>for</strong> <strong>the</strong> module. Although care has been<br />

taken to generalize <strong>the</strong> module's embedded s<strong>of</strong>tware, until wider range testing can be<br />

per<strong>for</strong>med, <strong>the</strong> embedded s<strong>of</strong>tware must be considered as adapted to <strong>the</strong> author's style <strong>of</strong><br />

bowling and <strong>the</strong> specific parameters <strong>of</strong> his game.<br />

The graph <strong>of</strong> a typical wave<strong>for</strong>m captured by <strong>the</strong> SMARTDOT module prototype is<br />

shown in Figure 2-6, which is a screen capture from <strong>the</strong> PC-based MASTER application<br />

developed in concert with <strong>the</strong> SMARTDOT module.<br />

The raw data points are shown in blue, <strong>the</strong> resulting wave<strong>for</strong>m is shown in green, and <strong>the</strong><br />

impacts registered <strong>for</strong> this shot are shown in orange. The numerical results <strong>of</strong> <strong>the</strong><br />

analysis <strong>of</strong> <strong>the</strong> data are shown under <strong>the</strong> "RELEASE" and "IMPACT" headings. The<br />

MASTER application is presented in Section III <strong>of</strong> <strong>the</strong> paper.<br />

Figure 2-6: MASTER "Raw Data" Screen Capture<br />

28


2.8.1 Detecting Release<br />

Detecting <strong>the</strong> point <strong>of</strong> release by using a RELEASE light level has been quite effective.<br />

Since <strong>the</strong> bowler must cover up <strong>the</strong> light sensor when placing <strong>the</strong>ir fingers in <strong>the</strong> ball, <strong>the</strong><br />

module sees a very low level <strong>of</strong> light (essentially 0) while <strong>the</strong> bowler is gripping <strong>the</strong> ball.<br />

There are circumstances when, as part <strong>of</strong> a bowler's normal ritual, <strong>the</strong>y insert and remove<br />

<strong>the</strong>ir fingers in <strong>the</strong> ball several times be<strong>for</strong>e commencing <strong>the</strong>ir delivery. SMARTDOT<br />

detects each <strong>of</strong> <strong>the</strong>se as a release, assuming enough pressure has been applied to activate<br />

<strong>the</strong> module, but <strong>the</strong> discrimination routine is intended to recognize, and ignore, such<br />

behavior.<br />

Pre-sampling <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m helps capture <strong>the</strong> moment <strong>of</strong> release - that point when <strong>the</strong><br />

light samples start to increase from <strong>the</strong>ir dark pre-release levels. Although <strong>the</strong> module<br />

uses <strong>the</strong> configured RELEASE level to detect release (at which time it writes <strong>the</strong> eight<br />

pre-samples to EEPROM), <strong>the</strong> MASTER program determines <strong>the</strong> exact moment <strong>of</strong> release<br />

from those pre-sample values, which might differ from <strong>the</strong> time <strong>the</strong> module used by one<br />

or two sample times. Referring to Figure 2-7, which zooms in on <strong>the</strong> first 400 msecs <strong>of</strong><br />

<strong>the</strong> wave<strong>for</strong>m shown in Figure 2-6, <strong>the</strong> pre-sample light level is actually 0 (completely<br />

dark) until <strong>the</strong> bowler starts to release <strong>the</strong> ball at -17 msecs. Release occurs between -8<br />

msecs and 0 msecs, where a sharp increase in <strong>the</strong> light level is evident.<br />

70<br />

60<br />

50<br />

Impact with Lane<br />

(ball l<strong>of</strong>t)<br />

Light Level<br />

40<br />

30<br />

20<br />

Release<br />

Point<br />

Finger Pressure<br />

at Release<br />

10<br />

0<br />

-50<br />

0 50 100 150 200 250 300 350<br />

Milliseconds (since Release)<br />

Figure 2-7: Raw Data Release Region (400 ms)<br />

2.8.2 Detecting Impacts<br />

The piezoelectric film sensor and <strong>the</strong> comparator circuitry are more than adequate <strong>for</strong><br />

detecting <strong>the</strong> various impacts <strong>the</strong> ball experiences. Several impacts are shown in Figure<br />

2-7, which presents <strong>the</strong> first few hundred milliseconds after release. At two consecutive<br />

sample times, -8 msecs and 0 msecs, <strong>the</strong> sudden pressure that <strong>the</strong> bowler applied to <strong>the</strong><br />

finger insert while releasing <strong>the</strong> ball is indicated. At 183 msecs, <strong>the</strong> graph indicates <strong>the</strong><br />

ball contacting <strong>the</strong> lane. The module consistently records both <strong>the</strong> pressure applied at<br />

release and <strong>the</strong> impact generated when <strong>the</strong> ball hits <strong>the</strong> lane.<br />

At <strong>the</strong> o<strong>the</strong>r end <strong>of</strong> <strong>the</strong> lane, <strong>the</strong> module has no problem detecting multiple impacts with<br />

<strong>the</strong> pins, as seen in Figure 2-8 (an expansion <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m in Figure 2-6). This<br />

particular wave<strong>for</strong>m is from a ball that hit <strong>the</strong> 1-3 pocket and resulted in a strike. A good<br />

pocket hit generally results in <strong>the</strong> ball hitting four pins on its way through <strong>the</strong> rack, and<br />

<strong>the</strong>re are four impacts indicated on <strong>the</strong> graph. Throughout testing, solid pocket hits<br />

tended to generate four impacts, while light pocket hits, and high hits resulted in three<br />

29


impacts. By looking at <strong>the</strong> "signature" <strong>of</strong> <strong>the</strong> impacts, it might be possible <strong>for</strong> <strong>the</strong><br />

MASTER application to utilize <strong>the</strong> impact in<strong>for</strong>mation at <strong>the</strong> pins to discern whe<strong>the</strong>r or<br />

not <strong>the</strong> ball hit <strong>the</strong> pocket. It might also be possible to discriminate between <strong>the</strong> first and<br />

second balls <strong>of</strong> a frame by looking at <strong>the</strong> impact signatures <strong>of</strong> consecutive wave<strong>for</strong>ms.<br />

Light Level<br />

140<br />

120<br />

100<br />

80<br />

60<br />

Impact<br />

(Head Pin)<br />

Impact<br />

(5 Pin)<br />

Impact<br />

(3 Pin)<br />

Impact<br />

(9 Pin)<br />

40<br />

20<br />

0<br />

2450<br />

2500 2550 2600 2650 2700 2750 2800 2850<br />

Milliseconds (since Release)<br />

Figure 2-8: Raw Data Impact Region (800 ms)<br />

2.8.3 Wave<strong>for</strong>m Discrimination and Validation<br />

Correct operation <strong>of</strong> this function is critical <strong>for</strong> proper and convenient operation <strong>of</strong> <strong>the</strong><br />

module. The discrimination routine implemented in this version <strong>of</strong> <strong>the</strong> module is quite<br />

simplistic, and is based on observations <strong>of</strong> wave<strong>for</strong>ms from just a single individual. In<br />

that regard, <strong>the</strong> routine served its purpose, but it does have some inherent limitations.<br />

Figure 2-9 shows <strong>the</strong> first 800 msecs following release <strong>of</strong> <strong>the</strong> ball. The module must<br />

determine, within <strong>the</strong> first 533 msecs after release, whe<strong>the</strong>r to continue recording <strong>the</strong><br />

wave<strong>for</strong>m, or to switch to detecting <strong>the</strong> COMM wand. With <strong>the</strong> limited scratch pad space<br />

available (72 samples worth) <strong>for</strong> <strong>the</strong> module to make this decision, it is possible <strong>for</strong> <strong>the</strong><br />

routine to "misfire". Since <strong>the</strong> author generates about 420 rpms (7 rps) at release, <strong>the</strong><br />

routine can detect three revolutions in <strong>the</strong> validation time <strong>of</strong> 533 msecs, causing it to<br />

decide that <strong>the</strong> ball is, in fact, rolling down <strong>the</strong> lane.<br />

However, when executing certain spare shots, many bowlers release <strong>the</strong> ball with as little<br />

rotation as possible in order to "flatten" <strong>the</strong> ball's hook. In this case, <strong>the</strong> module reaches<br />

<strong>the</strong> end <strong>of</strong> <strong>the</strong> scratch pad be<strong>for</strong>e <strong>the</strong> discrimination routine has determined that <strong>the</strong> ball<br />

is, in fact, rolling down <strong>the</strong> lane. The discrimination routine decides that <strong>the</strong> wave<strong>for</strong>m is<br />

invalid, and switches to detecting <strong>the</strong> COMM wand.<br />

The wave<strong>for</strong>m in Figure 2-10 was captured using <strong>the</strong> module's TEST mode, and displays<br />

a wave<strong>for</strong>m from just such a spare conversion (10-pin). This wave<strong>for</strong>m resulted from <strong>the</strong><br />

ball rolling down <strong>the</strong> lane, but <strong>the</strong> first 600 msecs do not con<strong>for</strong>m to <strong>the</strong> current definition<br />

<strong>for</strong> a "valid" wave<strong>for</strong>m in <strong>the</strong> module's embedded s<strong>of</strong>tware.<br />

30


Light Level<br />

100<br />

90<br />

80<br />

70<br />

60<br />

50<br />

40<br />

30<br />

20<br />

1 st<br />

complete<br />

Revolution<br />

2 nd<br />

complete<br />

Revolution<br />

10<br />

0<br />

Release<br />

Point<br />

-50 0 100 200 300 400 500 600 700 800<br />

Milliseconds (since Release)<br />

Figure 2-9: Raw Data Release Region (800 ms)<br />

Figure 2-10: 10-Pin Shot, "Raw Data" Screen Capture<br />

31


Also, <strong>the</strong>re have been instances in AUTO mode where <strong>the</strong> module recorded what<br />

appeared to be <strong>the</strong> ball returning to and rolling on <strong>the</strong> ball return. SMARTDOT is<br />

activated on every impact (as well as when <strong>the</strong> finger insert is pressed), and one <strong>of</strong> <strong>the</strong>se<br />

impacts can occur when <strong>the</strong> ball is hoisted from <strong>the</strong> subway up to <strong>the</strong> ball return. If <strong>the</strong><br />

module is facing downward after this impact (so that <strong>the</strong> release level is not detected at<br />

start-up), and <strong>the</strong> ball rolls fast enough after start-up to satisfy <strong>the</strong> discrimination routine,<br />

a "misfire" results.<br />

If <strong>the</strong> module is in AUTO mode when this scenario occurs, <strong>the</strong> result is that <strong>the</strong> wave<strong>for</strong>m<br />

from <strong>the</strong> ball just rolled is lost, overwritten by <strong>the</strong> "misfire" generated at <strong>the</strong> ball return.<br />

See <strong>the</strong> "Future Work" section <strong>for</strong> more in<strong>for</strong>mation on revisions to <strong>the</strong> discrimination<br />

routine.<br />

An interesting observation from <strong>the</strong> wave<strong>for</strong>m in Figure 2-9 is that <strong>the</strong> first complete<br />

revolution <strong>of</strong> <strong>the</strong> ball occurred be<strong>for</strong>e <strong>the</strong> ball hit <strong>the</strong> lane. Thus, this revolution has not<br />

yet been impacted by <strong>the</strong> interaction between <strong>the</strong> ball and <strong>the</strong> lane, and is truly<br />

representative <strong>of</strong> <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> ball at release.<br />

2.8.4 Wave<strong>for</strong>m Shape<br />

The initial premise behind using a light sensor to detect revolution <strong>of</strong> <strong>the</strong> ball was that <strong>the</strong><br />

digitized light wave<strong>for</strong>m would be roughly sinusoidal in nature. Looking at Figures 2-9<br />

and 2-11, <strong>the</strong> actual wave<strong>for</strong>m is much "rougher" than anticipated. Figure 2-10 shows<br />

<strong>the</strong> first 800 msecs <strong>of</strong> a wave<strong>for</strong>m, Figure 2-11 shows 800 msecs <strong>of</strong> <strong>the</strong> same wave<strong>for</strong>m,<br />

centered at <strong>the</strong> ball's initial impact with <strong>the</strong> pins.<br />

140<br />

120<br />

100<br />

Last complete<br />

Revolution<br />

Impact<br />

(Head Pin)<br />

Light Level<br />

80<br />

60<br />

40<br />

20<br />

0<br />

2000<br />

2100 2200 2300 2400 2500 2600 2700 2800<br />

Milliseconds (since Release)<br />

Figure 2-11: Wave<strong>for</strong>m Shape, Impact Region (800 ms)<br />

Although <strong>the</strong> captured wave<strong>for</strong>m is not exactly sinusoidal, it exhibits some basic<br />

characteristics that are encouraging, such as a periodic oscillation, and a sinusoidal shape<br />

in <strong>the</strong> "valleys" <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m. A sinusoidal envelope closely approximating <strong>the</strong><br />

digitized wave<strong>for</strong>m is superimposed on <strong>the</strong> graphs, and <strong>the</strong> beginnings and endings <strong>of</strong><br />

each complete revolution <strong>of</strong> <strong>the</strong> ball, located by <strong>the</strong> peaks in <strong>the</strong> sine wave, are<br />

demarcated in red. A digital filter applied to <strong>the</strong> captured data could extract <strong>the</strong> target<br />

sine wave.<br />

32


By filtering <strong>the</strong> data, and <strong>the</strong>n counting <strong>the</strong> number <strong>of</strong> samples between <strong>the</strong> peaks, it is<br />

possible to find <strong>the</strong> angular velocity (rpms) <strong>for</strong> each <strong>of</strong> <strong>the</strong> revolutions. In Figure 2-9,<br />

<strong>the</strong>re are between 16 and 17 samples in each <strong>of</strong> <strong>the</strong> revolutions, and <strong>the</strong> time between<br />

samples is 8.333 msec (120 Hz sample rate), yielding an angular velocity <strong>of</strong> 424 to 450<br />

rpms (7.06 - 7.50 Hz). In Figure 2-11, <strong>the</strong>re are between 15 and 16 sample times,<br />

yielding an angular velocity <strong>of</strong> 450 to 480 rpms (7.50 to 8.0 Hz).<br />

One concern immediately apparent from <strong>the</strong> results just obtained is that by using <strong>the</strong><br />

method described (measuring time by counting samples), a difference <strong>of</strong> one sample time<br />

resulted in a change <strong>of</strong> ~25-30 rpms over a range <strong>of</strong> 425-480 rpms (± 2.8%). A finer<br />

resolution in <strong>the</strong> angular velocity calculations is probably required. Ano<strong>the</strong>r concern is<br />

developing a method <strong>for</strong> calculating appropriate cut-<strong>of</strong>f frequencies <strong>for</strong> <strong>the</strong> digital filter.<br />

Suggestions <strong>for</strong> dealing with <strong>the</strong>se problems are presented in Section III.<br />

2.8.5 Communications<br />

The module's s<strong>of</strong>tware UART has turned out to be quite reliable. In an infrared (IR)<br />

wireless environment, <strong>the</strong> proximity <strong>of</strong> <strong>the</strong> communicating devices and ambient<br />

background light infiltration are <strong>the</strong> two main concerns. The proximity <strong>of</strong> <strong>the</strong> devices is<br />

fixed at about 1 3 / 8 " (1.375"), as long as <strong>the</strong> user does not remove <strong>the</strong> COMM wand during<br />

communications.<br />

Normally, an IR filter would be used to block visible light, but in this application,<br />

detection <strong>of</strong> visible light is necessary. By having <strong>the</strong> module detect <strong>the</strong> presence <strong>of</strong> <strong>the</strong><br />

COMM wand (by looking <strong>for</strong> a very low light level), <strong>the</strong> module can assure that<br />

background light infiltration has been reduced to an acceptable level be<strong>for</strong>e initiating<br />

communications with <strong>the</strong> wand.<br />

One recurring problem was encountered that will be fixed in a later version <strong>of</strong> <strong>the</strong> module<br />

s<strong>of</strong>tware. During <strong>the</strong> upload portion <strong>of</strong> <strong>the</strong> "Transmit" command, if <strong>the</strong> COMM wand<br />

was moved such that light infiltrated during <strong>the</strong> wand's reception <strong>of</strong> <strong>the</strong> EEPROM<br />

contents, <strong>the</strong> data file could be corrupted without detection by <strong>the</strong> MASTER program.<br />

There is no handshaking going on during this portion <strong>of</strong> <strong>the</strong> exchange, and if <strong>the</strong> COMM<br />

wand is positioned just right, it is possible <strong>for</strong> <strong>the</strong> 120 Hz fluorescent noise to simulate<br />

repeated START bits. The wand continues to see START bits, and consequently continues<br />

to receive data until it has counted 512 bytes, at which time it proceeds to process <strong>the</strong><br />

data.<br />

Suggested improvements <strong>for</strong> <strong>the</strong> communication routines are discussed in <strong>the</strong> "Future<br />

Work" section.<br />

2.8.6 Battery Life<br />

A major design goal was to limit <strong>the</strong> overall current drawn by <strong>the</strong> module. Lithium coin<br />

cells are rated in milliamp-hours (<strong>the</strong> number <strong>of</strong> hours <strong>the</strong> battery can supply one<br />

milliamp <strong>of</strong> current while maintaining its rated battery voltage). Several different<br />

techniques were used to limit <strong>the</strong> current draw <strong>of</strong> <strong>the</strong> module. The TSL251 light sensor is<br />

turned <strong>of</strong>f when not in use, reducing current draw by 800 µAmps. While <strong>the</strong> module is<br />

running, <strong>the</strong> 87C752's IDLE mode is used between sample times. This cuts <strong>the</strong> average<br />

current draw <strong>of</strong> <strong>the</strong> module from 3.5 mAmps to under 2.0 mAmps. Extensive use <strong>of</strong> time<br />

outs has also helped to limit <strong>the</strong> run time <strong>of</strong> <strong>the</strong> module. For any given shot, <strong>the</strong> average<br />

current draw is 2.5 mAmps <strong>for</strong> 3-4 seconds, yielding 7.5-10 mAmp-seconds per shot.<br />

33


However, testing revealed that <strong>the</strong>re are also multiple "false" activations per shot, which<br />

occur be<strong>for</strong>e release <strong>of</strong> <strong>the</strong> ball and from <strong>the</strong> ball return mechanism handling <strong>the</strong> ball.<br />

These activations typically accumulate 10-15 seconds <strong>of</strong> additional run time, accounting<br />

<strong>for</strong> ano<strong>the</strong>r 25-35 mAmp-seconds per shot. There<strong>for</strong>e, <strong>the</strong> actual battery usage works out<br />

to be ~40 mAmp-seconds per ball. For a 200 mAmp-hour coin cell, this yields a battery<br />

life <strong>of</strong> 18,000 shots (about 1000 games). The bowler could use <strong>the</strong> module up to 20<br />

games a week <strong>for</strong> a year without having to replace <strong>the</strong> battery. A lower capacity battery<br />

could also be specified, reducing <strong>the</strong> cost, weight, and height <strong>of</strong> <strong>the</strong> module.<br />

2.9 FUTURE WORK<br />

The prototype SMARTDOT module was developed to serve three functions: first, as a<br />

pro<strong>of</strong>-<strong>of</strong>-concept; second, as a data collection device to capture and characterize <strong>the</strong><br />

ambient light wave<strong>for</strong>m that <strong>the</strong> module was being developed to record; and third, to<br />

serve as <strong>the</strong> initial hardware plat<strong>for</strong>m upon which to develop and test <strong>the</strong> embedded<br />

s<strong>of</strong>tware <strong>for</strong> <strong>the</strong> commercial SMARTDOT module.<br />

Recall that <strong>the</strong> nature <strong>of</strong> <strong>the</strong> light wave<strong>for</strong>m was unknown at <strong>the</strong> start <strong>of</strong> this project.<br />

Much knowledge has been gained since <strong>the</strong>n from actually being able to observe and<br />

analyze <strong>the</strong> captured data. This knowledge will be put to use in future iterations <strong>of</strong> <strong>the</strong><br />

module's embedded s<strong>of</strong>tware.<br />

Also, in <strong>the</strong> time since <strong>the</strong> design and construction <strong>of</strong> <strong>the</strong> SMARTDOT module prototype,<br />

component technology has improved tremendously. Upgrading <strong>the</strong> module with <strong>the</strong>se<br />

advanced components will allow <strong>for</strong> significant improvements in <strong>the</strong> capabilities <strong>of</strong> both<br />

<strong>the</strong> hardware and <strong>the</strong> embedded s<strong>of</strong>tware, as well as in reductions in <strong>the</strong> cost, size, and<br />

weight <strong>of</strong> <strong>the</strong> module.<br />

2.9.1 Microprocessor<br />

Microprocessor technology in <strong>the</strong> 8-bit arena has changed quite dramatically in <strong>the</strong> last<br />

few years. Cygnal Integrated Products just recently introduced a true system-on-a-chip<br />

8051-based microprocessor (C8051F300x). The 'F300x contains 8K bytes <strong>of</strong> on-board<br />

flash memory (which can be used <strong>for</strong> both program and data), 256 bytes <strong>of</strong> RAM, an<br />

advanced serial UART, advanced power-management functions, on-board ultra-low<br />

power comparators, a low-power analog-to-digital converter (ADC), on-board<br />

programmable oscillator, and reset circuitry, all in a package that measures 3mm by<br />

3mm. With this microprocessor, <strong>the</strong> TSL25x light sensor, LED's and a small amount <strong>of</strong><br />

passive components, <strong>the</strong> module can be redesigned to be smaller, cheaper and more<br />

powerful than <strong>the</strong> current design. It will even be possible to upgrade <strong>the</strong> module's<br />

embedded s<strong>of</strong>tware via <strong>the</strong> infrared interface while <strong>the</strong> module remains in <strong>the</strong> ball.<br />

The 'F300x also makes certain s<strong>of</strong>tware improvements possible. Since it contains both an<br />

on-board comparator and a hardware UART, it will be possible to feed <strong>the</strong> TSL251<br />

output to <strong>the</strong> comparator and <strong>the</strong>n to <strong>the</strong> reception port <strong>of</strong> <strong>the</strong> UART. In addition, <strong>the</strong><br />

transmission port <strong>of</strong> <strong>the</strong> UART can directly drive <strong>the</strong> transmit LED's, allowing <strong>for</strong> much<br />

higher transmit baud rates. This will be an issue with <strong>the</strong> much higher serial EEPROM<br />

densities now available (see "Sample Memory" below). These improvements also<br />

eliminate <strong>the</strong> s<strong>of</strong>tware UART, freeing up a significant amount <strong>of</strong> code space.<br />

34


The 'F300x can write to any portion <strong>of</strong> its flash memory "on <strong>the</strong> fly". There<strong>for</strong>e, flash<br />

memory that is not used <strong>for</strong> code space is available as sample memory. If <strong>the</strong> code can<br />

be limited to 2K bytes, as it is in <strong>the</strong> prototype, 5.5K <strong>of</strong> on-board flash memory is<br />

available <strong>for</strong> data space (<strong>the</strong> high-order 512 bytes are reserved <strong>for</strong> factory use). A<br />

scheme <strong>for</strong> compressing <strong>the</strong> sample data is proposed in <strong>the</strong> "Data Compression" section<br />

that allows <strong>for</strong> <strong>the</strong> recording <strong>of</strong> an entire game's worth <strong>of</strong> data (up to 21 shots) <strong>for</strong> most<br />

bowlers. Using <strong>the</strong> excess on-board flash memory as <strong>the</strong> sample memory eliminates <strong>the</strong><br />

need <strong>for</strong> an external serial EEPROM chip, which results in cost savings and reductions in<br />

PCB space and <strong>the</strong> overall weight <strong>of</strong> <strong>the</strong> module.<br />

The 'F300x provides additional advantages. Where as <strong>the</strong> Philips 87C752 has an<br />

instruction rate that is 1 / 12 <strong>of</strong> <strong>the</strong> clock frequency, <strong>the</strong> 'F300x's average instruction rate is<br />

one-half that <strong>of</strong> <strong>the</strong> clock frequency, executing instructions at six times <strong>the</strong> rate <strong>of</strong> <strong>the</strong><br />

'752. Faster instruction execution means more time can be spent in <strong>the</strong> IDLE mode. The<br />

'F300x also has an on-board ADC that samples at a rate 10 times faster than <strong>the</strong> '752,<br />

again cutting down on time spent out <strong>of</strong> IDLE mode. In addition, <strong>the</strong> 'F300x has <strong>the</strong><br />

ability to switch its internal clock frequency, meaning that it can slow down when it's not<br />

processing data, and speed up when it has work to do. Once again, this results in a<br />

reduction in current draw. These additional power reductions could result in an average<br />

current draw <strong>of</strong> one-eighth to one-quarter that <strong>of</strong> <strong>the</strong> current SMARTDOT prototype,<br />

allowing <strong>the</strong> use <strong>of</strong> a smaller, cheaper, lighter-weight battery.<br />

2.9.2 Communications<br />

Since it is very easy to inject noise into an IR connection, <strong>the</strong> module should issue a<br />

checksum after each grouping <strong>of</strong> bytes so that <strong>the</strong> MASTER program can verify <strong>the</strong><br />

contents <strong>of</strong> <strong>the</strong> data. The module should also send a fixed terminating character to<br />

indicate that <strong>the</strong> transmission is complete. This character won't be unique to <strong>the</strong><br />

transmission since <strong>the</strong> data can take any <strong>of</strong> <strong>the</strong> 256 values, but it will be positioned at a<br />

fixed location in <strong>the</strong> transmit stream. These were oversights in <strong>the</strong> current version <strong>of</strong> <strong>the</strong><br />

embedded s<strong>of</strong>tware.<br />

Ultimately, it would be beneficial to implement a limited IrDA (InfraRed Data<br />

Association) protocol stack. Using one <strong>of</strong> <strong>the</strong> standard IrDA protocols would facilitate<br />

communication with just about any PDA-type device, all <strong>of</strong> which utilize various IrDA<br />

protocols to "beam" in<strong>for</strong>mation back-and-<strong>for</strong>th. Un<strong>for</strong>tunately, implementing an IrDA<br />

stack in an 8-bit device is a fairly complex task, which also consumes a fair amount <strong>of</strong><br />

code space. For now, it is something that will remain on <strong>the</strong> backburner.<br />

2.9.3 Sample Memory and Multiple Wave<strong>for</strong>ms<br />

As <strong>the</strong> prototype is currently designed, <strong>the</strong> SMARTDOT module can only record one shot<br />

at a time. This has proven to be highly inconvenient and time-consuming. Much more<br />

desirable is <strong>the</strong> ability to record multiple shots, preferably at least an entire game's worth<br />

<strong>of</strong> data, between uploads. In addition, <strong>the</strong> effectiveness <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m discrimination<br />

and validation routine is severely impacted by <strong>the</strong> limited amount <strong>of</strong> scratch pad memory<br />

in <strong>the</strong> prototype. If <strong>the</strong> module had more time (meaning more space) to record data while<br />

deciding <strong>the</strong> source <strong>of</strong> a wave<strong>for</strong>m, it could per<strong>for</strong>m this task much more reliably.<br />

In <strong>the</strong> time since <strong>the</strong> SMARTDOT module prototype was assembled, serial EEPROM<br />

memory densities have increased dramatically. Using <strong>the</strong> assumptions previously<br />

presented (a 4 second maximum sampling time at a 120 Hz sample rate), <strong>the</strong> amount <strong>of</strong><br />

data memory required to store <strong>the</strong> data <strong>for</strong> a single game can now be determined. It is<br />

35


possible to roll up to 21 shots in one game <strong>of</strong> bowling. Allowing a maximum <strong>of</strong> 512<br />

bytes per ball (500 samples, plus some additional header in<strong>for</strong>mation), 10752 bytes are<br />

required to store <strong>the</strong> "worst-case" game: 21 balls thrown at 10 mph.<br />

Serial EEPROM is now available in 8Kx8 (64K bits), 16Kx8 (128Kk bits), and 32Kx8<br />

(256K bits) chips, with 64Kx8 (512K bits) soon to be available. The 16Kx8 chip is<br />

mandated using <strong>the</strong> above criteria. If a sample rate <strong>of</strong> 240 Hz is required, <strong>the</strong> 256Kb<br />

module would have to be specified, with a commensurate increase in cost. At a 120Hz<br />

data rate, <strong>the</strong> 256Kb chip will also accommodate three full games <strong>of</strong> bowling, which is<br />

significant, since a league series usually consists <strong>of</strong> three games.<br />

The above calculations are based on minimum ball speeds (maximum sample time per<br />

ball). However, a greater number <strong>of</strong> shots can be captured <strong>for</strong> a given size memory if <strong>the</strong><br />

data is stored in variable length records. Such a record would consist <strong>of</strong> header<br />

in<strong>for</strong>mation (<strong>the</strong> ball count, <strong>the</strong> activation count, <strong>the</strong> run time, <strong>the</strong> length <strong>of</strong> <strong>the</strong> record, a<br />

pointer to <strong>the</strong> previous record, a pointer to <strong>the</strong> next record, etc.) and <strong>the</strong> actual sample<br />

data. The records would be stored as a doubly-linked list, and uploaded as a group,<br />

probably at <strong>the</strong> end <strong>of</strong> each game, which would free up <strong>the</strong> memory <strong>for</strong> <strong>the</strong> next game.<br />

2.9.4 Data Compression<br />

Although serial EEPROM memory has increased in capacity while also becoming<br />

cheaper, it is cost-effective to use <strong>the</strong> smallest memory space that will hold a game's<br />

worth <strong>of</strong> data (21 balls maximum). The data collected so far might possess<br />

characteristics that could be exploited by a data compression routine. Bearing in mind<br />

that <strong>the</strong> collected wave<strong>for</strong>ms are from a single bowler and a single bowling<br />

establishment, it would be incorrect to assume that this data is representative <strong>of</strong> <strong>the</strong> entire<br />

bowling population. However, it should be possible to draw some initial useful<br />

conclusions that are worth fur<strong>the</strong>r study.<br />

It was originally assumed that <strong>the</strong> wave<strong>for</strong>m <strong>the</strong> SMARTDOT module records would have<br />

a roughly sinusoidal shape. Looking at just <strong>the</strong> lower half <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m, that<br />

assumption is basically valid. However, <strong>the</strong> wave<strong>for</strong>m exhibits striking directionality<br />

when <strong>the</strong> module is facing <strong>the</strong> ceiling, as can be seen in Figure 2-10. By setting 0° to be<br />

that point where <strong>the</strong> module is facing directly toward <strong>the</strong> ceiling, it is apparent that <strong>the</strong><br />

sample-to-sample values change ra<strong>the</strong>r rapidly (20 or more counts at a time) in <strong>the</strong> range<br />

from 270° to 90°. This phenomenon results from <strong>the</strong> fluorescent ceiling lights acting as<br />

point sources, ra<strong>the</strong>r than as a uni<strong>for</strong>mly distributed light source, and from <strong>the</strong> module<br />

being located below <strong>the</strong> surface <strong>of</strong> <strong>the</strong> ball.<br />

However, <strong>the</strong> sample-to-sample values in <strong>the</strong> 180° <strong>of</strong> rotation between 90° and 270°<br />

change relatively slowly (only a few counts at a time). This portion includes <strong>the</strong> valleys<br />

<strong>of</strong> <strong>the</strong> wave<strong>for</strong>m, which are produced when <strong>the</strong> module faces <strong>the</strong> lane surface, in <strong>the</strong><br />

shadow <strong>of</strong> <strong>the</strong> ball. The "interesting" portion <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m falls within <strong>the</strong> range 10-<br />

50 (0x0A to 0x32), where <strong>the</strong> wave<strong>for</strong>m exhibits a finer granularity. This in<strong>for</strong>mation<br />

can be used to advantage in contemplating appropriate data compression techniques.<br />

A system needs to be established that can store two samples in one byte - 4 bits per<br />

sample. If samples could be stored as a value relative to each o<strong>the</strong>r, or relative to some<br />

known fixed value, this goal might be accomplished. It would be beneficial to maintain a<br />

fine granularity around <strong>the</strong> inflection points <strong>of</strong> <strong>the</strong> valleys in <strong>the</strong> wave<strong>for</strong>m, and loosen<br />

that granularity as <strong>the</strong> sample values move fur<strong>the</strong>r away from those inflection points.<br />

36


One possibility is to use a trans<strong>for</strong>mation table to record <strong>the</strong> data. Each sample would be<br />

compressed into four "value" bits, plus a fifth "range" bit. Two adjacent compressed<br />

values would be stored toge<strong>the</strong>r in a byte, while <strong>the</strong> "range" bits would be stored<br />

consecutively in groups <strong>of</strong> eight comprising a "range" byte. The impact bits would also<br />

need to be stored in separate bytes. In this fashion, six bytes would be required to store<br />

eight samples: four dual sample bytes, one range byte, and one impact byte. Thus, a<br />

compression <strong>of</strong> 25% has been achieved, allowing an 8-Kbyte external EEPROM to hold a<br />

"worst-case" game's worth <strong>of</strong> sample data. The data <strong>for</strong> one wave<strong>for</strong>m would be stored<br />

as shown in Figures 2-12a and 2-12b.<br />

(one header per wave<strong>for</strong>m)<br />

1 2 3 4 5-8<br />

Ball<br />

Count<br />

Previous<br />

Record<br />

(address / 8)<br />

Next<br />

Record<br />

(address / 8)<br />

Pre-Samples<br />

Impact Byte<br />

(8 impact bits)<br />

Pre-Sample Bytes<br />

(no translation)<br />

1 2 3 4 5 6 7 8<br />

Figure 2-12a: Wave<strong>for</strong>m Header<br />

(repeated up to 60 times <strong>for</strong> 480 samples)<br />

1 2 3-6<br />

Impact Byte<br />

(8 Impact bits)<br />

Range Byte<br />

(8 Range bits)<br />

Sample Bytes<br />

(translated values)<br />

1 2 3 4 5 6 7 8<br />

Figure 2-12b: Wave<strong>for</strong>m Compressed Sample Record<br />

An example translation table is shown in Figure 2-13. Notice that this table yields a nonlinear<br />

translation, resulting in a hash function that converts 8-bit values into 5-bit values<br />

(4 data bits plus <strong>the</strong> "range" bit). For example, using <strong>the</strong> translation table <strong>of</strong> Figure 2-13,<br />

if eight consecutive samples contained <strong>the</strong> values 10, 12, 16, 38, 57, 75, 118, and 85 and<br />

impacts were registered at <strong>the</strong> third (16) and fourth (38) samples, <strong>the</strong> compressed data<br />

would appear as shown in Figure 2-12c.<br />

1 2 3-6<br />

Impact Byte<br />

30h<br />

(0011 0000)<br />

Range Byte<br />

1Fh<br />

(0001 1111)<br />

Sample Bytes<br />

(translated values)<br />

2 2 4 5 B C E D<br />

Figure 2-12c: Compressed Samples Example<br />

37


2.9.5 Module Training<br />

Due to variations in bowler style and bowling<br />

equipment, and with inherent variations in <strong>the</strong><br />

ambient background light levels at various bowling<br />

establishments, it will probably be necessary to<br />

"train" <strong>the</strong> module <strong>for</strong> a given bowler, and <strong>for</strong> a<br />

given establishment. This can be easily<br />

accommodated at <strong>the</strong> beginning <strong>of</strong> each session <strong>of</strong><br />

bowling.<br />

The MASTER application would issue a command to<br />

<strong>the</strong> module to take samples without data<br />

compression. This data, collected from several<br />

"training" shots would <strong>the</strong>n be uploaded to <strong>the</strong><br />

MASTER program, which would scan <strong>the</strong> data and<br />

come up with <strong>the</strong> best-fit translation table, and<br />

download <strong>the</strong> table to <strong>the</strong> module. The module<br />

would <strong>the</strong>n use <strong>the</strong>se values in its data compression<br />

routines. If <strong>the</strong> module was not trained, it could use<br />

<strong>the</strong> last translation table downloaded to it as a<br />

default.<br />

The MASTER program could also determine <strong>the</strong><br />

average ball speed <strong>of</strong> <strong>the</strong> bowler and use this<br />

in<strong>for</strong>mation to decide whe<strong>the</strong>r <strong>the</strong>re was enough<br />

room to store uncompressed data (since <strong>the</strong> amount<br />

<strong>of</strong> space used is dependent on <strong>the</strong> wave<strong>for</strong>m sample<br />

time), or to use <strong>the</strong> data compression function.<br />

Stored<br />

Nibble<br />

Value<br />

Actual Sample Value<br />

(0) Range<br />

Bit<br />

(1) Range<br />

Bit<br />

0x0 < 5 28-29<br />

0x1 5-8 30-31<br />

0x2 9-12 32-33<br />

0x3 13-14 34-35<br />

0x4 15-16 36-37<br />

0x5 17 38-39<br />

0x6 18 40-41<br />

0x7 19 42-43<br />

0x8 20 44-45<br />

0x9 21 46-49<br />

0xA 22 50-54<br />

0xB 23 55-59<br />

0xC 24 60-79<br />

0xD 25 80-99<br />

0xE 26 100-127<br />

0xF 27 >127<br />

Figure 2-13: Data Compression<br />

Translation Table<br />

2.9.6 Adjustable Sampling Parameters<br />

Preliminary analysis <strong>of</strong> <strong>the</strong> data collected revealed that some type <strong>of</strong> digital filtering is<br />

required in order to extract useful data from <strong>the</strong> captured wave<strong>for</strong>m. However, <strong>the</strong> 120<br />

Hz sampling rate may not be high enough to accurately achieve <strong>the</strong> desired resolution in<br />

angular velocity (rpms). The 120 Hz rate is <strong>the</strong> minimum acceptable, but 240 Hz, or<br />

even 480 Hz, may be required. Of course, higher sampling rates increase <strong>the</strong> data storage<br />

requirements, and require faster EEPROM write times. Ramtron makes an appropriate<br />

density ferroelectric serial EEPROM with a write time equivalent to <strong>the</strong> data bus speed<br />

that fits <strong>the</strong> application, although <strong>the</strong> cost-per-bit is ∼50% higher than that <strong>for</strong> standard<br />

serial EEPROMs [22].<br />

The sampling rate could be adjusted based on <strong>the</strong> rate <strong>of</strong> rotation <strong>the</strong> bowler applies to <strong>the</strong><br />

ball and on <strong>the</strong> velocity that <strong>the</strong> bowler throws <strong>the</strong> ball. The higher <strong>the</strong> rate <strong>of</strong> rotation,<br />

and/or <strong>the</strong> velocity, <strong>the</strong> higher <strong>the</strong> sampling rate should be. But with a higher ball speed,<br />

less time is required to sample <strong>the</strong> full wave<strong>for</strong>m, so <strong>the</strong>re should be some <strong>of</strong>fset between<br />

<strong>the</strong> increased sample rate and <strong>the</strong> reduced sample time.<br />

Ano<strong>the</strong>r option is to interpolate between 120 Hz samples based on <strong>the</strong> rate <strong>of</strong> change <strong>of</strong><br />

<strong>the</strong> sample values surrounding <strong>the</strong> values to be interpolated. This interpolation would be<br />

handled by <strong>the</strong> MASTER application.<br />

38


2.10 SUMMARY<br />

This portion <strong>of</strong> <strong>the</strong> research has shown that <strong>the</strong> in-situ sensor module is a viable concern,<br />

although <strong>the</strong> current prototype has its limitations. The major limitation is that <strong>the</strong> module<br />

is capable <strong>of</strong> capturing only one shot at a time. Given <strong>the</strong> advances in data storage<br />

density and reductions in cost-per-bit, this limitation can be easily overcome.<br />

Ano<strong>the</strong>r major limitation is <strong>the</strong> effectiveness <strong>of</strong> <strong>the</strong> discrimination routine, but <strong>the</strong> routine<br />

has been hampered by a lack <strong>of</strong> scratch pad memory space. This limitation is also solved<br />

with an increase in <strong>the</strong> available storage space.<br />

Now that <strong>the</strong> nature <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m is better understood, <strong>the</strong> next version <strong>of</strong> <strong>the</strong> module<br />

will be more attuned to capturing <strong>the</strong> essence <strong>of</strong> <strong>the</strong> data. In addition, advances in<br />

technology have made it possible to cut <strong>the</strong> weight and height <strong>of</strong> <strong>the</strong> module, as well as<br />

<strong>the</strong> component cost, by at least a third. Those same advances also allow more<br />

sophisticated techniques to be implemented within <strong>the</strong> module's embedded s<strong>of</strong>tware, such<br />

as data compression, variable sampling frequencies, better wave<strong>for</strong>m discrimination, and<br />

more advanced communication techniques.<br />

The major concern to emerge during <strong>the</strong> SMARTDOT module's development is <strong>the</strong><br />

"rough" shape and <strong>the</strong> directionality <strong>of</strong> <strong>the</strong> captured ambient light wave<strong>for</strong>m. Although it<br />

is possible to visually count <strong>the</strong> revolutions <strong>of</strong> <strong>the</strong> ball directly from <strong>the</strong> wave<strong>for</strong>m, it is<br />

not at all evident that <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> ball changes as <strong>the</strong> ball rolls down <strong>the</strong><br />

lane, nor is it possible to resolve <strong>the</strong> revolution count to better than about one-half<br />

rotation.<br />

Consequently, some level <strong>of</strong> digital signal processing is required in order to remove <strong>the</strong><br />

"noise" from <strong>the</strong> wave<strong>for</strong>m be<strong>for</strong>e beginning to extract <strong>the</strong> useful in<strong>for</strong>mation from that<br />

wave<strong>for</strong>m. The methods used to digitally filter <strong>the</strong> raw data and <strong>the</strong> assumptions and<br />

methods used to extract <strong>the</strong> "interesting" in<strong>for</strong>mation from <strong>the</strong> filtered wave<strong>for</strong>m are<br />

presented in <strong>the</strong> next section.<br />

39


SECTION III: ANALYZING THE DATA - THE MASTER APPLICATION<br />

This portion <strong>of</strong> <strong>the</strong> paper presents <strong>the</strong> data manipulations used to extract <strong>the</strong> wave<strong>for</strong>m<br />

from <strong>the</strong> raw data, <strong>the</strong> assumptions <strong>for</strong> analysis <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m, <strong>the</strong> ma<strong>the</strong>matics and<br />

physics behind those assumptions, and <strong>the</strong> possible in<strong>for</strong>mation that can be derived from<br />

<strong>the</strong> extracted wave<strong>for</strong>m. Consideration is also given to future possibilities <strong>for</strong> analysis<br />

and presentation <strong>of</strong> <strong>the</strong> data.<br />

The SMARTDOT sensor module is intended solely as a data collection device, serving as<br />

<strong>the</strong> sensing mechanism <strong>for</strong> <strong>the</strong> SMARTDOT system. The actual power <strong>of</strong> <strong>the</strong> system,<br />

however, will reside in <strong>the</strong> MASTER application. For <strong>the</strong> purposes <strong>of</strong> this portion <strong>of</strong> <strong>the</strong><br />

project, it was necessary to develop a data-analysis program that was capable <strong>of</strong><br />

communicating with <strong>the</strong> module, and uploading, storing, and facilitating a quick analysis<br />

and assessment <strong>of</strong> <strong>the</strong> data at <strong>the</strong> test site (a local bowling establishment) on a laptop<br />

computer. As such, <strong>the</strong> current MASTER program is a research tool - <strong>the</strong> creation <strong>of</strong> a<br />

user-friendly, GUI-based analysis and presentation package falls into <strong>the</strong> development<br />

phase <strong>of</strong> <strong>the</strong> project.<br />

3.1 RAW DATA ANALYSIS<br />

The original premise behind <strong>the</strong> development <strong>of</strong> <strong>the</strong> SMARTDOT system was that <strong>the</strong><br />

light wave<strong>for</strong>m <strong>the</strong> module captures would be sinusoidal in nature, and that in<strong>for</strong>mation<br />

relevant to <strong>the</strong> action <strong>of</strong> <strong>the</strong> ball could be extracted from that digitized wave<strong>for</strong>m. Under<br />

ideal circumstances, with truly uni<strong>for</strong>m lighting, <strong>the</strong> data that SMARTDOT collects would<br />

closely transcribe a sine wave. In actuality, <strong>the</strong> captured wave<strong>for</strong>m is quite "rough" - it<br />

does exhibit "peaks" and "valleys" like a sinusoid, and it also possesses a cyclic,<br />

repetitive shape, but it only loosely resembles a simple sine wave.<br />

It is possible to visually identify and count <strong>the</strong> revolutions <strong>of</strong> <strong>the</strong> ball from <strong>the</strong> raw data,<br />

to a resolution <strong>of</strong> one-quarter to one-half revolution. The release and impact times are<br />

captured with a fair amount <strong>of</strong> accuracy, and it is easy to use <strong>the</strong>m to calculate <strong>the</strong><br />

average speed <strong>of</strong> <strong>the</strong> ball. However, <strong>the</strong> "rough" shape <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m makes it<br />

impossible to reliably determine <strong>the</strong> starting and ending points <strong>of</strong> a particular revolution,<br />

nor is it "easy" to determine <strong>the</strong> total number <strong>of</strong> revolutions to better than one-half<br />

rotation. After <strong>the</strong> first look at <strong>the</strong> digitized wave<strong>for</strong>m data in <strong>the</strong> early portions <strong>of</strong> <strong>the</strong><br />

research, it was obvious that <strong>the</strong> raw data would have to be digitally filtered be<strong>for</strong>e it<br />

could be used in an automated analysis program.<br />

3.1.1 The "Ideal" Wave<strong>for</strong>m<br />

Be<strong>for</strong>e developing a digital filter <strong>for</strong> <strong>the</strong> raw data, some understanding <strong>of</strong> what <strong>the</strong><br />

desired data should look like must be gained. Recall that <strong>the</strong> ball is released with a linear<br />

velocity that is greater than <strong>the</strong> corresponding angular velocity will support - <strong>the</strong> ball is<br />

skidding (traveling faster than it is revolving). Friction between <strong>the</strong> ball and <strong>the</strong> lane<br />

works to resolve this discrepancy between <strong>the</strong> angular and linear velocities <strong>of</strong> <strong>the</strong> ball.<br />

With no o<strong>the</strong>r <strong>for</strong>ce but friction acting on <strong>the</strong> ball from <strong>the</strong> moment <strong>of</strong> release until <strong>the</strong><br />

moment <strong>of</strong> impact with <strong>the</strong> pins, <strong>the</strong> ball experiences a monotonic increase in its angular<br />

velocity (at any instant, <strong>the</strong> ball's angular velocity is greater than at any previous instant),<br />

and a corresponding monotonic decrease in its linear velocity.<br />

40


The ball's angular velocity increases until <strong>the</strong> discrepancy between <strong>the</strong> angular and linear<br />

velocities is resolved (a condition called roll out). If <strong>the</strong> ball rolls out be<strong>for</strong>e reaching <strong>the</strong><br />

pins, it is no longer skidding, and <strong>the</strong> continuing decrease in its linear velocity due to<br />

rolling friction also directly impacts <strong>the</strong> angular velocity (it begins to monotonically<br />

decrease, as well). Under normal circumstances, <strong>the</strong> ball does not roll out be<strong>for</strong>e hitting<br />

<strong>the</strong> pins, and <strong>the</strong>re<strong>for</strong>e, <strong>the</strong> angular velocity generally increases until <strong>the</strong> ball hits <strong>the</strong> pins.<br />

Given a uni<strong>for</strong>m light distribution along <strong>the</strong> length <strong>of</strong> <strong>the</strong> lane, <strong>the</strong> light level seen by<br />

SMARTDOT will be at its highest (brightest) when <strong>the</strong> module faces directly towards <strong>the</strong><br />

ceiling, and at its lowest (darkest) when <strong>the</strong> module faces directly towards <strong>the</strong> floor, with<br />

a smooth transition occurring between those two points. Under <strong>the</strong>se circumstances, a<br />

graph <strong>of</strong> <strong>the</strong> light wave<strong>for</strong>m appears as an increasing frequency "chirp". The peaks and<br />

valleys <strong>of</strong> <strong>the</strong> sinusoid are spaced fur<strong>the</strong>r apart near <strong>the</strong> release point, and get closer<br />

toge<strong>the</strong>r as <strong>the</strong> ball approaches <strong>the</strong> pins. Figure 3-5, which is a capture <strong>of</strong> <strong>the</strong> filtered<br />

"Wave<strong>for</strong>m" screen from <strong>the</strong> MASTER program, depicts this wave<strong>for</strong>m.<br />

If <strong>the</strong> ball rolls out, its angular velocity reaches a maximum at <strong>the</strong> roll out point, and <strong>the</strong>n<br />

begins decreasing. It is possible to use this in<strong>for</strong>mation to detect whe<strong>the</strong>r or not roll out<br />

has occurred by looking <strong>for</strong> a decrease in <strong>the</strong> angular velocity.<br />

Recall also that friction-reducing lane oil is regularly applied to <strong>the</strong> first 30-40 feet <strong>of</strong> <strong>the</strong><br />

lane. There<strong>for</strong>e, <strong>the</strong> ball is more prone to sliding on <strong>the</strong> upper half <strong>of</strong> <strong>the</strong> lane (nearer <strong>the</strong><br />

foul line), with <strong>the</strong> majority <strong>of</strong> <strong>the</strong> increase in angular velocity occurring on <strong>the</strong> lower<br />

half <strong>of</strong> <strong>the</strong> lane (nearer <strong>the</strong> pins). There<strong>for</strong>e, a graph <strong>of</strong> <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> ball<br />

versus time (or distance from <strong>the</strong> foul line) will have a hyperbolic or exponential shape,<br />

assuming roll out has not occurred. The graph <strong>of</strong> <strong>the</strong> linear velocity will mirror that <strong>of</strong><br />

<strong>the</strong> angular velocity, starting high and falling <strong>of</strong>f at <strong>the</strong> end. Figure 3-7, which is a<br />

capture <strong>of</strong> <strong>the</strong> "<strong>Analysis</strong>" screen from <strong>the</strong> MASTER program, depicts <strong>the</strong>se two graphs.<br />

If <strong>the</strong> ball had rolled out, <strong>the</strong> graph <strong>of</strong> its angular velocity in Figure 3-7 would display an<br />

inflection point at <strong>the</strong> point <strong>of</strong> roll out, decreasing after roll out, while <strong>the</strong> graph <strong>of</strong> its<br />

linear velocity would continue to decrease. Figure 3-9 depicts a wave<strong>for</strong>m that resulted<br />

from <strong>the</strong> ball rolling out be<strong>for</strong>e hitting <strong>the</strong> pins.<br />

3.1.2 The "Real" Wave<strong>for</strong>m<br />

The "jagged" appearance <strong>of</strong> <strong>the</strong> raw data wave<strong>for</strong>m, as shown in Figure 3-1, indicates<br />

that a good deal <strong>of</strong> high frequency "noise" has been captured along with <strong>the</strong> desired<br />

wave<strong>for</strong>m. Since <strong>the</strong> module filters out <strong>the</strong> 120 Hz flicker <strong>of</strong> <strong>the</strong> overhead fluorescent<br />

lights while capturing <strong>the</strong> wave<strong>for</strong>m, this noise must have ano<strong>the</strong>r cause. In fact, <strong>the</strong><br />

noise could be <strong>the</strong> result <strong>of</strong> three additional sources: <strong>the</strong> non-homogenous nature <strong>of</strong> <strong>the</strong><br />

overhead lighting; <strong>the</strong> directionality <strong>of</strong> <strong>the</strong> light sensor that was introduced by placing <strong>the</strong><br />

SMARTDOT module at <strong>the</strong> bottom <strong>of</strong> a finger hole, 1 3 / 8 inches below <strong>the</strong> surface <strong>of</strong> <strong>the</strong><br />

ball; and from "aliasing" <strong>of</strong> frequencies greater than one-half <strong>the</strong> sampling frequency.<br />

These higher frequencies might result from flash bulbs, reflections, etc. O<strong>the</strong>r than <strong>the</strong>se<br />

transient sources, aliasing should have minimal impact, since <strong>the</strong>re are no significant<br />

sources <strong>of</strong> flickering light greater than 120 Hz in a bowling center.<br />

41


Figure 3-1: MASTER "Raw Data" Screen Capture<br />

The non-homogenous nature <strong>of</strong> <strong>the</strong> overhead lighting can be seen in Figure 3-2, which<br />

zooms in on <strong>the</strong> first 800 msecs <strong>of</strong> Figure 3-1. Multiple local peaks are evident during<br />

each revolution, with each <strong>of</strong> <strong>the</strong>se "side lobes" occurring as a row <strong>of</strong> ceiling lights comes<br />

into view <strong>of</strong> <strong>the</strong> light sensor. Looking closer, it is also evident that <strong>the</strong> side lobes grow<br />

and recede as <strong>the</strong> ball travels fur<strong>the</strong>r down <strong>the</strong> lane. Eventually <strong>the</strong>y disappear<br />

completely, as is evident in Figure 3-3, which zooms in on <strong>the</strong> last 800 msecs <strong>of</strong> <strong>the</strong> shot<br />

in Figure 3-1.<br />

The directionality <strong>of</strong> <strong>the</strong> module can be seen in <strong>the</strong> shape <strong>of</strong> Figure 3-3. The light level<br />

rapidly approaches a peak value when <strong>the</strong> light sensor is pointing almost directly at <strong>the</strong><br />

light source, and just as rapidly retreats as <strong>the</strong> light sensor rotates away from <strong>the</strong> light.<br />

Notice that <strong>the</strong> valleys <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m do not display this directional characteristic.<br />

Drawing from Fourier analysis techniques, <strong>the</strong> cyclic wave<strong>for</strong>m shown in Figure 3-1<br />

must have a fundamental frequency close to that <strong>of</strong> its major peaks, which resulted from<br />

each rotation <strong>of</strong> <strong>the</strong> ball. For a cyclic wave<strong>for</strong>m to exhibit such sharp peaks, <strong>the</strong>re must<br />

also be a significant amount <strong>of</strong> high-frequency harmonic content. The multiple local<br />

peaks present in each revolution, as shown in Figure 3-2, will be responsible <strong>for</strong> some<br />

significant intermediate harmonic content, as well [7].<br />

42


Light Level<br />

100<br />

90<br />

80<br />

70<br />

60<br />

50<br />

40<br />

30<br />

20<br />

10<br />

0<br />

Release<br />

Point<br />

-50 0 100 200 300 400 500 600 700 800<br />

Milliseconds (since Release)<br />

Figure 3-2: Raw Data Release Region (800 ms)<br />

By considering <strong>the</strong> nature <strong>of</strong> <strong>the</strong> ideal wave<strong>for</strong>m (an increasing frequency "chirp"), it is<br />

possible to deduce <strong>the</strong> shape <strong>of</strong> <strong>the</strong> frequency spectrum <strong>of</strong> <strong>the</strong> raw data. Since <strong>the</strong> lane is<br />

more heavily oiled near <strong>the</strong> foul line, <strong>the</strong> coefficient <strong>of</strong> friction is lower, and <strong>the</strong> ball will<br />

slide more. This sliding prevents <strong>the</strong> ball's linear momentum from being transferred into<br />

angular momentum, thus maintaining a fairly constant velocity <strong>for</strong> <strong>the</strong> first few<br />

revolutions <strong>of</strong> <strong>the</strong> ball. Thus, a fundamental frequency is established that is close to <strong>the</strong><br />

initial angular velocity at release.<br />

140<br />

120<br />

100<br />

Impact<br />

(Head Pin)<br />

Light Level<br />

80<br />

60<br />

40<br />

20<br />

0<br />

2000<br />

2100 2200 2300 2400 2500 2600 2700 2800<br />

Milliseconds (since Release)<br />

Figure 3-3: Raw Data Impact Region (800 ms)<br />

As <strong>the</strong> ball continues down <strong>the</strong> lane, it eventually gains angular velocity, and this change<br />

will be reflected in additional higher frequency content, albeit with a decreasing<br />

magnitude, in <strong>the</strong> frequency bands immediately adjacent to <strong>the</strong> fundamental frequency.<br />

Due to <strong>the</strong> harmonic content introduced by <strong>the</strong> sharp peaks and multiple local peaks,<br />

<strong>the</strong>re should be additional frequency content at integer multiples <strong>of</strong> <strong>the</strong> fundamental<br />

frequency, appearing as an attenuated "echo" <strong>of</strong> <strong>the</strong> shape <strong>of</strong> <strong>the</strong> frequency content<br />

around <strong>the</strong> fundamental. The characteristic frequency spectrum shape just described is<br />

shown in Figure 3-4.<br />

43


3.2 FILTERING THE RAW DATA<br />

Figure 3-4 is a capture <strong>of</strong> <strong>the</strong> "Spectrum" screen from <strong>the</strong> MASTER program, and<br />

demonstrates <strong>the</strong> use <strong>of</strong> digital signal processing (DSP) and, more specifically, <strong>the</strong><br />

application <strong>of</strong> <strong>the</strong> Fast Fourier Trans<strong>for</strong>m (FFT) to <strong>the</strong> raw data wave<strong>for</strong>m shown in<br />

Figure 3-1. By obtaining <strong>the</strong> frequency spectrum <strong>of</strong> <strong>the</strong> raw data, it is possible to identify<br />

and retain <strong>the</strong> fundamental frequencies, while removing <strong>the</strong> harmonic content and o<strong>the</strong>r<br />

noise. Applying <strong>the</strong> inverse FFT function (FFT -1 ) to <strong>the</strong> modified spectrum <strong>the</strong>n yields<br />

<strong>the</strong> filtered wave<strong>for</strong>m <strong>of</strong> Figure 3-5, which closely resembles <strong>the</strong> ideal wave<strong>for</strong>m that was<br />

previously described [7,10].<br />

Figure 3-4: MASTER "Spectrum" Screen Capture<br />

The MASTER program must be able to per<strong>for</strong>m this filtering automatically, without any<br />

user input. There<strong>for</strong>e, a reliable method <strong>for</strong> <strong>the</strong> MASTER to identify <strong>the</strong> fundamental<br />

frequency, and <strong>the</strong> band <strong>of</strong> frequencies <strong>of</strong> interest, must be developed. For this<br />

application, <strong>the</strong> fundamental frequency will be considered <strong>the</strong> component <strong>of</strong> <strong>the</strong> spectrum<br />

with <strong>the</strong> greatest magnitude in excess <strong>of</strong> 2.0 Hz.<br />

Looking at <strong>the</strong> spectrum <strong>of</strong> Figure 3-4, it is easy to identify <strong>the</strong> fundamental frequencies<br />

centered at ~7.5 Hz (disregarding <strong>the</strong> low-frequency components located below 2.0 Hz),<br />

with <strong>the</strong> first harmonic centered at twice <strong>the</strong> fundamental (~15 Hz). The magnitude <strong>of</strong><br />

44


<strong>the</strong> fundamental frequency has been normalized to 1.00, with <strong>the</strong> remainder <strong>of</strong> <strong>the</strong><br />

frequency components normalized relative to <strong>the</strong> fundamental frequency [7].<br />

Extracting <strong>the</strong> desired wave<strong>for</strong>m requires a bandpass filter that removes <strong>the</strong> unwanted<br />

low and high frequencies while leaving <strong>the</strong> frequencies <strong>of</strong> interest unaltered. It is<br />

important to note that <strong>the</strong> fundamental frequency will vary from bowler to bowler.<br />

Consequently, a bandpass filter with fixed upper and lower bounds is not appropriate.<br />

Instead, <strong>the</strong> MASTER must calculate <strong>the</strong> pass band dynamically <strong>for</strong> each bowler, and<br />

possibly <strong>for</strong> each individual shot.<br />

Several basic methods are appropriate <strong>for</strong> calculating <strong>the</strong> pass band limits. These limits<br />

can be set based on:<br />

• A percentage <strong>of</strong> <strong>the</strong> fundamental frequency.<br />

• A percentage <strong>of</strong> <strong>the</strong> magnitude <strong>of</strong> <strong>the</strong> fundamental frequency.<br />

• A combination <strong>of</strong> <strong>the</strong> first two.<br />

There are two separate limits imposed on <strong>the</strong> upper band <strong>of</strong> <strong>the</strong> filter. First, <strong>the</strong> pass band<br />

should not be allowed to extend into <strong>the</strong> harmonic portion <strong>of</strong> <strong>the</strong> spectrum, as this will<br />

introduce components <strong>of</strong> <strong>the</strong> noise <strong>the</strong> filter is intended to remove. Second, <strong>the</strong> ball<br />

reaches its highest angular velocity at <strong>the</strong> point <strong>of</strong> roll out, or at impact with <strong>the</strong> pins if it<br />

doesn't roll out, and it can revolve, at most, 26.7 times in 60 feet (if it did not skid at all).<br />

Combining that in<strong>for</strong>mation with <strong>the</strong> time <strong>of</strong> transit <strong>of</strong> <strong>the</strong> ball, it is possible to apply an<br />

upper bound to <strong>the</strong> maximum angular velocity <strong>of</strong> <strong>the</strong> ball and, <strong>the</strong>re<strong>for</strong>e, <strong>the</strong> high side <strong>of</strong><br />

<strong>the</strong> bandpass filter.<br />

The dashed orange line around <strong>the</strong> fundamental frequencies in Figure 3-4 represents <strong>the</strong><br />

adaptive bandpass filter <strong>for</strong> this spectrum. The MASTER program calculated <strong>the</strong>se limits<br />

automatically, using <strong>the</strong> third method listed above (through a combination <strong>of</strong> frequency<br />

percentages and magnitudes). The MASTER identifies <strong>the</strong> fundamental frequency, and<br />

<strong>the</strong>n extends <strong>the</strong> pass band limits on ei<strong>the</strong>r side <strong>of</strong> <strong>the</strong> fundamental until it finds an area <strong>of</strong><br />

"insignificant contribution". In this case, it finds a contiguous group <strong>of</strong> frequency<br />

components with magnitudes less than 0.1 (10% <strong>of</strong> <strong>the</strong> fundamental).<br />

The bandpass filter limits must also con<strong>for</strong>m to minimum and maximum percentages <strong>of</strong><br />

<strong>the</strong> fundamental frequency. The spectrum shown is typical <strong>for</strong> <strong>the</strong> author's bowling style<br />

and he has found that <strong>the</strong> minimum low cut-<strong>of</strong>f frequency can be set relatively close to<br />

<strong>the</strong> fundamental frequency (75% <strong>of</strong> <strong>the</strong> fundamental), while <strong>the</strong> high cut-<strong>of</strong>f frequency<br />

should be at least 125% <strong>of</strong> <strong>the</strong> fundamental, but no more than 175% <strong>of</strong> <strong>the</strong> fundamental.<br />

Of course, <strong>the</strong>se limits may differ <strong>for</strong> o<strong>the</strong>r bowlers.<br />

With <strong>the</strong> pass band limits identified, a digital bandpass filter can now be applied to <strong>the</strong><br />

spectrum. The magnitudes <strong>of</strong> <strong>the</strong> frequency components within <strong>the</strong> pass band are<br />

retained, while those outside <strong>the</strong> pass band are set to zero (0.00). Applying <strong>the</strong> inverse<br />

FFT function (FFT -1 ) to <strong>the</strong> altered spectrum yields <strong>the</strong> wave<strong>for</strong>m shown in Figure 3-5.<br />

This filtered sinusoidal wave<strong>for</strong>m describes <strong>the</strong> rotation <strong>of</strong> <strong>the</strong> finger hole that contained<br />

<strong>the</strong> SMARTDOT module and, since <strong>the</strong> entire surface <strong>of</strong> <strong>the</strong> ball rotates at <strong>the</strong> same rate<br />

as <strong>the</strong> finger hole, this wave<strong>for</strong>m also describes <strong>the</strong> rotation <strong>of</strong> <strong>the</strong> ball. The 'C' source<br />

code from <strong>the</strong> MASTER application <strong>for</strong> <strong>the</strong> adaptive bandpass filter implementation has<br />

been included in Appendix D.<br />

45


3.3 FINDING REVOLUTIONS AND ANGULAR VELOCITY<br />

Due to <strong>the</strong> regular sinusoidal nature <strong>of</strong> <strong>the</strong> filtered wave<strong>for</strong>m <strong>of</strong> Figure 3-5, it should be<br />

possible to develop methods that enable <strong>the</strong> MASTER to automatically "count" <strong>the</strong> total<br />

revolutions <strong>of</strong> <strong>the</strong> ball, find <strong>the</strong> period <strong>of</strong> each revolution, and calculate <strong>the</strong> angular<br />

velocity (rpms) <strong>for</strong> each <strong>of</strong> those revolutions.<br />

Figure 3-5: MASTER "Wave<strong>for</strong>m" Screen Capture<br />

Define a full revolution <strong>of</strong> <strong>the</strong> ball as starting at any local maximum or minimum <strong>of</strong> <strong>the</strong><br />

filtered wave<strong>for</strong>m, and ending at <strong>the</strong> sample be<strong>for</strong>e <strong>the</strong> next local maximum or minimum,<br />

i.e., two consecutive "peaks" or "valleys" define a revolution. The period <strong>of</strong> any<br />

revolution can be found by counting <strong>the</strong> samples between <strong>the</strong> two peaks or valleys that<br />

define that revolution, and dividing that count by <strong>the</strong> sampling frequency.<br />

Let j i,0 and j i,n-1 be <strong>the</strong> indices <strong>of</strong> <strong>the</strong> starting and ending samples <strong>for</strong> revolution i, and f be<br />

<strong>the</strong> sampling frequency (120 Hz in this case), <strong>the</strong>n<br />

t i = (i i,n-1 - i i,0 ) / f, where t i is <strong>the</strong> period, in seconds, <strong>for</strong> revolution i.<br />

The angular velocity (ω i ) during revolution i is simply <strong>the</strong> inverse <strong>of</strong> <strong>the</strong> period.<br />

ω i = 1 / t i .<br />

46


Since <strong>the</strong> fundamental frequency and <strong>the</strong> minimum and maximum frequencies <strong>of</strong> <strong>the</strong><br />

wave<strong>for</strong>m have already been found, and <strong>the</strong> manner in which <strong>the</strong> frequency changes over<br />

time (monotonically increasing, with a possible inflection point, if roll out occurred) is<br />

known, it is easy to develop a method to locate <strong>the</strong> local maxima and minima <strong>of</strong> <strong>the</strong><br />

filtered wave<strong>for</strong>m.<br />

This is accomplished by starting at <strong>the</strong> beginning <strong>of</strong> <strong>the</strong> filtered sample array (which<br />

includes <strong>the</strong> pre-samples), and working through <strong>the</strong> array, looking <strong>for</strong> inflection points<br />

(those points where <strong>the</strong> wave<strong>for</strong>m changes direction). Each time an inflection point (a<br />

local minimum or local maximum) is found, <strong>the</strong> index <strong>of</strong> <strong>the</strong> inflection point is recorded<br />

in a separate array. Due to <strong>the</strong> monotonically increasing nature <strong>of</strong> <strong>the</strong> frequency <strong>of</strong> <strong>the</strong><br />

wave<strong>for</strong>m, once <strong>the</strong> distance (<strong>the</strong> number <strong>of</strong> samples) between <strong>the</strong> first two inflection<br />

points is found, that distance can be used to help estimate <strong>the</strong> location <strong>of</strong> <strong>the</strong> next<br />

inflection point.<br />

There are still two fractional revolutions that must be dealt with: from release until <strong>the</strong><br />

first peak, and from <strong>the</strong> last peak (or valley) to pin impact. Both <strong>of</strong> <strong>the</strong>se fractional<br />

values can be extrapolated from <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> revolution immediate adjacent<br />

to each fractional value.<br />

Again let f be <strong>the</strong> sampling frequency (120 Hz), and j R be <strong>the</strong> index <strong>of</strong> <strong>the</strong> release sample,<br />

j 1,0 be <strong>the</strong> index <strong>of</strong> <strong>the</strong> sample that begins <strong>the</strong> first full revolution, j F be <strong>the</strong> index <strong>of</strong> <strong>the</strong><br />

sample that ends <strong>the</strong> last full revolution, and j P be <strong>the</strong> index <strong>of</strong> <strong>the</strong> pin impact sample, and<br />

ω 1 and ω F be <strong>the</strong> angular velocities during <strong>the</strong> first and last full revolutions <strong>of</strong> <strong>the</strong> ball,<br />

respectively, <strong>the</strong>n<br />

R R = ((j 1,0 - j R ) / f) · ω 1 ,<br />

and<br />

R P = ((j P - j F ) / f) · ω F ,<br />

where R R and R P are <strong>the</strong> fractional revolutions <strong>of</strong> <strong>the</strong> ball immediately after release and<br />

immediately be<strong>for</strong>e pin impact, respectively.<br />

The discussion in Section II established that <strong>the</strong>re would be at least 15-20 samples per<br />

revolution, allowing R R and R P to be resolved to at least 30° <strong>of</strong> rotation. Thus, it should<br />

be possible to count <strong>the</strong> total revolutions <strong>of</strong> <strong>the</strong> ball to within 0.1 revolutions, yielding a<br />

resolution <strong>of</strong> better than 1% <strong>for</strong> counts greater than 10 revolutions.<br />

Even though a resolution <strong>of</strong> 1% has been obtained in counting <strong>the</strong> total revolutions, <strong>the</strong><br />

angular velocity can only be resolved to about 4% <strong>for</strong> a rotation rate <strong>of</strong> 300 rpms, using<br />

<strong>the</strong> same technique. This discrepancy arises from <strong>the</strong> 120 Hz sampling frequency, which<br />

yields a time resolution <strong>of</strong> 8.333 msecs. Although <strong>the</strong> wave<strong>for</strong>m does not necessarily<br />

capture <strong>the</strong> exact peaks and valleys <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m, it does at least capture a pair <strong>of</strong><br />

consecutive samples that <strong>for</strong>m an 8.333 msec "window" around each true peak or valley.<br />

It is possible to get around <strong>the</strong> sampling-induced resolution issue by interpolating<br />

between each <strong>of</strong> those pairs <strong>of</strong> values to obtain very good approximations <strong>of</strong> <strong>the</strong> true<br />

peaks and valleys <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m.<br />

Figure 3-6 illustrates a simple interpolation technique <strong>for</strong> finding <strong>the</strong> "true" location <strong>of</strong><br />

<strong>the</strong> local maxima and minima <strong>of</strong> <strong>the</strong> filtered wave<strong>for</strong>m. By finding <strong>the</strong> intersection point<br />

<strong>of</strong> <strong>the</strong> slope lines <strong>of</strong> both sides <strong>of</strong> a peak or valley, <strong>the</strong> actual peaks and valleys can be<br />

accurately located. Two sample values are used to find each slope line. These samples<br />

47


are located on ei<strong>the</strong>r side <strong>of</strong> <strong>the</strong> mid-point between <strong>the</strong> top and bottom <strong>of</strong> each side <strong>of</strong> a<br />

peak or valley. Recall that <strong>the</strong> indices <strong>of</strong> <strong>the</strong> peak and valley samples were recorded<br />

earlier. The intersection <strong>of</strong> <strong>the</strong> resulting two slope lines is considered as <strong>the</strong> true peak or<br />

valley <strong>for</strong> subsequent calculations. Each adjacent peak-valley pair defines a halfrevolution<br />

<strong>of</strong> <strong>the</strong> ball, and <strong>the</strong> lateral distance between <strong>the</strong>m, measured in msecs, gives<br />

<strong>the</strong> period <strong>of</strong> that half-rotation. The angular velocity <strong>for</strong> that half-revolution is simply <strong>the</strong><br />

inverse <strong>of</strong> <strong>the</strong> period.<br />

140<br />

120<br />

Interpolated<br />

Peaks<br />

Half (180°)<br />

Revolutions<br />

Filtered Light Level<br />

100<br />

80<br />

60<br />

40<br />

20<br />

0<br />

2200<br />

Interpolated<br />

Valley<br />

2250 2300 2350 2400 2450 2500 2550 2600<br />

Milliseconds (since Release)<br />

Figure 3-6: Maxima and Minima Location Interpolation<br />

Having obtained <strong>the</strong> angular velocity <strong>for</strong> each revolution <strong>of</strong> <strong>the</strong> ball, a graph <strong>of</strong> <strong>the</strong><br />

angular velocity <strong>of</strong> <strong>the</strong> ball with respect to time can be drawn, as shown in Figure 3-7.<br />

The raw angular velocity values that were just found are shown in blue, with each entry<br />

representing one-half revolution <strong>of</strong> <strong>the</strong> ball.<br />

Obviously, something has gone awry. The angular velocity <strong>of</strong> <strong>the</strong> ball should be<br />

monotonically increasing, yet <strong>the</strong> graph <strong>of</strong> <strong>the</strong> raw values exhibits a noticeable<br />

oscillation, especially in <strong>the</strong> first two-thirds <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m. Since <strong>the</strong> angular velocity<br />

<strong>of</strong> <strong>the</strong> ball can't actually be rising and falling as indicated by <strong>the</strong> raw angular velocity<br />

graph in Figure 3-7, some o<strong>the</strong>r factor must be at work here.<br />

By looking back at Figures 2-2a, 3-2, and 3-3, <strong>the</strong> cause <strong>of</strong> this oscillation can be<br />

deduced. Figure 2-2a depicts <strong>the</strong> ball rolling down <strong>the</strong> lane under several rows <strong>of</strong> ceiling<br />

lights. As stated be<strong>for</strong>e, <strong>the</strong>se lights act as a point source, ra<strong>the</strong>r than as a uni<strong>for</strong>mly<br />

distributed source <strong>of</strong> light. As <strong>the</strong> SMARTDOT module rotates up towards <strong>the</strong> ceiling, <strong>the</strong><br />

light sensor faces backwards (toward <strong>the</strong> foul line) and "sees" <strong>the</strong> ceiling lights that it has<br />

already passed under. These lights are detected earlier than <strong>the</strong>y "should" be, i.e., be<strong>for</strong>e<br />

<strong>the</strong> light sensor has rotated directly toward <strong>the</strong> ceiling. Consequently, <strong>the</strong> peak light level<br />

<strong>for</strong> that revolution occurs earlier than it should.<br />

As <strong>the</strong> ball continues down <strong>the</strong> lane, <strong>the</strong> module rotates toward <strong>the</strong> ceiling, and if it is not<br />

directly under a light, <strong>the</strong> light level gets darker (ra<strong>the</strong>r than brighter), and a dip occurs<br />

where <strong>the</strong> peak is expected to be. As <strong>the</strong> ball continues to rotate and travel down <strong>the</strong><br />

lane, <strong>the</strong> module eventually aligns with a different ceiling light and ano<strong>the</strong>r local peak is<br />

created. Figure 3-2 shows this phenomenon quite clearly. As <strong>the</strong> ball continues down<br />

<strong>the</strong> lane, <strong>the</strong>se point sources eventually combine to look like a single light source, hence<br />

<strong>the</strong> lack <strong>of</strong> "side lobes" in Figure 3-3.<br />

48


Figure 3-7: MASTER "<strong>Analysis</strong>" Screen Capture<br />

Depending on <strong>the</strong> position <strong>of</strong> <strong>the</strong> ball relative to <strong>the</strong> ceiling lights, and <strong>the</strong> current<br />

orientation <strong>of</strong> <strong>the</strong> module in relation to <strong>the</strong> ceiling, <strong>the</strong> directionality <strong>of</strong> <strong>the</strong> light sensor<br />

can cause it to "see" a ceiling light too early, while at o<strong>the</strong>r times it must rotate longer<br />

be<strong>for</strong>e encountering <strong>the</strong> next ceiling light. This action imposes a Doppler-like effect on<br />

<strong>the</strong> wave<strong>for</strong>m <strong>the</strong> module captures. The differences must average out, since <strong>the</strong> ball will<br />

eventually transition from approaching a specific light source to moving away from that<br />

same source, but <strong>the</strong> effects that this Doppler effect has imprinted on <strong>the</strong> filtered<br />

wave<strong>for</strong>m must still be dealt with.<br />

Referring to Figure 3-7 again, <strong>the</strong> green line superimposed over <strong>the</strong> blue raw angular<br />

velocity graph is a 5 th -order polynomial curve created by a generalized least squares<br />

curve-fitting function, using <strong>the</strong> raw angular velocity data as input [10,11]. This line<br />

yields <strong>the</strong> expected shape <strong>for</strong> <strong>the</strong> angular velocity curve. This is a "simple" fix that<br />

presents a good approximation <strong>for</strong> <strong>the</strong> actual response <strong>of</strong> <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> ball.<br />

However, this method has its limitations. Unlike <strong>the</strong> actual monotonic response <strong>of</strong> <strong>the</strong><br />

ball, <strong>the</strong> polynomial curve-fitting scheme allows <strong>the</strong> angular velocity to initially dip<br />

following release, and <strong>the</strong>n recover as <strong>the</strong> ball travels down <strong>the</strong> lane.<br />

The 'C' source code from <strong>the</strong> MASTER application <strong>for</strong> locating <strong>the</strong> revolutions and<br />

finding <strong>the</strong> angular velocities has been included in Appendix D.<br />

49


3.4 LINEAR VELOCITY, DISTANCE, AND COEFFICIENT OF FRICTION<br />

If <strong>the</strong> manner in which <strong>the</strong> linear velocity <strong>of</strong> <strong>the</strong> ball changes over time can be<br />

determined, it is <strong>the</strong>n possible to determine <strong>the</strong> initial (release) velocity, which is one <strong>of</strong><br />

<strong>the</strong> major execution variables that a bowler must learn to control. The ball could <strong>the</strong>n be<br />

located (along with each revolution) on <strong>the</strong> lane relative to <strong>the</strong> foul line, ra<strong>the</strong>r than<br />

relative to <strong>the</strong> time <strong>of</strong> release. This would allow <strong>the</strong> determination <strong>of</strong> <strong>the</strong> ball l<strong>of</strong>t<br />

distance (ano<strong>the</strong>r major execution variable). Having found <strong>the</strong> conversion from time<br />

(sample index) to distance, <strong>the</strong> coefficient <strong>of</strong> friction acting between <strong>the</strong> ball and <strong>the</strong> lane<br />

can also be found, which can be used to infer <strong>the</strong> distribution <strong>of</strong> oil on <strong>the</strong> lane.<br />

Since <strong>the</strong> length <strong>of</strong> <strong>the</strong> lane and <strong>the</strong> time that it took <strong>for</strong> <strong>the</strong> ball to travel from <strong>the</strong> foul<br />

line to <strong>the</strong> pins are both known, it is easy to calculate <strong>the</strong> average speed (linear velocity)<br />

<strong>of</strong> <strong>the</strong> ball. But this average value reveals little about <strong>the</strong> initial velocity that <strong>the</strong> bowler<br />

applied to <strong>the</strong> ball at release, except that <strong>the</strong> release velocity must have been greater than<br />

<strong>the</strong> average velocity (since <strong>the</strong> linear velocity <strong>of</strong> <strong>the</strong> ball is always decreasing).<br />

Calculating <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> ball was fairly straight <strong>for</strong>ward, once <strong>the</strong><br />

wave<strong>for</strong>m had been filtered. Even <strong>the</strong> Doppler effect created by <strong>the</strong> ball traveling<br />

underneath multiple discrete light sources is fairly simple to deal with. However,<br />

recovering <strong>the</strong> instantaneous linear velocity from <strong>the</strong> ball's average linear velocity and <strong>the</strong><br />

angular velocity <strong>of</strong> each revolution presents an interesting, challenging, and non-trivial<br />

problem.<br />

That task is currently <strong>the</strong> major focus <strong>of</strong> <strong>the</strong> ongoing research. One method that is based<br />

on a simplistic <strong>for</strong>m <strong>of</strong> energy conservation has already been developed. It relies on <strong>the</strong><br />

assumption that no energy is lost as friction works to transfer energy from <strong>the</strong> linear<br />

momentum <strong>of</strong> <strong>the</strong> ball to <strong>the</strong> angular momentum <strong>of</strong> <strong>the</strong> ball. The same method can be<br />

generalized to allow <strong>for</strong> a constant (but arbitrary) percentage <strong>of</strong> <strong>the</strong> energy transferred<br />

from <strong>the</strong> linear momentum to be lost to friction.<br />

To this point in <strong>the</strong> discussion, all <strong>of</strong> <strong>the</strong> MASTER screen captures, with <strong>the</strong> exception <strong>of</strong><br />

Figure 3-7, contained graphs with respect to time, ra<strong>the</strong>r than distance. Figure 3-7<br />

contains graphs <strong>of</strong> both <strong>the</strong> angular and linear velocities <strong>of</strong> <strong>the</strong> ball with respect to<br />

distance from <strong>the</strong> foul line, and represents <strong>the</strong> current state <strong>of</strong> <strong>the</strong> "<strong>Analysis</strong>" portion <strong>of</strong><br />

<strong>the</strong> MASTER program, which relies on <strong>the</strong> simplified version <strong>of</strong> <strong>the</strong> linear velocity<br />

extraction function mentioned above.<br />

Throughout <strong>the</strong> paper, it has been assumed that friction is <strong>the</strong> only <strong>for</strong>ce <strong>of</strong> any<br />

significance acting on <strong>the</strong> ball. The results <strong>of</strong> <strong>the</strong> frictional <strong>for</strong>ce are apparent by<br />

observing <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> ball increase as friction acts to resolve <strong>the</strong><br />

discrepancy between <strong>the</strong> initial linear and angular velocities <strong>of</strong> <strong>the</strong> ball.<br />

Assume, <strong>for</strong> <strong>the</strong> moment, that <strong>the</strong> ball loses no energy throughout <strong>the</strong> course <strong>of</strong> a shot<br />

(<strong>the</strong> total kinetic energy and <strong>the</strong> total momentum <strong>of</strong> <strong>the</strong> ball remain constant). The<br />

conclusion can <strong>the</strong>n be drawn that all <strong>of</strong> <strong>the</strong> momentum <strong>the</strong> ball gains from <strong>the</strong> increase<br />

in its angular velocity must have been transferred from <strong>the</strong> ball's linear momentum, i.e.,<br />

any increase in angular momentum must be exactly <strong>of</strong>fset by a decrease in linear<br />

momentum.<br />

Having assumed constant energy, <strong>the</strong> energy <strong>of</strong> <strong>the</strong> ball <strong>for</strong> each revolution <strong>of</strong> <strong>the</strong> shot<br />

must remain <strong>the</strong> same. Since <strong>the</strong> angular velocity (and thus <strong>the</strong> angular momentum) <strong>for</strong><br />

each revolution <strong>of</strong> <strong>the</strong> ball has already been found, if <strong>the</strong> energy <strong>for</strong> that revolution is<br />

50


known, <strong>the</strong> linear momentum (and thus <strong>the</strong> linear velocity) <strong>for</strong> that revolution can also be<br />

found. Once <strong>the</strong> linear velocity <strong>for</strong> each revolution is known, <strong>the</strong> location <strong>of</strong> each<br />

revolution <strong>of</strong> <strong>the</strong> ball and <strong>the</strong> ball l<strong>of</strong>t distance, relative to <strong>the</strong> foul line, can be found.<br />

Putting those assumptions and deductions into more <strong>for</strong>mal terms, <strong>the</strong> assumption that <strong>the</strong><br />

ball does not lose energy over time means that <strong>the</strong> ball possesses constant energy<br />

throughout its trip to <strong>the</strong> pins, and that its energy at any instant is equal to its energy at<br />

any o<strong>the</strong>r instant [8].<br />

The total energy <strong>of</strong> <strong>the</strong> ball (E) is <strong>the</strong> sum <strong>of</strong> its potential (P) and kinetic (K) energies:<br />

E = P + K.<br />

Since <strong>the</strong> ball rolls on a flat, level lane surface, <strong>the</strong>re is no potential energy (P = 0), and<br />

E = K.<br />

Since it is assumed that <strong>the</strong> ball has constant energy from its release at <strong>the</strong> foul line to its<br />

impact with <strong>the</strong> pins,<br />

K R = K i = K P ,<br />

where K i is <strong>the</strong> energy <strong>of</strong> <strong>the</strong> ball <strong>for</strong> each revolution i between release (K R ) and pin<br />

impact (K P ).<br />

The assumption <strong>of</strong> constant energy implies that energy losses due to vibration, heat, wind<br />

resistance, and noise generation are negligible. There<strong>for</strong>e <strong>the</strong> only components <strong>of</strong> <strong>the</strong><br />

energy <strong>of</strong> <strong>the</strong> ball are its angular momentum (K ω ) and its linear momentum (K v ), thus<br />

K = K ω + K v .<br />

The angular momentum <strong>of</strong> an object with angular velocity ω is given by<br />

K ω = ½Iω 2 ,<br />

where I is <strong>the</strong> moment <strong>of</strong> inertia <strong>of</strong> <strong>the</strong> rotating object.<br />

The moment <strong>of</strong> inertia I <strong>of</strong> a bowling ball with mass m and radius R falls somewhere<br />

between <strong>the</strong> moments <strong>of</strong> inertia <strong>of</strong> a solid sphere and a spherical shell, such that<br />

2 / 5 mR 2 < I < 2 / 3 mR 2 .<br />

The actual moment <strong>of</strong> inertia <strong>for</strong> a given ball will fall between <strong>the</strong>se two values, but<br />

closer to <strong>the</strong> first, since <strong>the</strong> density <strong>of</strong> a bowling ball in <strong>the</strong> 12-16 pound range is fairly<br />

constant across <strong>the</strong> radius <strong>of</strong> <strong>the</strong> ball [8].<br />

The 2 / 5 R 2 term is a constant, where R is <strong>the</strong> radius <strong>of</strong> <strong>the</strong> ball (nominally 4.3"), so if<br />

k = 2 / 5 R 2 = 0.4 · (0.3583 ft) 2 = 0.05136 ft 2 ,<br />

<strong>the</strong>n<br />

K ω = ½kmω 2 .<br />

The linear momentum <strong>of</strong> an object with mass m and linear velocity v is<br />

K v = ½mv 2 .<br />

There<strong>for</strong>e, <strong>the</strong> total kinetic energy K <strong>of</strong> <strong>the</strong> ball, under <strong>the</strong> assumptions, is given by<br />

K = ½mv 2 + ½kmω 2<br />

= ½m(v 2 + kω 2 ), where k = 0.05136 ft 2 .<br />

51


3.4.1 Finding <strong>the</strong> Linear Velocity <strong>of</strong> <strong>the</strong> Ball<br />

The following values have already ei<strong>the</strong>r been measured or calculated:<br />

1) The total distance D T <strong>the</strong> ball traveled from release to pin impact (nominally 60<br />

feet from foul line to head pin).<br />

2) The time T it took <strong>for</strong> <strong>the</strong> ball to travel D T feet.<br />

3) The average linear velocity <strong>of</strong> <strong>the</strong> ball v ave = D T / T.<br />

4) The number <strong>of</strong> revolutions R T that occurred in time T.<br />

5) The period t i and angular velocity ω i = 1 / t i <strong>of</strong> each revolution i in R T .<br />

Using <strong>the</strong>se values, an equation can be developed that gives <strong>the</strong> linear velocity v i <strong>for</strong> each<br />

revolution i <strong>of</strong> <strong>the</strong> ball.<br />

Recalling <strong>the</strong> previous calculations <strong>for</strong> R R and R P (<strong>the</strong> fractional revolutions at release and<br />

pin impact), D T can be represented as<br />

D T = R R · (v 1 t 1 ) + v 1 t 1 + v 2 t 2 +....+ v n t n + R P · (v n t n )<br />

= (1+ R R ) · v 1 t 1 + v 1 t 1 + v 2 t 2 +....+ v n t n + (1 + R P ) · v n t n .<br />

By letting t 1 ' = (1 + R R ) · t 1 , t n ' = (1 + R P ) · t n , and t i ' = t i <strong>for</strong> 1 < i < n, <strong>the</strong> above equation<br />

can be reduced to <strong>the</strong> summation<br />

R T<br />

D T = Σ (v i t i ').<br />

i=1<br />

Recall <strong>the</strong> assumption that <strong>the</strong> kinetic energy K <strong>of</strong> <strong>the</strong> ball remains constant from release<br />

to pin impact, and let K i be <strong>the</strong> kinetic energy <strong>of</strong> <strong>the</strong> ball during revolution i. Then<br />

K i = m / 2 (v i + kω 2 i ), where ω i = 1/t i '<br />

and<br />

K 1 = K i = K n , <strong>for</strong> 1 ≤ i ≤ n.<br />

From <strong>the</strong> above,<br />

m / 2 (v 2 1 + kω 2 1 ) = m / 2 (v 2 i + kω 2 i ),<br />

and solving <strong>for</strong> v i in terms <strong>of</strong> v 1 ,<br />

v i = (v 2 1 + k(ω 2 1 - ω 2 i )) ½ .<br />

For constant energy, no energy is lost to friction, and <strong>the</strong> above equation reveals that<br />

friction acts solely to transfer energy from linear momentum to angular momentum. An<br />

expression can now be obtained <strong>for</strong> each velocity v i in terms <strong>of</strong> v 1 . Substituting that<br />

expression into <strong>the</strong> previous summation yields<br />

R T<br />

D T = Σ (v 2 1 + k(ω 2 1 - ω 2 i )) ½ · t i '.<br />

i=1<br />

The value <strong>of</strong> D T is nominally 60 feet, and this summation can be used in developing a<br />

converging iterative solution <strong>for</strong> v 1 . The remaining values <strong>for</strong> v i can be generated from<br />

<strong>the</strong> value found <strong>for</strong> v 1 .<br />

52


In order to find <strong>the</strong> value <strong>for</strong> v 1 , an initial "seed" value v is needed to start <strong>the</strong> iteration. A<br />

good first guess <strong>for</strong> v is <strong>the</strong> average linear velocity v ave <strong>of</strong> <strong>the</strong> ball,<br />

v ave = D T / T,<br />

The actual value <strong>for</strong> v 1 (<strong>the</strong> initial velocity) is greater than v ave , since <strong>the</strong> ball is constantly<br />

slowing down after release. Plugging v ave into <strong>the</strong> above summation will result in a value<br />

D' that is less than D T . D' can be used to arrive at <strong>the</strong> next guess, as follows:<br />

v' = v + (D T - D') / R T .<br />

Iteration continues in this fashion (guess, calculate, adjust), until <strong>the</strong> difference between<br />

D T and D' does not exceed a predefined threshold, at which point a value <strong>for</strong> v 1 has been<br />

found. The velocities <strong>for</strong> <strong>the</strong> remaining revolutions are obtained by plugging v 1 and <strong>the</strong><br />

values <strong>for</strong> ω 1 and ω i into<br />

v i = (v 2 1 + k(ω 2 1 - ω 2 i )) ½ .<br />

3.4.2 Finding <strong>the</strong> Distance from <strong>the</strong> Foul Line<br />

Using <strong>the</strong> values <strong>for</strong> v i from this equation, a method <strong>for</strong> converting time (sample index) to<br />

distance <strong>for</strong> each sample in <strong>the</strong> wave<strong>for</strong>m can be derived. With such a conversion, it is<br />

possible to find <strong>the</strong> distance <strong>the</strong> ball has traveled at any time in <strong>the</strong> wave<strong>for</strong>m, and also to<br />

graph <strong>the</strong> linear and angular velocities <strong>of</strong> <strong>the</strong> ball with respect to distance. The location<br />

<strong>of</strong> each revolution on <strong>the</strong> lane relative to <strong>the</strong> foul line, and <strong>the</strong> ball l<strong>of</strong>t distance (<strong>the</strong><br />

distance <strong>the</strong> ball traveled be<strong>for</strong>e impacting <strong>the</strong> lane) can also be determined.<br />

Recall that<br />

R T<br />

D T = Σ (v i t i ').<br />

i=1<br />

By per<strong>for</strong>ming <strong>the</strong> summation from i = 1 to R i-1 , such that<br />

R i-1<br />

D i = Σ (v i t i '),<br />

i=1<br />

D i <strong>the</strong>n gives <strong>the</strong> distance from <strong>the</strong> foul line where revolution i started.<br />

The value <strong>for</strong> each <strong>of</strong> <strong>the</strong> v i 's was found previously, and v i can now be assigned to each<br />

sample <strong>of</strong> revolution i. Since <strong>the</strong> distance D i from <strong>the</strong> foul line to <strong>the</strong> start <strong>of</strong> each<br />

revolution i has also been found, <strong>the</strong> distance <strong>for</strong> each sample in revolution i, relative to<br />

<strong>the</strong> foul line can be calculated.<br />

Define s i,0 to be <strong>the</strong> first sample <strong>of</strong> revolution i, so that s i,0 , s i,1 , …, s i,n-1 are <strong>the</strong> n samples<br />

<strong>of</strong> revolution i and let d i,j be <strong>the</strong> corresponding distance <strong>for</strong> sample s i,j . A method <strong>for</strong><br />

finding <strong>the</strong> velocity v i and <strong>the</strong> distance D i <strong>for</strong> s i,0 has already been given. Assuming a<br />

constant velocity during revolution i, <strong>the</strong> distances <strong>for</strong> <strong>the</strong> remaining samples <strong>of</strong><br />

revolution i can be generated from <strong>the</strong> equation<br />

d i,j = D i + (j / f) · v i ,<br />

where 0 ≤ j < n, and f is <strong>the</strong> sampling frequency (currently 120 Hz).<br />

Thus, a conversion from time (sample index) to distance <strong>for</strong> each sample has been found,<br />

and it is now possible to graph <strong>the</strong> linear and angular velocities <strong>of</strong> <strong>the</strong> ball with respect to<br />

distance from <strong>the</strong> foul line, as well as indicate <strong>the</strong> location <strong>of</strong> each impact.<br />

53


3.4.3 Finding <strong>the</strong> Coefficient <strong>of</strong> Friction<br />

The coefficient <strong>of</strong> friction can be recovered from <strong>the</strong> previous calculations. Under <strong>the</strong><br />

assumptions, <strong>the</strong> only active <strong>for</strong>ce is <strong>the</strong> <strong>for</strong>ce due to friction acting between <strong>the</strong> ball and<br />

<strong>the</strong> lane, and that <strong>for</strong>ce acts solely to transfer linear momentum to angular momentum.<br />

Since <strong>the</strong> changes in angular and linear momentum <strong>for</strong> each sample are known, <strong>the</strong><br />

frictional <strong>for</strong>ce required to generate those changes can be found.<br />

For any revolution i, <strong>the</strong> frictional <strong>for</strong>ce F µi acting during i is given by<br />

Fµi = m / 2 · k(ω 2 i - ω 2 i-1 ) / (D i - D i-1 ) = m / 2 · (v 2 i - v 2 i-1 ) / (D i - D i-1 ).<br />

The coefficient <strong>of</strong> friction µ i between <strong>the</strong> ball and <strong>the</strong> lane <strong>for</strong> revolution i is <strong>the</strong>n<br />

µ i = Fµi / mg, where g is <strong>the</strong> acceleration due to gravity.<br />

Similarly, <strong>the</strong> frictional <strong>for</strong>ce <strong>for</strong> any sample j <strong>of</strong> revolution i can be found from<br />

Fµi,j = m / 2 · k(ω 2 i,j - ω 2 i,j-1 ) / (d i,j - d i,j-1 ) = m / 2 · (v 2 i,j - v 2 i,j-1 ) / (d i,j - d i,j-1 ).<br />

The coefficient <strong>of</strong> friction µ i,j between <strong>the</strong> ball and <strong>the</strong> lane <strong>for</strong> any sample j <strong>of</strong> revolution<br />

i is <strong>the</strong>n given by<br />

µ i,j = Fµi,j / mg.<br />

Using this result, <strong>the</strong>re is now enough in<strong>for</strong>mation to graph <strong>the</strong> coefficient <strong>of</strong> friction<br />

between <strong>the</strong> ball and <strong>the</strong> lane with respect to <strong>the</strong> distance from <strong>the</strong> foul line.<br />

54


3.5 ASSUMPTIONS AND ERROR ANALYSIS<br />

The derivations behind <strong>the</strong> MASTER calculations presented in <strong>the</strong> previous discussion<br />

rely heavily on several basic assumptions, some <strong>of</strong> which have already appeared in o<strong>the</strong>r<br />

sections throughout <strong>the</strong> course <strong>of</strong> <strong>the</strong> paper. This section presents <strong>the</strong> analysis<br />

assumptions in detail, along with an assessment <strong>of</strong> <strong>the</strong>ir possible error contributions.<br />

3.5.1 Distance<br />

Throughout <strong>the</strong> paper, it has been assumed that <strong>the</strong> ball travels 60 feet - <strong>the</strong> distance from<br />

<strong>the</strong> foul line to <strong>the</strong> head pin. Under normal circumstances, release <strong>of</strong> <strong>the</strong> ball occurs close<br />

to <strong>the</strong> foul line, and <strong>the</strong> first pin <strong>the</strong> ball encounters is <strong>the</strong> head pin (at least on <strong>the</strong> first<br />

ball <strong>of</strong> any frame). It is time to take a closer look at what this assumption entails.<br />

• The ball is released at <strong>the</strong> foul line: An error factor is introduced in <strong>the</strong> average<br />

linear velocity calculation if <strong>the</strong> ball is released behind <strong>the</strong> foul line (<strong>the</strong> actual<br />

velocity will be higher than calculated), or beyond <strong>the</strong> foul line (<strong>the</strong> actual<br />

velocity will be lower than calculated). Generally, <strong>the</strong> bowler releases <strong>the</strong> ball at,<br />

or just beyond, <strong>the</strong> foul line. For a legal delivery, no part <strong>of</strong> <strong>the</strong> bowler's body<br />

may touch <strong>the</strong> lane beyond <strong>the</strong> foul line. This presents a physical limitation on<br />

release beyond <strong>the</strong> foul line <strong>of</strong> approximately 12 inches.<br />

Additional error is possible from behind <strong>the</strong> foul line, usually resulting from a<br />

noticeable lapse in execution on <strong>the</strong> bowler's part (dropping <strong>the</strong> ball, releasing <strong>the</strong><br />

ball early, or stopping short <strong>of</strong> <strong>the</strong> foul line). Although <strong>the</strong> module can not detect<br />

<strong>the</strong> absolute point <strong>of</strong> release, it does indicate when <strong>the</strong> ball hit <strong>the</strong> lane, in relation<br />

to release. In addition, <strong>the</strong> bowler easily recognizes when <strong>the</strong>se major lapses in<br />

execution occur, and can take note <strong>of</strong> <strong>the</strong>m.<br />

The nominal margin <strong>of</strong> error at <strong>the</strong> point <strong>of</strong> release is estimated to be ±6", with <strong>the</strong><br />

vast majority <strong>of</strong> releases occurring within a ±3" range.<br />

• The ball hits <strong>the</strong> head pin at a fixed location: At <strong>the</strong> o<strong>the</strong>r end <strong>of</strong> <strong>the</strong> lane, <strong>the</strong><br />

ball can hit <strong>the</strong> head pin in different spots - head on, or on <strong>the</strong> right or left side. A<br />

pin is 4½" in diameter at <strong>the</strong> height at which <strong>the</strong> ball contacts it, and <strong>the</strong> center <strong>of</strong><br />

<strong>the</strong> pin is located 60' ±½" from <strong>the</strong> foul line. A ball is nominally 8½" in diameter.<br />

Assuming <strong>the</strong> ball is released with its center over <strong>the</strong> foul line and it hits <strong>the</strong> head<br />

pin dead center, it must travel 59' 5" to 59' 6" from <strong>the</strong> point <strong>of</strong> release. If <strong>the</strong> ball<br />

barely grazes <strong>the</strong> right or left side <strong>of</strong> <strong>the</strong> head pin, <strong>the</strong> ball traveled at least 59'<br />

11½" to 60' ½". A solid pocket hit (<strong>the</strong> goal <strong>of</strong> any potential strike delivery) falls<br />

halfway between <strong>the</strong>se two ranges, so <strong>the</strong> expected distance from <strong>the</strong> foul line that<br />

<strong>the</strong> initial pin impact should occur is 59' 8¾". There<strong>for</strong>e, <strong>the</strong> margin <strong>of</strong> error<br />

introduced in hitting <strong>the</strong> head pin is ±3¾"<br />

If <strong>the</strong> ball misses <strong>the</strong> head pin, it must travel at least an additional 10.4" to get to<br />

<strong>the</strong> next pin, and <strong>the</strong> same error factors as <strong>for</strong> hitting <strong>the</strong> head pin come into play.<br />

The bowler could take note <strong>of</strong> <strong>the</strong> first pin that was hit - <strong>the</strong> head pin, <strong>the</strong> 2/3 pins,<br />

<strong>the</strong> 4/6 pins or <strong>the</strong> 7/10 pins, and <strong>the</strong> analysis s<strong>of</strong>tware could again adjust <strong>for</strong> <strong>the</strong><br />

difference. Bowlers readily identify <strong>the</strong> location <strong>of</strong> <strong>the</strong> ball based on <strong>the</strong> board it<br />

is on when it hits <strong>the</strong> pins. This in<strong>for</strong>mation could be used to better locate <strong>the</strong> ball<br />

at pin impact, along with <strong>the</strong> first pin hit, and this error could be reduced to<br />

approximately ±1".<br />

55


• The ball takes <strong>the</strong> shortest path from <strong>the</strong> foul line to <strong>the</strong> head pin: In<br />

actuality, <strong>the</strong> ball is rarely thrown straight at <strong>the</strong> head pin from <strong>the</strong> center <strong>of</strong> <strong>the</strong><br />

foul line. Instead <strong>the</strong> ball is rolled with some amount <strong>of</strong> hook, and is released<br />

from some place o<strong>the</strong>r than <strong>the</strong> center <strong>of</strong> <strong>the</strong> lane, and is initially directed<br />

somewhat toward <strong>the</strong> right gutter (<strong>for</strong> a right-handed bowler). If <strong>the</strong> ball were<br />

thrown from <strong>the</strong> outside edge <strong>of</strong> <strong>the</strong> right gutter in a straight line 45-50 feet down<br />

<strong>the</strong> lane, and <strong>the</strong>n suddenly hooked straight toward <strong>the</strong> pocket, it would travel an<br />

extra 7 / 8 ". At <strong>the</strong> o<strong>the</strong>r extreme, if <strong>the</strong> ball were released at <strong>the</strong> left gutter, and<br />

traced a regular arc to <strong>the</strong> right gutter at 30 feet, and <strong>the</strong>n back to <strong>the</strong> head pin, it<br />

would travel an extra 6". This is an extreme amount <strong>of</strong> hook, but will be factored<br />

into <strong>the</strong> error budget as ±3".<br />

• The ball and pins each have fixed diameters: The ABC maintains tight control<br />

over <strong>the</strong> allowed dimensions <strong>of</strong> <strong>the</strong> ball and <strong>the</strong> pins. The ball has a nominal<br />

diameter <strong>of</strong> 8.547 ±0.047", resulting in a nominal circumference <strong>of</strong> 26.853<br />

±0.149". The diameter <strong>of</strong> <strong>the</strong> ball contributes a negligible error. However, <strong>the</strong><br />

circumference <strong>of</strong> <strong>the</strong> ball, which is used in later calculations to estimate <strong>the</strong><br />

amount <strong>of</strong> sliding and <strong>the</strong> coefficient <strong>of</strong> friction, could be multiplied by <strong>the</strong> total<br />

number <strong>of</strong> revolutions <strong>the</strong> ball makes during a shot, which can total 20 or more.<br />

In this case, <strong>the</strong> error contribution due to <strong>the</strong> ball's circumference could contribute<br />

up to ±3".<br />

At <strong>the</strong> height that <strong>the</strong> ball strikes a bowling pin (8.77"), <strong>the</strong> pin must have a<br />

nominal diameter <strong>of</strong> 4.766 ±0.031". This is an insignificant contribution to <strong>the</strong><br />

error calculations.<br />

Combining <strong>the</strong> three significant errors (at <strong>the</strong> foul line, at <strong>the</strong> pins, and <strong>the</strong> ball path),<br />

yields a total <strong>of</strong> approximately ±12" <strong>of</strong> error in <strong>the</strong> distance <strong>the</strong> ball travels. For a<br />

nominal distance <strong>of</strong> 60 feet, <strong>the</strong> total error works out to ±1.67%. For a ball thrown at 15<br />

mph, this error will manifest itself in <strong>the</strong> velocity calculations as a difference <strong>of</strong> 0.25<br />

mph.<br />

This error could be reduced fur<strong>the</strong>r by supplying <strong>the</strong> appropriate in<strong>for</strong>mation to <strong>the</strong><br />

MASTER program. The bowler could input <strong>the</strong>ir normal release point as a configuration<br />

parameter. Then, during normal play, <strong>the</strong>y would indicate <strong>the</strong> approximate board where<br />

<strong>the</strong> ball was released, <strong>the</strong> extreme right (or left) board that <strong>the</strong> ball crossed on its path to<br />

<strong>the</strong> pins, and <strong>the</strong> first pin <strong>the</strong> ball hit, along with <strong>the</strong> type <strong>of</strong> hit (head on, right, left, graze,<br />

etc.) and/or <strong>the</strong> board <strong>the</strong> ball was on at <strong>the</strong> time <strong>of</strong> impact. The analysis s<strong>of</strong>tware would<br />

utilize this in<strong>for</strong>mation in its calculations. This type <strong>of</strong> input could reduce <strong>the</strong> margin <strong>of</strong><br />

error to less than 6", increasing <strong>the</strong> velocity resolution to 0.1 mph.<br />

3.5.2 Time<br />

Ano<strong>the</strong>r assumption is that <strong>the</strong> microprocessor's clock is accurate. If <strong>the</strong> clock is based<br />

on a quartz crystal, it will be accurate over temperature to at least ±200 ppm (0.02%), or<br />

600 µsecs over a 3-second shot, which is an insignificant error contribution. If a ceramic<br />

resonator is used (because it is much cheaper and much more durable), a ±2% error over<br />

temperature is possible, which is ±60 msecs over a 3 second shot. This is not<br />

insignificant, and would be additive to <strong>the</strong> distance error in any calculation <strong>of</strong> velocity.<br />

However, this error could be calibrated out by measuring <strong>the</strong> actual clock rate with a<br />

more precise clock and compensating <strong>for</strong> <strong>the</strong> difference in <strong>the</strong> MASTER s<strong>of</strong>tware.<br />

56


3.5.3 External Forces and Friction<br />

The major assumption is that <strong>the</strong> frictional <strong>for</strong>ce between <strong>the</strong> ball and <strong>the</strong> lane is <strong>the</strong> only<br />

<strong>for</strong>ce <strong>of</strong> any significance acting on <strong>the</strong> ball following release. Losses due to noise,<br />

vibration, and aerodynamic drag are considered negligible. A fur<strong>the</strong>r assumption is that<br />

<strong>the</strong> <strong>for</strong>ce due to friction acts on <strong>the</strong> ball in such a way as to translate its linear momentum<br />

to angular momentum.<br />

The ball is released with an initial linear velocity that exceeds <strong>the</strong> ball's angular velocity.<br />

That is, <strong>the</strong> ball travels fur<strong>the</strong>r during one revolution <strong>of</strong> <strong>the</strong> ball than one circumference<br />

<strong>of</strong> <strong>the</strong> ball. This difference causes <strong>the</strong> ball to skid (slide). Also, generally speaking, <strong>the</strong><br />

axis <strong>of</strong> rotation <strong>of</strong> <strong>the</strong> ball is nei<strong>the</strong>r parallel to <strong>the</strong> surface, nor is it normal to <strong>the</strong><br />

direction <strong>of</strong> <strong>the</strong> lane. The resolution <strong>of</strong> <strong>the</strong>se differences as <strong>the</strong> ball traverses <strong>the</strong> lane<br />

causes <strong>the</strong> ball to hook. The <strong>for</strong>ce due to friction causes <strong>the</strong> ball to resolve <strong>the</strong>se<br />

differences, slowing <strong>the</strong> ball down, while increasing its angular velocity. This resolution<br />

occurs until such time as <strong>the</strong> ball is no longer skidding (rolled out), or <strong>the</strong> ball has<br />

completely traversed <strong>the</strong> lane and entered <strong>the</strong> pit.<br />

• The ball is always slowing down after it is released: The <strong>for</strong>ce due to friction<br />

causes <strong>the</strong> ball to translate linear momentum to angular momentum, until such<br />

time as <strong>the</strong> resolution (rollout) point is reached. If rollout is reached, both <strong>the</strong><br />

angular and linear velocities decrease. There<strong>for</strong>e, <strong>the</strong> linear velocity is always<br />

continuously and monotonically decreasing.<br />

• The angular velocity is always increasing: The angular velocity <strong>of</strong> <strong>the</strong> ball will<br />

continuously and monotonically increase until <strong>the</strong> rollout point is reached, at<br />

which time <strong>the</strong> angular velocity also starts to decrease in a continuous and<br />

monotonic fashion, along with <strong>the</strong> linear velocity. Roll out can be detected by<br />

observing <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> ball near <strong>the</strong> pins. The ball has rolled out if<br />

<strong>the</strong> angular velocity has begun to decrease, in which case, <strong>the</strong> linear velocity <strong>of</strong><br />

<strong>the</strong> ball can be directly deduced, since it must travel 27" (one circumference <strong>of</strong> <strong>the</strong><br />

ball) <strong>for</strong> every revolution <strong>of</strong> <strong>the</strong> ball.<br />

• Perfect transfer from linear momentum to angular momentum occurs:<br />

Actually this is not <strong>the</strong> case, but <strong>the</strong> amount <strong>of</strong> transfer from linear to angular<br />

momentum can be detected in <strong>the</strong> change in angular velocity between each<br />

revolution <strong>of</strong> <strong>the</strong> ball. Since <strong>the</strong> <strong>for</strong>ce due to friction is <strong>the</strong> only <strong>for</strong>ce acting on<br />

<strong>the</strong> ball, it will be directly related to <strong>the</strong> amount <strong>of</strong> change in <strong>the</strong> angular velocity.<br />

The actual unaccounted <strong>for</strong> losses due to friction result from heating <strong>of</strong> <strong>the</strong> ball<br />

and/or <strong>the</strong> lane, noise generation, vibration, and inelastic de<strong>for</strong>mation <strong>of</strong> <strong>the</strong> ball<br />

and lane.<br />

If <strong>the</strong> ball rolls out, it is possible to directly observe <strong>the</strong> effects <strong>of</strong> friction, since <strong>the</strong> linear<br />

velocity is directly related to <strong>the</strong> angular velocity, and <strong>the</strong> drop in kinetic energy <strong>of</strong> <strong>the</strong><br />

ball can <strong>the</strong>n be measured. While <strong>the</strong> ball is skidding, <strong>the</strong> actual losses due to friction are<br />

very probably some constant fraction (percentage) <strong>of</strong> <strong>the</strong> change in angular momentum,<br />

i.e., 90% <strong>of</strong> <strong>the</strong> change in linear momentum is transferred to angular momentum, 10% is<br />

given up as heat, noise, etc. The exact percentage is not yet known, and it probably<br />

varies <strong>for</strong> each type <strong>of</strong> ball, but with additional research, it should be possible to place an<br />

upper and lower bound on <strong>the</strong> frictional losses.<br />

57


3.6 IMPLEMENTATION, PERFORMANCE, AND ACCURACY<br />

The version <strong>of</strong> <strong>the</strong> MASTER application that was used to generate <strong>the</strong> screen captures <strong>for</strong><br />

this paper incorporates most <strong>of</strong> <strong>the</strong> derivations and methods given in Sections 3.1 to 3.4.<br />

Figure 3-8 presents a data flow diagram <strong>of</strong> <strong>the</strong> various routines that generate <strong>the</strong> data <strong>for</strong><br />

<strong>the</strong> graphs displayed on <strong>the</strong> "Spectrum", "Wave<strong>for</strong>m", and "<strong>Analysis</strong>" screens. Appendix<br />

D contains <strong>the</strong> 'C' source code <strong>for</strong> those routines.<br />

MASTER <strong>Analysis</strong> Calculations Data Flow Diagram<br />

From:<br />

Upload/Archive Routines<br />

A<br />

vCalcSpectrum (page D-3)<br />

Initialize: RealData[ ] = RawData[ ]<br />

Calc Spectrum: RealSpectrum[ ] = FFT (RealData[ ])<br />

Calc Magnitudes: FFTMag[ ] = FFTMagnitude (RealSpectrum[ ])<br />

Calc Frequencies: FFTFreq[ ] = FFTFrequency()<br />

Find Fundamental: FundFreq = max (FFTMag[ ]), Freq > 2.0 Hz<br />

Normalize:<br />

FFTMag[ ] / FFTMag[FundFreq]<br />

Find Pass Band Limits: LOFilterIndex, HIFilterIndex<br />

vCalcVelocityData (page D-15)<br />

Calc RPM Energies: RPMEnergy[i] = k * RPMData[i] 2<br />

Calc RPM Ave Energy: RPMAveEnergy = Σ (RPMEnergy[ ]) /<br />

(PinImpactIndex - ReleaseIndex)<br />

Estimate Linear Energy: SpeedAveEnergy = ((LaneLength * SamplingFreq) /<br />

(PinImpactIndex - ReleaseIndex)) 2<br />

Calc Ball Ave Energy: BallAveEnergy =<br />

(1+FrictionCoef) * RPMAveEnergy * SpeedAveEnergy<br />

Calc Linear Velocities: VelocityData[i] =<br />

(BallAveEnergy - ((1 + FrictionCoef) * RPMEnergy[i])) 1/2<br />

Get Ball L<strong>of</strong>t Distance:<br />

Get Release Velocity:<br />

BallL<strong>of</strong>t = Σ ((VelocityData[i] * 12.0) / SamplingFreq),<br />

ReleaseIndex ≤ i ≤ LaneImpactIndex<br />

ReleaseVelocity = VelocityData[ReleaseIndex]<br />

vCalcFilterData (page D-5)<br />

Remove LO Freqs: RealData[i] = 0.0, i < LOFilterIndex<br />

Remove HI Freqs: RealData[i] = 0.0, i > HIFilterIndex<br />

Keep Pass Band Freqs: RealData[i] = RealSpectrum[i],<br />

LOFilterIndex ≤ i ≤ HIFilterIndex<br />

Get Impact Velocity:<br />

ImpactVelocity = VelocityData[PinImpactIndex]<br />

Get Ball Speed: BallSpeed = (LaneLength * SamplingFreq) /<br />

(PinImpactIndex - ReleaseIndex)<br />

Get Ball Time: BallTime = (PinImpactIndex - ReleaseIndex) /<br />

SamplingFreq<br />

Filter Data: RealData[ ] = FFT -1 (RealData[ ])<br />

Remove DC Bias: RealData[ ] - Min (RealData[ ])<br />

vCalcDistanceData (page D-16)<br />

Calc Distance to Sample: Distance[i] = Σ ((VelocityData[j] * 12.0) / SamplingFreq),<br />

0 ≤ j ≤ i<br />

fAnalyzeData (page D-7)<br />

Fill Distance Vectors: RPMDistance[ ], VelocityDistance[ ], RawRPMDistance[ ],<br />

ImpactDistance[ ]<br />

Find Rev Loc Indices: RevBGNLoc[ ], RevENDLoc[ ]<br />

Interpolate:<br />

RPMLoc[i] = Interpolate (RevENDLoc[i-1],<br />

RevBGNLoc[i])<br />

Calc Angular Velocities: CalcRPMs[i] = 1 / (RPMLoc[i] - RPMLoc[i-1])<br />

Remove Doppler: RPMData[ ] = PolyCurveFit (CalcRPMs[ ])<br />

Get Release RPMs: ReleaseRPMs = RPMData[ReleaseIndex]<br />

Get Impact RPMs: ImpactRPMs = RPMData[PinImpactIndex]<br />

Calc Rev Distance:<br />

vCalcRevLocations (page D-17)<br />

Fill Distance Vector: RevLocDistance[ ]<br />

RevDistance[rev] = Σ ((VelocityData[i] * 12.0 ) / SamplingFreq),<br />

0 ≤ i ≤ RPMLoc[rev]<br />

A<br />

Figure 3-8<br />

To:<br />

Graphing Routines<br />

58


3.6.1 Implementation and <strong>Per<strong>for</strong>mance</strong><br />

There are several per<strong>for</strong>mance issues with <strong>the</strong> current version <strong>of</strong> <strong>the</strong> MASTER s<strong>of</strong>tware<br />

that are currently being addressed.<br />

• The coefficient <strong>of</strong> friction calculations from Section 3.4.3 have not yet been<br />

incorporated. Instead, a command-line argument specifies <strong>the</strong> percentage <strong>of</strong> <strong>the</strong><br />

change in angular momentum that is lost due to friction. For this paper, frictional<br />

losses were set at 10%.<br />

• A somewhat less accurate method <strong>for</strong> deriving <strong>the</strong> linear velocities than that<br />

described in Section 3.3 is currently implemented. This method derives <strong>the</strong><br />

average linear momentum from <strong>the</strong> average linear velocity <strong>of</strong> <strong>the</strong> ball, and<br />

calculates <strong>the</strong> average angular momentum from <strong>the</strong> angular velocities <strong>for</strong> each<br />

revolution. Although this yields <strong>the</strong> proper shape <strong>for</strong> <strong>the</strong> wave<strong>for</strong>m, it<br />

misrepresents <strong>the</strong> magnitude <strong>of</strong> <strong>the</strong> linear velocities. See vCalcVelocityData in<br />

Figure 3-8 <strong>for</strong> more detail.<br />

• The current linear velocity extraction algorithm does not check <strong>for</strong> roll out <strong>of</strong> <strong>the</strong><br />

ball (that <strong>the</strong> angular velocity is decreasing). There<strong>for</strong>e, under <strong>the</strong> constant<br />

energy assumption, when <strong>the</strong> angular velocity begins to decrease, <strong>the</strong> calculated<br />

linear velocity increases. The graph in Figure 3-9 demonstrates this phenomenon.<br />

Figure 3-9: Effects <strong>of</strong> Roll Out, "<strong>Analysis</strong>" Screen Capture<br />

59


• The angular velocity graph is highly sensitive to a "phase shift" that can occur in<br />

<strong>the</strong> wave<strong>for</strong>m when <strong>the</strong> ball crosses under <strong>the</strong> pin deck light. Referring back to<br />

Figures 2-2a and 2-2b in Section II, <strong>the</strong> pin deck light is bright enough that it can<br />

alter <strong>the</strong> duration <strong>of</strong> <strong>the</strong> last revolution significantly, depending on <strong>the</strong> orientation<br />

<strong>of</strong> <strong>the</strong> light sensor as <strong>the</strong> ball approaches <strong>the</strong> pins. Consequently, <strong>the</strong> revolution<br />

location algorithm detects a longer (or shorter) duration than actually occurred,<br />

artificially inflating or deflating <strong>the</strong> final angular velocity <strong>of</strong> <strong>the</strong> ball. Figure 3-10<br />

illustrates this phenomenon.<br />

Light Level<br />

140<br />

120<br />

100<br />

80<br />

60<br />

Last complete<br />

Revolution<br />

Phase<br />

Shift<br />

Impact<br />

(Head Pin)<br />

40<br />

20<br />

0<br />

2000<br />

2100 2200 2300 2400 2500 2600 2700 2800<br />

Milliseconds (since Release)<br />

Figure 3-10: Pin Deck Phase Shift, Impact Region (800 ms)<br />

Figures 3-11a and 3-11b indicate <strong>the</strong> adverse effects <strong>of</strong> this "phase shift" on <strong>the</strong><br />

analysis <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m. The analysis captured in Figure 3-11a was per<strong>for</strong>med<br />

on <strong>the</strong> wave<strong>for</strong>m with <strong>the</strong> phase-shifted portion <strong>of</strong> <strong>the</strong> raw data included. The<br />

angular velocity begins to roll <strong>of</strong>f 10 feet in front <strong>of</strong> <strong>the</strong> pins. The same<br />

wave<strong>for</strong>m was used <strong>for</strong> <strong>the</strong> analysis captured in Figure 3-11b, but <strong>the</strong> phaseshifted<br />

portion <strong>of</strong> <strong>the</strong> raw data was excluded from <strong>the</strong> calculations. As a<br />

consequence, Figure 3-11b shows <strong>the</strong> angular velocity continuing to increase all<br />

<strong>the</strong> way through impact with <strong>the</strong> pins.<br />

The difference in <strong>the</strong> two raw data wave<strong>for</strong>ms is only 50 msec (6 sample times),<br />

but <strong>the</strong> difference in <strong>the</strong> resulting analysis is dramatic. The simplest method <strong>for</strong><br />

correcting <strong>the</strong> problem is to find <strong>the</strong> pin impact point in <strong>the</strong> wave<strong>for</strong>m, and <strong>the</strong>n<br />

exclude from <strong>the</strong> spectrum calculation <strong>the</strong> 50-75 msecs (6-9 samples) that<br />

immediately precede pin impact. After <strong>the</strong> raw data wave<strong>for</strong>m has been filtered,<br />

<strong>the</strong> time is reinserted by extrapolating <strong>the</strong> results <strong>of</strong> <strong>the</strong> angular velocity extraction<br />

routine back into <strong>the</strong> excluded data.<br />

The problem arises because <strong>the</strong> filtered wave<strong>for</strong>m that is used <strong>for</strong> all <strong>of</strong> <strong>the</strong><br />

analysis calculations is reconstructed <strong>for</strong> time-independent frequency content.<br />

Using an FFT function over <strong>the</strong> entire wave<strong>for</strong>m at one time yields frequency<br />

components <strong>of</strong> <strong>the</strong> data, but does not reveal when those frequencies were present<br />

in <strong>the</strong> wave<strong>for</strong>m. A more advanced technique would be to use wavelet methods<br />

in <strong>the</strong> spectrum calculations to yield time-correlated frequency content.<br />

60


Figure 3-11a: Effects <strong>of</strong> Phase Shift, Apparent Rollout<br />

Figure 3-11b: Effects <strong>of</strong> Phase Shift, No Rollout<br />

61


3.6.2 Accuracy<br />

The question <strong>of</strong> accuracy has not yet been addressed. Just how accurately do <strong>the</strong> graphs<br />

displayed in <strong>the</strong> "<strong>Analysis</strong>" screen <strong>of</strong> <strong>the</strong> MASTER program depict <strong>the</strong> actual response <strong>of</strong><br />

<strong>the</strong> ball? What accuracy can be claimed <strong>for</strong> <strong>the</strong> SMARTDOT system and, more<br />

importantly, how can this accuracy be verified?<br />

The SMARTDOT system is intended to serve <strong>the</strong> following functions: quantify <strong>the</strong><br />

consistency <strong>of</strong> a bowler's release; provide objective feedback with which to measure <strong>the</strong>ir<br />

per<strong>for</strong>mance and improvement; and capture and measure <strong>the</strong> response <strong>of</strong> a bowling ball<br />

over <strong>the</strong> course <strong>of</strong> a game or match, as well as capture its response to varying lane<br />

conditions.<br />

There<strong>for</strong>e, it is more important that <strong>the</strong> system give consistent and repeatable results,<br />

ra<strong>the</strong>r than absolutely accurate results. Ideally, if <strong>the</strong> bowler rolls <strong>the</strong> ball <strong>the</strong> same way<br />

on two different shots, and <strong>the</strong> ball responds identically to that stimulus, <strong>the</strong>n <strong>the</strong> results<br />

that <strong>the</strong> MASTER reports should be <strong>the</strong> same. If <strong>the</strong> bowler releases one ball with a<br />

velocity 10% higher than ano<strong>the</strong>r ball, <strong>the</strong> MASTER should report a 10% difference in <strong>the</strong><br />

two release velocities.<br />

There are several options available <strong>for</strong> accurately verifying SMARTDOT's per<strong>for</strong>mance:<br />

• Take SMARTDOT to a CATS-instrumented facility and correlate <strong>the</strong> MASTER's<br />

analysis results against <strong>the</strong> CATS findings [12] and/or contact Brunswick and<br />

possibly obtain time on <strong>the</strong>ir "Throbot" machine, which can apply known<br />

amounts <strong>of</strong> velocity, spin, and l<strong>of</strong>t to <strong>the</strong> ball, and <strong>the</strong>n correlate <strong>the</strong> MASTER's<br />

findings against <strong>the</strong> release parameters <strong>of</strong> "Throbot" [9].<br />

• Instrument a lane and per<strong>for</strong>m external verification and validation. By fitting a<br />

lane with a fast and accurate position/velocity sensing system, <strong>the</strong> actual response<br />

<strong>of</strong> <strong>the</strong> ball from foul line to head pin could be captured. Since <strong>the</strong> linear velocity<br />

and distance results are derived from <strong>the</strong> angular velocity data, if those results can<br />

be externally quantified, it will be possible to determine <strong>the</strong> accuracy <strong>of</strong> <strong>the</strong><br />

assumptions and <strong>the</strong> calculations underlying <strong>the</strong> entire SMARTDOT system.<br />

• Add a solid-state accelerometer/tilt-sensor to <strong>the</strong> module and correlate <strong>the</strong> actual<br />

results <strong>of</strong> <strong>the</strong> accelerometer with <strong>the</strong> inferred angular velocity results from <strong>the</strong><br />

light sensor. This is a realistic possibility, using <strong>the</strong> ADXL202E accelerometer<br />

from Analog Devices [15], although it requires a fair amount <strong>of</strong> additional<br />

development ef<strong>for</strong>t on <strong>the</strong> sensor module.<br />

To this point, <strong>the</strong> only practical (meaning cost-effective) assessment method has been to<br />

use video analysis. With markers applied at known distances on <strong>the</strong> lane, and additional<br />

markers applied to <strong>the</strong> ball each 30° <strong>of</strong> rotation, multiple shots have been simultaneously<br />

captured with SMARTDOT and on videotape. Through this practice, <strong>the</strong> current MASTER<br />

analysis techniques appear to be accurate to within 1/2 mph and 90° <strong>of</strong> rotation.<br />

However, standard video is limited to 30 frames per second, yielding a resolution <strong>of</strong> 33<br />

msecs per frame, which is insufficient <strong>for</strong> verifying accurate measurement to 0.1<br />

revolution and 0.1 mph. It is also not possible, using this technique, to verify <strong>the</strong> angular<br />

velocity measurements resulting from <strong>the</strong> filtered wave<strong>for</strong>m, nor <strong>the</strong> actual locations <strong>of</strong><br />

each revolution. It will eventually be necessary to utilize one or more <strong>of</strong> <strong>the</strong> previously<br />

mentioned techniques to reliably validate SMARTDOT.<br />

62


3.6.3 The "Perfect" Game to Analyze<br />

Several years ago, with an earlier prototype <strong>of</strong> <strong>the</strong> SMARTDOT sensor module installed<br />

in <strong>the</strong> ball, <strong>the</strong> author had <strong>the</strong> extreme good <strong>for</strong>tune <strong>of</strong> rolling a perfect game while<br />

testing <strong>the</strong> module. SMARTDOT successfully captured <strong>the</strong> wave<strong>for</strong>ms <strong>for</strong> all 12 strikes<br />

<strong>of</strong> that game. Figure 3-12 gives a tabular summary <strong>of</strong> <strong>the</strong> "<strong>Analysis</strong>" statistics and<br />

Appendix E contains screen captures from <strong>the</strong> "Raw Data", "Spectrum", and "<strong>Analysis</strong>"<br />

screens <strong>for</strong> <strong>the</strong> 12 frames <strong>of</strong> <strong>the</strong> 300 game.<br />

Frame<br />

Release<br />

MPH RPMs<br />

Impact<br />

MPH RPMs<br />

L<strong>of</strong>t<br />

(in)<br />

Time<br />

(sec)<br />

Average<br />

MPH<br />

Total<br />

Revolutions<br />

Average<br />

RPMs<br />

1 16.6 425 15.4 560 44 2.52 16.3 19.4 462<br />

2 16.7 415 15.4 569 44 2.48 16.5 18.5 448<br />

3 16.6 423 15.5 551 49 2.48 16.5 18.4 445<br />

4 16.3 424 15.2 547 48 2.54 16.1 19.1 451<br />

5 16.6 412 15.2 569 54 2.50 16.4 18.4 442<br />

6 16.5 426 15.3 551 -- 2.50 16.4 18.2 437<br />

7 16.8 426 15.7 548 54 2.48 16.5 19.2 465<br />

8 16.3 422 15.1 553 -- 2.56 16.0 19.4 455<br />

9 16.5 425 15.3 558 -- 2.52 16.3 19.2 457<br />

10 16.8 434 15.8 551 -- 2.47 16.6 18.8 457<br />

11 16.7 427 15.5 554 -- 2.48 16.5 18.6 450<br />

12 16.6 426 15.6 542 -- 2.48 16.5 18.4 445<br />

Min 16.3 412 15.1 542 44 2.47 16.0 18.2 437<br />

Max 16.8 434 15.8 569 54 2.56 16.6 19.4 465<br />

Median 16.6 425 15.4 552 49 2.49 16.5 18.7 451<br />

Mean 16.6 424 15.4 554 49 2.50 16.4 18.8 451<br />

Deviation ±1.5% ±2.5% ±2.3% ±2.4% ±5.0% ±2.0% ±1.8% ±3.2% ±3.1%<br />

Figure 3-12: 300 Game <strong>Analysis</strong> Summary<br />

This set <strong>of</strong> 12 wave<strong>for</strong>ms possesses some interesting characteristics that could be used in<br />

future versions <strong>of</strong> <strong>the</strong> MASTER analysis s<strong>of</strong>tware, as well as to refine <strong>the</strong> embedded<br />

s<strong>of</strong>tware <strong>of</strong> <strong>the</strong> SMARTDOT module. First, <strong>the</strong> valleys <strong>of</strong> <strong>the</strong> wave<strong>for</strong>ms exhibit a shape<br />

much closer to that <strong>of</strong> a sinusoidal wave<strong>for</strong>m than <strong>the</strong> peaks do. This suggests that much<br />

<strong>of</strong> <strong>the</strong> impact <strong>of</strong> <strong>the</strong> Doppler effect and <strong>the</strong> directionality <strong>of</strong> <strong>the</strong> ceiling lights could be<br />

eliminated by restricting <strong>the</strong> analysis to only <strong>the</strong> lower half <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m.<br />

Also, <strong>the</strong> peak and average light levels increase dramatically when <strong>the</strong> ball crosses under<br />

<strong>the</strong> pin deck light. The time interval between detection <strong>of</strong> <strong>the</strong> pin deck light and impact<br />

with <strong>the</strong> pins could be used to determine whe<strong>the</strong>r or not <strong>the</strong> ball hit <strong>the</strong> head pin. The<br />

"signature" <strong>of</strong> <strong>the</strong> pin impacts might also be useful.<br />

Although <strong>the</strong> accuracy <strong>of</strong> <strong>the</strong> MASTER analysis algorithms requires a more rigorous<br />

analysis, and has not yet been <strong>for</strong>mally verified, <strong>the</strong> relative consistency <strong>of</strong> <strong>the</strong> results<br />

from <strong>the</strong>se twelve shots, all <strong>of</strong> which resulted in pocket hits, lends some credence to <strong>the</strong><br />

validity <strong>of</strong> <strong>the</strong> analysis methods.<br />

It was also especially gratifying to <strong>the</strong> author to have thrown <strong>the</strong> first-ever 300 game<br />

captured with <strong>the</strong> SMARTDOT system.<br />

63


3.7 FUTURE WORK<br />

The MASTER application, in its current incarnation, has served solely as a research tool.<br />

It facilitates rapid assessment <strong>of</strong> <strong>the</strong> SMARTDOT module's per<strong>for</strong>mance, and enables <strong>the</strong><br />

review and archival <strong>of</strong> previously collected data. As <strong>the</strong> MASTER analysis algorithms<br />

have been developed and modified, this version <strong>of</strong> <strong>the</strong> MASTER application has made it<br />

possible to recall previous raw data wave<strong>for</strong>ms and observe <strong>the</strong> effects <strong>of</strong> <strong>the</strong> changes to<br />

<strong>the</strong> algorithms.<br />

3.7.1 Algorithms<br />

The analysis algorithms are still evolving. Various concerns and problems have been<br />

presented over <strong>the</strong> course <strong>of</strong> <strong>the</strong> paper, and several <strong>of</strong> <strong>the</strong>se stand out.<br />

• Filtering <strong>the</strong> Raw Data Wave<strong>for</strong>m: This is <strong>the</strong> most important step in <strong>the</strong> entire<br />

analysis process. The basis <strong>for</strong> <strong>the</strong> analysis algorithms is that <strong>the</strong> wave<strong>for</strong>m is<br />

representative <strong>of</strong> <strong>the</strong> angular position <strong>of</strong> a single point on <strong>the</strong> ball. As <strong>the</strong> ball<br />

rolls down <strong>the</strong> lane, that point transcribes a sinusoidal path that <strong>the</strong> SMARTDOT<br />

module captures, and that <strong>the</strong> MASTER unit analyzes to recover <strong>the</strong> action <strong>of</strong> <strong>the</strong><br />

ball. If this wave<strong>for</strong>m cannot be recovered "cleanly", <strong>the</strong> analysis will be flawed.<br />

A simple FFT function was used to find <strong>the</strong> spectrum, and an adaptive filter was<br />

used to filter <strong>the</strong> wave<strong>for</strong>m. Although <strong>the</strong> spectrum <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m reveals a<br />

great deal <strong>of</strong> in<strong>for</strong>mation, <strong>the</strong> major focus <strong>of</strong> interest is <strong>the</strong> manner in which <strong>the</strong><br />

frequency changes over time, which an FFT does not reveal. There<strong>for</strong>e, fur<strong>the</strong>r<br />

investigation needs to be per<strong>for</strong>med into more advanced digital processing<br />

techniques, more specifically into wavelet <strong>the</strong>ory, which will allow <strong>the</strong> MASTER<br />

algorithms to characterize <strong>the</strong> timing <strong>of</strong> <strong>the</strong> frequencies in <strong>the</strong> wave<strong>for</strong>m.<br />

• Curve Fitting: Due to <strong>the</strong> Doppler effect observed in <strong>the</strong> raw angular velocity<br />

wave<strong>for</strong>m, it has not been possible to directly recover <strong>the</strong> instantaneous angular<br />

velocity <strong>of</strong> <strong>the</strong> ball from <strong>the</strong> raw data. There<strong>for</strong>e, a least-squares curve-fitting<br />

scheme was used to approximate <strong>the</strong> true shape <strong>of</strong> <strong>the</strong> angular velocity wave<strong>for</strong>m.<br />

However, this scheme does not include facts about <strong>the</strong> nature <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m<br />

that are known to be true, i.e., that it is monotonically increasing, at least until<br />

rollout occurs. A more refined method must be identified that takes into account<br />

<strong>the</strong> specific nature <strong>of</strong> this problem.<br />

• Friction: Throughout <strong>the</strong> analysis, an assumption has been maintained that no<br />

energy is lost due to friction. Actually, <strong>the</strong> energy lost is relatively small, but not<br />

negligible. Since <strong>the</strong> linear velocity is derived from <strong>the</strong> change in angular<br />

momentum, any portion <strong>of</strong> <strong>the</strong> linear momentum that is not transferred to angular<br />

momentum causes <strong>the</strong> resultant linear velocity calculation to be too low.<br />

It appears to be possible to recover <strong>the</strong> actual frictional <strong>for</strong>ce or, at <strong>the</strong> very least,<br />

to place upper and lower bounds upon it. Since <strong>the</strong> ball is always revolving<br />

slower than it is traveling, and <strong>the</strong> number <strong>of</strong> revolutions <strong>of</strong> <strong>the</strong> ball is known, <strong>the</strong><br />

total distance <strong>the</strong> ball would have traveled had it not been skidding during those<br />

revolutions can be calculated. This distance will always be less than <strong>the</strong> distance<br />

<strong>the</strong> ball actually traveled (nominally 60 feet).<br />

64


Since <strong>the</strong> change in angular velocity <strong>for</strong> each revolution <strong>of</strong> <strong>the</strong> ball is known, it<br />

should be possible to distribute <strong>the</strong> discrepancy in <strong>the</strong> two distances in relation to<br />

<strong>the</strong> changes in angular velocity. This process yields <strong>the</strong> distance <strong>the</strong> ball covered<br />

<strong>for</strong> each revolution, and <strong>the</strong> linear velocity can be recovered using that distance<br />

and <strong>the</strong> period <strong>of</strong> each revolution. The kinetic energy <strong>of</strong> <strong>the</strong> ball can <strong>the</strong>n be<br />

calculated <strong>for</strong> each revolution. Knowing <strong>the</strong> weight <strong>of</strong> <strong>the</strong> ball, and <strong>the</strong> energy<br />

lost between revolutions, <strong>the</strong> coefficient <strong>of</strong> friction could be calculated <strong>for</strong> each<br />

revolution.<br />

3.7.2 End-User MASTER S<strong>of</strong>tware<br />

The eventual development <strong>of</strong> <strong>the</strong> end-user version <strong>of</strong> <strong>the</strong> MASTER application is an entire<br />

project in itself. The current version is merely a tool to aid in developing and assessing<br />

<strong>the</strong> analysis algorithms, which are at <strong>the</strong> heart <strong>of</strong> <strong>the</strong> SMARTDOT system. Even though<br />

fur<strong>the</strong>r refinement <strong>of</strong> those algorithms is required, and <strong>for</strong>mal verification <strong>of</strong> <strong>the</strong>ir<br />

accuracy has yet to be per<strong>for</strong>med, <strong>the</strong>y have demonstrated <strong>the</strong> feasibility <strong>of</strong> <strong>the</strong> entire<br />

system. Although some <strong>for</strong>m <strong>of</strong> <strong>the</strong> algorithms will be part <strong>of</strong> <strong>the</strong> end-user version <strong>of</strong> <strong>the</strong><br />

MASTER s<strong>of</strong>tware, <strong>the</strong> final implementation <strong>of</strong> <strong>the</strong> MASTER application will look and<br />

feel nothing like its current incarnation.<br />

There are two <strong>for</strong>ms that <strong>the</strong> MASTER application will ultimately take. The first is as a<br />

full-blown, PC-hosted, Windows ® -based GUI application, and <strong>the</strong> second is as a portable<br />

PDA-based application. The two would tie toge<strong>the</strong>r, resulting in real-time utility <strong>for</strong> <strong>the</strong><br />

bowler at <strong>the</strong> bowling center, while also allowing <strong>for</strong> in-depth analysis and per<strong>for</strong>mance<br />

tracking and data archiving at home.<br />

• PDA-based application: The PDA application would allow <strong>the</strong> bowler to upload<br />

wave<strong>for</strong>m in<strong>for</strong>mation from <strong>the</strong> SMARTDOT module, and <strong>the</strong>n save and review <strong>the</strong><br />

in<strong>for</strong>mation during <strong>the</strong> course <strong>of</strong> a practice session or match. The application would<br />

also accept user-input about <strong>the</strong> particular bowling session (bowling establishment,<br />

lanes, ball used, etc.), and pertinent details <strong>for</strong> each frame thrown (release point, ball<br />

path, impact location, result, etc).<br />

The application would provide on-site feedback that pertains to <strong>the</strong> bowler's current<br />

execution in relation to previously established norms. It could also provide trending<br />

in<strong>for</strong>mation regarding differences in ball response between <strong>the</strong> two lanes <strong>of</strong> a pair, or<br />

from <strong>the</strong> beginning <strong>of</strong> a match to <strong>the</strong> end, or between several different bowling balls.<br />

The bowler could also find out <strong>the</strong> manner in which <strong>the</strong>ir execution changes over <strong>the</strong><br />

course <strong>of</strong> a match: did <strong>the</strong>ir release velocity decrease/increase; did <strong>the</strong> release RPMs<br />

drop-<strong>of</strong>f or pick-up, etc.<br />

• Windows ® application: The Windows ® MASTER application would have all <strong>of</strong> <strong>the</strong><br />

capabilities <strong>of</strong> <strong>the</strong> PDA application, but would also create and maintain a database <strong>of</strong><br />

past per<strong>for</strong>mances. The PDA would automatically upload <strong>the</strong> in<strong>for</strong>mation it had<br />

previously collected at <strong>the</strong> bowling alley to <strong>the</strong> MASTER application, which would<br />

<strong>the</strong>n archive that in<strong>for</strong>mation in its database.<br />

The primary function <strong>of</strong> <strong>the</strong> MASTER s<strong>of</strong>tware would be to facilitate queries <strong>of</strong> this<br />

database <strong>for</strong> various trends and relationships between scores, bowling balls, execution<br />

parameters, etc. Ultimately, it would not only help correlate <strong>the</strong> bowler's execution<br />

(release parameters) with <strong>the</strong>ir per<strong>for</strong>mance (score), it could also provide a correlation<br />

between that in<strong>for</strong>mation and <strong>the</strong> different equipment (bowling balls) that <strong>the</strong> bowler<br />

uses.<br />

65


3.8 SUMMARY - MASTER ANALYSIS<br />

The SMARTDOT concept was predicated on <strong>the</strong> assumption that <strong>the</strong> action <strong>of</strong> a bowling<br />

ball could be captured by sampling and recording <strong>the</strong> ambient light level at a single point<br />

on <strong>the</strong> ball as <strong>the</strong> ball rolls down <strong>the</strong> lane. This concept was developed in two stages:<br />

first, by building an in-situ sensor module that captures and uploads <strong>the</strong> wave<strong>for</strong>m; and<br />

second, by deriving and implementing a set <strong>of</strong> algorithms that filter, analyze, and display<br />

<strong>the</strong> captured wave<strong>for</strong>m.<br />

It was assumed that <strong>the</strong> digitized wave<strong>for</strong>m would be sinusoidal in nature, with <strong>the</strong> peaks<br />

and valleys <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m occurring at 0° and 180° <strong>of</strong> rotation, respectively. In<br />

actuality, <strong>the</strong> digitized wave<strong>for</strong>m required some "massaging" through adaptive digital<br />

filtering be<strong>for</strong>e <strong>the</strong> analysis process could be automated. Fur<strong>the</strong>r, <strong>the</strong> discrete rows <strong>of</strong><br />

overhead fluorescent lights imprint a Doppler-like effect on <strong>the</strong> filtered wave<strong>for</strong>m,<br />

resulting in apparent oscillations in <strong>the</strong> angular velocity <strong>of</strong> <strong>the</strong> ball, especially on <strong>the</strong> first<br />

half <strong>of</strong> <strong>the</strong> lane (closest to <strong>the</strong> foul line).<br />

A polynomial curve-fitting scheme was used to smooth out <strong>the</strong> angular velocity<br />

wave<strong>for</strong>m, and <strong>the</strong> linear velocity <strong>of</strong> <strong>the</strong> ball was recovered through energy conservation<br />

techniques, combined with certain assumptions about <strong>the</strong> effects <strong>of</strong> friction. From <strong>the</strong><br />

linear velocity, it was possible to find <strong>the</strong> distance <strong>the</strong> ball was l<strong>of</strong>ted at release, and <strong>the</strong><br />

location <strong>of</strong> each revolution <strong>of</strong> <strong>the</strong> ball relative to <strong>the</strong> foul line. A method <strong>for</strong> finding <strong>the</strong><br />

coefficient <strong>of</strong> friction between <strong>the</strong> ball and <strong>the</strong> lane was also derived, although this<br />

technique has not yet been implemented.<br />

Ano<strong>the</strong>r problem that arose from <strong>the</strong> analysis was that <strong>of</strong> "phase shift", where <strong>the</strong> pin<br />

deck light overpowers <strong>the</strong> ceiling lights and imposes a sudden phase shift on <strong>the</strong><br />

wave<strong>for</strong>m immediately be<strong>for</strong>e <strong>the</strong> ball hits <strong>the</strong> pins. This phase shift occurs in <strong>the</strong> last<br />

revolution <strong>of</strong> <strong>the</strong> ball, and can drastically affect <strong>the</strong> resulting analysis. The effects <strong>of</strong> <strong>the</strong><br />

phase shift can be removed by excluding from <strong>the</strong> data passed to <strong>the</strong> digital filter <strong>the</strong> 50-<br />

75 msecs (6-9 samples) <strong>of</strong> <strong>the</strong> wave<strong>for</strong>m immediately preceding impact. Be<strong>for</strong>e<br />

proceeding with <strong>the</strong> remainder <strong>of</strong> <strong>the</strong> analysis algorithms, <strong>the</strong> filtered wave<strong>for</strong>m is<br />

extrapolated back into <strong>the</strong> samples that were previously excluded.<br />

It is important to note that all <strong>of</strong> <strong>the</strong> wave<strong>for</strong>ms used <strong>for</strong> development <strong>of</strong> <strong>the</strong> MASTER<br />

algorithms have originated from <strong>the</strong> author's use <strong>of</strong> <strong>the</strong> SMARTDOT system. As such,<br />

testing <strong>of</strong> <strong>the</strong> SMARTDOT system with a wider range <strong>of</strong> users is mandated, and fur<strong>the</strong>r<br />

refinement <strong>of</strong> <strong>the</strong> algorithms will most likely result. Ultimately, <strong>the</strong> results <strong>of</strong> <strong>the</strong><br />

MASTER analysis algorithms must be verified and validated with <strong>for</strong>mal testing. That<br />

testing could also be used to reveal which algorithms are <strong>the</strong> most applicable to <strong>the</strong><br />

SMARTDOT system.<br />

Admittedly, <strong>the</strong>re is much development, verification, and validation yet to be done.<br />

However, this phase <strong>of</strong> <strong>the</strong> project has shown that <strong>the</strong> SMARTDOT system, as described,<br />

is a feasible and viable method <strong>for</strong> quantifying and assessing a bowler's level <strong>of</strong><br />

execution and per<strong>for</strong>mance.<br />

66


BIBLIOGRAPHY<br />

[1] United State Patent and Trademark Office, http://www.uspto.gov/, March 2002<br />

[2] US Patent 4,893,182 (January 9, 1990) - Video Tracking and Display <strong>System</strong><br />

ABSTRACT: An imaging processing system <strong>for</strong> displaying a succession <strong>of</strong> selected separated<br />

images <strong>of</strong> a moving object moving in an o<strong>the</strong>rwise substantially static scene includes an image sensor<br />

<strong>for</strong> generating video signals <strong>of</strong> <strong>the</strong> static scene and <strong>for</strong> generating video signals <strong>of</strong> <strong>the</strong> static scene<br />

including <strong>the</strong> object moving <strong>the</strong>rethrough. The video signals are generated over a plurality <strong>of</strong> frames.<br />

A first memory stores <strong>the</strong> video signals <strong>of</strong> at least one <strong>of</strong> <strong>the</strong> plurality <strong>of</strong> frames from <strong>the</strong> static scene.<br />

A second memory stores <strong>the</strong> video signals <strong>of</strong> <strong>the</strong> plurality <strong>of</strong> frames from <strong>the</strong> static scene including <strong>the</strong><br />

object moving <strong>the</strong>rethrough. Structure is provided <strong>for</strong> comparing on a frame-by-frame basis <strong>the</strong> video<br />

signals stored in <strong>the</strong> first memory with <strong>the</strong> video signals stored in <strong>the</strong> second memory to <strong>the</strong>reby<br />

determine <strong>the</strong> presence <strong>of</strong> <strong>the</strong> object in each <strong>of</strong> <strong>the</strong> plurality <strong>of</strong> frames. A display illustrates <strong>the</strong> location<br />

<strong>of</strong> <strong>the</strong> object in each <strong>of</strong> <strong>the</strong> plurality <strong>of</strong> frames.<br />

[3] US Patent 5,118,105 (June 2, 1992) - <strong>Bowling</strong> Statistics Display <strong>System</strong><br />

ABSTRACT: A statistical analysis package <strong>for</strong> a bowling center system provides displays used to<br />

analyze bowling ball trajectories. The bowling center system includes a central processing unit having<br />

a memory and connected to a ball trajectory unit. The ball trajectory unit generates in<strong>for</strong>mation<br />

representing <strong>the</strong> trajectory <strong>of</strong> a bowling ball in a lane which is stored in <strong>the</strong> processing unit memory.<br />

The processing unit memory is operable in response to a user request <strong>for</strong> selecting trajectory<br />

in<strong>for</strong>mation to develop statistical graphs illustrating historical tendencies at a select trajectory position<br />

<strong>for</strong> display on a monitor.<br />

[4] US Patent 5,526,326 (June 11, 1996) - Speed Indicating Ball<br />

ABSTRACT: A speed indicating ball includes a timer, which is activated upon throwing <strong>of</strong> <strong>the</strong><br />

ball, and deactivated upon catching <strong>of</strong> <strong>the</strong> ball, <strong>for</strong> measuring <strong>the</strong> ball's time <strong>of</strong> flight. The timer is<br />

connected to a display which provides a direct read out which is inversely proportional to <strong>the</strong> time <strong>of</strong><br />

flight <strong>of</strong> <strong>the</strong> ball, and which corresponds to <strong>the</strong> relative velocity <strong>of</strong> <strong>the</strong> ball.<br />

[5] US Patent 5,761,096 (June 2, 1998) - Speed-sensing projectile<br />

ABSTRACT: A speed-sensing projectile such as <strong>for</strong> example a baseball includes a generally<br />

spherical body. An inertial switch is positioned within <strong>the</strong> body and is actuable between open and<br />

closed conditions in response to accelerations <strong>of</strong> <strong>the</strong> body greater than a threshold value. A processor<br />

also within <strong>the</strong> body is responsive to <strong>the</strong> inertial switch and calculates <strong>the</strong> average speed at which <strong>the</strong><br />

baseball is thrown over a fixed distance. A visible display on <strong>the</strong> body is in communication with <strong>the</strong><br />

processor and displays <strong>the</strong> calculated speed.<br />

[6] US Patent 6,151,563 (November 21, 2000) -<br />

Speed, spin rate, and curve measuring device using magnetic field sensors<br />

ABSTRACT: A device <strong>for</strong> measuring a movable object, such as a baseball, football, hockey puck,<br />

soccer ball, tennis ball, bowling ball, or a golf ball. Part <strong>of</strong> <strong>the</strong> device, called <strong>the</strong> object unit, is<br />

embedded, secured, or attached to <strong>the</strong> movable object <strong>of</strong> interest, and has a spin detection circuit,<br />

electronic processor circuit, magnetic field sensor circuit, and a radio transmitter. The o<strong>the</strong>r part <strong>of</strong> <strong>the</strong><br />

device, called <strong>the</strong> monitor unit, is held or worn by <strong>the</strong> user and serves as <strong>the</strong> user interface <strong>for</strong> <strong>the</strong><br />

device. The monitor unit has a radio receiver, a processor, an input keypad, and an output display that<br />

shows <strong>the</strong> various measured motion characteristics <strong>of</strong> <strong>the</strong> movable object, such as <strong>the</strong> time <strong>of</strong> flight,<br />

speed, trajectory height, spin rate, or curve <strong>of</strong> <strong>the</strong> movable object, and allows <strong>the</strong> user to input data to<br />

<strong>the</strong> device.<br />

67


[7] Bose, Nirmal K., Digital Filters - Theory and Applications, North-Holland, New<br />

York, New York, 1985<br />

[8] Halliday, David and Resnick, Robert, Physics - Parts 1 & 2, John Wiley and Sons,<br />

New York, New York, 1978<br />

[9] Saunders, Fenella, "The Physics <strong>of</strong> ... <strong>Bowling</strong>", Discover Magazine, March 2000<br />

[10] Science and Engineering Tools Version 9.0, Quinn-Curtis, Inc., Needham<br />

Massachusettes, 1995<br />

[11] Simmons, George F., Calculus with Analytic Geometry, McGraw Hill, New York,<br />

New York, 1985<br />

[12] Vezina, Larry, "High-Tech Help", <strong>Bowling</strong> Magazine, Members Only Edition<br />

1994/1995<br />

[13] Vint, Bill, "<strong>Bowling</strong>'s Invisible Obstacle Course", <strong>Bowling</strong> Magazine,<br />

December/January 1993<br />

[14] ABC Equipment Specifications Manual,<br />

http://www.bowl.com/bin/pdf/specsmanual2001.pdf, March 2002<br />

[15] Analog Devices Incorporated,<br />

http://products.analog.com/products/info.asp?product=adxl202, March 2002<br />

[16] Cygnal Integrated Products, http://www.cygnal.com/, March 2002<br />

[17] Honeywell Sensor Products,<br />

http://www.ssec.honeywell.com/magnetic/datasheets/hmc1051-1052.pdf,<br />

March 2002<br />

[18] Maxim Integrated Circuits,<br />

http://dbserv.maxim-ic.com/quick_view2.cfm?qv_pk=1219, March 2002<br />

[19] Measurement Specialties, Incorporated, http://www.msiusa.com/piezo/index.htm,<br />

March 2002<br />

[20] Microchip Technologies, Incorporated,<br />

http://www.microchip.com/11110/pline/memory/index.htm, March 2002<br />

[21] Philips Semiconductor, http://www-us9.semiconductors.com/pip/s87c752-4a28,<br />

March 2002<br />

[22] Ramtron International Corporation,<br />

http://www.ramtron.com/products/producthome.htm, March 2002<br />

[23] Texas Advanced Optical Solutions (TAOS), http://www.taosinc.com/, March 2002<br />

[24] Toshiba Corporation,<br />

http://www.toshiba.com/taec/cgi-bin/display.cgi?table=Category&CategoryID=114,<br />

March 2002<br />

68


APPENDIX A - SMARTDOT MODULE EMBEDDED SOFTWARE<br />

FLOWCHARTS<br />

Figure A-1a Start-Up Task Flowchart ...............................................................................A-2<br />

Figure A-1b Pre-Sampling Task Flowchart .......................................................................A-2<br />

Figure A-2 Light Sample ISR Flowchart .........................................................................A-3<br />

Figure A-3 Sampling Task Flowchart ..............................................................................A-4<br />

Figure A-4 Discrimination Task Flowchart .....................................................................A-5<br />

Figure A-5 Communication Task Flowchart ...................................................................A-6<br />

Figure A-6 Wand Detection ISR Flowchart.....................................................................A-7<br />

Figure A-7 UART Receive Task Flowchart .....................................................................A-8<br />

Figure A-8 Bit Sample ISR Flowchart..............................................................................A-9<br />

Figure A-9 Receive Time Out ISR Flowchart..................................................................A-9<br />

Figure A-10 Shutdown Task Flowchart ...........................................................................A-10<br />

A-1


Appendix A: SMARTDOT Module Embedded S<strong>of</strong>tware Flowcharts<br />

START-UP TASK FLOWCHART<br />

A<br />

PRE-SAMPLING<br />

TASK FLOWCHART<br />

B<br />

SLEEP MODE<br />

Wait <strong>for</strong><br />

Pressure on Insert<br />

IDLE MODE<br />

Wait <strong>for</strong><br />

SAMPLE Interrupt (T0)<br />

NO<br />

Release<br />

LITE<br />

Level<br />

Detected?<br />

Initialize Module Resources<br />

and Variables<br />

YES<br />

Get Start-Up LITE Sample<br />

YES<br />

Wait<br />

too long<br />

<strong>for</strong><br />

Release?<br />

Select Active Scratch Pad<br />

(0 or 1)<br />

NO<br />

Write Pre-Samples to EEPROM<br />

(Sample Buffer - 8 bytes)<br />

Is<br />

Sample<br />

DARK?<br />

YES<br />

NO<br />

Impact<br />

Detected<br />

Since Last<br />

Sample?<br />

YES<br />

Set Impact Bit <strong>for</strong> Sample<br />

Advance to Next Page <strong>of</strong><br />

EEPROM (8 bytes)<br />

Enable Interrupts<br />

NO<br />

Sample Timer (T0)<br />

Impact Detection (EX0)<br />

Time Out Timer (TI)<br />

Move Sample to BUF[PTR]<br />

PTR++<br />

At End<br />

<strong>of</strong><br />

Sample<br />

Buffer?<br />

YES<br />

PTR = Buffer BGN<br />

NO<br />

Figure A-1a<br />

A<br />

To: SHUTDOWN<br />

SAVE RUN TIME<br />

B<br />

Figure A-1b<br />

To: SAMPLING<br />

START<br />

A-2


Appendix A: SMARTDOT Module Embedded S<strong>of</strong>tware Flowcharts<br />

LIGHT SAMPLE ISR FLOWCHART<br />

On:<br />

Timer 0 (T0)<br />

Overflow<br />

A<br />

B<br />

C<br />

Disable Interrupts<br />

Push ACC<br />

Push PSW<br />

First Sample = TRUE<br />

New Sample = TRUE<br />

Turn ON TSL251<br />

(start next ADC conversion)<br />

First<br />

Sample<br />

Of<br />

240 Hz<br />

Pair?<br />

YES<br />

Sample = ADAT<br />

(from previous conversion)<br />

YES<br />

Reached<br />

Shutdown<br />

Time?<br />

NO<br />

Is<br />

Sample<br />

=<br />

Release<br />

Level?<br />

YES<br />

NO<br />

NO<br />

Impact = FALSE<br />

First Sample = FALSE<br />

Is<br />

Sample<br />

Level below<br />

Shutdown<br />

Level?<br />

NO<br />

Reset Shutdown Count<br />

<strong>for</strong> Release Time Out<br />

Release = TRUE<br />

Sample += ADAT<br />

(from previous conversion)<br />

NO<br />

Is<br />

Sum<br />

><br />

255?<br />

YES<br />

B<br />

Sample = 127<br />

(clip to 127 <strong>for</strong> Impact Bit)<br />

YES<br />

Shutdown Count++<br />

Has it<br />

been<br />

Dark<br />

too Long?<br />

NO<br />

NO<br />

Has<br />

Release<br />

Already<br />

Occurred?<br />

YES<br />

Reset Shutdown Count<br />

<strong>for</strong> Shutdown Time Out<br />

Update Run Time<br />

Turn Off TSL251<br />

(waits <strong>for</strong> ADC to complete)<br />

Pop PSW<br />

Pop ACC<br />

Enable Interrupts<br />

Sample /= 2<br />

(average out 240 Hz noise)<br />

YES<br />

Shutdown = TRUE<br />

(reached Shutdown condition)<br />

A<br />

Figure A-2<br />

C<br />

RETURN FROM INTERRUPT<br />

A-3


Appendix A: SMARTDOT Module Embedded S<strong>of</strong>tware Flowcharts<br />

START<br />

CONTINUE<br />

A<br />

SAMPLING TASK FLOWCHART<br />

B<br />

Is<br />

Sampling<br />

Enabled?<br />

YES<br />

Initialize GROUP Variables<br />

Group Max = 0<br />

Group Min = 255<br />

Sample CNT = 0<br />

Write BUF Contents to<br />

EEPROM (8 bytes)<br />

Advance to Next Page <strong>of</strong><br />

EEPROM (8 bytes)<br />

NO<br />

IDLE MODE<br />

In<br />

TEST<br />

Mode?<br />

YES<br />

Wait <strong>for</strong><br />

SAMPLE Interrupt (T0)<br />

Reached<br />

End <strong>of</strong><br />

Sample<br />

Space?<br />

YES<br />

Overflow = TRUE<br />

NO<br />

Impact<br />

Detected?<br />

YES<br />

Set Impact Bit <strong>for</strong> Sample<br />

NO<br />

In<br />

AUTO<br />

Mode?<br />

NO<br />

NO<br />

Move Sample to BUF[PTR]<br />

PTR++<br />

NO<br />

Reached<br />

End <strong>of</strong><br />

Scratch<br />

Pad?<br />

YES<br />

YES<br />

Ball Rolling = TRUE<br />

Enable Sampling<br />

Reached<br />

End<br />

<strong>of</strong><br />

BUF?<br />

NO<br />

Initialize AUTO Detection<br />

PTR = BUF_BGN<br />

Local Max = Sample<br />

Local Min = Sample<br />

Group CNT = 0<br />

YES<br />

PTR = Buffer BGN<br />

YES<br />

Is<br />

Sampling<br />

Enabled?<br />

NO<br />

A<br />

B<br />

Figure A-3<br />

To: DISCRIMINATION<br />

AUTO DETECTION<br />

To: SHUTDOWN<br />

SAVE RUN TIME<br />

To: SHUTDOWN<br />

DONE<br />

SAMPLING<br />

A-4


Appendix A: SMARTDOT Module Embedded S<strong>of</strong>tware Flowcharts<br />

AUTO<br />

DETECTION<br />

A<br />

DISCRIMINATION TASK FLOWCHART<br />

B<br />

Is<br />

Sample<br />

><br />

Group Max?<br />

YES<br />

Group Max = New Sample<br />

NO<br />

Did<br />

Direction<br />

Change?<br />

(Change <<br />

0)<br />

YES<br />

Is<br />

Sampling<br />

Enabled?<br />

YES<br />

In<br />

TEST<br />

Mode?<br />

NO<br />

YES<br />

NO<br />

NO<br />

Is<br />

Sample<br />

<<br />

Group Min?<br />

NO<br />

YES<br />

Group Min = New Sample<br />

Is<br />

Change ><br />

Hysteresis<br />

?<br />

NO<br />

YES<br />

Group Min = New Sample<br />

Group Min = New Sample<br />

NO<br />

Is<br />

Ball<br />

Rolling?<br />

YES<br />

At<br />

End <strong>of</strong><br />

Group?<br />

NO<br />

Group Min = New Sample<br />

Group Min = New Sample<br />

Group Min = New Sample<br />

YES<br />

Is<br />

Wave<strong>for</strong>m<br />

Going<br />

UP?<br />

YES<br />

Change =<br />

Sample - Group Max<br />

Reach<br />

AUTO<br />

Time<br />

Out?<br />

YES<br />

NO<br />

NO<br />

Change =<br />

Group Min - Sample<br />

To: SAMPLING<br />

CONTINUE<br />

B<br />

To: COMMUNICATION<br />

SWITCH TO COMM<br />

To: SHUTDOWN<br />

DONE SAMPLING<br />

A<br />

Figure A-4<br />

A-5


Appendix A: SMARTDOT Module Embedded S<strong>of</strong>tware Flowcharts<br />

COMMUNICATION TASK FLOWCHART<br />

SWITCH<br />

TO COMM<br />

A<br />

B<br />

C<br />

Initialize Communications<br />

Wait <strong>for</strong> Wand = TRUE<br />

Wand Present = FALSE<br />

Dark = FALSE<br />

Level Count = 0<br />

Shutdown Count = 0<br />

Set Timer 0 (T0) <strong>for</strong> Wand Detection<br />

Delay 40 msecs <strong>for</strong> Wand<br />

to switch to 38400 baud<br />

Retry Count = 3<br />

Receive Time Out = 200 msecs<br />

Did<br />

Command<br />

Terminate<br />

Normally?<br />

NO<br />

YES<br />

Transmit 'XON" @ 38400 baud<br />

(acknowledge successful completion)<br />

IDLE MODE<br />

Transmit "HI" @ 38400 baud<br />

to Wand ("Clear to Send")<br />

Update Run Time Count<br />

Wand Interrupt (T0)<br />

(darkness <strong>for</strong> 125 msecs)<br />

Receive Command Byte<br />

from Wand @ 600 baud<br />

Shutdown Count++<br />

Transmit "HI" to Wand<br />

@ 38400<br />

Echo Command Byte<br />

to Wand @ 38400 baud<br />

IDLE MODE<br />

Wand Interrupt (T0)<br />

(receive NULL @ 600 baud)<br />

Wait <strong>for</strong> Wand = FALSE<br />

Wand Present = TRUE<br />

Process Command<br />

'A' - Set AUTO Mode<br />

'S' - Set SINGLE Mode<br />

'T' - Transmit Data<br />

'X' - Set TEST Mode<br />

0x0X - Set CFG Bytes X and X+1<br />

Done<br />

All<br />

Retries?<br />

NO<br />

YES<br />

B<br />

C<br />

A<br />

To: SHUTDOWN<br />

SAVE RUN TIME<br />

Figure A-5<br />

A-6


Appendix A: SMARTDOT Module Embedded S<strong>of</strong>tware Flowcharts<br />

On:<br />

Timer 0 (T0)<br />

Overflow<br />

A<br />

WAND DETECTION ISR FLOWCHART<br />

B<br />

Disable Interrupts<br />

Push ACC<br />

Push PSW<br />

Waiting<br />

<strong>for</strong><br />

Dark?<br />

NO<br />

Is Sample<br />

=<br />

LITE<br />

Level?<br />

NO<br />

Did<br />

LITE<br />

Pulse Just<br />

End?<br />

YES<br />

Was<br />

it <strong>the</strong><br />

Correct<br />

Length?<br />

YES<br />

Dark = FALSE<br />

Sample = ADAT<br />

(from previous conversion)<br />

YES<br />

YES<br />

NO<br />

NO<br />

Update Run Time<br />

Turn ON TSL251<br />

(start next ADC conversion)<br />

Is<br />

Sample<br />

< Dark<br />

Level?<br />

NO<br />

Reset Level Count<br />

Level Count++<br />

(counting LITE samples)<br />

Turn OFF TSL251<br />

(waits <strong>for</strong> ADC to finish)<br />

A<br />

YES<br />

Level Count++<br />

(counting DARK samples)<br />

Pop PSW<br />

Pop ACC<br />

Enable Interrupts<br />

Reached<br />

Minimum<br />

Dark<br />

Time?<br />

NO<br />

Shutdown Count++<br />

Was<br />

Shutdown<br />

Detected?<br />

NO<br />

YES<br />

YES<br />

Dark = TRUE<br />

(Wand is in place)<br />

Waited<br />

Too<br />

Long?<br />

YES<br />

Push SAVE RUN TIME<br />

on to Stack<br />

NO<br />

Shutdown = TRUE<br />

Figure A-6<br />

B<br />

RETURN FROM INTERRUPT<br />

A-7


Appendix A: SMARTDOT Module Embedded S<strong>of</strong>tware Flowcharts<br />

RECEIVE<br />

BYTE<br />

(from Wand)<br />

A<br />

UART RECEIVE TASK<br />

FLOWCHART<br />

B<br />

C<br />

Wait <strong>for</strong> Start Bit<br />

Wait <strong>for</strong> Parity Bit<br />

Reset Receive Time Out<br />

Bit Sample Interrupt T0)<br />

Bit Sample Interrupt (T0)<br />

Turn ON TSL251<br />

(starts ADC conversion)<br />

New Bit = FALSE<br />

NO<br />

Is<br />

PARITY<br />

Bit<br />

corrrect?<br />

Halt Bit Sample Timer (T0)<br />

Wait <strong>for</strong> Dark<br />

Wand Interrupt (T0)<br />

Valid<br />

START<br />

Bit?<br />

NO<br />

YES<br />

New Bit = FALSE<br />

Turn OFF TSL251<br />

(ADC has already finished)<br />

Set Bit Sample Timer (T0)<br />

<strong>for</strong> 4800 Hz<br />

YES<br />

Wait <strong>for</strong> Stop Bit<br />

Wait <strong>for</strong> 1 to 0 Transition<br />

Wait <strong>for</strong> Data Bit<br />

Bit Sample Interrupt (T0)<br />

Wand Interrupt (T0)<br />

Bit Sample Interrupt (T0)<br />

New Bit = FALSE<br />

Initialize Bit Sampling<br />

New Bit = FALSE<br />

Bit Dark Counter = 0<br />

DARK Level = ZERO Level<br />

Start Bit Sample Timer (T0)<br />

Bit Count = 0<br />

Bit Sample Count = 0<br />

New Bit = FALSE<br />

Shift Bit into RCV Byte<br />

NO<br />

Valid<br />

STOP<br />

Bit?<br />

NO<br />

Done<br />

All 8<br />

Data Bits?<br />

Push NO RESPONSE<br />

on to Stack<br />

YES<br />

New Bit = FALSE<br />

YES<br />

A<br />

B<br />

Figure A-7<br />

C<br />

RETURN<br />

A-8


Appendix A: SMARTDOT Module Embedded S<strong>of</strong>tware Flowcharts<br />

BIT SAMPLE ISR FLOWCHART<br />

RECEIVE TIME OUT ISR FLOWCHART<br />

On:<br />

Timer 0 (T0)<br />

Overflow<br />

A<br />

B<br />

On:<br />

Timer TI<br />

Overflow<br />

Disable Interrupts<br />

Is this a<br />

Middle<br />

Bit<br />

Sample?<br />

NO<br />

Take All<br />

8 Bit<br />

Samples?<br />

NO<br />

Disable Interrupts<br />

Sample = ADAT<br />

(from previous conversion)<br />

YES<br />

YES<br />

NO<br />

Reached<br />

Time<br />

Out?<br />

Start ADC conversion<br />

(TSL251 is already ON)<br />

A<br />

Is<br />

Sample<br />

< Dark<br />

Level?<br />

YES<br />

NO<br />

DARK<br />

Samples<br />

= 2?<br />

YES<br />

NO<br />

YES<br />

Halt Time Out Timer (TI)<br />

Level Count++<br />

(counting DARK samples)<br />

Bit = 1 Bit = 0<br />

Push NO RESPONSE<br />

onto Stack<br />

DARK Level = ZERO Level<br />

(hysteresis between LITE and DARK)<br />

DARK Level = ONE Level<br />

(hysteresis between LITE and DARK)<br />

Bit Sample Count++<br />

Enable Interrupts<br />

Enable Interrupts<br />

B<br />

RETURN FROM INTERRUPT<br />

RETURN FROM INTERRUPT<br />

Figure A-8<br />

Figure A-9<br />

A-9


Appendix A: SMARTDOT Module Embedded S<strong>of</strong>tware Flowcharts<br />

SHUTDOWN TASK FLOWCHART<br />

DONE<br />

SAMPLING<br />

A<br />

SAVE<br />

RUN TIME<br />

BACK TO<br />

SLEEP<br />

Disable Interrupts<br />

Update Run Time<br />

in EEPROM<br />

Switch Active<br />

Scratch Pads<br />

Update Ball Count<br />

in EEPROM<br />

Update Activation Count<br />

in EEPROM<br />

Sample<br />

Overflow<br />

?<br />

NO<br />

Write ZEROs to Unused<br />

Sample Memory<br />

Turn Off TSL251<br />

Turn Off TRX LEDs<br />

SHUTDOWN_PIN = 0 (D-FF CLK)<br />

YES<br />

Write CFG Byte, Sample<br />

End to EEPROM<br />

Run Shutdown Delay<br />

Start Shutdown Time Out<br />

SHUTDOWN_PIN = 1 (D-FF CLK)<br />

(clocks '0' to D-FF on 0 to 1 edge)<br />

SLEEP MODE<br />

Shutdown Time Out or<br />

Pressure on Insert<br />

A<br />

To:<br />

START-UP<br />

Figure A-10<br />

A-10


APPENDIX B - SMARTDOT MODULE SOURCE CODE<br />

SDM-DECL.R07 - Definitions and Declarations .................................................................B-2<br />

SDM-REGS.H - Register bank 0 Definitions......................................................................B-11<br />

SDM-MAIN.R07 - Start-Up, Sampling and Discrimination Routines, ISRs ..................B-12<br />

SDM-MSTR.R07 - Communication Routines, S<strong>of</strong>tware UART, Commands, ISRs ......B-22<br />

SDM-2404.R07 - I 2 C 24C04 EEPROM Routines ...............................................................B-36<br />

B-1


APPENDIX C - SMARTDOT MODULE COMMAND TIMING DIAGRAMS<br />

Upload Command Timing Diagram........................................................... C-2<br />

Mode Command Timing Diagram.............................................................. C-3<br />

Configuration Command Timing Diagram................................................ C-4<br />

C-1


Appendix C: SMARTDOT Module Command Timing Diagrams<br />

'U' - 0x55 'U' - 0x55 'T' EEPROM CONTENTS<br />

512 Bytes<br />

@ 38400 baud<br />

200 msec time out<br />

200 msec time out<br />

200 msec time out<br />

10 msec typical<br />

"HI" character<br />

@ 38400 baud<br />

"HI" character<br />

@ 38400 baud<br />

Echo Command<br />

@ 38400 baud<br />

500 msec typical<br />

to<br />

1second max<br />

160 msec nominal<br />

C-2<br />

500 msec typical<br />

to<br />

1 second max<br />

125 msec<br />

40 msec delay<br />

40 msec delay<br />

40 msec delay<br />

TRANSMIT<br />

1 Start<br />

8 Data<br />

EVEN Parity<br />

2 Stop<br />

0x00 'T' 0x11<br />

uP START-UP<br />

RELEASE<br />

WAND IN PLACE<br />

MODULE: "HI"<br />

WAND: "I'M HERE"<br />

MODULE: "CLEAR TO SEND"<br />

WAND: "TRANSMIT"<br />

MODULE: ECHO<br />

WAND: "CLEAR TO SEND"<br />

MODULE: UPLOADING DATA<br />

uP SHUTDOWN<br />

NULL character<br />

@ 600 baud<br />

Transmit Command<br />

@ 600 baud<br />

XON character<br />

@ 600 baud<br />

RECEIVE<br />

1 Start<br />

8 Data<br />

EVEN Parity<br />

1 Stop<br />

Figure C-1<br />

AMBIENT LIGHT<br />

UPLOAD COMMAND TIMING DIAGRAM


Figure C-2<br />

Appendix C: SMARTDOT Module Command Timing Diagrams<br />

MODE COMMAND TIMING DIAGRAM<br />

0x00 'A','S','X'<br />

AMBIENT LIGHT<br />

'U' - 0x55 'U' - 0x55 ECHO<br />

200 msec time out<br />

200 msec time out<br />

"HI" character<br />

@ 38400 baud<br />

"HI" character<br />

@ 38400 baud<br />

Echo Command<br />

@ 38400 baud<br />

500 msec typical<br />

to<br />

1second max<br />

C-3<br />

500 msec typical<br />

to<br />

1 second max<br />

125 msec<br />

40 msec delay<br />

40 msec delay<br />

10 msec delay<br />

NULL character<br />

@ 600 baud<br />

Set Mode CMD<br />

@ 600 baud<br />

RECEIVE<br />

1 Start<br />

8 Data<br />

EVEN Parity<br />

1 Stop<br />

TRANSMIT<br />

1 Start<br />

8 Data<br />

EVEN Parity<br />

2 Stop<br />

'A' - Auto Mode<br />

'S' - Single Mode<br />

'X' - Test Mode<br />

uP START-UP<br />

RELEASE<br />

WAND IN PLACE<br />

MODULE: "HI"<br />

WAND: "I'M HERE"<br />

MODULE: "CLEAR TO SEND"<br />

WAND: "SET MODE"<br />

MODULE: ECHO<br />

uP SHUTDOWN


Figure C-3<br />

Appendix C: SMARTDOT Module Command Timing Diagrams<br />

CONFIGURATION COMMAND TIMING DIAGRAM<br />

'U' - 0x55 'U' - 0x55 ECHO<br />

200 msec time out<br />

200 msec time out<br />

200 msec time out<br />

10 msec typical<br />

"HI" character<br />

@ 38400 baud<br />

"HI" character<br />

@ 38400 baud<br />

Echo Command<br />

@ 38400 baud<br />

500 msec typical<br />

to<br />

1second max<br />

0x00 0x00 - 0x0E 1 st BYTE<br />

C-4<br />

500 msec typical<br />

to<br />

1 second max<br />

125 msec<br />

40 msec delay<br />

40 msec delay<br />

NULL character<br />

@ 600 baud<br />

Configure CMD<br />

@ 600 baud<br />

Data Byte<br />

@ 600 baud<br />

RECEIVE<br />

1 Start<br />

8 Data<br />

EVEN Parity<br />

1 Stop<br />

AMBIENT LIGHT<br />

TRANSMIT<br />

1 Start<br />

8 Data<br />

EVEN Parity<br />

2 Stop<br />

2 nd BYTE<br />

ECHO<br />

uP START-UP<br />

RELEASE<br />

WAND IN PLACE<br />

MODULE: "HI"<br />

WAND: "I'M HERE"<br />

MODULE: "CLEAR TO SEND"<br />

WAND: "CONFIGURE"<br />

MODULE: ECHO<br />

WAND: 1 st DATA BYTE<br />

MODULE: ECHO<br />

WAND: 2 nd DATA BYTE<br />

MODULE: ECHO<br />

uP SHUTDOWN<br />

40 msec delay<br />

200 msec time out<br />

40 msec delay<br />

Echo Byte<br />

@ 38400 baud<br />

Echo Byte<br />

@ 38400 baud<br />

Data Byte<br />

@ 600 baud<br />

ECHO


APPENDIX D - MASTER "ANALYSIS" CALCULATIONS SOURCE CODE<br />

vCalcSpectrum ........................................................................................................................D-3<br />

vCalcFilterData .......................................................................................................................D-5<br />

fAnalyzeData ...........................................................................................................................D-7<br />

vCalcReleaseImpactRPMs ...................................................................................................D-14<br />

vCalcVelocity Data ...............................................................................................................D-15<br />

vCalcDistanceData ................................................................................................................D-16<br />

vCalcRevLocations ...............................................................................................................D-17<br />

D-1


APPENDIX E - 300 GAME MASTER SCREEN CAPTURES<br />

Frame<br />

Release<br />

MPH RPMs<br />

Impact<br />

MPH RPMs<br />

L<strong>of</strong>t<br />

(in)<br />

Time<br />

(sec)<br />

Average<br />

MPH<br />

Total<br />

Revolutions<br />

Average<br />

RPMs<br />

1 16.6 425 15.4 560 44 2.52 16.3 19.4 462<br />

2 16.7 415 15.4 569 44 2.48 16.5 18.5 448<br />

3 16.6 423 15.5 551 49 2.48 16.5 18.4 445<br />

4 16.3 424 15.2 547 48 2.54 16.1 19.1 451<br />

5 16.6 412 15.2 569 54 2.50 16.4 18.4 442<br />

6 16.5 426 15.3 551 -- 2.50 16.4 18.2 437<br />

7 16.8 426 15.7 548 54 2.48 16.5 19.2 465<br />

8 16.3 422 15.1 553 -- 2.56 16.0 19.4 455<br />

9 16.5 425 15.3 558 -- 2.52 16.3 19.2 457<br />

10 16.8 434 15.8 551 -- 2.47 16.6 18.8 457<br />

11 16.7 427 15.5 554 -- 2.48 16.5 18.6 450<br />

12 16.6 426 15.6 542 -- 2.48 16.5 18.4 445<br />

Min 16.3 412 15.1 542 44 2.47 16.0 18.2 437<br />

Max 16.8 434 15.8 569 54 2.56 16.6 19.4 465<br />

Median 16.6 425 15.4 552 49 2.49 16.5 18.7 451<br />

Mean 16.6 424 15.4 554 49 2.50 16.4 18.8 451<br />

Deviation ±1.5% ±2.5% ±2.3% ±2.4% ±5.0% ±2.0% ±1.8% ±3.2% ±3.1%<br />

Raw Data Screen Captures (Figure E-1) ..................................................................E-2<br />

Spectrum Screen Captures (Figure E-2) .................................................................E-4<br />

<strong>Analysis</strong> Screen Captures (Figures E-3) .................................................................E-6<br />

E-1


Appendix E: 300 Game <strong>Analysis</strong><br />

Frame 1 Frame 2<br />

Frame 3 Frame 4<br />

Frame 5 Frame 6<br />

Figure E-1a E-2


Appendix E: 300 Game <strong>Analysis</strong><br />

Frame 7 Frame 8<br />

Frame 9<br />

Frame 10, 1 st Ball<br />

Frame 10, 2 nd Ball<br />

Frame 10, 3 rd Ball<br />

Figure E-1b E-3


Appendix E: 300 Game <strong>Analysis</strong><br />

Frame 1 Frame 2<br />

Frame 3 Frame 4<br />

Frame 5 Frame 6<br />

Figure E-2a E-4


Appendix E: 300 Game <strong>Analysis</strong><br />

Frame 7 Frame 8<br />

Frame 9<br />

Frame 10, 1 st Ball<br />

Frame 10, 2 nd Ball<br />

Frame 10, 3 rd Ball<br />

Figure E-2b E-5


Appendix E: 300 Game <strong>Analysis</strong><br />

Frame 1 Frame 2<br />

Frame 3 Frame 4<br />

Frame 5 Frame 6<br />

Figure E-3a E-6


Appendix E: 300 Game <strong>Analysis</strong><br />

Frame 7 Frame 8<br />

Frame 9<br />

Frame 10, 1 st Ball<br />

Frame 10, 2 nd Ball<br />

Frame 10, 3 rd Ball<br />

Figure E-3b E-7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!