EE645 Embedded Systems Design - Student Projects 2012: Dixon & Morris

6-Axis Microcontroller for 3D Environment

Kris Dixon and Alex Morris

University of Alaska Fairbanks

EE645 - Embedded Systems Design

10 May 2012

Introduction:

As computer graphics hardware improves, 3-dimensional environments are becoming increasingly popular, with both practical and recreational applications. A digital environment allows designers to better visualize and analyze architectural designs, medical devices, mechanical parts, consumer products, etc. It is possible to start with a digital design and then use it in applications to the physical world, or conversely, start with a physical object, map it into the digital domain, and perform analysis. In any case, a powerful and intuitive interface between the digital 3D environment and the physical world is paramount.

The traditional computer mouse is a common tool for manipulating objects on a computer screen, especially for 2-dimensional environments. With the growing popularity of 3-dimensional environments, a different kind of tool is necessary. The purpose of this project was to design and build a prototype for a computer mouse that is more powerful and intuitive for manipulating an object in a 3-dimensional graphical environment.

The Design:

The goal of our design was to create a controller that would transmit information to a computer such that the motions of the controller would be directly mimicked by the motions of an object on the computer screen: If the user moves the controller left, the object moves left. If the user rotates the controller, the object rotates. In order to faithfully recreate physical motions of the user in a graphical environment, we needed to gather information in 6 axes: translational acceleration in three axis directions and rotational velocity about three axes.

We used the ADXL335 3-axis accelerometer and the ITG3200 3-axis gyroscope from SparkFun to measure acceleration and rotational velocity. The MSP430 microcontroller is the backbone of the device, sampling data 120 times per second from both the accelerometer and gyroscope and then transmitting the data to the PC 30 times per second. In choosing the sample rate we had a trade-off between accuracy and power consumption, and in choosing the transmit rate we had a trade-off between "choppiness" of the graphical motion and power consumption. Although commerically-available mice can have sampling rates as high as 1000 Hz, we informally determined by experiment that 120 Hz was sufficient to accurately track the motions of the user. To determine a minimum transmit rate, we learned that the human eye detects smooth motion for refresh rates greater than 30 Hz, which was confirmed by our trials.

The ADXL335 IC and ITG3200 IC came pre-soldered to their own breakout boards, which we soldered to a generic protoboard and plugged in to the MSP-EXP430F5438 Experimenter Board. The 3D mouse is wired to the PC using a USB connection. <insert picture of device>

Operation:

The MSP430 samples data from the accelerometer using the internal Analog-to-Digital converter, and samples data from the gyroscope using the digital I2C interface. The following figure is the data (yellow) and clock (green) signals on the I2C bus when the gyroscope IC is transmitting data to the MSP430. The MSP430 receives one of these transmissions 120 times per second. Immediately after each reception, the MSP430 samples data from the accelerometer using the Analog-to-Digital converter.

The MSP430 then averages the data every 4 samples and then transmits the result to the PC using the UART serial communication protocol. The following figure is the signal on the line when the MSP430 transmits data to the PC. The MSP430 sends one of these transmissions 30 times per second.

Results:

The PC reads acceleration and rotational velocity data from the COM port and translates it into motion about 6 axes. Below is an example of 3-axis accelerometer data received by the PC when the device is moved slowly and tapped by the user.

We created a graphical environment using OpenGL. Using the device, the user can control the movement and orientation of a 3D graphical teapot. Moving the device to the left moves the teapot to the left, rotating the device rotates the teapot, etc.

Final Thoughts:

We created a device that in many ways is comparable to commercially-available products in terms of performance and design features. An advantage of our prototype is its adaptability to specific applications. The sample rate and transmit rate are programmable parameters, so the device may be tailored for a range of desired accuracies, resolution, etc. The total cost of the prototype, including MSP430 experimenter's board, gyroscope IC, and accelerometer IC, was about $150. If we were to buy components in bulk and without their unneeded accessories, hardware costs would total less than $50. This is about half the price of the cheapest 3D mouse we were able to find on the web.