Wireless Head Tracking Gimbal/Communication

Communication

As this project uses a number of devices for different tasks, robust communication among these devices is necessary for optimal performance.

Figure: Mapping of communication peripherals used in this project.

Contents:

I2C

The gimbal IMU (MPU6050) supports I2C communication which can be used to retrieve data from the IMU. The gimbal MCU (TIVA C) communicates with the sensor using its I2C1 module. The communication process starts with the MCU commanding the sensor to wake up. Then the MCU sends the slave address followed by the register address. The sensor responds by sending the value of the corresponding register address to the MCU.

The flowcharts below depicts the algorithm used for I2C communication

I2C Receive Flowchart I2C Transmit Flowchart

UART

UART module 1 of the gimbal MCU (TIVA C) is used to communicate with the headset IMU. The headset IMU has an onboard ATMEL ATMEGA328 microcontroller which is programmed to serially send data in the following manner:

Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
'y' <Yaw Value> 'p' <Pitch Value> 'r' <Roll Value> 'y' <Yaw Value>

A snippet of a log file logged by a serial communication terminal window program shows the data from the IMU received by the PC via USB in figure below

Figure: Serial data output from the headset IMU logged in hexadecimal values.

Here we can see that 0x79 is equivalent to char y, followed by that 0xFE is the yaw value, then 0x70 is equivalent to char p and 0x17 is the pitch value. Similarly, 0x72 is equivalent to char r and the roll value is 0x92 and so on. The data transmitted by the headset IMU is received by Xbee 2 which transmits the data wirelessly to Xbee 1. Xbee 1 then finally transmits the headset IMU data to the gimbal MCU. UART module 0 of the gimbal MCU is used to communicate with the PC in order to debug/log using the UARTprintf function from the UARTstdio library.

In order to read the serial data received by the TIVA C microcontroller, the following algorithm is used:

Figure: Flowchart depicting algorithm used by TIVA C microcontroller to interpret headset IMU data.