Klein Bot

Kleins, robots, electricity


Second Place at the Robot Rally!

Posted by Klein on October 24, 2010 at 9:33 PM Comments comments (0)

Octowobble was a great success at the 2010 Robot Rally. We placed second overall in the Polyathlon and first in the sub-contest Dead Reckoning -- much better than expected. I'm still collecting photos, notes, and thoughts from the last few days, and I'll post a more complete summary later. In the meantime, it's back to "real life" and getting full nights of sleep.

Update 10/26

Scores and photos are posted at the AHRC site.


Update 2/1/2011

Neglected to add this last Fall. Videos are available on YouTube.

http://www.youtube.com/watch?v=Q5pJFALx4co (at 3:00 and 6:45)

http://www.youtube.com/watch?v=Gv3TlvYtMKI (at 0:45 and 3:40)

Countdown: 38 hours

Posted by Klein on October 21, 2010 at 9:16 PM Comments comments (0)

The Rally competition begins at 11 AM on Saturday. I think I'm close to covering 5 of 6 events in the polyathlon -- line following and beacon finding are 4 of the 6, dead reckoning will be a shot in the dark -- just some trial and error, not real reckoning.

Now on to work on the beacon detector and to write some programs tonight.

Countdown: 57 hours

Posted by Klein on October 20, 2010 at 8:52 PM Comments comments (0)

Octowobble was nowhere near ready for his coming out at the local robot club last night, so he's being schooled on the workbench tonight. It may be a late one -- he's been very bad.

I did get some good tips on things to try.The best route was to switch from "simple anti-phase PWM" to sign and direction control.

With anti-phase PWM, you peg the PWM ("speed") pin high, and alternate the direction pin quickly. If it's forward half the time and back the other, the net power to the motor is zero. As the PWM balance shifts, so does the average power and the motor turns. The theory is that the ~500 Hz PWM from the Arduino is insufficient to properly drive the input pin.

I've switched a driver to sign and direction. This is an easy change, just un-tied the PWM from V+ and brought it out to an Arduino pin. I'm tweaking the software and testing is about to begin.


Did you know that if you comment out code, it doesn't run? For instance, if the code that actually writes to the motor driver pins is commented out and replaced with Serial.print commands, then the motors never actually turn, and there might actually be nothing wrong with the driver.

Further Update:

It works! I'm now switching to work on the beacon detector. I can't rely on their beacon since I've never had a chance to test against it, so I'm cobbling together one of my own.

Countdown: 104 hours

Posted by Klein on October 18, 2010 at 11:42 PM Comments comments (0)

I'm trying to squeeze in some functionality before the local robot meeting tomorrow night.

Current status: I've discovered that the twin motor driver board doesn't drive one motor well when both motors are connected. Short? E-m interference? Time for some more troubleshooting.


I thought this might be a quick fix, so I played the "just a little more, I've almost got it" game. I checked the datasheet "typical application" notes and updated some component values and tied an output pin high. But somewhere in the changes, I broke one of the drivers. Now it's 2 AM, and there's no sleeping in tomorrow. Maybe I can find a quick fix before the robot meet?

Off to bed.

Countdown: 156 hours

Posted by Klein on October 16, 2010 at 10:12 PM Comments comments (1)

Getting nervous ...

Just 7 days, wait, 6 and a half days until the competition, and I can sleep in tomorrow. Time for an all nighter, I think.

Turn on New Age/Techno soundtrack ... check

Warm up soldering iron ... check

Arduino programming cable ... check

Recharge batteries ... check

Here we go ...

10:30 PM

A flaky battery holder, so I tried a smaller 8 batt holder. But the motor driver won't work (as wired) on 8 batts / 10.6 volts.

11:24 PM

Ben's in bed, so I'm finishing the second driver on my own.

2:00 AM

