RoboSumo Tournament semester 1 2019-2020 – 2pm Wed 4/12/2019

This semester’s RoboSumo tournament
takes place at 2pm,
Wednesday 4th December 2019
in room KEG-036, DIT Kevin St

Click here for Live Tournament ranking
(Note: All rankings are provisional and subject to change)

Please review the following information carefully from start to finish.

Tournament time and location

The tournament will commence at 2pm on Wednesday 4th December 2019 in room KEG-036, which is located in one of the smaller side corridors on the ground floor of the main building in DIT Kevin St. Weigh-in and robot validation will take place from 14:00-14:45. The first bouts will commence at 15:00. During the initial “sorting” phase of the tournament, competitors will be divided into two pools, each of which will be assigned to one of the two competition arenas. Within each pool, sorting will proceed based on the bubble sort process previously described in class. The initial ranking will be determined by the results of the Tip the Can competition.

The exact duration of the tournament will depend on how quickly things progress, but we aim to be completely finished by 5pm. To ensure that the tournament proceeds efficiently, teams must comply with the instructions of the referee(s) without dispute at all times.

Robot Weigh-in – 2:00pm in KEG-036

Before your robot can compete in any sumo bouts, it must weigh-in and be measured to ensure compliance with the competition rules.

  • The weight limit is 500 grams, as measured using the electronic scales in room KEG-036. This includes every part of the competing robot, including batteries.
  • The size limit is 10 cm x 10 cm x 10 cm (no part of the robot is allowed to be outside this boundary). The size limit will be strictly applied.

Teams should present their robots for the weigh-in at 2:00pm in room KEG-036. One of the tutors will act as compliance officer, managing the weigh-in. He/she will run through a checklist with each team.

Sumo Bouts – 3pm in KEG-036

From 3:00pm onwards, teams should be continuously present in room KEG-036 and ready to compete immediately whenever summoned to one of the arenas. When a referee summons two robots to the arena for a bout, if one robot is ready to compete but the other is not (e.g. the team fails to present themselves at the arena, or the robot is non-compliant, or the robot is non-functioning) the first robot will be granted a walkover victory in that bout. In that case, however, the losing team remains eligible to compete in subsequent bouts (until they are eliminated from the tournament).

Submitting Your Robot for Formal Assessment – KEG-036

Once your team is eliminated from the competition (or has won!), you must submit your robot for assessment. This is critically important for your final grade. The compliance officer (or another tutor) will be managing the submission of robots and will run through the following checklist with each team:

  1. Have you submitted your robot? A clear label showing the robot’s name should be securely attached. Suitable labels will be available in KEG-036.
  2. Optional: Have you attached a 1-page feature guide to your robot? This sheet can be used to highlighting interesting design features that might not be immediately obvious to the assessment panel during the design assessment. There is no special format for this page – if you’re including one, just make it clear, fold it up, and attach it securely to your robot.
  3. Have you provided a completed robot information sheet? This sheet includes: team/robot name, team number, tutor name, programme code, name of every team member, blog address of every team member. Blank paper copies of the robot information sheet will be available in KEG-036.

Please do not leave without submitting your robot. Doing so may have a catastrophic effect on your grade.

TU Dublin tournament rules

The RoboSumo tournament rules are those of the Robot Challenge “Mini” class, mostly as described in the Robot Challenge rules PDF document. However, those rules make provision for tournament organisers to introduce local rule changes as appropriate. The following rule variations apply in the TU Dublin RoboSumo tournament:

The beginning of each bout:

  1. Infrared starting devices are not required (and generally are not used). Instead, each team nominates a single team member as the designated starter for each bout. The designated starter manually starts the robot at beginning of each bout, as instructed by the referee. The specific method of starting the robot is left up to each team – flicking a switch, pressing a button, inserting a wire, inserting a battery, etc. – but whatever method is used, the robot must remain stationary until it is started.
  2. The referee positions both robots before the bout begins (or instructs the competitors where to position them). Ordinarily, the referee will place the robots on opposite quadrants of the arena, each facing along a line parallel to that of the other robot, but not in the direction of the opponent. However, the starting position and orientation of each robot within the arena is entirely at the discretion of the referee.
  3. Once the referee has positioned the robots, each robot must remain stationary until the referee says “Go”.
  4. When the referee says “Go” each team’s designated starter starts his/her robot.
  5. The designated starter is only allowed to start the robot – he/she may not change the position or orientation of the robot in the arena.
  6. Once the robot begins moving, the designated starter may not touch the robot again until the bout has ended. He/she must withdraw from the arena and have no further contact with the robot until the bout ends.
  7. The designated starter may not touch his/her robot after it has begun moving (or has moved from its initial position).
  8. The designated starter may not touch his/her robot after the opponent robot has made physical contact with it.
  9. The designated starter may not touch the opponent robot at any time.

