A Robotics Project Page
Google
 
Web    www.PhilBot.com
My other sites
  • OurCoolHouse
  • Phil's Resume
  • Web Portfolio

  • [Home] [Projects] [Hardware] [Software] [Books] [Links] [Downloads]


    Mark III - Mini Sumo Project

    My first small-scale robotics project explore the world of Robo-Sumo.

    Sumo is the ancient Japanese combat/sport where two extremely large combatants attempt to force each other out of a circular Sumo Ring (or Dohjo).  Substituting robots for Sumo wrestlers naturally started in Japan, and the original robot size & weight limitations of 20cm x 20cm x 20cm (8" x 8" x 8") and 3Kg (6.6lbs) is still called the "Japan Class".  When Robo-Sumo came to America, a new "Mini Sumo" class was created to permit smaller, less-expensive, robots to compete.  This Mini class places a 10cm x 10cm (4" x 4") footprint, and 0.5 Kg (1.1 lb) limitation on the contestants.  Since then even smaller Micro and Nano classes have been created, but Mini-Sumo is still the most popular in the US.

    A complete set of Sumo rules and regulations can be found on my [links] page.

    My online research located several companies that sold MiniSumo robot kits.  Some sites also sold a wide range of typical robotic components.  Check out my [links] page to see what I found. 

    The choice

    Ultimately I decided that the "Mark III" MiniSumo kit sold by Tim Rohaly at [Junun.org] was the best option for me.   I'm not totally sure about the history behind the Mark III, except that it's the third generation of this design, and it began as a standard platform for competing in Portland Area Robotics Society [PARTS] robotic competitions (like [PDXBot]).  There were several things I liked about the Mark III: 

    Mark III Mini Sumo robot showing PIC processor and front IR Eye sensorsThe Mark III is a very compact platform, that uses two modified Servos to drive the wheels, two IR "Eye" sensors to detect the opponent's position and three IR Line-sensors to detect the outer edge of the Sumo Ring.  Two different controller board flavors are available at Junun: A standard Microchip PIC based controller, and another version that uses the OOPic.  To test the waters I started out with the Standard PIC based unit for $92.  When it arrived by USPS I cleared my desk and started building.

    Construction

    The controller board came as a bag of components so it needed to be built from scratch. I've been building circuit boards all my life so this one was not a problem.  There is an large [Web-based manual] that does a great job of detailing the assembly process.  The only part that some people may find tricky is identifying the color codes on the resistors.  They were the tiny 1/8 Watt variety and so the color bars were very small.  An ohm meter might prove necessary if you weren't used to interpreting resistor color codes.

    My only problem was one case of stupidity.  The manual stated that one switch could only be installed two ways, and both were OK.  Well I found a third way (on the wrong side of the board) so I had to kick myself and then unsolder and re-solder the part.  To make future disassembly easier, I added connectors to the three Line-sensors that would have been soldered to the controller board.  The mechanical assembly came next, and that consisted of locating the correct screws and fitting everything together.  One fun part was modifying (hacking) the Servos for continuous rotation.  This involved pulling the Servos apart, clipping off some bits of plastic and adding a slot for calibration  

    I did a quick power test before installing the PIC processor in it's socket, then fired up Hyper-term and bit the bullet. I did the "Happy Dance" when it powered up and talked first time.

    The Software

    The PIC version of the Mark III comes with a license for the CH Basic Compiler from [Celestial Horizons'] .  The license needs to be "activated" by email, and unfortunately I chose to build my Bot over the Easter weekend and could not get the compiler activated right away.  Luckily I searched around on the [Yahoo Mark III forum], and found several pre-compiled programs that I could use to calibrate the Servos and run my first one-on-none Sumo test.  When I finally got the compiler activated, it did seem like you had to go through quite a few hoops to compiler the program, and then assemble it and finally download it to the Bot.

    To be blunt, I'm not a big fan of any of the "BASIC" language variants.  Basic was fine back in 1975 when PDP-8's were all the rage, but that was a long time ago.  There have been plenty of more sophisticated languages created since then, and I think we should use them rather than being stuck in the dark ages. I also think that goes for Visual Basic as well, which doesn't earn me many smiles in some circles.  I guess I'm a bit of a software snob.

    Since the days of Basic, Fortran and Pascal came and went, "C" has led the charge for many years, followed by C++, Java and now C# (Pronounced C Sharp).   So as you might expect I started looking around for a good C type compiler to use on my MiniSumo.    I wasn't particularly impressed with what I found.  The tools were either too expensive (for what they did) or they were from the free "GNU" world which forced me to get into the "way-back machine" and relearn the ancient art of DOS command line, batch files and separate compilers, assemblers, linkers and loaders. Yuk!

    Finally I hit upon an oasis in the world of "brew your own" robot language tools: OOPic.

    OOPic to the rescue

    To quote the [OOPic website]:

     "Specially designed for robotics, the OOPic is a totally different approach in microcontrollers that uses Virtual Circuits to interact with the attached hardware while the application program focuses on controlling the Virtual Circuits in an Object-Oriented programming style."

    In many ways, the OOPic (Object Oriented Pic) echos my own strategy in programming, which is to build modular components which can be easily assembled into more sophisticated systems.  As a firm believer in code reuse and Object Oriented programming, I was very excited to find the OOPic.    As it turned out, the OOPic is "just" a custom programmed version of a regular PIC (PIC16F877), the same chip used by the standard Mark III.  Consequently, [Junun.org] also sells an OOPic Mark III Kit for just a few dollars more.

    OOPic programming is all about using a set of pre-existing interface "Objects" and interconnecting them to do something useful.  The objects range from simple Analog and Digital I/O elements to Servo controllers, IR range converters and  Speech synthesizers. The machine code for all the objects is already coded into the OOPic chip, and a Windows-based  "Integrated Development Environment" (IDE) is used to write the program that interconnect the objects.  The OOPic IDE can be programmed in Basic (Boo) and C/Java (Yay) so even I'm happy.

    The best part is that this is a fully integrated solution.  You run one Windows program to write your code, compile it, download it into your Bot, and then debug the running program.  So naturally my next order was for an OOPic Mark III MiniSumo, plus an OOPic upgrade kit to convert my first Mark III into an OOPic version.  In the mean time I downloaded the OOPic compiler, absorbed the list of OOPic Objects and cruised the Yahoo OOPic [Users Group] for insights and code downloads.

    Just to prove that you don't have to be a tech wizard to build the Mark III, I got my wife to assemble the second unit.  She naturally read the assembly manual a lot better than I did, and didn't make the "wrong side switch" goof that I did.  Her unit also stated up and ran first time, so we're now two for two.

    After playing around with the OOPic compiler and writing my first successful OOPic Sumo program, I set to work creating an OOPic UserClass to embody the "standard" functions of a Mark III Robot.  My goal was to write the User Class based on "Virtual Circuits" that would run automatically in the background, so that someone else could program the fighting strategy without having to worry about running the various interfaces.  My first set of software was based on the current V5.0 OOPic compiler.  Since then I've upgraded the code to work with the new OOPic V6.0 compiler (still in beta). 

    Both the new and legacy versions of my OOPic code are available on my [download] page.  The new OOPic 6.0 compiler has a much better C syntax so this is the version that I'd recommend you use.  Maybe by the time you read this, the 6.0 compiler will be released.  Click on the links below to read my explanation of the associated program file.

    OOPic Compiler version oUserClass description Calling programs
    V6.0 code (New):   [PBot_MkIII_1.0_VC6]      [PBot_MkIII_Sumo_VC6]
    V5.0 code (Legacy):   [PBot_MkIII_VC]      [PBot_MkIII_Sumo_VC]

     

    Web content is copyright © PhilBot.com 2005, Deep Creek Lake, MD.
    Contact: Phil Malone 301.387.2331, webmaster@PhilBot.com