BullyBot

TheCowGod's picture
Terrorize other robots
Cost to build: 
$150
Time to build: 
10 hours

By now I've built a few different robots, and they've had it pretty good so far. They get to spend their entire life going about their business, drumming on things or chasing light, with nobody to bother them. I think it's time that changed. They need to learn what it's like in the real world.

To that end, I've started building what I'm tentatively calling the BullyBot. It's going to be a tank-tread-based robot with an AirSoft machine gun mounted on top, and it will find the other robots in the room and shoot at them. It builds character.

 


2008/6/29

Initial construction. I bought a cheap, electric-powered Airsoft gun, took it apart, and figured out how it works. It's pretty simple -- the trigger operates a simple switch which closes the circuit between the 4 AA batteries and the electric motor that drives the mechanism. I cut off all the parts of the gun that the robot won't need (the handle, shoulder stock, etc), removed the trigger mechanism, and soldered my own wires to the motor. I then wired up a simple circuit to let the Arduino fire the gun by means of a relay. Works great, aside from the fact that there's no good way to fire a single shot. No big loss, I can just shoot 2 or 3 at a time.

Next I bought two torquey servos and set about building a 2-axis mount for the gun, to let the robot turn the gun left and right and aim it up and down, like a tank. I also started working on the main body of the robot (it'll be plywood-based, just like Little Drum Machine).

 01.jpg

Extending the axles

 

02.jpg

Useless parts removed

 

03.jpg

Removed parts

 

04.jpg

Up/Down servo mounted

 

05.jpg

The robot's base (those axles will need some support)

 

06.jpg

Mounted on the second servo for left/right aiming

 

07.jpg

View from the other side

 

08.jpg

It might be a good idea to add a second up/down servo on the right, just to add some support so it's not hanging in space like that.

 

 


2008/7/2

 

Over the last few days I've been working on the mobile base of the robot. I've got it basically all put together -- I guess the next step is to mount the gun turret servo on the base, breadboard up all the circuits, and then start working on the IR detection. I'm still not sure exactly what will be required to detect other robots, so obviously I don't want to solder anything together yet. I just received my Digikey order containing a bunch of Panasonic PNA4612's, which are IR detectors originally designed for use in electronics appliances like VCRs for detecting the remote control signal from across the room. The specified max range is "minimum 11m, typical 18m". I hope that those will do what I want -- all I'll have to do is modulate the IR LED on the other robots at 38 kHz so this sensor can detect them. I'll post them as a component once I've gotten familiar with them.

I'm already pretty clear on what the circuitry for the motors, servos, and gun firing will be, so I might go ahead and solder that up on one perfboard (sort of a 'motors control module'), and then just build a second circuit board for the IR circuits once that's finalized.

Pictures!

09.jpg

Lotsa holes drilled in the base

10.jpg

The lower half of the base assembled

11.jpg

The bottom of the base

12.jpg

Preparing to install the upper half of the base. Leftover aluminum tubing from Little Drum Machine's drumsticks make for pretty good DIY standoffs, except that if you overtighten the screws, the aluminum starts to crumple.

13.jpg

The assembled base.

14.jpg

Space between the platforms to mount the Arduino and all the other circuit boards. I plan to mount the batteries on top, to make them easy to remove for charging.

 


2008/7/7

I soldered up an 'output module' as I described earlier -- a PCB containing the circuitry for the Pololu Low Voltage Dual Serial Motor Controller, the relay and transtor for the gun firing circuit, and the header pins for the two aiming servos. Once I finalize the IR detection, I'll have a separate board for that circuitry.

With everything assembled (but with no input at all), I coded up a simple program to have him aim the gun around at random and shoot wildly into the air. I quickly noticed that the recoil affects his aim pretty significantly. Every time he fires, the gun moves up and to the left. I might have to modify the 'shoot()' routine to move the servos down and to the right while he's shooting, to try and balance that effect. We'll see how that goes.

I also did some work on the IR detection. Building the detector circuit was simple -- the sensors I ordered output a voltage that's high when no 38 kHz signal is detected, and low when it detects a signal. So for now, I just ran it through an LED -- later, I'll sample the output with a digital input. I tested it with a remote control, and the sensor picks it up with no problems, even when I'm 15' away on the other side of the room, around the corner, and pointing the remote AWAY from the sensor. Range isn't going to be a problem -- I think the real struggle will actually be LIMITING the sensor's sensitivity to make it more directional so I can actually use it to find WHERE the other robots are. But it's interesting to know that the communication is so reliable at such a distance -- these sensors were only about $1, so this might represent a good way for two robots to talk to each other (indoors) for less money than the EasyRadio modules.

With the detector circuit built and working in 2 minutes, I was optimistic about the IR emitter circuit that will be mounted on each of the other robots. I shouldn't have been. I've never used the 555 timer chip before, and I struggled for hours, researching and trying various combinations of resistors, capacitors, and wiring, before finally coming up with something that the detector could see. Man, I'd love to have an oscilloscope.

So finally I've got both parts of the circuit working, and as I suspected, it's way too sensitive. I epoxied on a length of aluminum tube to the front of the sensor to try and give it 'tunnel vision', and it did seem to help, but I think there's still a lot of leakage through the gaps in the sides of the metal case. I'll have to look into covering it with opaque paint or something. But I'm hopeful.

 

Now to the pictures!

15.jpg

The completed 'output module'. I'm pretty happy with how compact and orderly it turned out. Inputs from the Arduino are on the top, power connections are on the left, and outputs to the motors are on the bottom (along with the servo connections in the top left). The green PCB is the Pololu motor controller -- it fits perfectly and sits flush on top of the relay (pictured below). I worried about the magnetic field in the relay's coils affecting the operation of the motor controller, but I haven't noticed a problem so far.

 

16.jpg

Pololu controller removed from its socket, showing the rest of the components.

17.jpg

Underside, showing all the junctions. Maybe it's time to start looking into PCBs.

18.jpg

Everything wired up for testing, and working perfectly.

19.jpg

555-based 38kHz IR emitter circuit. The digicam actually sees the infrared light emitted by the LED, though in real life it's invisible.

20.jpg

Detector circuit -- much simpler.

21.jpg

All assembled.

22.jpg

Stick 'em up!!

 

 


2008/8/14

 

Thought I'd give a little update. I've been having trouble getting BullyBot to move. The Pololu Low Voltage Motor Controller and Tamiya gearbox worked in testing, but when I assembled the whole robot, it wouldn't move. So I took it all apart again for troubleshooting, and I think I might have been overloading the batteries or something. But I think it doesn't matter, because it looks like I might have killed the low voltage motor controller while troubleshooting. Oops :) Fortunately, I have a spare Micro Dual Serial Motor Controller left over from LDM. The uDSMC can't run the toy motors in the Tamiya gearbox, as we learned in this thread, but as Ben from Pololu suggested in that same thread, you can replace the FA-130 motors with Solarbotics RM3's, which the uDSMC can control. So I ordered a bunch of those RM3s, and now I just need to desolder the capacitors and motor leads from the current motors and solder up the new ones in their place. I'm hoping that will take care of that problem, and then I can get back to troubleshooting the IR robot targeting.

