Showing posts with label Project 5 - Mini Sumo Bot. Show all posts
Showing posts with label Project 5 - Mini Sumo Bot. Show all posts

Friday, January 11, 2013

My First Arduino

After months of doing next to nothing with my electronics, I have finally jumped back into it.  This time I have come back with an Arduino!

I started playing with micro controllers while in college... about 8 years ago... really, 8years ago... I'm getting old.

My first micro controller was a Basic Atom Pro which used a C compiler which cost around $100 if you wanted to get into longer code (50+ lines if memory serves me correctly).

I quickly ran into issues and ended up switching to standard PIC chips (by Microchip) after a coworker, an electrical engineer, gave me a bunch of his old books and programmer.  Since then, and up to now, PIC is all I have used.

Since I began hearing about Arduino a few years ago, I considered giving it a shot... however, up until someone got me a UNO this Christmas, I had never used one.

After installing the software and about 10 minutes of playing... I regretted not switching sooner!  The majority of my time spent on the PIC was figuring out how to set the bits correctly to get something to work.  With the Arduino, although that stuff is still needed, it is all behind the scenes.. and I am glad to see it go.

I have purchased a number of shields and plan on hooking up my balancing bot (or so I hope it will balance).  I will probably update the Sumo Bot also with an Arduino...

Stay tuned...

Arduino UNO, XBee, Proto and Motor Shields

Sunday, May 6, 2012

Sumo Bot Fully Assembled (with issues)

After a lot of frustrating hours, I have my first Sumo Bot somewhat up and running... unfortunately, he is currently running in circles  I have not found my error yet, but I must have an short somewhere....

Here is the functionality which I do have. (The following four digits control the drive direction, for example, to drive forward, the command is 1010.  To 'turn on a dime' the command is 1001 for counter clockwise or 0110 for the clockwise direction.)
1000 = Right side drives forward (which is what should happen)
0100 = Nothing happens, but both pins on the right side are high (should drive right side in reverse)
0010 = Both sides drive forward (should only drive left side forward)
0001 = Both sides drive in reverse (should only drive left side in reverse)

Although he isn't working, he sure looks pretty.

Completed Sumo Bot Isometric View

Side View

Front View

Saturday, May 5, 2012

Updates


Its been a little while since my last post. Let's go over what I've been doing

The Sumo Bot (Name TBD)
I have slowly been populating the PCB and testing everything as I go along. I have had a series of issues which have been simple mistakes but time consuming to realize.

First, I was having issues with the driver chip not pulling down the low side of the H-bridge, even when I was telling it too. That was easily corrected when I realized the current sense pin MUST be connected to ground.  I am planning to hook the current sense to an ADC pin, but I was holding off just in case the driver sent a lot of current through that pin into the PIC.  So far, I have not let any of that magic smoke out... yet.

Next, the edge sensors were not changing voltage when the line was supposed to be sensed. That again was easily fixed when I realized that the program I was using had the pins set as outputs.
"Why does that matter?" You ask...
Well, when the PIC pin is set as an output (rather than input) there are pull down resistors (resistors which are connected to ground) that are enabled.  These resistors ensure the pin in not 'floating' (when you change states on to off, the pin remains high).  In my case, when I powered the board, they were pulling the output side of the IR sensor down, such that it appeared nothing was happening when the input changed.  I realized that while falling asleep one night.

Here is what the sumo bot is looking like these days.

Current Status of Sumo Bot

Learning C# (C Sharp)
One of my more favorite bloggers is Shane Colton (scolton.blogspot.com).  In general, he does a lot of seemingly advanced things with motor drivers, quad-copters, and robots in general.  He also does a lot of data logging and plotting with a program he created in Visual Basic (or so I have gathered).  I am hoping I can do the same with C# (pronounced C Sharp).  Through the robot club I am part of, a member has given me the code to log incoming serial data... now I am attempting to use the "Chart" tool to also plot the incoming data.  Once I have something worthy of posting... I will include the downloadable program.  The below image is the current layout.

C# Form Layout

Saturday, March 31, 2012

Mini Sumo Bot Board Has Arrived!

I ordered the board on 3/18 and it arrived in the mail today (3/31), 13 days later.  That's pretty impressive lead times by BatchPCB!

Front and Back Side of Sumo Bot PCB
For the longest time, I have been wanting to do a time lapse video of me doing something... anything.... Finally, this time I remembered and set up my free app on my iPhone to capture it (app is Time-Lapse by TippTech LLC).  Check this out.


I still have a bit of soldering and testing to do before I am done, but, when I hooked up my PICkit2, the PIC16F877A was recognized!

During my testing as I solder things on, I realize my status LED is not actually connected to a pin on the microcontroller...... ERRRRR.
AND
I also noticed that there was two unconnected traces in the board layout.  If you look closely at the PCB image on my last post, the bottom center area shows two traces (thin yellow lines)... which are telling me to connect them both ground.  Unfortunately, my ground plane has been cut up into different pieces due to various traces, it disconnected itself (yes, I am blaming it on Eagle)..

