For this course, I:

  • Created physical version of Sega’s “Super Monkeyball” game with a rotating tabletop with LED lights, ball-tracking camera, and controller
  • Collaborated with 3 other project members
  • Programmed camera interface in C to use SPI
  • Programmed servos to control the rotating board
  • Programmed game logic
  • Wrote progress and final reports

What is Super Monkeyball?

Super Monkey Ball is a GameCube game where the player moves around Monkey Balls by tilting the stage. In the video game, the objective was to make it from start to finish without rolling off the stage and to collect bananas to gain points. In this project, we have replicated the game in real life. The balls are placed on a flat surface that uses servos to tilt. A pixy camera tracks the location of the ball, and a program on the Nucleo stabilizes the ball on the flat surface at any point. A Wii Fit balance board is used to control the tilt of the surface to move the ball in different directions. We have created 6 different levels to play by defining in software where valid paths and edges/walls are, and the tilting surface uses lights to signify where those are. Falling off the edge of the green-lit path results in the ball being reset.

Components

All Components are included in the final project, and work with the project.

  • STM Nucleo Board
  • 2 Servos connected to the tilting board
    • These use PWM signals from the Nucleo which requires timers to define arm position.
  • LED light strips under the surface
    • These work as 169 individual LEDs with 24 bit registers daisy-chained together in a way similar to SPI. The registers are 8 bit values for the colors red, green, and blue.
    • The individual bit values are set using PWM at different duty cycles. A DMA is used to set all the LEDs almost instantaneously.
  • Pixy Cam
  • Wii Fit Board, with UART interface module
    • The Nintendo version of Bluetooth was not compatible with the Nucleo, so a program on a Windows PC converted the board signals to percentages sent with UART over USB. The UART module took the USB info and converted it to UART signals that the Nucleo could use. We set up DMA (direct memory access, a form of memory-mapped i/o defined in the ABI with some background hardware tasks) on the Nucleo so that explicit polling was not required.

My Contributions:

  • Set up the SPI interface with the pixy cam and the structs for receiving pixy data
  • Calibrated distances from the pixy cam with error
  • Wrote game state logic
  • Setup Github repo to track code changes and revert if needed

System Integration

  • The project used components in necessary contexts and allowed for incremental features to be added based on game logic. 
  • Adding a new level takes about 5 minutes.
  • The ball stabilization is fairly smooth, fast, and doesn’t overshoot. The PD controller can be easily changed in the code to change responsiveness.
  • All devices are responsive in the eye of the game player.
  • The logic to determine position from the pixy cam accounts for the tilt in the board that would distort pixy values.
  • The logic to tilt the board based on input from the balance board also opposes ball velocity to make it easier for gamers to control the ball.
  • The LEDs match up well to the detected ball location, and there is accounting for error in falling off edges or picking up bananas. This is seen in when a player’s ball rolls over a banana, the board properly turns that pixel from yellow to green.
  • The C code contains many functions such that the main function primarily handles the game logic and does not manually control devices.

Technical Achievements

  • Working physical version of Super Monkeyball with 6 levels.
    • Game has 6 defined paths. Players must collect all “bananas” (yellow pixels) and not fall off the path (red pixels) before reaching the finish area (purple pixels). The game detects when any of these events happen.
  • Automatic stabilization
    • Inspired by Youtube videos, our board can automatically stabilize the ball to any point. For the game, the ball stabilizes first at the center of the board, then the start location, and then the control is turned over to the player. 
  • Audience response
    • The game regularly drew a crowd in both lab and expo.

Functional Diagram

Design Diagram

Expo Poster

Setbacks

  • The pixy cam was generally unreliable. With changing light conditions, it might not pick up a corner or the ball. Also, the pixy would send invalid data. We fixed this by always sending the pixy a “getVersion” request before a “getBlocks” request. Still, the pixy would begin to send bad data after an average of 10 minutes, and required a power cycle.
  • The Wii Fit Balance Board did not connect directly to the Nulceo since the Nucleo doesn’t work well with bluetooth .
  • Users had trouble with falling off the entire board (as opposed to the virtual board), so we fixed this by adding a border around the whole board.

Device Costs

  • 1 Nucleo board ($20, provided)
  • 1 Pixy Cam ($60, provided)
  • 1 3A Power Supply ($8.50)
  • 2 Servos ($22.25)
  • Servo Accessories – 
    • Pushrod connectors and end ties ($17)
    • Servo Arms ($12)
    • Servo Brackets ($15)
  • Wood, Plexiglass, Acrylic Light Panel, and Cardboard ($41.50)
  • 1 UART Module ($7.50, provided)
  • 13 LED Strips ($21, provided)
  • 1 Wii Fit Balance Board ($35)

Project Total: $259.75