BibimBot Mini Sumo


Update!  BiBimBot won the 2015 AHRC Mini Sumo Competition!  It was one of the most evenly matched Mini Sumo competitions imaginable.  Delta Force won 2 out of 3 rounds in the first match up, but BiBimBot made its way through the losers bracket and won two consecutive rounds against Delta Force to win the double elimination competition.  Check out the video below:



So how did BiBimBot win this time?  Well, I made two minor changes to the bot since 2014.  The first change was to epoxy a number of small copper weights to the existing steel weights wherever there was a little extra room.  BiBimBot was up to 498 grams in 2015 vs weighing in at only 468 grams in 2014.  The additional weight increased the amount of friction so its push was stronger this year.

The second change was in the code.  If you look closely at the video from 2014 below, there is a match where Delta Force and BiBimBot lock head-to-head and it looks like a draw.  Suddenly Delta Force seems to surge forward and push BiBimBot out with relative ease.  Back then, BiBimBot was programmed to automatically change strategy if it got stuck in a particular mode for too long.  Having BiBimBot attempt to spin away from Delta Force was a bad idea, especially considering that BiBimBot wasn't any faster than Delta Force.  For 2015, I removed all the timeout scenarios and BiBimBot pushed and pushed until it won!

Mini Sumo


Mini Sumo is an autonomous robotic competition in which two Sumo bots try to push each other out of a ring. Mini Sumo is different than battle robots in that they are autonomous and make no attempt to injure the opponent.

Mini Sumo robot competitions are held throughout the world. The Atlanta Hobby Robot Club hosts a Mini Sumo competition at their annual Robot Rally. For more than a decade, the AHRC Mini Sumo contest has been dominated by Dale Heatherington's Delta Force. While it would be naive to think I could beat Delta Force on my first attempt at building a Mini Sumo bot, I wanted to build a competitive robot and learn as much as possible in preparation for building a second one.

Rules

Mini Sumo competitions use a bracket structure and each match is won by winning two out of three rounds. During each round, two Mini Sumo robots have 90 seconds to push each other out of the Sumo ring, and the first robot to leave the ring loses even if it drives out on its own. The ring is a 77 cm diameter black circle with a 2.5 cm wide white line around the edge. Each robot must weigh 500 grams or less, and must fit within a 10 x 10 cm square (i.e. about 1.1 pounds and 4x4 inch). There is no limit to the height of the robot. Remote control is not allowed, although the robot may freely transmit data to an external station for logging. Robots are not allowed to store or throw any objects including liquids, powders, or air. No flammable devices are permitted and no attempt to adhere the robot to the ring is allowed. The judges have significant discretion to disqualify any robot which violates the spirit of the competition. Judges may also stop any round early and declare a winner if any competitor is broken, failed to start, or the robot has otherwise "lost the will to fight".


Bibimbot with its cover removed.

Mechanical Design

The primary goal of Mini Sumo is to generate pushing force greater than your opponent. This is achieved by designing a robot which is as heavy as possible with wheels having the highest amount of friction. Since the maximum weight of the robot is fixed, selecting the robot's wheels is a critical design step. I had some old silicone lego tires around as well as some natural rubber rollers from old copier machines. I performed a test where I attached two wheels together, set them on a piece of wood, and steadily increased the angle of the wood until the wheels began to slide off. The Lego tires started sliding off around 40-50 degrees incline, while the rubber rollers held steady until about 60 degrees incline of the wood. With this being my first Mini Sumo bot, I wasn't sure how good the wheels needed to be. I searched online and found a number of options which could work. Slot car racing wheels stood out since there was a very wide variety of shapes and sizes available. I contacted a few suppliers and Alpha Piranha racing tires seemed to be a good bet and were readily available. I ordered a pair and ran the incline test.  To my surprise, the wheels didn't fall off until the wood was inclined at an impressive 70 degrees. I decided to go with the slot car wheels.

Selecting the motors was not too critical because there are a lot of options available with sufficient torque and speed in the size range required, my primary concerns were mounting to the wheels and the chassis. After performing some calculations, I decided to use Pololu 75:1 micro metal gear motors which are also used on the Zumo kit. Operating at 7.2 V with 0.825" wheels, the robot would travel at a max of 0.4 m/s with each motor generating 1.5 kg of pushing force - more than enough to spin the tires. The motor's 3mm shafts could mount directly to the slot car racing wheels, and Pololu's mounting brackets would hold the motors to the chassis.



Mocking up the Mini Sumo layout using cardboard