Both of the above errors can be easily (but reluctantly) corrected by adding additional wire.  I plan on making V2 eventually anyway.

Sunday, March 18, 2012

PWB on Order!

Today, I added the finishing touches to the schematic and finished laying out the board (auto-trace did most of that work).  I added a bit more circuitry to protect the PIC from back EFM.  I also added a decoupling capacitor to avoid any issues with the motors sucking up enough of the power to shut the PIC off.  That being said, this thing is much more complicated than any of the boards I have made in the past... I'm a little worried I will have spent all that money ($17 for the board and $10 for the handling) and then all of the solder time to find out I did something wrong.  We will see.

Below are the finished schematic and board.

Completed Mini Sumo Schematic

Finished Mini Sumo PWB
The board has the following features
  • Four motor direction indicator LEDs
  • Schottky EMF-protection diodes
  • Diode protection from incorrect battery 
  • TX/RX connections
  • Seven IR sensors (3 line sensors and 4 distance sensors)
  • Total motor peak current of 5Amp (I think that is without a heat sink)
Lets hope it works.

Friday, March 16, 2012

Sumo Bot Schematic and Printed Circuit Board (PCB)

Today I decided to spend a few hours working on the Sumo Bot schematic and Printed Circuit Board (PCB).  As you can see from the images below, I have made a lot of progress.  (I am using Eagle by CadSoft).  I just have to let auto-trace to its thing and I will be all done.  Then off to BatchPCB

In general, there is nothing fancy going on.  I am using a L298 4A Motor Driver and either a PIC16F877A or PIC16F886.  I believe they are interchangeable.  The PIC16F886 has the advantage of four pins which can output Pulse Width Modulation (PWM).  Later on, I may want to get fancy and control the motors more precisely (rather than the current two speeds, off or on).

I  included a few jumpers to turn off LEDs when I don't need them as well as hooking the 'current sense' pins on the motor driver to the PIC.  I'm not sure how they work at the moment, but I might want to play with that in the future.

There are also a number pins which are currently unused.  Those will be connected to a pad on the board which is easily accessible... for future projects and/or expanding this board's capabilities.

Sumo Bot Schematic

Sumo Bot PWB

Although this is about complete, here are a few things version 2 might include
  • Low voltage alarm using an OpAmp (like this one) to protect the Li-Po battery
  • On-board IR sensors and emitters to replace the expensive narrow field-of-view Sharp sensors

Sunday, March 4, 2012

Working Mini Sumo Robot!

After a lot of wire stripping, soldering, confusion, de-soldering, re-soldering, and four letter words, I got the bot working!

I retrofitted my tachometer board and soldered it down to a perforated board.  I then wired everything to it.

Yes.... I know.... It looks horrible.  But it is only a prototype.

Mess O' Wires

Under the hood



After getting the circuit wired and code working properly, I am beginning to lose faith in these off-the-shelf IR sensors.  Unfortunately, the just do not seem to have the field-of-view I am going to need.  (they are "Distance" sensors after all)


On the other hand, the sensor are mounted on the same flat surface.  I should try to angle them a little and see if that helps.

Next steps...
  • Attempt to improve current IR sensors
  • Play with different IR sensors
  • Begin working on custom PCB (in-work, see below)

Sumo Robot Schematic

Saturday, February 25, 2012

Added Electronics to the Sumo Chassis

Last night was a busy night.  From about 7pm to 2am I managed to do the following.
  • Design IR sensor bracket and standoffs
  • Fabricate the bracket and standoffs
  • Modify the ballast plate to mate with razor blade 'scoop'
  • Assembly everything to the chassis
  • Wire the line sensors on the bread board
  • Wire sensors to my makeshift sumo board (reusing my tachometer board)
  • Wire motor driver board to sumo board
  • Begin rough version of program
  • Fix all of my mistakes in wiring
  • and finally, actually get it moving in a somewhat logical fashion
The Cobra chassis does come with standoffs and additional hardware for mounting, but they were just a little too high for my taste.  Using small diameter tube, I made my own standoffs which were about 1/4" shorter than the stock ones.  My ultimate goal here is to limit the height in an attempt to reduce the IR signature (i.e. make it harder for other bots to see me).  As you can see from the following images, it's quite low profile.

IR Sensors - Isometric View

Low Profile Front View

Side View
Although the Cobra kit came with the circuit diagram showing how to wire the line sensors, I wanted to make sure everything worked for me as it should. The included instructions are from Lets Make Robots. The image below shows the breadboard set-up  The bottom left pin of the line sensor block is the output pin.

Line Sensor Circuit
The following images show the 'completed' sumo bot.  I say 'completed' because this is only a rough first cut of the Bot.  I plan on playing with the code to get this working well enough to figure out what improvements need to occur.  For example, I can already tell (I think) that the IR sensors have too narrow of a field of view.  This causes the bot to loose sight of it's opponent too easily.  I'll try to include some video showing this on the next post.

