Monday, May 30, 2016

Introducing RatAttach - Our first BattleBot

My daughters and I have been watching the last season of BattleBots so when I asked them what project they wanted to do over the long weekend the choice was obvious:  Make a BattleBot.  I have never built a BattleBot so the first obstacle to overcome was figuring out how to do it.  In this post I will explain how we built our first BattleBot that we named RatAttack.

Building robots is not a cheap hobby especially when you build them to do battle.  I definitely did not want to use my BeagleBone Black that I used in my other robots, within this one.  After thinking about building a BattleBot for a couple of days, I had the idea Saturday morning to go to our local Goodwill stores and buy up any and all remote control cars/trucks that they had.

My oldest daughter and I drove to all four of our local Goodwill stores and we ended up buying 10 remote controlled cars (one remote controlled rat but more on that later) and 12 remote controllers for $14.  Out of all of the cars/remote controllers we were able to get two remote controlled cars actually working.  On top of the working cars, we were also able to salvage 3 working salvo motors, 10 working DC motors, numerous battery holders, gears and wheels.  Let me tell you how much fun my daughter had tearing the old cars apart and salvaging the parts.  I think she liked that more then actually working on our BattleBot.

After our salvage operation was complete we started carefully taking one of the working RC cars apart so we could build our BattleBot around it  We picked the biggest car to start with and after we took the outside apart we were left with this:





The next thing to do was to design the exterior of the BatttleBot.  We like a number of the BattleBots from last season with Stingray and Overdrive being our two favorites but we decided to mirror our first BattleBot after Tombstone (http://battlebots.com/robot/tombstone/).  Here is our first BattleBot named RatAttack:






The follow video shows RatAttack in action.




We used our 3D printer to print the parts for RatAttack.  Probably not good for an actual BattleBot but for our first bot to play with it really worked out well.

The robot itself has a 9V battery pack that powers the car itself.  To power the front weapon we have a 12V battery pack hidden underneath our rat (see image below).  This 12V battery pack powers a little DC motor which spins the blade.  The 12V battery pack is WAY to powerful for the motor (and we have already blown one motor) but we have a few spare right now and really wanted to see it spin fast J.  We connected a little switch between the DC motor and the power supply to let us turn the blade on and off.





We definitely need to put a more powerful motor in RatAttack for the Blade.  I would also like to get the eyes on the rat itself to work.  We also need to cover the wires rather than just using electrical tape.  Finally we need to make the outside armor cover more of the bot itself maybe evening adding a weapon in the back of the bot but I think this is a very good start for our first BattleBot.

So about that Rat.  The first Goddwill that we visited on Saturday did not have any RC cars on display so we asked one of the sales people if they had any.  He said they had one but we probably didn’t want it and he was not sure if they had a controller for it.  We told him that we would take working/non-working ones so he went in back and brought the Rat out.  It really was not what I was looking for but my daughter talked me into getting it and now we have RatAttack.

This was a fun little project for the long weekend and the girls and I really had a lot of fun building him.  They are also ready to build another one and make changes to RatAttack. 




Saturday, May 21, 2016

BuddyBot Update and Parts List

In this post I will show the latest updates to BuddyBot and also give a list of parts that I used to build him.  You can use this parts list to build your own Swift based robot.

This weekend we added a couple new sensors and changed BuddyBot’s look a little bit.  The MaxSonar range finders work great unless BuddyBot is coming up on an object at too large of an angle.  To help the sonar range finders we added two IR Obstacle Avoidancesensors.  We also had an issue where BuddyBot always wanted to climb on the dog pillows and he ended up tipping over.  To stop this we also added a tilt sensor to detect when BuddyBot attempted to climb something.

Lets start off by seeing some new pictures of BuddyBot:




I did not include any new videos on this post because the new sensors simply enhanced BuddyBot's earlier functionality and did not really add anything else.  You can see videos of BuddyBot in the BuddyBot gets obstacle avoidance post.


I will say that I am not too fond of the IR ObstacleAvoidance sensors.  I might be doing something wrong but in order to get two of them to work I need to power one of them on, let it initialize and then power the other one on.  If I let them both power up with everything else they both constantly detect an obstacle.

The tilt sensor works well when the rover is running inside the house however I did have to set it to detect at a higher tilt then I originally wanted because the vibration of the rover itself set it off occasionally.  When I ran BuddyBot outside, the rough terrain constantly set the tilt sensor off.

I did add both sensors to the SwiftyBones Component library.  I also rewrote a large portion of the SwiftyBones_BuddyBot code.

A couple of people have asked about the components that make up BuddyBot so they could build one similar to it.  With that in mind, lets look at the components of BuddyBot.

BuddyBot’s Components

The following images has BuddyBot’s components labeled:








Here is the component list:

1X Battery Pack  (Recommend having a spare)
2X Mini Boards (1 Pack) for LED and Button 
100 Ohm resistor  (one for each LED)
10K Ohm resistor for button
1K Ohm Resistor and 3.3K OhmResistor for MaxSonar Range Finders

You can either solder some of the components (like the LED and Buttons) or attach them all to the solder less breadboard.  I have the Kendal 937D Soldering Station and really like it.  Trust me, if I can use it to solder then anyone can because I am not very good at soldering but I am working on it J.

I printed off a lot of parts and you can find the parts on Thingiverse thing:1580488.  I have the Monoprice Maker Select 3D printer and it is AWESOME.  If you are looking for an entry-level 3D printer I would absolutely recommend this printer.  It has been nothing but terrific for me.

You can use this blog post to setup  your BeagleBone Black with Swift.

I use my SwiftyBones library to program BuddyBot

Finally you can find the current code for BuddyBot on the SwiftyBones_BuddyBotgithub page.

If you have any questions about how to build a BuddyBot, please ask.

BuddyBot’s Future
I asked my daughters what projects they wanted to work on this summer since I was not planning on writing any books over the summer.  My oldest said that she wanted to build robots again.  BuddyBot was created so I would have a good working robot as a base for our projects and also a good library for her to work with.

Now that school is just about over I plan on turning the creative aspect over to my daughters.   Over the next week or two I will be showing them how BuddyBot was built (the component and electronic aspect of it) and also going over how he was programmed.  At that point I will discuss various upgrades we can do depending on if they want to expand BuddyBot from a hardware and software point of view (more Sensors) or from simply a software point of view (expand on his programming).  Some of the ideas I came up with are:

  1.  Adding another MaxSonar Range Finder to detect if BuddyBot approaches a ledge or stairs
  2.  Adding some sound detecting sensors so BuddyBot can move toward sounds
  3.  Adding a path sensor so BuddyBot can follow a path
  4.  Update the code so BuddyBot will try to reach the other end of a room while avoiding obstacles
  5.  Have them design some parts to print for BuddyBot


I have also started designing a new robot that I will work on while my daughters work on BuddyBot.  I will use Swift with SwiftyBones for this new Robot as well because I am finding that Swift is a great development platform for robotic development.

Sunday, May 15, 2016

Buddybot gets Obstacle Avoidance

BuddyBot, the first robot programmed in the Swift programming language with SwiftyBones, just got some more upgrades.  The first being a second MaxSonar_EZ2 range finder so it can decide which way to turn when it detects an object in front of it.  The rest of the upgrades were cosmetic like a new top tray that holds the breadboard in place, two new indicator LEDs so it now has three and a new start button.   You can see the earlier posts on BuddyBot here:


The first robot programed in Swift with SwiftyBones
BuddyBot - The Swift robot gets its first upgrades

If you are interested in making your own BuddyBot or if you just want to see what parts were used you can see this post:  BuddyBot update and Parts List

Here are some new pictures of BuddyBot





When I added the second MaxSonar_EZ2 range finder I put one on the left side and one on the right side.  This allows BuddyBot to determine if the left or right side is closer to the object in front of it and then determine which way to turn based on which side is closer.  It is a very basic system, which could use some more logic, but it is definitely a start.  You can see several videos of BuddyBot with the new obstacle avoidance system below.










  
One thing with the MaxSonar_EZ2 range finder, or any small sonar sensor like this one, is when the robot approaches an object at too large of an angle, the sonar sensor will not register the object.  With this in mind, I think I will want to add an infrared obstacle avoidance sensor to assist the MaxSonar range finders.  The IR sensor I am thinking about using is this one.  I currently have one of these so I am thinking about giving it a try next weekend.  What I will do is when the IR sensor detects an object then I will use the sonar range finders to determine which way to move.

I am also thinking about using a sonar sensor to determine if BuddyBot is near a ledge or step.  I am thinking that if I use a sonar sensor, facing down, in BuddyBot’s nose then I can determine if it is at a ledge or a stairway.  I could take the range when the BuddyBot first starts and if the range increases significantly then it has approached a ledge.


I did not make any changes to the SwiftBones library for this upgrade however I did make significant changes to the BuddyBot code.  You can see the changes on BuddyBot’s GitHub page.

Sunday, May 8, 2016

BuddyBot - The Swift robot gets its first upgrades

BuddyBot, the robot programmed in the Swift programming language just got its first upgrades.  The first thing you may notice is I printed out a couple of new trays to hold the components so it looks better.  Secondly I added a MaxSonar_EZ2 range finder so it can detect obstacles in front of it and turn.  Right now it simply turns right when it gets close to an obstacle. 

Here is the new BuddyBot


The following video shows my daughters playing with BuddyBot.


I created a new github page for the BuddyBot code.   

I also just added a component library to the SwiftyBoneslibrary and I used some of those components to build this version of BuddyBot.  You can read about the component library on the wiki page.


I think the next upgrade is going to be a second MaxSonar sensor.  Rather than having one sensor in the center I am thinking about putting two sensors on the front, one on the right and one on the left, so BuddyBot can make decisions on which way to turn rather than always turning right.  This means I will need to print out a new tray that will hold two sensors.