So Let it be Written, So Let it be Done!

April 12, 2008

Robotics in the Morning

Filed under: kamakula,robot,trinity firefighting — kamakula @ 8:03 am
Tags: , , ,

Yesterday afternoon I made the trip to Rochester. Stopped by RIT and got to see Dr. Phillips and Dr. Brown. It was good to catch up with them for a bit. I wandered around the engineering building looking for more professors but nobody else was around. I went by the SAU and saw a couple people from OAS. Chatted a bit, then went over to the science building to look for the Chrises, but I guess they were gone too for the weekend.

Leaving RIT, I went over to the gallery where April’s senior thesis was on display. I’m really amazed by the work she’s done. I mean, I’ve always been impressed by her artistry and skill. It definitely was a great thing that her interests intersected with robotics enough that she hung out with us guys. I finally had a decent conversation with her. Got a couple pictures of April (gasp!) and even got a hug before I left.

The trip to Hartford was uneventful. I did get 450 miles on my current tank of gasoline, however, a few wrong turns and having to travel about 3 miles further outside my way in a 30mph zone extended my overall trip length by about 30 minutes. Nevertheless, I arrived at the hotel in Hartford and noticed something. . . an SG van! Not only did MDRC get funding for the trip, they also got a van, and brought six people.

That plus the level of completion that the robots were in when I arrived and the way that they’d divided up work (different people working on different modules providing services to each other), I’m really impressed with the improvements they’ve made since Nate and I left. As usual though, MDRC was very short on sleep the night prior to competition. Heck, my Thursday night was likely the only night this week I got more sleep than these guys though :).

Another thing, these guys are all young. And by young, I mean 2nd and 3rd years. I think Alex may be a fourth year. So, definitely our workshop idea worked. To jump start the new MDRC members into building robots and directly participating in the club, rather than having to sit on the sidelines and only minorly help the more “experienced” guys because they didn’t have any idea of the skills they already possessed. Nate’s going to be really happy when I tell him about this trip.

Pretty soon we’ll (well, some of us) will head up to Trinity, register and secure a table, hopefully in a good spot. Though I remember arriving more or less on time last year and still getting relatively screwed. Though I ended up meeting this really cool guy who got the spot next to me so maybe it was worth it. I wonder if I should have printed out business cards. . .but I think going informal will be ok. I’ve got my pad so I can jot down names and other contact info as needed. . .

I could pass mine out, but like girls you meet at bars or clubs, they never make the first move. If you give out your info without getting theirs in return, you’re pretty much not going to hear from them again. You need to be the one initially driving the interaction. Anyway, I think I’ll stay here tonight and drive back early Sunday morning. If I leave around 4-6am, I can get back between noon-2pm.

I really need to work on the DSP project so I don’t have so much to do on Sunday. . . Yaay, I’m so excited about today. I can’t wait to get there and start meeting people and seeing what others have worked on, how things have improved (in terms of algorithms, robot design, the still major problem of reliable detection and localization of the candle) since last year. I feel bad I don’t have a robot to enter, but I’ve got some ideas for how to generate some more time.