The end of each bout:

  1. The duration of each bout is limited to 30 seconds.
  2. If both robots remain in the arena when the time limit for the bout expires, the referee will decide the winner based on each robot’s distance from the centre of the table (the closer the better), robot activity/behaviour during the bout, attitude/behaviour of each team during the bout, and/or other criteria at his/her own discretion. The referee may explain the criteria upon which the winner of a bout was chosen, but is not required to do so.

Other rules:

  1. When a bout fails to produce a clear winner, the referee may, at his/her own discretion, order the bout to be replayed.
  2. During the sorting phase of the competition, matches will consist of a single bout. However, in the latter (knockout) stages of the competition the number of bouts in each match increases (best of 3 or best of 5).
  3. The dimensions of each arena will be similar to those described in the Robot Challenge rules (77cm diameter with a 2.5cm white border), but may deviate slightly from them. However, the white border will not be less than 2.5cm in width.
  4. A robot which displays no responsiveness to its opponent or its surroundings for a significant period of time may, at the referee’s discretion, be disqualified from a bout. In particular, please note that robots which simply spin on the spot will be viewed very unfavourably by the referees unless they exhibit other behaviour which provides evidence that the spinning forms part of a meaningful control strategy.
  5. Each team’s robot spending limit is €70. This figure must include the cost of all components included in the final robot, as it is presented for the tournament validation process, with the following specific exceptions. The €70 budget does not include the cost of components or materials purchased but not used in the final robot. It does not include any cost incurred for postage and packing. Most recycled materials which are obtained free of charge do not need to be accounted for in the robot budget, but specialised components which would not be available to other teams through normal scavenging (e.g. remote control servos) may need to be represented by an indicative cost. In general, the referees do not systematically verify the cost of every robot, but where a specific dispute arises or it is suspected that a robot may be in breach of this rule, a team may be asked to provide evidence of their total spending (e.g. by providing receipts or showing where each component used can be purchased for the claimed price). Where a team is suspected to be in breach of this rule and cannot prove otherwise, the referees may apply a penalty of some kind or even disqualify a robot from the tournament.

Important note: Every effort has been made to compose the rules of each bout and the structure of the tournament as a whole in a way that is fair and consistent, but since it is impossible to anticipate every eventuality, the referee(s) must have ultimate discretion to overrule any regulation or introduce a rule change at any time.

Tournament structure

The tournament is divided into two main phases – a sorting phase and a knockout phase. Each team must also complete a validation process prior to competing in their first match.

Validation process

The validation process ensures that each robot complies with the restrictions on size and mass imposed by the Mini class rules. Teams who do not successfully complete the validation process are not eligible to compete in competitive bouts and can therefore only move down in the tournament ranking. Teams who are unable to field a compliant robot may still be asked to compete in one or more exhibition bouts for assessment purposes, but they cannot progress to the knockout phase of the tournament.

  • The mass of the robot, including batteries and all parts which will be attached to the robot during a bout, must not exceed 500 grams.
  • The size of the robot must not exceed 10 cm by 10 cm by 10 cm. Note that robots are permitted to expand beyond their 10cm by 10cm footprint after the start of a bout, as described in the Robot Challenge rules.
  • All ground contact points that bear the weight of the main body of the robot must fit within the 10 cm x 10 cm footprint throughout the entire bout. It is permissible for parts of the robot to touch the ground outside the 10 cm x 10 cm footprint once the bout is underway, but the weight of the main body of the robot must not rest on them.

Following validation (the “weigh-in”), if a team makes any change to their robot which increases its size or mass, they must repeat the validation process prior to competing in a match.

Sorting phase

The initial ranking will be determined primarily by the results of the Tip the Can challenge. The objective of the sorting phase is to select the top 8 teams. A variation on the so-called bubble sort will be used for the majority of the sorting phase. However, the referee(s) may deviate from this pattern at his/her/their own discretion to resolve any unforeseen ranking issues or anomalies.

