Welcome to our Sumo Kit for Google webpage!

If you’ve received a boxed RoboSlam Sumo kit you’re nearly ready to host your own robotic Sumo tournament.  Your kit includes two robots that are eager to Sumo wrestle: one pre-programmed, fully assembled mini Sumo robot and one pre-programmed robot that needs to be assembled!

These robots are just like the ones that are built by our workshop participants. They’re designed to introduce complete beginners to electrical and electronic engineering, robotics, and computer science. For short workshops or workshops with very young children, we sometimes pre-program the robots, as we have done with the two robots in your box.

Each of your robots is programmed to spin until it senses an object ahead–then charge towards the object, attempting to shove it out of the arena.

On this page you will find:

1) Assembly Instructions: Instructions for assembling your pre-programmed Google demonstration robot.

2) RoboSumo Arena: Advice for drawing a RoboSumo arena and commencing your Sumo tournament.

3) Programming Information: Information on re-programming your robot.

 
Assembly Instructions

Step 0: Construct the body of the robot

Before assembling the electronics of the robot, a little bit of mechanical construction is required in order to create a solid platform onto which the electronics, motors and batteries can be attached. This only takes a few minutes and the process is illustrated and explained in the following photo sequence. Please click on the first image to view it at full size. The arrow keys can be used to navigate through the rest of the photo sequence.

Now that the basic body of the robot is built, here’s how to assemble your bag of electronic parts into a fully-functioning, autonomous robot that performs in robotic sumo bouts without any form of remote control:

Step 1: Switch to Chrome/Firefox

In the unlikely event that you’re reading this in Internet Explorer, please switch to Chrome or Firefox now. Some elements of these instructions do not display correctly in Internet Explorer.

Step 2: Prepare wires

A total of 23 wires are required to assemble and program the robot. Each wire has been pre-cut to the required length and has 5-6 mm of its plastic insulation stripped from each end. Every piece of wire in the circuit is of one of four standard lengths:

  • Short: 30mm in length, including 5-6mm stripped at each end.
  • Medium: 50mm in length, including 5-6mm stripped at each end.
  • Long: 60mm in length, including 5-6mm stripped at each end.
  • Extra Long: 100mm in length, including 5-6mm stripped at each end.

The quantity of each length in each colour is:

  • BLACK: 3 short, 2 medium, 1 extra long
  • RED: 2 short, 2 medium
  • ORANGE: 2 medium
  • PURPLE: 2 medium, 2 long
  • BROWN: 1 short, 2 medium
  • GREY: 2 medium
  • YELLOW: 1 extra long
  • GREEN: 1 extra long

roboslam_wire_lengths

Over the next few steps, we build a basic breadboard circuit using the MSP430 microcontroller to blink two light emitting diodes (LEDs) on and off. These LEDs are used as indicator lights in the final robot.

Step 3: Connect the battery pack to the breadboard

The breadboard is the rectangular plastic board with the grid of holes on the top. We use it to build and test electronic circuits quickly without any soldering. Each of the two main panels in the centre of the breadboard consists of 30 short rows of 5 connected holes. To connect any two wires (or components) together, just plug them both into the same short row. For example, wires plugged into holes a3 and e3 will become electrically connected because they’re both in the same row of 5.

The long red and blue lines on each side of the breadboard indicate that each of these long rows of holes is connected continuously along the full length of the board. We call these long rows “rails”. They are normally used to distribute supply voltage to different parts of the circuit. The red rail is used for the positive supply voltage (either 6V or 3.3V in this circuit). The blue rail is used for the negative supply voltage (0V).

Connect the battery pack to the breadboard as shown below. Put three batteries into the battery pack, but leave the last one out until the circuit is ready to be powered up.

Connect battery pack to breadboard

Step 4: Install the voltage regulator