Isometric View 1 - 'Completed' Version 1 of my Sumo Bot

Isometric View 2

Side View

Front VIew

Top View

Things left to do.
  • Attached line sensors
  • Create line sensor circuit
  • Wire output of line sensor to board
  • Start design and layout of custom Mini Sumo Bot PWB
  • Work on scoop mechanism

Wednesday, February 22, 2012

Review of Fingertech Robotics "Cobra" Mini Sumo Bot

As I mentioned in a previous post, I ordered the Fingertech Robotics Mini Sumo Bot kit.  At $120, I was hoping I would not be disappointed in the quality of the parts and assembly.  In summary, I was not.

  • 4 Motors at $20 each          = $80
  • 4 Wheels at $10 each          = $40
  • 3 Sensors at $1.75 each      = $5.25
  • 1 Chassis at ~$10 each       =  $10
  • 4 Posts at ~$0.25 each       = $1
  • 8 Fasteners at ~$0.25 each = $2
  • 1 Scoop at ~$5 each          =  $5
  • Glue                                   = Priceless
  • Grand Total                       = $143.25
The first thing I though when I opened the box was "it's assembled"!?  Being mechanically inclined, I usually like to put stuff together myself (or in most cases, rip things apart).  But it was nice to see it all together right out of the box... I guess.

The first thing I noticed when I pulled this out of the box was the weight, it seemed very heavy.  Mini sumo bots are allowed to weigh a maximum of 500 grams, per Robogames.net and the RobotRoom.com.  Although I do not have a scale handy to check the weight, Fingertech claims it weighs in at 333 grams.  (3-3-3, come on... what is the likely hood of that number?)

My only area of disappointment was the method of securing the motors down to the chassis.  In this case, they are glued on.  Typically, I am not a fan of glue.  It can be easy to shear a motor off the chassis during handling or worse during a competition.  Lets hope they picked a good glue (Elmers = Bad).  I will probably change this in the near future, stay tuned.

Also, I did notice that one of the motor axes was just a little off from being parallel with the others... again, this is a big drawback when using glue.  Its hard to fix the position once its stuck together... but I'm sure it is not enough to cause any issues.  In fact, it will probably not even be noticeable to most people.  But I know it is there, and I'll probably just HAVE to fix it sooner or later.  If it ain't broke...... make it straight.

Fingertech's images of this kit were lacking, so I figured I would show it off for them.

Isometric View

Side View

Front View

Bottom View

Rear View

Rear Isometric View

Included Hardware and Sensors

Wheel Removal In-Progress

Wheel Removed

Snazzy Isometric View

Sunday, February 19, 2012

Mini Sumo Bot

After getting cyclops up an running, I started to think about alternative chassis.  Sure the Tamiya track version is fine for a test-bed, but I needed something that was a little more robust and competition worthy.  I ended up buying Fingertech's Cobra chassis from Fingertech Robotics.

Fingertech Robotics 'Cobra'  Chassis

It has not yet arrived from Canada, but I'll be sure to transfer all of Cyclops's guts over to this beast.

Sunday, January 1, 2012

Mini Sumo Robot Testing

I have made some serious progress (in comparison to what I usually do).  My Mini Sumo Robot has all the components secured to the platform (secured = tape) and a working program.

Instead of using home-built IR sensors (shown in the image in my last post), I opted to use the Sharp IR distance sensor to make things easier to start.  Since I only had one laying around, I have named him "Cyclops".  Obviously, the more sensors the better, but this is a good place to start.

Mini Sumo Robot - Cyclops
Mini Sumo Robot - Cyclops (Front)
Mini Sumo Robot - Cyclops (Back-Side)
Mini Sumo Robot - Cyclops (Back-Side)
Although he has not changed much in appearance since my last post, I have wired everything and created a simple program.  The program does the following.


  1. Rotate
  2. Sense target
  3. Drive forward
Here is the IR Sensor working


And here is the first test (actually about the fourth after a bit of tweaking).


From here, I will refine the program to make him a bit smarter and 'tune' the IR sensor so it's not seeing the ground when the sensitivity is turned up (turned up in the code).    

My long-term goal is to design and build a 'professional' version.  I can use Cyclops to refine my design and keep me motivated.

Saturday, December 24, 2011

Starting a Mini Sumo Robot Project

For a while now I have been intending to put together all the modules I have lying around to make a Mini Sumo Robot. I have a tank tread platform, a dual motor controller, an old battery pack from an RC car, and the board from my tachometer project. With those parts plus IR emitters and sensors, I have the beginnings of a sumo bot. Below is the approximate layout (not yet hooked up).

Pieced Together Mini Sumo Bot
My first attempt at creating the IR emitter and sensor circuit failed miserably... mostly because I was trying to do too much at once.  The other problem I think I am getting is the vast differences in the IR detectors I purchased from RadioShack.  I have one of the Sharp distance measuring units I bought from Sparkfun (GP2Y0A21YK) a while ago... I should probably purchase another and leave the building my own module for the future.