Your rating: None Average: 5 (4 votes)
fritsl's picture

This is SO WICKED!!

This is SO WICKED!!
TheCowGod's picture

Heehee, thanks, can't wait

Heehee, thanks, can't wait to get it working :)

Dan

GobliZ's picture

Cool, I really like it.Maybe

Cool, I really like it.

Maybe not adding another servo for support, but just an axle (steel pin). So it still can rotate and gets supported. How are you going to do the finding of the other robots part? By adding a camera, and do blob recognition? I'd love to see someone getting a relatively cheap webcam to work with a microcontroller. I need to figure out soon how they work.

TheCowGod's picture

Yeah, an axle would probably

Yeah, an axle would probably make more sense, I really don't need any extra power there, so a second servo would just be a waste of money and battery power.

As for finding the other robots, I figured I'd just add an IR LED to each robot, and use IR detectors on this one. I'd much rather be able to find them without needing help on their end, but I can't think of any way to do that. Eventually I'd love to get into image processing and stuff, I've got lots of ideas for things I could do if I could actually detect objects in a camera image, but for now I don't know how to even start on something like that, and I'm not really ready to drop the $100+ on something like the CMUCam just as a learning experience yet :) But it's something I really want to learn how to do eventually.

Dan

jip's picture

Salvaging camera chips from optical mice

Hi Dan,

This looks like a really awesome project! ...and how typically american to incorporate guns in robot building ;-).

I have seen one guy do a home-made camera for his robot using a camera chip from an optical mouse and mounting a lens in front of it. I guess that solution wouldn't be too expensive but of course it will only give you something like a 30x30 image in greyscale. Unfortunately the guy didn't document anything other than the chip being an ADNS-3060 and that he found a suitable lense at www.optics-online.com.

GobliZ's picture

indeed, do you think it

indeed, do you think it would be easy to hack a webcam, and connect it to a microcontroller? Most webcams have a USB cable, so the instructions to get it to work (ie. record etc.) are all serial instructions which in theory could be easily given via a microcontroller (DB9). But the instructions to send are nowere documented... or are they? And will be different for each webcam I think. I'd really love to see some instructions / tutorial on how to get me started, so if you find any, don't hesitate ;). If I don't find any usefull tutorials I think in the summer break (2 weeks from now) I will try to hack a webcam and document it, and share my findings. It's gonna be fun.
jip's picture

Hmm I haven't got a clue as

Hmm I haven't got a clue as how to hack a webcam :-). I think maybe you have to do a whole lot of coding to get the USB stack implemented - although I have no experience with that.

It would be a nice project to do since it will be much more affordable for everyone to just grab a webcam for their uC instead buying something like the CMUCam. I wish you luck!

BaseOverApex's picture

On USB Webcams

I'd guess there are only two commands: on and off. I'd also hazard a gues that the USB interface is identical for most major brands. I've used 5 or 6 different ones and the Logitech QuickCam driver works for them all.

Question: take a VGA Webcam, stream the data to a PIC. That's 640x480x24 = 900Kbytes of data. That's a whole lot of ones and zeroes. Not sure what other cams do, but it would be great if you could reduce the resolution, so it only sees a 5x5 array of colours. I'd be stunned (and pleased) if it were possible.

How does the Lego one work? Does it simply have a reduced resolution?

jip's picture

The Lego one? Is that the

The Lego one? Is that the one that comes with the Robolab package? If so I think that it is just a standard Logitech QuickCam that requires a PC. It doesn't connect to the RCX or anything.

A typical webcam has a little more functionality than just on and off :-), but I reckon those are the main ones of interest.

GobliZ's picture

Ok, that is the main idea

Ok, that is the main idea yeah. And then process the ones and zeros. But how would I get the serial data to be sent for the on / off command? I think that isn't documented anywhere... is it? (I have an old 320x200 camera, love to get that one to work with my uC).
TheCowGod's picture

The USB protocol is much

The USB protocol is much more complicated than serial. I don't think it'd be trivial at all to interface with a USB camera -- you'd basically have to reverse engineer their driver and re-implement it on your microcontroller. I don't think most microcontrollers would have the horsepower to handle that stream of data, much less do image processing to actually identify objects in it. I think the only real practical option is to move up to an actual computer (GroG-style), run linux or something on it, and let the native driver handle the camera interfacing.

I've actually got the Lego camera (Lego Vision Command), and yeah, it's just a regular webcam packaged up in a Lego shell -- it's got a regular USB port on it, so it doesn't connect to the RCX brick. You connect it to a computer, do your image processing there, and then send commands to the RCX brick via the IR tower. I was disappointed to find that the robot wouldn't be truly autonomous.

But of course, if you figure out how to get a camera working on a microcontroller, I'd love to hear about it :)

Dan

BaseOverApex's picture

Aaahhh

That makes sense. I had thoguht the Lego one was hooked to the Lego NXT. I have RCX, and ... well, a camera just wasn't going to ever happen, was it?

My vision would be for a camera with only a small resolution, wheich could detect changes in colour from edge to edge. If you have only 5 pixels across, for example, and your background is white and your target is green, a PIC or the like should easily be able to detect if the target is moving left/right or right/left.

Where the hell do you get a CCD which is only 5x5 pixels? :-)

TheCowGod's picture

Yeah, I only have the RCX

Yeah, I only have the RCX also, so I can't speak for the NXT, but I'd be surprised if it was THAT much more capable. I agree, a simple low-res "camera" would be best. Maybe with an array of color-filtered CdS sensors, so each one only sees red or blue or green... of course, even 5x5x3 colors = 75 sensors. Damn, this gets complicated quick.

Dan

jip's picture

The main processor in the

The main processor in the NXT is of the same class (ARM7) as the one that sits on the CMUCam3 and is running at 60 MHz, so I guess it is quite more capable than the 8 MHz Hitachi processor that was in the RCX, and I reckon that something like a 50x50 image should be no problem to process in near realtime as long as you're doing basic stuff.
TheCowGod's picture

Haha yes, maybe my next

Haha yes, maybe my next robot will eat cheeseburgers and hate foreigners. It would have to run on gasoline, of course.

That's interesting about optical mice -- I didn't realize it was an actual camera, I thought it was just some sort of IR detector or something. I guess that makes sense -- it needs to be able to look at the ground and determine when it's moving. Sounds like a hardcore project, but it would be interesting to try.

Dan

jip's picture

If you're using IR detection

If you're using IR detection you could also make a vest with IR LEDs on so it emits IR light. Then you could put the vest on and see if you dare enter the room when the robot is on :-D... or maybe a contest to see who can be in the same room as the robot without getting hit the longest... possibilities are endless :-)

BaseOverApex's picture

I'm lovin' it

Cracker. Looking forward to the vids. Can you make it chase Frits' YDM? Please?
TheCowGod's picture

Frits HAD mentioned that YDM

Frits HAD mentioned that YDM and my robots should get together for a visit sometime... Maybe I'll have a surprise for him :) Sorry Frits, parents can't be held responsible when their kids misbehave.

Dan

TofuRobot's picture

Nice, It's lookin real good!

Nice, It's lookin real good!
fritsl's picture

OMG, this is SO cool!!And

OMG, this is SO cool!!

And you are doing the "IR detector in tube" - I always wanted to do that! Wicked!! Nice to see that it is working - I would have thought a longer tube should be used. I have one on about 10 CM laying, the reciever taped in (to stop false light), over in my shed, but never got as far as you.. Why do you live so far away? I want to come over and play :D

fritsl's picture

Oh - and perhaps you want

Oh - and perhaps you want the inside of the tube to be mat to avoid reflections. Either make it in paper, or spray the inside with black mat paint - Oven paint in my case.

- And I was considering 2 sensors placed out in the open, to do the initial discovery of "enemies", placed with a simple plate between 0i0

- And my plan was not to shoot, but let them sort of hit each other (kick off a brick stuck with a voltage leading magnet to detect "Mine is kicked off, I have lost").. and so, robot A should say (invisible to humans) "I am doing attack number 3", and the other one should then pick defence 3a, 3b, 3c - whatever it prefered. Attack number 2 would be defence numer 2a, 2b etc.

That way one robot would attack the other, but just as it did, the other would come up with a smart move.. Perhaps the drummer-robot should be notified that it is under attack, so it can "run away" when shooting starts, insted of just playing drums?

TheCowGod's picture

I played with different

I played with different lengths of tube -- the one you see there, and two shorter ones. I found that (when I blocked the side leakage with my fingers), the length you see in the picture actually was a little too long for distances about 6-7 feet away -- the LED barely lit up at all. But the shorter ones were too short for closer range -- they worked well farther away, but up close it could still detect the emitter from pretty much any angle. I decided to go with the longer one, though, because there was still SOME signal farther away, so I figure if I just look for the point with the strongest signal, I should still be able to find something at that distance. And I figure it's better for my robot to be nearsighted -- works up close, but can't "see" robots beyond a certain distance and ignores them -- rather than farsighted, so that robots can get too close and then it "sees" them everywhere and starts shooting in directions where people like me might be :)

That's a good idea about painting the inside matte black. I'm glad I bought 10 of these sensors, because I might have to sacrifice a few trying to find the best way to limit its view.

I also thought it might be useful to have a few more 'wide-angle' sensors mounted at various angles, to give me a basic idea of which directions a signal is detected, so I can then turn in that direction and start looking with the more precise one mounted on the gun. Like the 'finder scope' on a telescope.

And I love the idea of having the other robots react to being shot :) I had started to fantasize about building a bipedal robot next, who would follow LDM around and dance to his music. And if BullyBot shot the bipedal robot, he would do an elaborate death scene and then throw himself to the ground. Might be asking a bit much of a robot with (a planned) 2 DOF per leg, but I like the idea of them running and hiding :)

It is definitely too bad that  we're on opposite sides of the planet. Maybe one day we should organize a LMR gathering where we all get together and build robots to interact with each other. Like, say, to fight a war, medieval style. That's something I'd like to see :)

Dan

NOX's picture

wii controller, BTW awesome robots you got there!!

I heard from some video I've watched that $40 wii remote has a powerful camera with infrared on it or some sort. I think this has a big potential on robots for $40 but I really don't have the know-hows. I found the video here. << http://www.ted.com/index.php/talks/johnny_lee_demos_wii_remote_hacks.htm... >>. I also got a working camera from a used store. seems look like the one sold by parallax but without the second PCB on the back of it. Maybe that is the communication for the camera to Basic Stamp 2.

This is an awesome site!! I've been looking for a dedicated site just for cheap robot building forever not til I found this site. Thanks for this site!

TheCowGod's picture

Hmm, interesting. I'll look

Hmm, interesting. I'll look into that, thanks.

Dan

CaptainTuna's picture

your robot is cool!! just

your robot is cool!! just wondering how you're gonna feed it with pellets
TheCowGod's picture

The gun holds 250 pellets,

The gun holds 250 pellets, and I don't think I want him having access to more than that at one time, in case something goes wrong :)

Dan

BaseOverApex's picture

Excellent work!

Load it up, you pussy!
jklug80's picture

And in other news a man was

And in other news a man was held hostage in his house for 10 years by a robot that shot pellets, picked them up and reloaded by itself, recharged itself, and played Barry Manalow's hit songs. Eventually the man made a bullet proof robot to kill the first robot.
CaptainTuna's picture

oh ok i just saw a video of

oh ok i just saw a video of it on youtube and i realized that bbs are not in the mag as it goes for standard airsoft rifles but at the top! didn't know that
Scheda's picture

That's a really awesome

That's a really awesome bot!

I think it would be a cool idea if the smaller bot tried to 'run away' from the bully bot as he's chasing him, that might be kinda cool!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.