The battery pack supplies 6 volts to the circuit, but this supply voltage is too high for some of the components in our circuit, so we need to use a voltage regulator to provide a lower voltage. The LM1117T is a 3.3 volt regulator which we connect as shown below to feed a stable 3.3V supply to the red rail on the right hand side of the breadboard.

  • Very carefully insert the LM1117T voltage regulator (the black rectangular component with three legs and a metal back plate) into holes c28, c29 and c30 of the breadboard. The metal back plate of the voltage regulator should be on the left, as shown in the illustration below. It’s tricky to coax the three legs of the LM1117T into the breadboard without bending them, so be careful! If you happen to have a long-nose pliers, it helps to insert the voltage regulator by holding the three pins with them.
  • Connect a short red wire between hole a28 and the red rail on the left-hand side of the breadboard (6V).
  • Connect a short black wire between hole a30 and the blue rail on the left-hand side of the breadboard (0V).
  • Connect a medium orange wire between hole e29 and the red rail on the right-hand side of the breadboard (3.3V).
  • Connect a medium black wire between hole e30 and the blue rail on the right-hand side of the breadboard (0V).
  • Connect a 220uF capacitor between the two rails on each side of the breadboard, as shown below. The capacitor is the small purple cylindrical component with two parallel legs sticking out the bottom. These capacitors act as reservoirs of electric charge, reducing unwanted fluctuations of the 6V and 3.3V supply voltages. Note that the minus leg of the capacitor, which is marked by a long black stripe running down the body of the capacitor, must be connected to the blue rail (0V).

Add the voltage regulator to the circuit

Step 5: Install the MSP430 microcontroller

WARNING: The MSP430 chip is very fragile! The pins bend and break easily, so be careful when placing it into the breadboard.

The “brain” of the robot is the MSP430 microcontroller. A microcontroller is a complete computer on a single chip. It contains a microprocessor, RAM memory, flash memory (like in a USB memory stick) and other useful features.

Place the MSP430G2452 microcontroller in the position shown. Make sure that the end of the chip with the semi-circular indentation is in row 3.

Add the MSP430 to the circuit

Step 6: Connect the voltage supply to the MSP430

To supply power to the MSP430 microcontroller,

  • Connect a medium orange wire between hole d3 and the red rail on the right-hand side of the breadboard (3.3V).
  • Connect a short black wire between hole j3 and the blue rail on the right-hand side of the breadboard (0V).

To prevent the microcontroller from resetting while the robot is running, a 10kΩ resistor (colour code: brown, black, orange, gold) must be placed between hole i7 and the red rail on the right-hand side of the breadboard (3.3V).

Connect the voltage supply to the MSP430

Step 7: Add two indicator LEDs

  • Connect the green LED between hole e1 and hole e2. One side of the LED is slightly flattened. That’s the side that should be connected to hole e1.
  • Connect a 220Ω resistor (colour code: red, red, brown, gold) between hole b1 and the blue rail on the left-hand side of the breadboard (0V). This resistor limits the amount of current that flows through the green LED so that it doesn’t burn out.
  • Connect a short brown wire from hole c2 to hole c4. This wire will supply current from pin 2 (which is also called P1.0) of the MSP430 to the green LED.
  • Connect the red LED between holes f1 and f2. The side of the LED that is slightly flattened should be connected to hole f1.
  • Connect a 220Ω resistor (colour code: red, red, brown, gold) between hole j1 and the blue rail on the right-hand side of the breadboard (0V). This resistor limits the amount of current that flows through the red LED so that it doesn’t burn out.
  • Connect a medium brown wire from hole h2 to hole h8. This wire will supply current from pin 15 (which is also called P1.7) of the MSP430 to the red LED.

Add the indicator LEDs to the circuit

Step 8: Install the SN754410NE motor driver chip

In this step we begin to add the motor control functionality to the robot.

  • Add the SN754410NE driver chip to the breadboard as shown below. The end of the chip with the semi-circular indentation must be in row 19.

step08_sn754410ne_ic

Step 9: Connect the voltage supply to the motor driver chip

Add the supply voltage connections shown below:

  • A short red wire between the left-hand red rail (6V) and hole a26.
  • A short black wire between the left-hand blue rail (0V) and hole a23.
  • A medium red wire between holes d26 and g19.

Connect the voltage supply to the SN754410NE IC

Step 10: Connect the microcontroller to the SN754410NE driver chip

In this step, we connect the digital outputs of the MSP430 microcontroller to the digital inputs of the SN754410NE driver chip. These connections allow the microcontroller to send signals to the driver chip to control the motors:

Add the connections shown below.

  • A long purple wire between holes d10 and d25.
  • A medium purple wire between holes d11 and d20.
  • A long purple wire between holes d12 and g25.
  • A medium purple wire between holes g12 and g20.

