BullyBot
Video Links
- IR detection testing
- Shooting blanks
- Detecting bare skin
- Detecting humans through clothing
- Too damn effective
- BullyBot gets a taste for human blood
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).

Extending the axles

Useless parts removed

Removed parts

Up/Down servo mounted

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

Mounted on the second servo for left/right aiming

View from the other side

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!

Lotsa holes drilled in the base

The lower half of the base assembled

The bottom of the base

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.

The assembled base.

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!

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.

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

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

Everything wired up for testing, and working perfectly.

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

Detector circuit -- much simpler.

All assembled.

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.
2008/10/11
It's alive! Switching to the uDSMC and RM3 motors didn't solve the problem, and so more months passed as I neglected the project. I hate when I'm stuck and can't figure out how to get past a problem. But finally I came back to the poor disassembled BullyBot and tackled the troubleshooting again. I tried a bunch of different combinations of motor controllers and motors to try and identify what was causing the problem. The Low Voltage Motor Controller wasn't dead as I had feared, so I tried LVMC with FA-130s, LVMC with RM3s in the Tamiya gearbox, LVMC with a Solarbotics GM3 (which I believe also comes with RM3s), and all of those motors with the uDSMC as well. In both cases, a voltmeter showed that they were outputting the right voltage, but as soon as I connected it to the motor itself, it would pulse for a fraction of a secondand then stop.
The crazy thing is that when I tried the uDSMC with an RM3 (with a .1uF capacitor across the leads), or the uDSMC with a GM3, it wouldn't work. But when I dragged over Little Drum Machine and touched wires from the uDSMC in BullyBot to LDM's GM3 (which should be identical to the loose one I tested with earlier, complete with its own 0.1uF capacitor across the leads), it worked!
Based on that test, I guessed that noise must still be an issue, so I added two more 0.1uF capacitors to each motor, as Pololu suggests. Finally, that solved the problem, and BullyBot can now drive around again, using the Low Voltage Motor Controller and RM3's in the Tamiya Gearbox. Phew. The motors now look like something that's been growing in Xen, but at least the robot can move again :)


Of course, now that it can finally drive around, I found that when it tries to turn, the cheap Tamiya tank treads tend to fall off of the hubs. Great. I guess I'll have to use something else. I might use the Pololu tracks like YDM/LDM, but they're so expensive. Plus, since this robot is more... offensive... I'd like the tracks to look more aggressive and tank-like. Suggestions are appreciated.
So now I guess it's time to get back to the IR detection circuits that have been taking up two of my breadboards for months. I'm happy to be making progress again.
2008/12/9
I kept having trouble narrowing down the field of view of my IR receiver. I coated the housing in white caulk, but still somehow the IR manages to make its way into the sensor -- maybe white caulk isn't opaque to IR light.
Gearing up for a separate project, I glanced back at the TPA81 8-pixel thermopile sensor I've been lusting after forever, and found that they'd dropped the price from $150 or so to $99. Still expensive, but that's only like 2-1/2 SRF05's... Or so I justified it to myself :) So I ordered it for that other project. Then Frits convinced me that the TPA81 isn't the best sensor to use on the other one, and mentioned offhand that I should use it on BullyBot...
By golly, he's right. I'm tired of messing with the IR thing. Plus, if BullyBot has a TPA81, then the other robots don't have to have the complex 38khz IR emitter circuits -- I just have to put something hot or warm on them. I figure something like a simple low-ohm 1W resistor mounted somewhere on the robot should get warm enough to be visible to the TPA81. It'll take some experimentation to find a combination that provides enough heat to be visible without wasting all of the robots' battery power (and burning people who venture too close). But I think it'll be a lot simpler (and feel less like cheating) than replicating the IR emitter circuit for every single robot. Plus, this way I can program BullyBot to track humans if I feel sadistic :) (Or is that masochistic?)
I also had a small laser and mounting bracket that I'd bought from SparkFun months ago with no specific project in mind -- I decided that laser sights would be fun as well. So today I rigged up a way to mount both the laser and the TPA81 on the gun in a way that's adjustable and aimable, and I wrestled through the I2C specification to figure out how to get the Arduino to talk to the sensor. It works pretty well -- my hand at about 3-4 feet shows up as a few degrees warmer than the ambient room, but so does my laptop and my computer monitor. I'll probably want to set its threshold a little higher than that. When I point it at an entire human body, it stands out a clear ~10 degrees warmer than ambient, even from farther away, so I'll probably stick to a threshold like 7-8 deg C above ambient.
Here's some pictures of the build process for the 'targeting package'.