In each of the two pools (odd and even), the sorting phase will continue until the referee is satisfied that he/she has identified which 4 teams should progress from that pool to the knockout phase of the tournament.

Knockout phase

The 8 (or 16 depending on the total number of competitors) top-ranked teams will proceed to the knockout phase of the tournament. When a team loses a match in this phase, they are eliminated from the tournament. The referees will decide the number of bouts per match in each stage of the knockout phase (ordinarily best of 3 bouts, apart from the final which is best of 5 bouts).

Laboratory access during the tournament

  • There will be no RoboSumo lecture from 2-3pm on the day of the tournament. Instead, teams will proceed directly to KEG-036 at 2pm for the tournament weigh-in.
  • Access to laboratories other than KEG-036 before 3pm on the day of the tournament will be subject to the limitations of the timetable for each laboratory (other classes may be timetabled in some rooms before 3pm).
  • Room KEG-036 will be open from 2pm onwards. However, space may be limited due to re-organisation of tables for the tournament.
  • The normal lab facilities will be available from 3pm onwards, to facilitate teams who wish to carry out repairs or adjustments to their robots. However, bear in mind that if the referee summons you to a match and you are not present, your opponent will be granted a walkover victory. The live ranking spreadsheet can provide a guide to when each team is likely to be called to compete.

Competitor check list

Inevitably, many teams will face technical issues on the day of the tournament, and it’s impossible to foresee every problem. However, there are certain issues which we see every year:

  1. PLEASE PLEASE PLEASE ensure that your robot is compliant with the size and weight limits. Yes, 101mm is too much! And yes, 501 grams is too much! To avoid unexpected problems, please leave some margin for error. We need to be absolutely strict about these limits and butchering your carefully crafted robot at the last minute to reduce its size or weight can be a heartbreaking experience.
  2. If you haven’t already tested your robot actually driving around, please do so BEFORE the tournament. Bizarrely, every year we see teams who leave it until the very last minute to attach the wheels to their motors for the first time. Unfortunately, many of them discover at that point that their gearing is totally inappropriate and the robot cannot actually move.
  3. Focus on the basics. This means getting your robot moving around and responding to its sensor(s).
  4. Make sure your robot doesn’t simply spin around the spot for the entire bout. This behaviour will be viewed very unfavourably by the referee.
  5. Make sure you bring spare batteries.

Finally, remember to get plenty of photos and videos of your robot (and team) in the run up to and during the tournament. Of all the evidence you will provide on your blog, photos and videos are some of the easiest to create, and they can really help to tell the story of your project.

Finally, best of luck to all of you!

Posted in Uncategorized | Leave a comment

State machine example from today’s lecture

// State machine example from lecture on 20-11-2019
// Written by Ted Burke - 20-11-2019

int state = 1; // state variable

// rangefinder pins
int trig_pin = 7;
int echo_pin = 8;

// motor control pins
int lmf_pin=3, lmr_pin=4, rmf_pin=5, rmr_pin=6;

void setup()
  pinMode(lmf_pin, OUTPUT); // LM forward
  pinMode(lmr_pin, OUTPUT); // LM reverse
  pinMode(rmf_pin, OUTPUT); // RM forward
  pinMode(rmr_pin, OUTPUT); // RM reverse

  pinMode(trig_pin, OUTPUT); // rangefinder trigger pin

void loop()
  float d;      // distance in metres
  int fls, frs; // colour sensors
  // Read sensors
  d = distance();
  fls = analogRead(0);
  frs = analogRead(1);

  // Implement current state
  if (state == 1) // FORWARD TO LINE
    motors(1, 1); // both motors forward

    if (fls > 500) state = 2;
    if (frs > 500) state = 3;
    if (d < 1.0) state = 6;
  else if (state == 2) // STRAIGHTEN UP RIGHT SIDE
    motors(0, 1); // LM stop, RM forward

    if (frs > 500) state = 4;
  else if (state == 3) // STRAIGHTEN UP LEFT SIDE
    motors(1, 0); // LM forward, RM stop

    if (fls > 500) state = 4;
  else if (state == 4) // REVERSE TO CENTRE
    motors(-1, -1); // both motors reverse

    delay(1200); // 1.2 second delay
    state = 5;
  else if (state == 5) // SPIN CLOCKWISE
     motors(1, -1); // LM forward, RM reverse

     if (d < 0.5) state = 6;
  else if (state == 6) // CHARGE
    motors(1, 1); // both motors forward

    if (d > 0.5) state = 1;

// This function sets the direction of left and right motors.
// For each motor: 1 for forward, -1 for reverse, 0 for stop.
void motors(int left, int right)
  if (left > 0)
    digitalWrite(lmf_pin, HIGH); // LM forward
    digitalWrite(lmr_pin, LOW);
  else if (left < 0)
    digitalWrite(lmf_pin, LOW);
    digitalWrite(lmr_pin, HIGH); // LM reverse
    digitalWrite(lmf_pin, LOW); // LM stop
    digitalWrite(lmr_pin, LOW);

  if (right > 0)
    digitalWrite(rmf_pin, HIGH); // RM forward
    digitalWrite(rmr_pin, LOW);
  else if (right < 0)
    digitalWrite(rmf_pin, LOW);
    digitalWrite(rmr_pin, HIGH); // RM reverse
    digitalWrite(rmf_pin, LOW); // RM stop
    digitalWrite(rmr_pin, LOW);

float distance()
  // Read the distance from the rangefinder
  int duration;                              // stores echo pulse duration in microseconds
  float d;                                   // stores the distance in metres
  digitalWrite(trig_pin, HIGH);              // begin trigger pulse
  delayMicroseconds(20);                     //
  digitalWrite(trig_pin, LOW);               // end trigger pulse
  duration = pulseIn(echo_pin, HIGH, 10000); // measure echo pulse duration
  d = 340e-6 * (duration/2);                 // convert to distance in metres
  delay(50);                                 // 50 ms delay to allow echoes to fade away

  return d; // pass the distance in metres back to the calling function
Posted in Uncategorized | Leave a comment

Guidelines for RoboSumo laser cutting

Useful information about using Inkscape to prepare drawings for laser cutting can be found in this earlier blog post:

Submitted designs must comply with the following guidelines:

  1. The material used will be 3mm acrylic.
  2. One submission at a time from each team. If you realise an error in your submitted drawing, please submit a replacement drawing as a reply to your original email. Only the last compliant submission from each team will be cut. If your design has already been cut before a replacement drawing is submitted, you will receive the one that was cut.
  3. The page size of your drawing must be 600mm (width) by 300mm (height).
  4. You should submit two copies of your drawing. The first should be PDF format (with 600x300mm page size). The second should be either SVG (if you’re using Inkscape) or DXF (if you’re using AutoCAD or some other drawing tool).
  5. Whatever drawing software you use, please set all dimensions to millimetres (mm) to avoid the pieces coming out the wrong size.
  6. To avoid wasting material during the cutting process, please pack your pieces along the left edge of the drawing, leaving a 5mm margin empty at the edge of the page.
  7. The drawing should contain only lines and curves to be cut by the laser. All lines and curves should be black (RGB value 0,0,0), fully opaque, and with a line width of 0.01mm. There should be no filled shapes or shaded areas. No other colours should be used. No labels or dimensions should be shown in the drawing.

I recommend using Inkscape for preparing your laser cutting designs. It’s a very flexible tool for 2D graphic design and illustration work which goes far beyond what you do for laser cutting patterns. The time you spend getting familiar with it will pay huge dividends in the future if you learn to use it well. Some useful tips for laser cutting drawings in Inkscape:

  1. Press Shift+Ctrl+D to open “Document Properties”. Set “Display units” to “mm”. Under “Page size”, in the “custom size” panel, set width to 600mm and height to 300mm. Personally, I also disable the page border shadow and set the page border colour to green so that I don’t mix it up with the lines of the drawing. Then close Document Properties.
  2. Press Ctrl+Shift+P to open Inkscape’s “Preferences” dialog. In the “Tools” section (which should be visible when the dialog opens) select “Geometric bounding box”. Then close Preferences.
  3. When your drawing is complete, ensure the width of all lines is 0.01mm. To do so, press Ctrl+A to select the whole drawing. Then press Ctrl+Shift+F to open the “Fill and Stroke” dialog. Under stroke style, select a line width of 0.01mm. It should be applied to all selected objects. You should also ensure the line colour is black, the opacity is 100%, and the fill is set to transparent.

Other suggestions:

  1. To verify that your drawings are correct before submitting them, a very effective method is to cut them out of 3mm foamboard by hand and check they fit together. To do so, print your design it’s full size on A4 paper (you may need to adjust the page size of your drawing). Stick the paper printout onto a sheet of foam board using double sided tape or glue. Use a craft knife to cut along each line very carefully. With care, you can produce an excellent approximation to the final laser cut parts which will help to identify any oversights in the design. Foamboard can be purchased in Eason’s for about 1-2 euro per A4 sheet.

If you have queries about creating or submitting your drawing, you can ask me or one of the other tutors in the lab or send me an email.

Posted in Uncategorized | Leave a comment

Tip the Can – Live Results spreadsheet – Sem 1 2019-2020

Click here for live Results spreadsheet

Posted in Uncategorized | Leave a comment

Example code from todays lecture: switch and rangefinder

// Tip the Can - written by Ted Burke - 16-10-2019

// pin numbers
int red = 2;
int green = 3;
int blue = 4;
int trig = 6;
int echo = 7;

void setup()
  pinMode(red, OUTPUT);   // red
  pinMode(green, OUTPUT); // green
  pinMode(blue, OUTPUT);  // blue

  pinMode(trig, OUTPUT);  // HC-SR04 trigger pin

  Serial.begin(9600);     // open serial connection to laptop

int button_was_pressed = 0; // global flag variable

void loop()
  // Read the distance from the rangefinder
  int duration;                          // stores echo pulse duration in microseconds
  float distance;                        // stores the distance in metres
  digitalWrite(trig, HIGH);              // begin trigger pulse
  delayMicroseconds(20);                 //
  digitalWrite(trig, LOW);               // end trigger pulse
  duration = pulseIn(echo, HIGH, 10000); // measure echo pulse duration
  distance = 340e-6 * (duration/2);      // convert to distance in metres
  Serial.print(distance);                // print out the distance
  Serial.println(" metres");             //
  delay(100);                            // 100 ms delay

  // Check the switch
  if (digitalRead(9) == 1)
    button_was_pressed = 1;

  // Decide what to do with the LEDs
  if (button_was_pressed == 0 && (distance > 0.8 || distance == 0))
    // This code runs if the button has not been pressed and
    // the distance is either greater than 0.8m or zero, which
    // indicates a timeout
    // "&&" means logical AND
    // "||" means logical OR
    digitalWrite(red, HIGH);
    digitalWrite(green, LOW);
    digitalWrite(blue, LOW);
  else if (button_was_pressed == 0 && distance <= 0.8)
    // This code runs if the button has not been pressed and
    // the distance is less than 0.8m (but not zero)
    digitalWrite(red, LOW);
    digitalWrite(green, HIGH);
    digitalWrite(blue, LOW);
    // This code runs if neither of the previous two blocks did
    digitalWrite(red, LOW);
    digitalWrite(green, LOW);
    digitalWrite(blue, HIGH);
Posted in Uncategorized | Leave a comment

Assembly instructions for TCRT5000 printed circuit board

Martin Sorohan, who designed the printed circuit board adapter for the TCRT5000 infrared reflective sensor, has kindly supplied the following assembly instructions for soldering it:

Colour Sensor Assembly on PCB Board — Robo Sumo

Posted in Uncategorized | Leave a comment

HC-SR04 rangefinder example from today’s lecture

// HC-SR04 rangefinder example
// Written by Ted Burke 9-10-2019

void setup()
  pinMode(7, OUTPUT); // trigger
  pinMode(8, INPUT);  // echo

  pinMode(2, OUTPUT); // LED 1 (red)
  pinMode(3, OUTPUT); // LED 2 (green)
  pinMode(4, OUTPUT); // LED 3 (blue)

void loop()
  // Send trigger pulse
  digitalWrite(7, HIGH);
  digitalWrite(7, LOW);

  delayMicroseconds(3300); // 3.3 ms delay

  int echoState;

  echoState = digitalRead(8);
  if (echoState == 0)
    // object within 50cm
    digitalWrite(2, HIGH);
    digitalWrite(3, LOW);
    // object is farther than 50cm
    digitalWrite(2, LOW);
    digitalWrite(3, HIGH);

  delay(50); // 50 ms delay to let any ultrasoubnd reflections die away
Posted in Uncategorized | Leave a comment