Ultrasonic USB Head Tracker
Back in 2004 I designed and built an ultrasonic head tracker
using a Cygnal C8051F321 development kit and some custom hardware. The purpose was for use in a game pretending
that the screen was a window and having a 3D environment update depending on
where your head is, satisfying one of the criteria for the brain to deduce 3D
data from a scene. One of the
requirements was that the system had to be very cheap to build.

System Design
The basic design was three Op-Amps amplifying output from
three Ultrasonic transducers which was fed through three comparators to create
a simple one bit signal which could be sampled by any input pin on the microcontroller. The one bit conditioning was used to keep the
amount of software processing to a minimum and thusly keeping the
microcontroller cheap.
The system worked as follows.
- Locate rough distance from
all transducers to by sending out a pulse and waiting for a response per
receiver.
- Send out a pulse of
length 8 cycles.
- Given the known
minimum distance from the transmitter to any of the receivers start
sampling all channels simultaneously when signal is expected to arrive.
Sample all receivers simultaneously for a period long enough to receive
all receiver data.
- Analyse the resultant
data and work out the phase difference between transmitted signal and received
signal, using this to apply a delta to all transducer distances.
- Repeat, waiting an
appropriate amount of time for reflected signals to have dissipated. If
the signal quality isn't good enough to retrieve a phase difference then
go back to step 1.
The
three resultant distances are sent via the USB port (endpoint 1) to the
computer where a Java program communicating via a custom dll rendered the
result.
Final thoughts
After completing the initial prototype I found the following issues that would need to be resolved for any commercial product.
- If you play music whilst
using the tracker is running the tracker jitters due to the
interference. A possible solution
is to require the wearing of headphones.
- The tracker loses tracking
if you move the transmitter too quickly. Can be improved by using a higher sample
rate, but this conflicts with a higher degrading of the signal due to
reflections and a requirement for a more powerful microcontroller.
- Reflections. Placing
anything in the way or near parallel to the transmitted signal causes errors.
This was to be expected.
Files of note:
Main.c
Sample.A51