Connect the motor control signals from the MSP430 to the SN754410 IC

Step 11: Connect the motors to the SN754410NE driver chip

  • Connect the wires of the left motor to holes c21 and c24
  • Connect the wires of the right motor to holes h21 and h24

There’s no need to worry about which way around you connect the wires for each motor. If the motor turns the wrong way, you can simply swap the wires around later on.

step11_motors

Step 12: Add the rangefinder and connect it to the microcontroller

The rangefinder is an ultrasonic distance sensor. During a sumo bout, the robot uses this to detect its opponent.

  • Add the rangefinder to the breadboard in the position shown (holes j14, j15, j16 and j17).
  • Connect a medium black wire from the left-hand blue rail (0V) to hole f14.
  • Connect a medium red wire from the left-hand red rail (6V) to hole f17.
  • Connect a medium brown wire between hole h9 and hole h16. This wire is used to transmit a trigger pulse from the MSP430 to the ultrasonic sensor each time the distance needs to be measured.
  • Connect the diode between hole e15 and hole f15, taking care that the end of the diode with the black stripe is inserted into f15.
  • Connect a medium grey wire between hole c9 and hole c15. This wire is used to transmit the “echo” pulse from the ultrasonic sensor to the MSP430 each time the distance has been measured. The duration of the echo pulse is proportional to the distance measured.
  • Connect a 10kΩ resistor (colour code: brown, black, orange, gold) between hole a3 and hole a9.

Add the rangefinder sensor to the circuit

Step 13: Test the robot

To test the rangefinder, we will make the robot perform a simple sumo wrestling behaviour. When an object is detected in front of the rangefinder, the green LED turns on and the robot drives forwards, but when nothing is detected, the red LED turns on and the robot turns around on the spot. The MSP430 microcontroller has been pre-programmed with example code that implements this behaviour, so to test the robot, all that is required is to insert the last battery and switch on the power (there’s a power switch on the batter pack):

Insert the last battery

When an object is detected in front of the rangefinder sensor, the green LED lights and both motors should drive forward. You can test this by holding you hand still about 15cm in front of the rangefinder. Once the green LED is lit, if either motor is turning backwards, then its two wires simply need to be swapped where they connect to the breadboard.

 
RoboSumo Tournament Information

Once you have two working robots, you’re ready to stage a sumo bout!

Your robot assembly kit includes a piece of chalk tied to a string. To create a Sumo arena about 35 cm in radius,  you need to find a flat level surface that’s fit for playing, pin down the end of the string with your finger, and drag the chalk around in a circle. Now place your robots inside the circular arena head to head and see which can shove the other out of the ring.

 
Programming Information

Programming activities are included in our MOOC and most of our RoboSlam robot-building workshops for teens and adults, and sometimes even children. If you’d like to try re-programming your robot to modify its behaviour, you’ll need to connect the robot to a PC via the Launchpad USB programming interface, as shown below.

Connect the Launchpad to re-program the robot

The Launchpad connects to the USB socket of the PC via the provided mini USB cable.

Step 14: Download the RoboSlam development software

To use the example programs provided below to control your robot, you need a text editor called Notepad++ and a C compiler called mspgcc. We have created a zip file called "roboslam.zip" which contains both, together with some other useful tools. You can downloaded this zip file here:

Please extract the contents of the zip file to "C:\RoboSlam\".

WARNING: If you decide to place your RoboSlam folder in a different location, the path to the folder must not contain any spaces. For example, "C:\Documents and Settings\users\Joe\RoboSlam" won’t work because there are spaces in the folder name "Documents and Settings".

Step 15: Compiling your first program for the robot

It’s time to compile your first program for the microcontroller.

  • Create a folder called "C:\RoboSlam\blink\".
  • Copy and paste the C code below into Notepad++ and save it as the filename "main.c" in the "blink" folder.
  • Copy and paste the file "build_for_g2452.bat" from the "RoboSlam" folder into the "blink" folder.
  • The microcontroller must be powered up during programming, so make sure all four batteries are in the battery pack.
  • Make sure that the switch on the battery pack is in the “On” position.
  • Double click the file “build_for_g2452.bat” to compile the blinking LED example and copy it onto the microcontroller, where it should start running immediately, causing the LEDs to blink on and off!