I quickly realized that selecting a battery for Bibimbot would be an important decision due to the large amount of volume that the battery would occupy. I prefer to use NiMH batteries so I don't have to worry about accidental over-discharge or catching on fire. While LiPo batteries are somewhat smaller than NiMH, they are significantly lighter and I needed the robot to be as heavy as possible.
I drew up a bunch of blocks in CAD to represent each item inside the robot and moved them around and around trying to figure out where to place all the parts. Once the wheels and motors arrived I mocked up the robot using cardboard to get a better feel for how tight the space would be. I eventually decided on a set of 400mah NiMH cells in a two sticks of three arrangement, ordered as a custom pack from onlybatterypacks.com.

Design of the Stainless Steel Chassis

In order to win, it is advantageous to be able to decrease the pushing force of the opponent.  Most Mini Sumo robots have a wedge design, attempting to lift the competitor off of the ring. This not only reduces the pushing force of the opponent, it increases your robot's pushing force because the weight of the opponent is now on top of your robot. I decided to go with the tried and true wedge design for Bibimbot. I wanted Bibimbot to have a low center of mass, so I decided to make the chassis out of a plate of 1/16" thick stainless steel. The motors would mount to this plate, and 4 threaded rods would protrude vertically from the plate for mounting the electronics on top. Small tabs on the side and rear of the plate would be bent up to create a place for the body to screw to. I added up the weight of all of the parts and realized I still needed to add 200 grams and I was running out of places to put extra weight. I found room for two blocks of steel in the front and one in the back which would get me close to 500 grams. The downside was I lost the space where I was going to mount a breakout board for an accelerometer and gyro. I figured having a heavier robot was the most important thing.

I wasn't sure initially what material I would use for the body of the robot. I wanted the body to be made of a light weight material so the robots center of mass would remain low. I thought about having something 3D printed, but I also heard it is possible to weld together pieces of ABS using acetone. Since I don't have a printer and didn't want to take on that kind of project at the moment, I figured I would have the most flexibility welding together ABS sheets in the shape of my previous cardboard mock-up. I ordered 5 black sheets of ABS off eBay. One side of the ABS was textured and the other was smooth. Since a lot of Mini Sumo robots use Infrared sensors, I used Bot-Choy's obstacle detector sensor to figure out whether the textured or the smooth side should face outwards. I found that if the smooth side of the ABS faces outwards, the material is completely invisible to the IR sensor at most angles, but if the ABS was perpendicular to the IR sensor, then it reflect the IR like a mirror. On the other hand when the textured surface faced outwards, the IR sensor could see the ABS material only at a very short range of 1-2 inches, and it was the same no matter what the angle was. I decided to put the textured side of the ABS sheet facing outward so the opponent wouldn't have the opportunity to see Bibimbot a long distance away.

I sketched out on a wipe board all of the shapes to be cut from the ABS sheets with dimensions. I used my calipers to mark the dimensions on the smooth inside surface of the sheets. I tried using a dremel to cut out the shapes, but the plastic melted quickly and became a mess. I had the best results by scoring the sheets repeatedly with a sharp Xacto knife, then bending and breaking them apart. While this takes a lot of time, it was still faster than cleaning up all the mess of the Dremel. The internal cutouts which create a pill-box around the IR sensors took the most time to carefully cut out. To connect the sheets, I held the pieces together in my hand and used my finger to place a small drop of Acetone into the joined edges. Holding the parts at an angle, the drop would run down the inside corner, wetting the edges all the way down. After 3-4 minutes I could let go of the parts and they would hold together. The joints are very fragile at first, and become much stronger after waiting a day. After joining the sides, front, back and top, I cut a few extra pieces of ABS and placed them on the inside corners to be sure the joints were strong. I cut out a small triangle of material and welded it onto the top of the body to prevent an airborne opponent from accidentally hitting the main power switch and turning Bibimbot off during a match.


Exposure to Acetone Vapor eliminates white discolorations of the ABS

Welding the corners with Acetone would occasionally cause the ABS to develop a white discoloration on the surface. I never figured out why it happened, but I was able to make the discolorations disappear. I read an article on Hackaday where a guy was smoothing out the surfaces of his ABS 3D prints by exposing them to an Acetone vapor on top of the printer's hot plate. I figured the same trick might fix the surface discolorations, but I didn't want to smooth it so much that the outer texture of the ABS disappeared. I filled a small polyethylene container with 1/4" of acetone and dropped it into an empty paint can. I rested the ABS body on the top edges of the container, and set the lid on top of the paint can. Exposure to the acetone vapor caused the white discolorations to disappear after a few hours, and didn't significantly affect the texture. The entire ABS body felt much more pliable afterwards, but regained its original rigidity after sitting out for a day or so.