I’ll just need to start earlier. I also have another idea for a balancing robot platform. It costs money though :(. So, I definitely have another reason to get a job this summer than just paying living expenses and fixing the remaining issues with my car. I need to raise money for a kick-ass balancing robot that I can use for next year’s competitions and other stuff.

April 16, 2007

Firefighting Competition Over – now at IEE SoSE conference

Filed under: kamakula,robot,trinity firefighting — kamakula @ 9:26 pm
Tags: ,
So, I was not able to get my robot into competition ready mode. The following was accomplished before I left trinity:

  • Robot base 75% complete.
  • Encoders tested and partially working.
  • Successful measurement of PWM pulse width from accelerometer.
  • Successful test of A2D code.
  • Implementation of PID code.

Unaccomplished Items:

  • Creation and testing of tone detection circuit.
  • Testing of IR detectors ability to find candle.
  • Creation of mechanism to put out candle.
  • Testing of route guidance code.
  • Testing of I2C code.

After I finally got the PWM code working, I started testing closed loop PID control of wheel speed. However, I noticed that the encoder output was too erratic to be used. It would take too long to attempt to calibrate PWM values to match speeds for each motor, so I decided to halt further work on the robot and go around talking to other builders, taking pictures/video, and enjoying other parts of the competition.

I still plan on getting the robot balancing and doing to hallway following/obstacle avoidance behaviors. Once I get back home, complete my final exam project, and some other school related things, I’ll see if I can redo the wheel encoders (perhaps add pull-down resistors on the output lines). With working encoders, I can determine the necessary PID parameters for closed loop wheel speed control. From there, I can work on closed loop control balance control. Once the robot is balancing, I can test driving the robot around and then add the hallway following and obstacle avoidance behaviors.

My experience this year has taught me a lot. I’ll likely discuss some of that here as time progresses.

April 13, 2007

One evening left and I’m flagging.

Filed under: kamakula,trinity firefighting — kamakula @ 9:27 pm
Tags: , ,

I’ve been at this airport for about 12 hours, awake for about 36. My flight status is officially resolved. I was on standby for two flights that were full, then switched from flying IAD -> BDL to ORD -> BDL. I’m going to arrive in Hartford around midnight. More than likely I’ll be too tired to do anything . . . unless I’m hyped up on adrenaline at the thought of finally arriving – so chances are I won’t get to do any hardware testing of any sort till Saturday morning.

So far at the airport I’ve:

  • Outlined robot low, mid, and high level routines.
  • Coded I2C functions to start and read ultrasonic sensor.
  • Coded A2D function to perform repeated conversions on A2D pins.
  • Coded quadrature encoder state machine to increment position counter.
  • Coded capture interrupt routines to track state of encoder outputs.
  • Coded capture interrupt routine to measure accelerometer pulse width.

Code-wise, I still need to:

  • Write/port PID routines to process a PID structure (two motor/wheel speeds and one gravity/acceleration).
  • Create bitmap of standard arena map.
  • Write/port path planning functions.
  • Create search route for robot.
  • Code routine to operate servo (for arm that puts out candle).
  • Write position update code that tracks robot’s x,y,theta position as well as registering robot with arena bitmap.
  • Write high level code that guides robot through each state of the competition (startup, search for candle, return home).
  • Write code that maintains robot heading.
  • Write code that keeps robot at least a fixed distance from any wall.
  • Write code that checks for obstacles or checks sensor readings to determine when end of hallway has been reached.
  • Write code that integrates all of this to the high level planning.

Construction/Assembly -wise, the following still needs to be done:

  • Create and test tone detector circuit.
  • Assemble new gearbox.
  • Attach encoder wheels and position wheel encoders.
  • Assemble robot frame.
  • Design, create, and test candle detection.
  • Attach all sensors to robot frame.

Of course, all the code I’ve written so far today will need to be debugged and tested as will all the code I’ve yet to write. Unfortunately, I’m pretty tired of coding now. . . I’ll have until 7pm Saturday to qualify for competition on Sunday, but I think it’s a big stretch to get all of that stuff accomplished in time. I’ll check the rules to see if I can determine the exact minimum necessary for qualification. It may be possible to code something that is able to pass quals then I can continue feverishly working Saturday night and Sunday morning.

This reminds me of IGVC, except since I was coding in Matlab and CCSC, thing were a heck of a lot easier and could be written, tested, and debugged much faster.

One Day Left and a lot poorer – At the airport.

Filed under: kamakula,robot,trinity firefighting — kamakula @ 10:20 am
Tags: , , ,

Well, so this trip hasn’t started out good.

Let me start by saying that typically, my body has two failure modes when extremely exhausted: hallucination, and falling asleep immediately at whatever I’m doing without any memory of the even. The hallucination has occurred after 72hours with ZERO sleep during which time I attended one class and skipped the rest to work on a lab project for the one class I attended. So, other than the two hours of class over those three days, I was in the lab for about the other 68. The remaining time accounts for bathroom and food breaks.

So, the hallucination in this occasion involved me seeing myself write a piece of code that compiled, linked, and loaded correctly. However, when I would test the board, nothing would happen. It took two hours for me to realize that I’d pretty much spent that time doing nothing.

The semi-narcalepsy occurs at lesser stages of exhaustion but can be bypassed if I keep myself supplied with sugar (which was the case with the hallucination event above).

However, tonight, I experienced what I can best term as reverse hallucination. Instead of seeing something that wasn’t there, I didn’t see something that was in plain sight. As I got ready to start packing up the assorted parts, I started looking for the gearbox I’d preassembled and the lexan I’d cut wednesday night. I started with where I last remember seeing them, the table at which I’d been cutting the lexan. Since I went to sleep soon after completing that, I knew that the chances of those items being anywhere else were pretty close to zero. So, I searched the table, didn’t see them. Ok, went to my work room, looked there. . no dice. Hmm, maybe I somehow took it to bed. . . not there. . . Perhaps I grabbed it in the morning when I went to the bathroom. . . nope. . . maybe I absentmindedly put it in the fridge (this happens more often than you’d think) – not this time. So, I spend 15-20 minutes searching my apartment and am about to have a nervous breakdown (I’m asking myself why would someone break into my apartment and only steal a gearbox and lexan). I go back to the table (for what is probably the 10th time) and look around again. . nothing. I turn away, and look back. . .and see the damn gearbox – WTF? It takes me another 20 seconds before I see the lexan.

Anyway, due to this and other reasons, and that I thought my flight was at 7AM, I end up leaving Tallahassee at about 2:45AM for a 6:00AM flight. 30 miles into the drive, I start feeling really tired and sleepy. 30 miles later, I stop at a gas station to stretch (which usually revives me) and check my flight info (which airline. . the exact time. . ) and see it’s for 6AM. Well. . . I still have over 100 miles to go. . . and about 2.5 hours till 6AM. Hell and Damnation! So, back on the road, really rejuvenated now, and creep up to 85. . 90. . . 100. . .110mph. And I’m good for about 70 miles. . . then I see the cop. . . but not in enough time, I get clocked at 92mph. Ticket is around $200. I can take a safe driver course to lower the fine and get points off. . . but this slows me down for the airport. Then I get here and waste time in the economy parking lot. I realize that there is no way I can get from that lot to the terminal in time, so I goto the terminal lot (twice as expensive to park). Time is 5:45AM. I’m pretty sure I’ve missed the flight, and when I check it, the kiosk confirms it for me.

In other news, someone provided the solution to the timer interrupt problem I was having before which really simplifies some of the coding I will be doing. At this point, I have code snippets and ideas all floating around. I’m pretty sure that all my sensors will work as expected, so now it’s time to write the code that glues it all together. So, I’ll take this time that I’m on standby for the next flight to plan out on paper the robot’s software architecture. Once that plan is pretty stable, I’ll return to coding.

April 10, 2007

Four days . . . really four evenings

Filed under: kamakula,robot,trinity firefighting — kamakula @ 11:10 am
Tags: ,

Note to self – next competition, either start way in advance or have enough vacation time so you don’t have to work the days prior to leaving for the competition.

So, I was able to find within the example code an implementation of printf that works well. I can modify the low level code that outputs the data over the serial port to be interrupt driven but that’s something that will only happen once the entire robot is complete and working properly.

I wrote analog to digital conversion code last night (and will test today). I think I’ll write quadrature encoder code and pulse width capture code today as well. I’ll use the I2C interface for the ultrasonic sensor and can borrow the code I wrote last year for an IGVC competition.

I should also be able to do some body work – cutting out the lexan pieces that would form the structural frame of the robot. I hope superglue works well on lexan 😉

April 9, 2007

Almost Five Days Left

Filed under: kamakula,robot,trinity firefighting — kamakula @ 12:44 am
Tags:

This are not looking good.

  • Broke a gear tooth with a superglue – gearbox accident. Luckily, Publix sells nail polish remover (acetone) which fixed the motor. But now I must next day air a couple spare gearboxes on Monday.
  • Spent hours tweaking the makefile until I got the PLL correct. . .
  • Wrote up lots of code. . . but a lot depends on displaying stuff over serial. However, it turns out implementation of stdio is incomplete in WinARM. There are work arounds. . . but I get the feeling they will take a long time to work through.

Hopefully, when things pull together, work will progress quickly. Just need to figure out a way to pull it.

Things left to do:

  1. Cut out lexan for structural components.
  2. Test out encoder circuitry.
  3. Write quadrature encoder code.
  4. Write accelerometer code.
  5. Write ultrasonic sensor code.
  6. Test A2D (infrared sensors).
  7. Design tone detector circuit.
  8. Get serial code to work.
  9. Test PWM
  10. Figure out competition strategy/algorithm (chances are this will be be partially coded on my flight to Hartford).

I suppose I could work around the serial stuff by cutting and pasting from the sample code. . . I was hoping to have ISR driven print capability that was light-weight. . . but I guess I can sacrifice that for development time. After all, with the PLL, it’s running at 60Mhz and I’ve got plenty of code space. . .

April 7, 2007

One Week Left

Filed under: kamakula,robot,trinity firefighting — kamakula @ 11:52 pm
Tags: , ,

Herein we join the adventure already in progress, where kamakula (that’s me!) has one week left to complete his robot (appropriately and presciently named LastMinute) in time for the Trinity Firefighting Competition. I’m a little pumped since I just completed a 5k run (32:04) – my first such in pretty much ever and my first week running in almost half a year.

LastMinute is supposed to be a two wheeled balancing robot that utilizes the ubiquitous Tamiya motor gearbox for locomotion. It will sport homebrew optical encoders (to determine it’s pose and speed), an accelerometer (feel that tug – it’s gravity!), ultrasonic sensors (echolocation like a bat), infrared (I can’t remember which animal sees in infrared. . . but I know you’re out there!) for distance measuring and to detect (hopefully) the bright spot of the candle (fire!). We’ve also got the cheap SN754410 quadruple H-Bridge to drive those motors. What ties all this together is a Philips LPC2131, an ARM7 controller in the package of a TiniARM from New Micros.

At this point, everything is pretty much in pieces. The ARM7, H-bridge, an accelerometer are on a breadboard. . . but not hooked up together. I’m still getting up to speed using WinARM to compile programs for the controller, so that still needs to be worked out. I’m not sure if I can get the optical encoders to work and I’ve never used the accelerometer before.

However – the goals for this evening:

  1. Setup timer interrupts correctly on ARM7 by creating a clock application that counts up H:MM:SS accurately (displayed over a serial link).
  2. Layout and solder optical encoder circuit then test it detects black/white transitions using an LED (and inverter as a buffer).
  3. Test quadrature encoder code by outputting over the serial link counts per second and direction.
  4. Layout H-Bridge circuitry on breadboard and test capability of driving gearbox motors with PWM output from ARM7.
  5. Test closed loop speed control of a wheel.

Blog at WordPress.com.