Dremels are nice, but some jobs work so much better on a bandsaw :)

Clearing a flat surface on which to mount the 'targeting package'

Adapter plate for TPA81 made from aluminum sheet

Modifying the laser mounting bracket

Tapping the rear holes to provide the ability to aim up or down by screwing the screws in or out

The complete 'targeting package' (red laser and TPA81)

He's got mirrored sunglasses like a cop

Rear view

Targeting package mounted on gun. The rear screws work nicely as a way of leveling the laser/sensor

Roommates beware :)
2008/12/11
I soldered up another small circuit board for the connections for the targeting package. I had to stick it under the other circuit board for a multi-story PCB to make it all fit, which became too tall to fit between the two wood panels, so I had to use washers to raise the upper panel. Even so, it barely fits, and the servo wires are crammed against the wood in a way I don't like. I guess the other option is to move some of the circuitry to the upper deck, but I like having that clear. We'll see.
With the robot reassembled, I started working on code for the scanning routine. I came up with something that works fairly well. It needs a little work, but it's good enough at finding me that it's a little creepy :) I coded it so that he turns on the laser pointer when he finds a target, so he has a way to say "Bang, you're dead" without having to actually shoot you. That is a welcome change, since the only person in the room most of the time is me.
I discovered something interesting while I was testing and working on the code. I left him sitting on the table next to me, scanning for targets, and over and over again he'd find me sitting next to him and shine the laser in my face and half blind me. Man. I just built a robotic version of an annoying kid with a laser pointer.
I put up a few videos above showing BullyBot tracking me like an animal. Here's a few more pictures.

The new circuit board for the TPA81 and laser module. The TPA81 communicates over I2C, which requires pull-up resistors on both lines.

All the wires connected. I've tried to keep things as intelligible as possible by color-coding wires, bundling related wires together with wire ties, etc. It helps, but it's definitely a mess in there.
2009/7/27
Just a small update. I finally had a houseguest who was willing to let BullyBot do what God put him on this earth to do -- shoot people in the face. Naturally, there's video. Now that BullyBot has a taste for human blood, he's never going to be content with the store-bought meat I've been feeding him...



@ Mon, 2008-06-30 04:18
This is SO WICKED!!
@ Mon, 2008-06-30 07:19
Heehee, thanks, can't wait
Heehee, thanks, can't wait to get it working :)
Dan
@ Mon, 2008-06-30 07:49
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.
@ Mon, 2008-06-30 08:03
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
@ Mon, 2008-06-30 08:55
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.
@ Mon, 2008-06-30 09:46
indeed, do you think it
@ Mon, 2008-06-30 10:00
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!
@ Mon, 2008-06-30 13:56
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?
@ Mon, 2008-06-30 14:59
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.
@ Mon, 2008-06-30 15:40
Ok, that is the main idea
@ Mon, 2008-06-30 15:46
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
@ Mon, 2008-06-30 19:30
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? :-)
@ Tue, 2008-07-01 00:49
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
@ Tue, 2008-07-01 13:52
The main processor in the
@ Mon, 2008-06-30 15:47
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
@ Mon, 2008-06-30 10:07
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 :-)
@ Mon, 2008-06-30 09:33
I'm lovin' it
@ Mon, 2008-06-30 15:49
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
@ Thu, 2008-07-03 02:10
Nice, It's lookin real good!
@ Mon, 2008-07-07 08:40
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
@ Mon, 2008-07-07 09:09
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?
@ Mon, 2008-07-07 15:18
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
@ Mon, 2008-07-07 08:47
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.html >>. 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!
@ Mon, 2008-07-07 15:19
Hmm, interesting. I'll look
Hmm, interesting. I'll look into that, thanks.
Dan
@ Mon, 2008-07-07 13:37
your robot is cool!! just
@ Mon, 2008-07-07 15:20
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
@ Mon, 2008-07-07 15:33
Excellent work!
@ Mon, 2008-07-07 15:54
And in other news a man was
@ Mon, 2008-07-07 16:21
oh ok i just saw a video of
@ Mon, 2008-07-07 15:34
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!