Munchies attack! Time for coffee and cookies (frozen Thin Mints. Yes, I still have some. No, you can't have them.)

Driver assembled (with switch and LED power indicator)

Battery pack is fixed (fingers crossed)

4:30 AM

The cookies are gone, the coffee's long gone cold. But I'm still here.

I've drilled some holes and switched from solder to hot glue.

I'm still aiming for a working line sensor and motor drivers this weekend.

6:30 AM

Hooking it up. Mostly making connecting wires and routing them now.

(Getting tired, though.)

7:30 AM

All hooked up, untested as a whole system. Octowobble has line sensors and motor control. We're ready to follow lines, as soon as I get a program together.

Time for bed!

More progress

Posted by Klein on October 14, 2010 at 11:51 PM Comments comments (1)

We made a little progress over the last several days, but not as much as I had hoped. Ben and I both have been overloaded with our respective work/school assignments.

I've started a to-do list to help organize the remaining work.

motor driver testing

motor driver 2 build and test

rebuild the power bus (12 volt) with a fuse and all upward pointing pins

edge sensors

proximity sensing

beacon sensing

motor encoders

Anyway, there's a bunch of new photos posted in the Octowobble album. Enjoy.

Motor drivers have arrived (LMD18200)

Posted by Klein on October 11, 2010 at 9:59 AM Comments comments (0)

The LMD18200 motor driver chips arrived from Hong Kong on Saturday. I'm working out the schematic for the supporting components and how to deal with the other-standard pin spacing (0.06 inches, not 0.1).

Soon we'll be moving, and we're pushing toward the deadline. The home robot club demo is in 8 days, competition in 12!

Line sensor success

Posted by Klein on October 11, 2010 at 9:53 AM Comments comments (0)

Thanks to Ben at Pololu for posting line sensor code for their QTR that's compatible with the Arduino. I was starting to get a bit panicky.

Ben's post is here


And here's theupdated library


I verified this with my Seeeduino (v1.1 "8/23/2008"). I edited the header for 6 pins on port D, and no emitter control. (Pins 0 and 1 are used for Serial communication, so I'm leaving them out.)

NUM_SENSORS   6     // number of sensors used



PololuQTRSensorsRC qtrrc((unsigned char[]) {2, 3, 4, 5, 6, 7}, NUM_SENSORS, TIMEOUT, EMITTER_PIN);

QTR Line Sensor - not working

Posted by Klein on October 2, 2010 at 10:21 PM Comments comments (0)

No luck getting the line sensor going. I'm asking for help from The Internet. I'm posting pictures of my setup and my code here, and posting my questions out there.


The setup:

Seeeduino pins 0 to 7 to QTR pins 1 to 8, respectively.

QTR enable pin unconnected.

Pictures in the photo gallery

connections to Seeduino

connections to QTR

IR LEDs are on

I verified 4.92v at Vcc on the QTR.

I verified continuity on each sensor connection


The code:

#include <PololuQTRSensors.h>

PololuQTRSensorsRC qtr((unsigned char[]) {0, 1, 2, 3, 4, 5, 6, 7},  8 );

void setup()
{ int i;
  for (i = 0; i < 250; i++) // make the calibration take about 5 seconds
  { qtr.calibrate();

void loop()
{ unsigned int sensors[8]; // an array to hold sensor values



After 5 seconds of (presumed) calibration, the code returns only "4000"s. I'm presuming that these are timeouts. A different version of the program using readLine returned only 0 for line position.


I got a prompt update from (Site Admin) Ben at the Pololu forum. No direct fix, but confirmation that it's not me. There's also some example code (with lots of room for improvement) at the primary forum thread.

QTR Setup

Posted by Klein on October 1, 2010 at 8:01 AM Comments comments (0)

I made a few cables and soldered some pins to the Pololu QTR line sensor ( www.pololu.com/catalog/product/961 ) last night, and moved upstairs to sit in the easy chair and try to get the the Seeeduino to talk to the QTR. Initial results are negative, but I was happy just to get things connected, and to get a skeleton program with the QTR library running.