Defconbot video
Over the weekend Joe and I made a video showcasing the sentry gun we made for defcon. See the defcon bot on the right side, or read the digg story
Over the weekend Joe and I made a video showcasing the sentry gun we made for defcon. See the defcon bot on the right side, or read the digg story
We got back from DefCon last weekend. Our Sentry Gun didn’t do very well (tied for last place), but the trip was a lot of fun overall. We knew before we went that we weren’t going to win, so coming in to it with that mindset made it a lot more enjoyable.
The robot was mostly finished a few weeks before the competition, which was good compared to the 30 pound combat robot where we stayed up until 2 am the week before the competition and barely finished a functional robot in time. This was also nice in that Joe was going to summer school every weekday, so the only time we could work on it together was on the weekends. The biggest part remaining at that point was just optimizing the software, which I could do during the week and then do minor changes to the gun itself during the weekend, like getting a single power supply with appropriate connectors rather than having 3 separate batteries with alligator clips to power the gun.
There were a few hurdles we had to overcome to make the gun function properly. Originally the intent was to have a single fixed camera, and calibrate the gun based on that. However, the servos aren’t very accurate when commanded to go to a particular position from another. Going to position 2000 from position 2300 was up to a couple inches off from position 2000 from position 1800. It was possible to change it so that we could manually make it go to the same spot from different approaches (instead of 2300 -> 2000 -> 1800 -> 2000, we did 2300 -> 1992 -> 1800 -> 2008), but after running the gun for a while, what was working a half hour ago to make the gun go to the same position, doesn’t work now (now required 2300 -> 1990 -> 1800 -> 2010). To solve this, Joe glued the camera on to the gun itself, and I modified the algorithm to use this. The down side to this approach though is it takes a lot longer to go to a particular position because it has to move, then see where the target is, then move closer, then see how close it is, then finally move again and then see that it’s in the right spot.
Another problem we were having was due to the way the gun was created, in that there is a servo that pushes a switch that triggers the air valve. Occasionally the solenoid in the valve triggering would cause a big EM pulse that messed up the USB <-> Serial converter we were using, requiring it to be unplugged and plugged in again. However, this happened when the servo was contacting the switch, so the valve was stuck open until the serial port could be reattached and the servo moved away from the switch. Luckily this didn’t happen at the competition though.
The weekend before the competition we created a façade for the gun to make it look like a sentry gun from team fortress (well, Zach and Joe did; I mostly watched). The original plan was to make it out of pieces of plastic, but when we actually started to mount all of the parts it was way too heavy for the servos, so they decided to make it out of cardboard instead. It turned out really nice for being made out of cardboard.
The trip to Vegas was pretty nice. All three of us bought a Nintendo DS and Mario Kart DS before going and we played that on the airplane. I still don’t like Southwest though, as the boarding procedure is what my family calls a “Cattle Call” to find seats. We found 4 seats near each other, and someone with a shirt that was something like “I’ve got the root password to your box” sat down next to Joe and Jamie. I commented that I bet he was going to Defcon too, and it turned out that he was.
We arrived Friday morning and Joe and Jamie went to get the air compressor and pick up the package from the hotel while Zach and I went to a talk on SQL Injection and out-of-band channeling. We got there late so we missed the introduction (luckily I knew what SQL injection was already, but Zach didn’t). It was a very neat attack as it allowed data to be leaked out of the SQL server than would be allowed in a normal SQL injection attack, and in places that injection wouldn’t even allow data to get out of the system. I’m trying to be vague here as not to confuse, but suffice it to say, I was pretty impressed with it.
After the talk, we met up and assembled the gun and took it to the practice area. It was both nice and awkward carrying the gun down the hotel lobby, as some people were like “woah what’s that, that’s cool” while we were walking down the halls, and then there was hotel security I was wondering what they were thinking. They didn’t say anything though, so we proceeded to the practice area. We did a bit of firing and tuning to get the system to work a little bit better. When we were satisfied that it would knock down the targets, we packed it up and took it back to their hotel room.
Then Zach and I went to another talk about how to use FPGAs to speed up brute-force attacks. I was thinking it would be more of an introduction to them, and how they worked, but the speaker just skipped over that because “a lot” of the audience had seen his previous talk(s) (it was about one in four), so the talk was mostly “Here’s me running this code on my laptop.. look how slow it is. Here’s me running it on the FPGA.. look how fast it is,” and the different things that all used the same kind of encryption (Bluetooth, and a few others). After that we went to a talk on how to hack the ECU on a car. It was a really interesting talk as he talked about the different settings in them, and the history of the different ways to do it: purchase a completely custom one, fake out the sensors, or reflash the current one, with the reflashing being the current method. He also explained what the different kinds of things meant, like the fuel mixtures at different RPMs and loads, and had a few analogies to the Dukes of Hazard. I think Zach liked that one the most, as he could relate to it the most.
After that Zach and I did a bit of walking down the strip (Joe and Jamie were already down the strip somewhere when we went to the talk). On the Defcon web site it said that Las Vegas is hot, and they were right. Even at 9-10 pm it was still hot enough to sweat. It was nothing like Sacramento where it gets cool in the night. We were hungry so the first stop was to get some food. Originally I wanted to go to Dennys, but we decided to see what else was there. We ended up making it to a place called “Strip Burger” which was on the Strip (not because they had strippers; I was slightly disappointed that there weren’t). The burger was pretty good, and I got a raspberry something on the waiter’s suggestion (it had mint leaves in it, which was slightly disturbing). Then we went and saw one of the shows on the road with a siren ship and a pirate ship – apparently women can cause another ship to sink simply by dancing in the show’s alternate reality. It was incredibly cheesy and we didn’t have a good view. We continued on and went into Caesar’s Palace and saw a bunch of stores that sold things which we couldn’t afford, and one of the talking statue shows. The animatronics were pretty neat. After that, we decided we would each get one of the “Yard Long Margaritas” or something to that effect (I think it was 40+ oz), and proceeded to drink most of them before getting back to the hotel.
On Saturday we went to the contest area again and set up our gun for the contest itself. In our first round we went against the winners from last year. Our gun had only shot down one target before they got to their last target, but their gun jammed and we managed to shoot down 2 more before they got their gun un-jammed and finished off the last target. Our second round we went up against a two-gun team that didn’t seem able to hit targets by aiming at them, so it just sprayed bullets everywhere, and they managed to knock down more targets than us, so they won, even though we were 100% accurate. There was supposed to be black targets to discourage this, but there weren’t any so they took advantage of that and beat us because of that.
Zach and I went to a few more conferences on Saturday. One was about how the radio signal used to tell GPS devices of road conditions works, and how to broadcast it. It was a really nice talk because the presenter was a good speaker and pretty funny to listen to. One of the things he mentioned was how it’s possible to send fake alerts to a particular car that says there’s a road is closed because of an air raid, or maybe bull fight instead (along with a bunch of other reasons). The next talk we went to was about identification devices (like smart card readers, fingerprint scanners, etc) to get in to buildings, and how easy it was to hack them (essentially unscrewing the plastic cover and installing a “tap” on it by cutting a few wires). He gave a nice demonstration of the device he made and how it worked. This speaker was a very good presenter as well and very funny.
On Saturday night we went and saw Penn & Teller at the Rio. We took a taxi from the Riviera to the Rio (which was my first time taking a taxi actually) and made it there about an hour ahead of time. Originally we were going to take the bus, but we didn’t realize how long it would take. We had pretty good seats: close to the front row of the balcony, right in the middle. The show was as amazing as I could have hoped for; with the exception of one or two parts (I’m not really interested in juggling or fire-breathing).
On Sunday, we didn’t see any more talks and instead went to Denny’s for brunch, then took the air compressor back and then headed off to the airport. I originally wanted to have a later flight because I wanted to stay a little longer, but I didn’t really feel like staying there by myself, so I went with them to the airport and just played my DS while I waited for my flight. It would’ve cost like $200 to move my flight up, so I decided it wasn’t worth it and just waited a little longer.
Overall the event was a lot of fun, and we’re definitely going to do it next year if we can. For our next gun we’re going to try to build it with a more reliable control system (stepper motors most likely) and probably a gun that doesn’t need to be calibrated, but rather just works, so probably something powered solely with air to fire and load the next pellet. I have a few ideas on how that’s going to work. Also Joe is looking in to another camera, even though the one we have worked pretty well. I think the main upgrade would be a cleaner image and a controllable zoom so that we’re not wasting 75% of the camera area on the surroundings of the arena.
We made it back from RoboGames. We lost both fights with Big Bloom. The first fight was against Billy Bob, a vertical drum spinner, which took a bunch of big chunks out of our frame, however it seemed to hold up pretty well since it’s half-inch thick, and the chunks were only a sixth of an inch thick at the deepest place. He cracked the polycarbonate piece on the top though after a big hit. We ended up losing that fight because the screws that hold the motors in came loose and the gears didn’t mesh any more. In our second fight we fought a wedge. We didn’t finish the melty brain on the final version, so it was a sit and spin. He charged at us and we made contact and threw each other around the arena a little bit, but we had some problems with using bluetooth to control it. It came disconnected after going out of range, or taking a big hit and bumping the power switch on the receiver. However, the bluetooth stack on the PC causes the program to freeze when this happens and you try to disconnect the serial port. I think that it’s trying to close a port that it already closed, so it blocks infinitely. I restarted the program really quick, but we got counted out and right after that happened we gained control of it and it started moving again. Oh well. For the next version, we’re going to use a standard Spektrum transmitter/receiver for r/c, and have the bluetooth only for debugging.
The next project that we’re working on is going to be the DefCon Bot. I’ve put a description of it up. It’s not quite finished yet, but I should finish it pretty soon (the description that is). We finished getting the hopper mechanism working yesterday, so as soon as we receive the pan/tilt servos, we can start testing it out. I have been working on getting the algorithm to determine what order to shoot the targets down in. This is what’s known as the Traveling Salesman Problem in computer Science, and is intractable for finding the most optimal solution (essentially unfeasable to do the calculations). However, I have created a heuristic for this and made a demo program that generates random points and gets a relatively optimal solution and “shoots” down the targets in order.
At work, I’ve got a project that involves a GPS antenna on my desk. However, there’s no real place to mount it, so I stuck the mounting pole in the corner of my cubicle. However, the side effect of this is that everybody that walks by asks me what it is. The most common thought is that it’s a sprinkler.
Another little video after we put it the components on a ‘frame’ and got some decent motors for it. There’s no mixing on the remote (so up-down controls one motor, left-right controls the other), so it’s really hard to drive. This is also filmed on Joe’s awesome camera he got for his graduation present, so it’s a lot higher quality than the other videos.
It’s been a long time since my last update, and I figure I should post something. Hopefully updates will be more regular. I’ve had a few things I wanted to post on my blog, but I didn’t want to do it without posting a more comprehensive update, and didn’t really want to post a comprehensive update, so nothing got done. A deadlock so to speak. Anyways, I’ll start off with what’s happened to me since the last update.
I finally graduated from Sacramento State in December and got my Bachelors degree in Mathematics and Computer Science. It was a lot of work, but in the end it was worth it. It wasn’t really all that difficult, just a lot of work. My aunt and cousin came out to Sacramento to watch me walk during the cerimony, which was actually relatively quick.
I’ve also just recently quit playing World of Warcraft. The expansion pack really killed the game for me, just a lot of work and not that much reward for doing it. I mean, it’s really just a giant treadmill to keep people entertained, but it wasn’t really entertaining anymore, so I’ve quit.
Last month I got a Nintendo Wii. After deciding I wanted to get one, it took a few weeks for me to finally find one. I ended up getting it at Wal-mart during their Sunday sale early in the morning. It’s a lot of fun to play, especially wii sports. I also got Zelda along with it, and later bought Paper Mario. Zelda wasn’t quite as fun as I was hoping for, and I haven’t beaten it yet. Paper mario was a lot of fun and I beat it in a few days, although there was way to much text for it in my opinion. It’s also a lot of fun to play wii sports on a giant projector, so if you ever get a chance to do that, you should.
It’s kind of nice being out of school, although that means that having a job is the next step. Initially I put my resume up on monster and contacted one company that did web applications in Davis, but I didn’t get chosen for the position. I also put my resume up on the Sacramento State Career site and got one interview from that; I didn’t really want to do what they offered, so I passed on that. I also went to the job fair at Sacramento State and got two interviews out of the process, although nothing panned out from that either (one was consulting and the other was mainly for an internship).
I was browsing the Career Newsletter at Sacramento State, and saw a position at Schilling Robotics in Davis. I had heard about Schilling from my friend Zach, who works there. I had been asking him when they were hiring computer science students and he said they weren’t. However, this posting was new so I talked to him about it, and he gave my resume to the right person, so I got a phone interview with their recruiter, then one with the person I would be working for, then finally an on-site interview with him and a few more people. Apparently I impressed them, as they offered me the position. I accepted, and I start May 7th. I’m really looking forward to it, because it is something new for me (as a job), to do more c++ work rather than web development. Also my experience with working on microcontrollers for doing robots will hopefully be useful in this job as well.
There are two big projects I’m working on this summer. The first is the one Joe is more excited about doing, the “Defconbot” as we call it. Basically the goal is to make an autonomous robot that will shoot down white targets against a black wall. Joe is somewhat involved with helping out on the software side (he really wants to make ‘cool’ drawing for the targetting), although he is primarily doing all of the design and fabrication of the robot itself. For the gun, we bought an air compressor and are essentially making a blow gun. The plastic BB’s will be loaded into a barrel, and compressed air will force it out of the barrel. The major mechanical point will be the feeder to get a single BB into the barrel at a time, and the valve to control when the air is on (as we don’t want to waste air). Currently we’re using an air sprayer as a valve to do the hand-testing, but ideally it will be some sort of electric valve, rather than something we make ourselves.
I’m mainly working on the software side of the project, since my mechanical & electrical engineering skills aren’t as great as his, and I’m a much better programmer than him, and a cooler guy in general too. I wrote some software in C# that grabs the video stream from a webcam, detects the objects, and also some software that controls servos using the serial port. This will be used to aim the gun at the targets. The two pieces currently aren’t hooked up together yet, as we don’t have two servos powerful enough to hold the gun yet. However, here is a screenshot for those that are interested:
The second project we’re working on is our 30 pound combat robot named “Big Bloom.” The concept is that it will spin in a circle using two wheels, and brake them at certain points in time so that it creates a translation across the arena when we want it to move. It is going to be controlled using bluetooth, and I have a few videos to show the progress on this. As usual, I’m doing the software side and he’s doing the mechanical/electrical. Anyways, the first video is the initial test of getting the wireless signal to the microcontroller (using bluetooth). The second is similar to the first, only I have it controlling motors as well. The last video is a small prototype I made a long time ago to see if the motion is possible, and how difficult it is to do. It basically just goes in a straight line, then stops, then goes in another straight line — this is all controlled by timers, so there’s no remote control.
Control Prototype v1:
Control Prototype v2:
Motion Prototype: