He was named "Cheesoid", he was built and programmed in 24 hours and he made us all very proud...
Robot-sumo is a competition where small (10cm x 10cm) length by width autonomous robots weighing less than 500 grams attempt to push each other out of a ring (1 meter diameter). The core concept is rather simple: Build a small robot, add some logic to make it behave intelligently and push your opponent out of the ring. The concept is simple yes, however, the implementation can get rather tricky, especially when you start building 24 hours before the competition.
This project came about when my friend Eric McClean and I were looking for a simple fun project. We were informed about about the Irish Robo-sumo competition being held in Galway and decided to enter. The idea was to build a simple robot and enter this competition as recreational entertainment. We were looking for a small fun project to keep us entertained and this competition seemed perfect.
We started with ample time and designed the robot, specifying the parts needed. With over a month to spare we placed the order and satisfied by the design process we elected to simply wait for the components to arrive. However the "arrival" part never actually happened. A week before the competition the parts had not arrived and we were slightly concerned. This concern wasn't help by the progress other teams were making. We were confident however that should the parts arrive tomorrow we would be able to make our robot. The days passed and no packages arrived. Finally it was the day before the competition and we only had the idea of a robot. Scavenging through boxes of discarded electronics, remains of Lego kits and with access to a milling machine, soldering iron and white board we decided to redesign the robot and build with what was available.
The design was simple enough, mostly due to necessity. We decided on a wedge robot. The main features\properties we wanted were:
We decided that we would use two motors to power two back wheels and have a third caster wheel at the front. This would allow for easy maneuverability and was simple enough that the components should be salvageable. The main strategy was to try get under the other robot with the wedge and, using the torque of the motors, push it out of the ring. With these design choices in mind we went about finding components.
We started construction by making the chassis of the robot. There was an abundance of perspex, it was as fine a material to use as any, light enough to keep us below the 500g threshold and sturdy enough to support the motors and resist any deformation due to strain. The main work here involved shaping a perspex sheet into an oval and making brackets out of some scrap metal. The oval was used as the geometry easily lends itself to avoid being stuck in corners. We then milled holes for screws and went about constructing the rest of the chassis. We quickly found, however, that there were not enough nuts and bolts of the correct dimensions. With the ever looming time constraint we dropped the metal brackets and opted to use glue guns.
Once the decision to use glue guns was made construction proceeded at a much quicker pace. Perspex housing was made for the micro-controller, batteries and circuitry. An Arduion micro-controller was found and re-purposed for the robot. Similarly Lego wheels were found as well as two matching motors. For sensors we were able to procure light sensors and an ultra-sonic sensor.
The components were affixed to the chassis, soldered and wired to the Arduino. The wiring was tested using a power supply in the lab and construction was completed just before we were scheduled to leave for Galway. "Cheesoid" was born. We planned on programming in the car on the way and finish testing the following morning before the competition.
During the car trip we were very excited to program the logic of Cheesoid and test the sensor readings and motors. However we quickly discovered that Java wasn't installed on my laptop and work slowed considerably. We were confined to a car, knew what we wanted to do but were unable to test or execute the code. The experience was somewhat uncomfortable, regardless we wrote some pseudo code and resigned ourselves to enjoy the car trip as much as possible.
Upon arriving in Galway we had a few hours to spend before we could check into the hostel for the night. We decided to bring Cheesoid out for a night on the town and simultaneously hunt for free Wifi access. The socializing was successful, the Wifi access was not. Despite our best efforts we were unable to find a connection. Once we checked into the hostel we connected to their Wifi and downloaded the required tools. We went about working on Cheesoid until tiredness overcame us and we fell asleep. Dreams that night were of semi-completed robots and overcoming insurmountable odds.
We awoke the next day and proceeded to the competition. We had thirty minutes before the robots had to be registered and were hard at work. We added a battery pack to the robot and programmed him to move one wheel forward. We held our breath as we hit execute... Cheesoid failed to move.
Ten minutes of debugging later we found the culprit to be loose wiring. Sticking with what had proven to work in the past we solidified all connections with a copious amount of glue. Executing the program a second time... Success. The wheel rotated and before the program had finished executing Cheesoid was whisked away to be registered for the competition.
Cheesoid was presented to the judges, weighed and his dimensions were measured. Passing all the requirements we then looked to finish his "intelligence". The algorithm was very simple. We drive forward until we hit the edge of the ring at which point turn roughly 90 degrees and then drive forward until the edge of the ring is encountered again. The edge of the ring was detected using the light sensor placed at the front of Cheesoid. Due to the time constraints the thresholds for the edge of the ring wad observed and hardcoded, (hopefully the lighting on the actual ring wouldn't vary) and the 90 degree turn was achieved using dead reckoning (hopefully the surface texture wouldn't vary). These were two critical assumption and it was unlikely that the conditions would remain constant. However this was not an exercise in best practice or proper automated calibration techniques. It was an exercise in quick hacks, messy coding and just plain fun.
We finished coding minutes before the first match and checked the roster for our group. We realized we had not implemented the switch that turned Cheesoid on and off. To quickly remedy this we configured the script to run automatically on start-up. It was however rather embarrassing that we lacked this basic switch functionality so the now purely cosmetic power switch was still sometimes clicked for appearances. Thankfully no one noticed that half the time when Cheesoid was moving the switch was firmly in the "Off" position.
For the competition there were four groups each containing four robots. The top two robots from each group proceeded to the quarter finals while the other two were eliminated. We got ready for our first match and waited to see what Cheesoid would do. Would he even move? ...
Cheesoid stirred, he came alive and then proceeded to drive in a triangle. You could call this interesting emergent behaviour however it was immediately apparent that the threshold for the light sensor was incorrectly set and being fired at every check. We were relieved that he moved and considered Cheesoid a success assuming our adventure had come to an end. However despite Cheesoids fondness of triangles he proceeded to win not one but two of his matches earning himself a position in the quarter finals.
The quarter finals were held on a main stage in the center of the arena, the whole ordeal was much more than we expected. We fully expected to be immediately eliminated however we now stood before an area of people with Cheesoids name being called out over the speakers. At that point two realizations were made. The first was "We probably should have worn some form of shirt", the second was "We probably shouldn't have named our robot Cheesoid". Had we realized this was a possibility we may have chosen a more enlightened name.
The quarter final was best of three and Cheesoid fought gallantly.
Unfortunately Cheeosids triangle wasn't able to save him. He was knocked out of the ring and out of the competition. He had progressed much further than expected and the entire experience was great fun. The adventure was an amazing success.
The main purpose for this project was to provide a nice break from work with a team project that was both fun and challenging. This was definitely achieved however there was also some rather valuable lessons learn from the exercise.
The main knowledge gained was the value of simplicity. Cheesoid was in no way a perfect robot, however he was extremely simple and preformed rather well. In comparison to this our initial robot was an over-engineered monstrosity. We adding components that we didn't really need and the initial design was far to ambitious. We didn't really need four light sensors to detect the edge of the ring from each direction. You really only move in one direction so one sensor would suffice. Similarly did we need multiple IR and ultra-sonic sensors to find the other robot? Given the size of the ring, the size of the robots and the lack of obstacles do we really need to know where the other robot is? Wouldn't a random walk suffice. Finally was there really any added benefit to our proposed wheel encoders? Do we really need to estimate where we are in the ring or try detect when we are being pushed? Just because we can build this sophisticated robot is it really what the problem requires. We should be designing the robot to fit the specified problem and not trying get the problem to fit this cool robot we built.
With the 24 hour build behind us and the celebratory party at an end we called an end to the robo-sumo project and retired the hero Cheesoid.
Special thanks to Hannah Lynch for documenting the journey and Aodhan Coffey for allowing us the use of his lab and equipment.