• Polycarbonaut Mark 1:

    Building an aluminum and polycarbonate robot chassis, Part II

    Continuing on where the previous guide left off, it's time to add the guts of the robot. We've got wheels and geers, true, but without brains and sensors, our brawn won't go far. I've decided to put basically a sumo bot on the chassis, so I'll have 4 IR floor sensors to detect the edge of the ring, 2 IR distance sensors to find the opponent, and enough computing horsepower to make sense of it all.

    Back to Part I


    Brains

    In the past, when I had a robot to build, I generally had one purpose or one event in mind, after which I knew the robot would be cannibalized for parts. Thus, I formed the habit of making all my circuits on breadboards, like this one from an old sumo bot I did for the WCRG:

    breadboarded brains

    This project is going to be somewhat more permanent, and I'd like something more sturdy than breadboard. My main choices are having a circuit board made up, or using perfboard (aka vector board) to build my circuit. Well, I've never done perfboard before, but for a one-off circuit, it seems much cheaper, so that's what I'm going with. Here's a picture of some perfboard:

    vector board

    The basic idea is to populate the board with your components, then solder wires between nodes to form your connections. The board I got from DigiKey is pretty big, so I'm just going to populate the top-corner and cut it out once it's ready. I'm populating before cutting to make sure I leave enough space... and in the end I'm glad I did this because I would have definitely underestimated the space required!

    Here's a shot of the populated board. I'm going to focus on the physical aspects of the design here... the electronics are a matter for another tutorial. The basics are pretty simple, though: you can see I'm using an Atmel microcontroller (the really long, 28-pin chip)... the chip above him is a MAX232, to level-shift the voltages so I can connect to the serial port on my computer. To the left of these two is the header for in-circuit serial programming (ISP) of the Atmel chip. The motor driver near the top, with its characteristic heat-sink, is an L298, and the smaller heat-sink'ed chip to his right is the voltage regulator that turns my 9V battery into a chip-friendly 5V. Other than that, a master switch, a shiny oscillator can (near the bottom), a debugging LED or two, and some headers and resistors to drive the sensors (covered later on) pretty much cover it. Like I said, I'll go into more detail on the circuit in another installment, for now, on with the construction!

    closeup of the mounted components

    Here's the board once I cut it out with a hack-saw (no wonder they call it a hack saw):

    cutout vector board

    And the underbelly of the beast, once all the wires are in place. This is my very first attempt at a vector board... so go easy on me... and really, it could've been much worse. Still, this is pretty ugly. I mean, if I ever had to debug something on here, I'd be pretty screwed. One thing I did figure out is that wire-wrap wire (the white stuff) is much nicer for this sort of thing, as it takes up less space, making it easier to see what's going on. You can see that I switched to wirewrap wire halfway through this job.

    cutout board back

    I read someplace that it's better to have a circuit board made up if you're going to need 2 or more of a board. Having done my first vector-board, I'm ready to whole-heartedly agree. The amount of work it took for the above mess was tremendous... and the end-result isn't really spectacular.

    The next step for the circuit is to mount it onto the robot. I had cut a shelf out of polycarbonate in the previous installment, which provides an upper deck to the robot. In these next two shots, I've mounted the control circuit to that shelf. Basically, a hole drilled in the perfboard on each corner, plus some nuts'n'bolts, and you've got a handy mounting. I didn't have standoffs, so I used two bolts, one on either side of the board, to hold it in place.

    board mounted on polycarbonate

    mounted board bottom


    Distance Sensors

    Next up, I want to mount two GP2D12 infrared distance sensors facing outward from the center of my robot. I'm mounting them at the center of the robot because they have a minimum range of about 10 cm... anything closer than that starts to look further away. So, if your sensor is on the front of your bot, and you're getting closer than 10 cm away from your opponent, he looks like he's getting away!

    To mount up the sensors, I fashioned yet another piece of aluminum angle bracket into a handy mounting bracket, and screwed it into the center of my robot:

    distance sensor mount

    And with the sensors in place:

    distance sensors mounted


    Floor Sensors

    Next is to mount up some floor sensors - I'm using a QRD1114 IR transmitter/detector pair. Basically, an IR LED emits a whack of IR light, and an IR transistor picks up the reflected light and provides a modulated output that varies with the light intensity. All it takes is a couple resistors to turn this guy into a fully functional edge-of-the-sumo-ring detector. The analog value it gives is fed straight into the microcontroller's A2D port. Again, more info on the electronics are to follow in a seperate tutorial... for now, let's figure out how to mount these puppies! Here's a stock photograph of the sensor:

    sensor

    And a shot of the sensor with wires soldered on, and stuffed into a section of black pen that I cut off with some very sharp wire cutters:

    sensor mounted in cut pen

    Notice the notches in the pen section:

    notch in the pen

    I cut some aluminum angle bracket to fit on the corners of the robot, then cut notches into the aluminum. The notches on the pen sections fit into the slots cut into the aluminum bracket:

    slotted into aluminum bracket

    That bracket looks pretty nasty, and with good reason: it was incredibly difficult to get a good cut on those notches with a dremel. Next time, I'm getting myself a vice, drill press, full-blown metalworking facility... something.... so I don't have to hold the metal with pliers while cutting with an unruly dremel! Can you tell I'm not entirely happy with the angle brackets?

    Moving on, the next step is to put a hole in each corner of the robot, where the sensors will feed through:

    holey robot

    Next, we need to hold our brackets in place. As you can see in this next shot, I've cleverly reused some holes in the corner brackets that hold the robot together. I had originally made these holes all the way through so that I could thoroughly clear them out of all aluminum bits, but now having a threaded hole on the inside of the chassis has come in handy. This part, I'm happy about!

    mounted sensor

    Lather, rinse, repeat 4 times... you get a robot with 4 floor sensors. Because of the slot in the mounting brackets, I can adjust the height of the sensors... closer to the surface gives a stronger signal... but you don't want them touching the ground!

    4 mounted sensors

    Things are starting to shape up....

    Shaping up....


    Power

    To power this beast, I'm using all NiMh rechargeable batteries: a 9V to run the logic, and 4 AA rechargeables to run the motors. By doing this I've entirely sidestepped all the arguments that come up in the forums about which battery technology is best... and gone with one that everyone's pretty sure is not the best. These are pretty heavy, and seem to die out after relatively few recharge cycles. They're also pretty expensive. Alas.

    I'm using some standard 9V clips, and plastic brackets to hold the AA's. But how to hold them in place? If you look back up at the distance sensor mounting section, you'll notice two strips of self-adhesive magnet just in front of each motor. These were my girlfriend's (excellent) idea: attach the batteries with magnets! Velcro would have worked too, but I didn't have any kicking around. I affixed a strip of self-adhesive magnet to the chassis, and to the batteries. The AA's ride on the lower deck, to keep the center of gravity low, while the 9V is on the upper deck:

    batteries with magnets

    batteries with magnets


    Cable Management

    Now I need to get my cables from the lower deck to the upper deck, and out of the way of the distance sensors. I did this with a bit of nifty cutting:

    Cable vias

    Jeffrey's tubes?

    Seems to work!


    One last detail...

    The darned power switch is a bit too long for the space on the upper deck. By making a nifty little cut with the dremel, I get a recessed, protected switch, and it looks like it was entirely intentional!

    switch cutout

    Ready for Programming

    That's it for mechanical work... I guess I could shorten up the cables, and put a lid on the thing... but it looks so darned cool with its brains sticking out like that!

    Seems to work!

    And here he is with the IR sensor powered up... of course, this is invisible to the human eye, but my camera catches my creation in all its sinister glory! I just love this photo...

    Seems to work!


    Next time around we'll look at the circuit side of things, and/or the actual programming of the robot... which I actually haven't gotten time to do yet! The first thing I want to do is a sumo-bot behaviour... but then of course I'm going to want to push it further. One of the things I want to try is to train it to recognize where in my apartment it is based on the statistics of the floor sensors... if I do it right, it'll be able to tell the difference between beige carpet and beige tiles... so if that turns your crank, stay tuned!


    Happy building!
    Don

8434 visits