2–96
Motorola Sensor Device Data
For More Information On This Product,
Go to: www.freescale.com
IMPLEMENTATION — SOFTWARE
The operation of the Baseball Pitch Speedometer is very
simple. Upon power on reset, the output LEDs are initialized
to display “00” and “Best Speed.” The analog to digital con-
verter is turned on and the offset voltages of the accelerome-
ters are measured and stored. Finally, all the variables are
initialized and the MCU goes into a dormant state, where it will
wait for a negative edge input capture pulse to trigger it to
begin processing the crash signal.
Once the input capture flag is set, the MCU will immediately
begin the analog to digital conversion sequence. As it digitizes
the crash signature, it will calculate the absolute difference
between the current value and the stored offset voltage value.
It will integrate by summing up all the differences. Figure 2
shows a typical crash signature of the Baseball Pitch
Speedometer. As illustrated, starting at the point of impact (A),
the acceleration will initially ramp up, reaching a maximum,
then decrease as the target is displaced. Because the target
is constrained to the frame structure, the acceleration will
continue to decrease until it reaches a minimum (point B),
which correspond to the travel stop of the target. It is difficult
to determine exactly when point B will occur, because the
amplitude and duration of the initial acceleration pulse will vary
with ball speed. Therefore, the capture window duration is set
so that it will encompass most typical crash signatures, while
rejecting most of the secondary ripples that result as the
energy is dissipated by the system.
After integrating the four signals, the results are added
together to produce an overall sum. This procedure averages
out the individual responses and reduces measurement error
due to the variability of where the ball lands on the target. The
MCU then divides the grand sum by an empirically predeter-
mined constant of proportionality. The result will then go
through a binary to BCD conversion algorithm. A look–up table
is used to match the BCD numbers to their corresponding
7–segment display codes. The calculated speed is displayed
on the two digit 8–segment displays (one segment corre-
sponds to the decimal point), and the “Your Speed” LED is
turned on while the “Best Speed” LED is turned off. After a
duration of approximately five seconds, the LEDs are toggled
and stored best speed is redisplayed. The five second delay
is used to provide enough time for the user to check his/her
speed and also to allow the target to return to a rest state. The
system is now ready for another pitch. A complete listing of the
software is presented in the Appendix.
CONCLUSION
The Baseball Pitch Speedometer works fairly well, with an
accuracy of +/– 5 mph. The dynamic range of the system is
also worthy of note, measuring speeds from less than 10 mph
up to well above the 70 mph range. One key point to empha-
size, is that the system is empirically calibrated, and so to
maintain good accuracy the system should only be used with
balls of mass equal to those used during calibration.
Although intended mainly for training and recreational pur-
poses, the Baseball Pitch Speedometer demonstrates a very
important concept concerning the use of accelerometers.
Accelerometers can be used not only to detect that an event
such as impact or motion has occurred, but more importantly
they measure the intensity of such events. They can be used
to discern between different crash levels and durations. This
is very useful in applications where it is desired to have the
system respond in accord with the magnitude of the input
being monitored. An example application would be a smart
air bag system, where the speed at which the bag inflates is
proportional to the severity of the crash. The deployment rate
of the airbag would be controlled so that it does not throw the
occupant back against the seat, thus minimizing the possibil-
ity of injury to the occupant. Another application where this
concept may be utilized is in car alarms, where the response
may range from an increased state of readiness and monitor-
ing, to a full alarm sequence depending on the intensity of the
shock sensed by the accelerometer. This could be used to
prevent unnecessary firing of the alarm in the event that an
animal or person were to inadvertently bump or brush against
the automobile.
F
Freescale Semiconductor, Inc.
n
.