Sensors

The original Bibimbot design called for 3 sets of sensors, but the breakout board for the accelerometer and gyro had to be sacrificed to make room for chunks of steel. The two remaining sets of sensors are both Infrared. One set of sensors looks for the opponent and the other set looks for the white line at the edge of the ring.

The sensor which looks for the opponent works just like Bot-Choy's obstacle detector, with some small differences and minor improvements. There are 3 sets 3 IR LED's which are each pulsed at 0.8A for 100 microseconds. The IR light from the LEDs is reflected off the opponent and is sensed by IR phototransistors mounted to the opposite side of the circuit board. One set of LEDs looks forward, while the other two look left and right. If the opponent is a dark color, Bibimbot may not be able to see the opponent until it is very close, because less of the IR light will be reflected.

Each of the IR LEDs used on Bibimbot has a much narrower viewing angle than those used on Bot-Choy, which increases the sensors range as more of the light is concentrated in a smaller area. As a result of the narrow viewing angle of each LED, more LEDs were required to still maintain a 180 degree field of view. The microprocessor didn't have enough I/O to control 9 separate LED channels, so I grouped them into 3 sets of 3 LEDs. The angular resolution of Bibimbot's obstacle detector sensor is not as good as Bot-Choy's, but it gains a few extra inches of sensing distance.

The circuit which drives the pulsed IR LEDs has been upgraded vs the Bot-Choy version. Instead of using a series resistor to control the LED current, I used the constant-current regulator circuit design from the Aquarium Light project. While the Aquarium light had a separate constant-current regulator for each LED, Bibimbot uses a single high-side P-FET constant current regulator which is shared among all of the pulsed LEDs. Much smaller N-FET transistors are used on the low-side of each LED, allowing the microprocessor to turn each LED on or off without level shifting. As a result of the tighter current regulation, I was able to increase the nominal current through the LEDs from 0.5A to 0.8A without fear of burning up the LEDs.


The phototransistors used in Bibimbot are the same as Bot-Choy - SFH314FA. When light enters the transistor, current flows from the collector to the emitter which changes the voltage at the collector. All three phototransistors are connected in parallel by default, but during layout of the circuit board I added the option to cut the traces and have each phototransistor sensed separately by jumpering them to the extra analog channels.

The sensitivity of the phototransistors decreases as the source of the IR light changes it angle to the sensor. At around 40 degrees, the sensitivity is half of what it would be if the light source was directly in front of the sensor. On Bot-Choy, I spaced the sensors apart by 80 degrees. In theory, an obstacle directly in front of Bot-Choy will reflect light into each of the two sensors, which will sense this light with 50% sensitivity. The combined sensor sensitivity should seamlessly transition between one sensor and the other. In practice, there is a bit of a blind spot directly in front of Bot-Choy where the combined sensitivity of the two phototransistors does not add up to 100%. To prevent this from happening again, Bibimbot has 3 phototransistors instead of two, providing better sensitivity at the extreme left and right sides, and more overlap to avoid blind spots when the light source is angled half-way between two of the sensors.

For sensing the white line at the edge of the Sumo ring, I used two different styles of IR sensor breakout boards from Pololu. Most Mini Sumo robots only have line sensors in the front, which makes them vulnerable to accidentally driving off the ring if they ever drive in reverse. I wanted Bibimbot to have a line sensor in all 4 corners, so that accidentally backing out of the ring wouldn't happen. In the front, I used Pololu's breakout board for the QRE1113 sensor. Before drilling the final holes into the stainless steel chassis, I made a temporary chassis plate out of ABS to help determine exactly where the front IR Line sensors should mount. Space was tight behind the rear wheels, so I used Pololu's QTR-L-1A right angle sensor, which places a right-angle IR LED and phototransistor on opposing sides of a thin circuit board to minimize thickness. The front line sensors were connected to the main circuit board using 3-conductor pigtails, while the rear line sensors were mounted to the main circuit board using tall pin headers.  Each of the sensors is an analog type as opposed to the RC charged circuit type. I prefer the analog sensors as the output can be read in as little as 20 us with the right A/D prescaler settings, whereas the RC charge types can take up to a millisecond or more to provide a reading.

Electronics

Bibimbot needed to be small, so I decided to design my own circuit board and have it professionally fabricated. Unlike my previous PCB designs which I made myself using toner transfer, I now had to pay attention to the soldermask, silk, cream, dimension, and many other layers I previously ignored. I now have a full appreciation of how much time it takes to smash every component and drag around all the reference designators so they don't land on top of pads, vias and other components. Since it was my first board and I wasn't sure what the quality would be, I stuck with 16 mil traces and 0.6mm drills for the vias. I sent the gerber files out to iTead Studios because they were the cheapest. About three weeks after sending it out I received 10 circuit boards for less than $30. The quality was good, I couldn't find anything wrong with any of them. Looks like my toner transfer days are finally over.

Comparison of CAD Layout vs Actual PCB

Bibimbot's main PCB connects a lot of smaller breakout boards together. The breakout boards include an Arduino Nano, Bluefruit EZ-Link, H-Bridge Drivers, Voltage Regulator and IR Line Sensors. There are a number of components mounted directly to the main board including an analog mux, main power switch and push button, various LEDs and resistors, power smoothing caps, and all of the obstacle sensor LEDs, phototransistors and FETs. As a Mini Sumo newbie I wasn't sure how well the obstacle sensors would work, so I added 3 sets of headers (JP18, JP20 and JP21 shown above) with various resistor population options so that other sensors could be added in the future if necessary.

The Nano didn't have enough analog inputs for all the on-board sensors so I added an 8 channel multiplexer. This was my first attempt at soldering a SMD chip, and after watching a lot of youtube videos I decided to use the drag soldering technique. I was pleasantly surprised that given enough flux, drag soldering the SO16 package really is as easy as it looks in the videos. I didn't have any issues with solder bridging or pads lifting off the boards.

Bibimbot can be reprogrammed wirelessly and transmit telemetry data using a Bluefruit EZ-Link wireless bluetooth connection from Adafruit. I can't describe how annoying it was to chase around Bot-Choy with its USB cable tethered to my computer, not to mention hours of time wasted troubleshooting bad cables. Bibimbot was a joy to test as I could stop the bot, reprogram it, restart it, collect more data, and do it all again without ever getting up from my chair.

The Arduino, Bluetooth, and Line Sensors are powered using a small 5V switching regulator from Pololu. These regulators are very small - much smaller than anything I could ever hope to solder to a circuit board myself. There is a jumper on the main PCB to optionally connect the Arduino's VIN pin directly to the V+ battery supply and use it's internal 5V LDO regulator. By default the Arduino is powered directly from the 5V switching regulator as this is more efficient.

The motors are controlled using two DRV8833 Dual H-Bridge motor driver breakout boards from Pololu. Channels A and B of each of the Dual H-Bridges are connected in parallel providing up to 4A max stall current to the motors. Both left side and both right side motors are connected in parallel. The Fault outputs of each of the Dual H-Bridges are wired together and connected to a single LED to indicate if any fault condition has occurred with the motor drivers.

To start a Mini Sumo match, the owner of the robot has to hit a button when the judge says go. The robot must wait 5 seconds for the owners to back away, then the Sumo match begins. The Arduino Nano doesn't have a lot of I/O pins, so I decided to combine the start button with the battery voltage sensing circuit. A resistor divider steps down the battery's voltage so that the Arduino can monitor the battery voltage and turn off the motors if it drops too low. The push button is connected in parallel with the low-side resistor of the voltage divider. If the Arduino senses that the battery voltage has dropped all the way to zero, it will know that the push button has been pressed. When the button is released the Arduino will again be able to monitor the battery voltage.

Each of Bibimbot's motors can draw up to 2A when stalled. When combined with all the other parts drawing current, the maximum current draw could be be over 9 amps. Connectors rated for 10 amps tend to be fairly large, so I avoided using a connector by soldering the battery wires directly to the PCB. When the robot is turned off, the main power switch connects the battery's positive side to a charging port. Bibimbot's ABS cover must be removed in order to access the charge port. The main power switch is rated for 6 amps and takes up a considerable volume, sticking out of the top of the cover. On future robots I'll probably use a much smaller slide switch in combination with a MOSFET as a main power switch to save space.

With all of the components plugged in and soldered to the PCBA, I pulled out the old cardboard templates and trial fit the electronics with the motors, battery and IR sensors in place.

Trial Fit of the PCBA with Motors, Battery and Breakout Boards in place

I made two mistakes in the electronics design of Bibimbot. The first mistake was not realizing that pins A6 and A7 of the Arduino Nano couldn't be used as GPIO. After receiving the boards and testing, I had to run a green wire from pin A6 over to pin D6 in order to get the forward facing obstacle detector LEDs to turn on.


Arduino Microcontroller and Analog Mux