//
// RoboSlam Example: Blinking LEDs
// Code is for MSP430G2452
// Last updated 10-2-2015
//

#include <msp430.h>

// main function
int main( void )
{
    // disable watchdog timer to prevent time out reset
    WDTCTL = WDTPW + WDTHOLD;

    // configure digital inputs and outputs
    P1DIR = 0b10000001;   // Port 1 outputs: P1.0 green LED, P1.7 red LED
    P2DIR = 0b00000000;   // Port 2 outputs: none

    // test LEDs and motors
    while(1)
    {
        P1OUT = 0b10000000; // red LED on for 500ms
        __delay_cycles(500000);
        P1OUT = 0b00000001; // green LED on for 500ms
        __delay_cycles(500000);
    }
}
Challenge: Modify the program so that the LEDs flash in the following sequence over and over again:

  1. Red on, green off
  2. Red on, green on
  3. Red off, green on
  4. Red off, green off

Step 16: Control the movement of the robot

  • Create another new folder called "C:\RoboSlam\zigzag\".
  • Copy and paste the code below into a new file in Notepad++ and save it as filename "main.c" in the "zigzag" folder.
  • Copy and paste the file "build_for_g2452.bat" from the "RoboSlam" folder into the "zigzag" folder.
  • The microcontroller must be powered up during programming, so make sure all four batteries are in the battery pack.
  • Make sure that the switch on the battery pack is in the “On” position.
  • Double click the file “build_for_g2452.bat” to compile the zigzag example program and copy it onto the microcontroller, where it should immediately start running, causing the motors to move.
  • Disconnect the robot from the LaunchPad and it should drive along the floor in a zigzag pattern.
//
// RoboSlam Example: Driving ZigZag
// Code is for MSP430G2452
// Last updated 10-2-2015
//

#include <msp430.h>

// function prototypes
void leds(int green, int red);
void motors(int left, int right);

// main function
int main( void )
{
    // stop watchdog timer to prevent time out reset
    WDTCTL = WDTPW + WDTHOLD;

    // configure digital inputs and outputs
    P1DIR = 0b10000001;   // Port 1 outputs: P1.0 green LED, P1.7 red LED
    P2DIR = 0b00001111;   // Port 2 outputs: P2.0-1 left motor, P2.2-3 right motor

    // Drive in a zigzag pattern indefinitely
    while(1)
    {
        motors(1,1);             // both motors forward
        leds(1,0);               // green LED on, red LED off
        __delay_cycles(2000000); // 2 second delay

        motors(-1,1);            // left motor reverse, right motor forward
        leds(0,1);               // green LED off, red LED on
        __delay_cycles(500000);  // 0.5 second delay

        motors(1,1);             // both motors forward
        leds(1,0);               // green LED on, red LED off
        __delay_cycles(2000000); // 2 second delay

        motors(1,-1);            // left motor forward, right motor reverse
        leds(0,1);               // green LED off, red LED on
        __delay_cycles(500000);  // 0.5 second delay
    }

    return 0;
}

//
// This function sets the direction of both motors.
// The first argument controls the left motor.
// The second argument controls the right motor.
// For each motor: positive number for forward,
// negative number for reverse, zero for stop.
//
void motors(int left, int right)
{
    // work out P2OUT value, then write to register
    int p2out_value = 0;
    if (left < 0)  p2out_value += 0b00001000;
    if (left > 0)  p2out_value += 0b00000100;
    if (right < 0) p2out_value += 0b00000010;
    if (right > 0) p2out_value += 0b00000001;
    P2OUT = p2out_value;
}

//
// This function controls the green and red LEDs.
// For each LED: 1 is for on, 0 is for off.
//
void leds(int green, int red)
{
    // work out P1OUT value, then write to register
    int p1out_value = 0;
    if (green == 1) p1out_value += 0b00000001;
    if (red == 1)   p1out_value += 0b10000000;
    P1OUT = p1out_value;
}
Challenge: Modify and recompile the above code to make the robot drive in a square pattern. Place a block in the centre of the RoboSumo arena and see how many times you can make your robot drive around a block without either touching the block or straying outside the chalk-drawn RoboSumo arena.

You can find other example code to try on the robot elsewhere on this site, including on the main RoboSlam workshop instructions page.

05-2015 RoboSlam Transition Week bodies and competition 82

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s