Webpage Info

 

1.      Project Title: Wii Head Tracking

 

2.      Members: Rich Castellano, David Devecsery, Salvator Gomez

 

3.      Introduction: Our project idea is a 3D positioning system that the user interfaces with by wearing a pair of glasses with two infrared diodes mounted on top. The system will obtain coordinates from the Wiimote's IR camera and we will calculate and produce x, y, and z values. These points will be fed into a 3D engine and a 3D cube will be shifted to reflect the user’s perspective on the object using a VGA driver to display it on a monitor.

 

4.      High Level Design:

a.      The VGA implements a polygon drawing algorithm in which we divide the polygon into triangles to fill the polygon and fills multiple triangles in parallel and recombined them into the overall polygon stored in the buffer.  Additionally, we had to run control signals from the VGA to the processor so the processor would know when to update the screen in order to sync with the double buffering.

b.      The 3D object engine uses trigonometry to transform a set of points based on the location of the user.

c.       Subcomponents

                                                              i.      Lab PPC/FPGA

1.      3D object engine

                                                            ii.      Lab PC

1.      Uses Bluetooth to obtain Wiimote data

2.      Sends data to PPC through serial port

                                                          iii.      Altera DE2-70 FPGA

1.      Double buffers VGA

2.      Transforms polygon points to pixels

                                                          iv.      USB Bluetooth adapter

1.      Connects to Wiimote

                                                            v.      Wiimote

1.      Uses infrared camera to track user location

                                                          vi.      Two Infrared Diode Transmitters

1.      Allows Wiimote camera to track two points

                                                        vii.      VGA Display

1.      Displays the object based on user’s location

 

 

 

d.      Functional Block Diagram:

 

 

 

 

 

 

 

 

 

 

5.      Member Task Distribution:

a.       Rich: I2C driver/Wii Bluetooth Sync/MPC Serial Communication/Math Libraries

b.      David: VGA driver/3D Engine/Math Libraries

c.       Salvator: I2C driver/3D Engine/Math Libraries

6.      Hardware Design:

a.       The hardware implements a polygon drawing algorithm composed of several main components:

                                                              i.      An I2C slave component to receive points

                                                            ii.       A triangle detection unit which uses a simple algorithm to divide a convex polygon into triangles and then buffers the output from the triangle detector and sends it through the triangle fillers

                                                          iii.      An algorithm to run multiple triangle fillers in parallel that calculate which pixels are inside of a given triangle, and add those pixels to the pixel buffer

                                                          iv.      A pixel buffer which receives multiple pixels in parallel and outputs a single pixel based on priority to the VGA ram

                                                            v.      A VGA ram that outputs to a VGA driver which draws pixels to the screen.

 

7.      Software Design:

a.      The software has four main components

                                                              i.      3D object engine

1.      This is coded in C and consists of four main files:

a.       Vect3d.c

                                                                                                                                      i.      Uses appropriate trigonometry to calculate angles and distances

b.      Transform3D.c

                                                                                                                                      i.      Translates passed in vertices

c.       ViewWindow.c

                                                                                                                                      i.      Creates an appropriate view window for the polygon

d.      Ppcmath.h

                                                                                                                                      i.      Math libraries for sin/sqrt/cos/atan

                                                            ii.      Serial communication and receiving Wiimote data

1.      This is coded in C# and essentially connects to the Wiimote through the Bluetooth adapter hooked up to the PC.  It receives initializes the Wiimote and receives data from it, converting the data into x and y points and a head distance to be used as a z coordinate.  It then opens a serial port to communicate with the PPC and writes the data over the serial port.

                                                          iii.      I2C driver

1.      This is coded in C and initializes the MPC823 for I2C communication.  The main functions allow for writing and reading and this driver is used to send vertex data to the hardware to draw the polygon.

                                                          iv.      Assembly files

1.      Putchar

a.      Enables us to write data over serial communication

2.      Getchar

a.      Enables us to read data over serial communication

3.      Uart

a.      Initializes MPC823 for serial communication with correct baud rate

 

 

 

 

 

 

 

 

 

 

 

b.      Flow Chart:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

8.      Results of the Design:

a.      Originally we took the IR camera out of the Wiimote and hooked it up to a proto board, which fed into the MPC823.  Our goal was to use I2C to talk directly to the IR camera from the MPC823.  In the end the documentation was not accurate enough for us to succeed.  We were able to communicate through I2C, but not able to initialize the camera correctly.  This led us to seek other solutions, in which we ended up using a USB Bluetooth adapter to connect to the Wiimote and then feed the data to the MPC823 through a serial port.

b.      We also originally planned to use SPI drivers to send vertex data to the hardware, but switched to I2C as it was easier and worked well.

c.       We had to use an additional FPGA (Altera) because of memory capacity and we used the SSRAM on the Altera to read and write our data at an adequate rate.

d.      Finally, when attempting to draw a 3D object we had some issues with the VGA driver trying to render multiple faces of the cube and we ended up just drawing a simple triangle

   

9.      Conclusions:

a.      It is possible to implement our project with the listed components.

b.      More processing power would have been better since we could have used more bits for the colors if we wanted, as well as increase the frame-rate of our display.

c.       If we did this again, we would have used the Altera’s on board ram and embedded processor to enhance performance and not have to deal with complicated SSRAM.  We would not have spent time trying to talk to the Wiimote through I2C from the MPC823 and would have used Bluetooth right off the bat. 

 

10.  Media:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

11.  References:

a.       Chung, Johnny L. "Head Tracking for Desktop VR Displays using the Wii Remote." Johnny Chung Lee Projects Wii. 10 Apr. 2009 http://johnnylee.net/projects/wii/.

b.      "IR Sensor - Wiimote Wiki." Main Page - Wiimote Wiki. 10 Apr. 2009 http://wiki.wiimoteproject.com/IR_Sensor.

c.       "Wiimote." WiiBrew. 10 Apr. 2009 http://wiibrew.org/wiki/Wiimote#IR_Camera.

d.      "WiiLi.org Wii Linux - Wiimote." 10 Apr. 2009 <http://homepage.mac.com/ianrickard/wiimote/wiili_wimote.html>.

e.       "Hacking the Wiimote IR camera." Make: Online. 10 Apr. 2009 http://blog.makezine.com/archive/2008/11/hacking_the_wiimote_ir_ca.html?CMP=OTC-0D6B48984890.

f.       "Translated version of http://www.kako.com/neta/2007-001/2007-001.html." Google Translate. 10 Apr. 2009 http://translate.google.com/translate?prev=_t&hl=en&ie=UTF-8&u=http%3A%2F%2Fwww.kako.com%2Fneta%2F2007-001%2F2007-001.html&sl=ja&tl=en&history_state0=.

g.      "Translated version of http://www.kako.com/neta/2008-009/2008-009.html." Google. 10 Apr. 2009 http://74.125.95.132/translate_c?hl=en&ie=UTF-8&sl=ja&tl=en&u=http://www.kako.com/neta/2008-009/2008-009.html&prev=_t&usg=ALkJrhj9k5G3KjYTZ0Z1pDphhf-UMeaYcA.

 

te which pixels are inside of a given triangle, and add those pixels to the pixel buffer

                                                          iv.      A pixel buffer which receives multiple pixels in parallel and outputs a single pixel based on priority to the VGA ram

                                                            v.      A VGA ram that outputs to a VGA driver which draws pixels to the screen.