The second mistake was in configuring the current sense resistor values for the DRV8833 motor drivers. When installed, the motor drivers will use these current sense resistors to set the maximum current which is sent to the motors. I didn't want to limit the current, so I set the resistor values to the smallest possible value which would still permit 4A of current flow: 62 milliOhms. The no-load current of two motors in parallel is only 80 mA, and the analog voltage sensing resolution of the Arduino is 5 mV. With 0.080 A flowing through 0.062 ohms, there is less than 5mV generated at the current sense resistor. In operation, the wheels slip long before the motors ever get close to stalling, and the useful current sense range is limited to 2-3 LSB of the A/D converter which is hardly usable. To achieve a more usable range for the current sensing, I would have to increase the resistor values, limiting the current to 1 amp or less. At some point I may put larger resistors on the H-Bridges, but I probably should have designed in some kind of op-amp circuit to scale the current sense output before sending it to the processor.

Software

In a spectacular example of overkill, I developed a rudimentary control sequencer for Bibimbot. The linked presentation explains it much better than I could in a few paragraphs here. I programmed it in C and learned a lot about pointers and dereferencing and defining pointers within structures and lists of function pointers, etc. When I tried explaining it to some folks in the club they told me I really should learn C++.

Bibimbot has few sensors and so the controls options are very basic. Some examples of the controls can be described as "Drive Forward for up to 10 seconds or until a line is seen in the front", "Turn for 300 ms in the opposite direction of where the line was last seen", "Drive Reverse for 800 ms unless a line is seen in the rear", and "Drive forwards towards the opponent". By stringing different controls together in a sequence, various robot behaviors can be created.  The video below shows some of these controls in action.



The part of the sequencer which was most interesting to me was the concept of creating a "World Model". A World Model takes the data from one or more sensors and may combine it in a way to create a model of information that is relevant to the robot. For example, Bibimbot needs to know if there is a line seen in the front of the robot so it can stop before it drives out of the ring. Bibimbot has no single sensor which indicates if there is a line in the front of the robot, but the information from the front left and the front right line sensors can be combined to indicate if there is a line anywhere in the front. A boolean variable can be created called "frontLine", which is true if there is a line anywhere in the front, and false if there is not a line anywhere in the front. Whenever frontLine changes from False to True, Bibimbot can quickly stop. There is another boolean variable called "opponentDetected" which indicates whether the obstacle sensor sees an opponent, regardless of where the opponent is. If an opponent is seen anywhere, then the "Drive towards the Opponent" control is now an option. Otherwise if no opponent is seen, any attempt to execute the "drive towards opponent" control could result in unpredictable and undesirable behavior. The variables that make up the World Model can be anything that is useful to the control of the robot. On a more sophisticated robot, the World Model could consist of 2D or 3D maps of the environment, or historical information. The robot would reference this database of information in order to decide what action it should take next. The World Model should be updated constantly and asynchronously to any actions that the robot might take.  In this last respect, Bibimbot is different than any of my previous robots which always checked the sensors on demand as opposed to asynchronously updating a model.

Learning about and creating the control sequencer for Bibimbot stretched my programming skills and was a great learning experience. I'm sure the control sequencer will find its way into other robots over time - robots which can actually take advantage of all the features.

2014 Robot Rally Competition

Bibimbot performed well during the 2014 AHRC Mini Sumo competition. It did lose one round to a Zumo competitor, as I forgot to flip the power switch on. The stock Zumo hit Bibimbot head on but was too lightweight to move Bibimbot. The judge ruled that Bibimbot had lost the will to fight, and declared the Zumo as the winner of that round. Thankfully I remembered to turn Bibimbot on for the other two rounds and won the best two out of three. In the final match it was Bibimbot vs Delta Force. Dale won the first round with an approach from behind, pushing Bibimbot out of the ring. In the second round, the two robots hit head on and nervously chattered about as both robots' wheels were spinning. Eventually Delta Force pushed Bibimbot out of the ring, continuing Delta Force's winning streak.


Bibimbot put up a good fight, and I learned a lot about what matters for a successful Mini Sumo robot. The biggest area for improvement is sensing the opponent. Bibimbot was unable to see Delta Force during the final match due to its black color, and Delta Force seemed to have the same issue. The final weight of Bibimbot was 468 grams, so it may perform slightly better if I figure out where to squeeze in another 30 grams of steel. Designing such a small robot to have a weight of 500 grams is rather difficult. In the future I'll need to plan for the weight in the very early design stages. I'm definitely looking forward to designing a smaller, faster, and stronger little brother for Bibimbot to play with next year.

Schematic (pdf)

If you like this project or have any suggestions, send me a note, I'd be glad to hear from you.