Welcome to Bob & Eileen's web site. Bob generally blogs here while Eileen blogs over at her site. You can see our photos from here or click the little camera in the upper right corner.


March 2017
« Sep    

January 2, 2012

Outdoor Robot gets (somewhat) smarter

Filed under: Robots,Software — Bob @ 6:36 pm

My Outdoor Robot project got some attention recently, now utilizing the ultrasonic sensors at the front to avoid obstacles. I’m still running it very slowly, so I can learn from watching it without having to run to catch it. I’ve implemented a subsumption architecture in the software that has a few simple behaviors:

  1. Startup: waits for a button press, and only allows for one minute runtime.
  2. Avoidance: using the front-facing ultrasonic sensors, turn away from obstacles. The turn is proportional to the distance to the obstacle.
  3. Cruising: run straight ahead at the maximum (slow, at this point) speed.

In the videos below you can see this happening. There really isn’t a lot of “smarts” to the software, although it looks pretty good while running. Next up is to get the “remote stop” working then I’ll increase the speed. I also need to work on behaviors for when the robot gets itself into a corner e.g. backup and turn around.

Enjoy these videos for now!

October 24, 2010

Video Fun!

Filed under: Commentary,Humor,Software — Bob @ 8:48 pm

Recently Eileen needed some help with creating a video to promote the Canadian Booksellers Association “Independents’ Day” back on October 16th. She wanted to promote her favorite local independent bookstore in North Vancouver.

We are not professional film makers, but I figured that we could pull something together. My equipment was limited to iMovie and Quicktime, my iPhone 4, a tripod, and a couple of dogs as “extras”. After bouncing around a few ideas we came up with the idea of silent film style clip, as it wouldn’t require audio, and some simple Quicktime effects would mask the low-end video recording. In all, I’m really happy with the results especially since we made the whole thing in one evening.

You can see the full version here, or a version tailored for mobile devices here. The silent film concept worked but we needed a twist to make it timeless (you’ll have to watch the video to see what we did).

August 12, 2010

Overo + Controller Area Network (Revisited)

Filed under: Electronics,Robots,Software — Bob @ 7:37 pm

A while back I posted about my work to enable support for the Microchip MCP2515 CAN controller with my Gumstix Overo. At the time I was confident of success because I was successfully receiving messages from my AVR setup. It was only recently that I discovered that in fact although reception was ok, transmission was not actually working.

Debugging the mcp251x Linux driver was an interesting exercise. Google wasn’t much help, as it seemed the few others attempting this same feat were either successful or completely unsuccessful. My situation suggested I didn’t have any electrical problems nor did I have any compatibility issues. Though resolving my problem I learned a whole lot of stuff I didn’t expect to, but it was really fun and rather educational. Maybe by sharing my diagnostics process others can learn something too.

Since I had a working receiver I was working under the impression there was some sort of issue with the way I configured the mcp251x driver. I tried upgrading to the latest version of the kernel (2.6.34) but no joy. I also looked at the latest development version of the mcp251x driver from the SocketCAN project. No new insight there at all.

From building a simple driver for the AVR chip I had a good working knowledge about how the MCP2515 works, so I figured it was really something to do with how the driver was written. It obviously wouldn’t be a generalized problem, but I had no idea what could be wrong. I started by adding a whole bunch of printk() debugging statements to better trace how the driver was called from userspace. Something odd was happening where the driver was repeatedly polling the MCP2515 chip for status. I traced what it was doing in the code and also followed the SPI conversation using my Saleae Logic logic analyzer. Nifty device by the way, highly recommend it. Turns out it didn’t really help solve the problem, but it did manage to help eliminate various false leads.

The SPI conversation and responses were perfectly normal. More printk() statements later and I was rather stumped. Then it occurred to me (at a time I wasn’t actually in front of my project) that there really should not be any polling. The driver configured itself with an interrupt line to know exactly when an event was pending. The polling I could observe over the SPI bus suggested this mechanism was not working (the status returned by the chip was correctly suggesting there was no pending events most of the time).

Turns out the default Overo build from OpenEmbedded sets up the GPIO pin for the interrupt line with a pull-down resistor. The interrupt line should normally be high then pulled low to signal a pending event. As far as I could tell, the pin was never actually being pulled high enough to be sensed by the Overo processor. I expect that the voltage level converters I’m using are to blame, failing to overcome the resistance of the pull-down resistor. This meant the Overo was seeing the GPIO pin as a low logic level all the time, leading to a constant interrupt. When this happens, the interrupt handler will fire and poll for the reason for the interrupt. Inspection of the code suggests this could starve the transmit code path from ever getting enough time to send messages. Indeed this would explain the situation I was observing. I adjusted the pin configuration in the u-boot recipe (now in my user.collection) to use a pull-up resistor instead, and now everything is fine. Because of the way that the mcp251x driver is written this should be ok.

I also discovered my previously published user.collection tarball was not matching my actual configuration. For reasons that are (again) likely due to the voltage level converters I lowered the maximum SPI rate to 500kHz. I’m using a CAN bus speed of 125kHz with a very low message frequency, so this doesn’t seem to be a problem. I was also annoyed by several of the useless messages printed to the console from the SPI driver and the mcp251x driver, so I commented them out with my own patch. Both issues are now fixed in the tarball. Download, roll into your own user.collection directory, and enjoy.

April 15, 2010

Overo + Controller Area Network

Filed under: Electronics,Robots,Software — Bob @ 7:20 pm

I’ve had a long interest in using Controller Area Network (CAN) to communicate between different components such as sensors or GPS modules or motor controllers. I wasn’t sure if I could do this with the Gumstix Overo board, but I got excited when I found out that Linux kernel version 2.6.33 would be including a driver for the Microchip MCP2515 CAN chip.

This required creating a custom image for the Overo, which meant setting up a build with OpenEmbedded. The Gumstix guys made it sound pretty easy in their instructions, so I set off to make it happen. I started with a virtual machine with Ubuntu 9.10 and set up bitbake and OpenEmbedded as suggested.

I’ve uploaded a tarball of my user.collection directory with overrides for the Overo machine configuration (you could probably ignore that) and for the Linux 2.6.33 recipe to include my configuration and patches to the Overo’s board initialization code for the MCP2515 chip on SPI bus 1 chip select 0.

My working environment for the org.openembedded.dev component uses change d535da0dfe20e965adb49d3acf720e7f9feb58c6. I’m sure by the time you try this there will be newer versions, but I can’t say whether my patches will work or not.

As for the hardware, the Overo uses 1.8v internally but the MCP2515 uses 5v. I used a few SparkFun logic level converter boards to translate voltages. Despite what you might read on their website, DO NOT USE the RX channels as this will send 2.5v into the 1.8v-capable pins on the Overo! Only use the TX channels (they are bidirectional and work at the correct voltage). I needed to translate five pins (SCLK, MISO, MISO, CS, and an interrupt pin) so I used three of the SparkFun boards.

I was able to use the candump program from the socket-can test tools suite to verify correct operation. Awesome!

March 27, 2009

I’m cool enough for a Mac!

Filed under: Commentary,Software — Bob @ 7:14 pm

After a miserable start Microsoft gave up on a silly advertising campaign (and supposedly also a very expensive campaign) to have Bill Gates and Jerry Seinfeld explain to me why Windows was wonderful. Their next attempt was the “I’m a PC” campaign that was somehow supposed to convince me that it was cool to use Windows. Their latest attempt now tries to convince me that purchase price, rather than coolness, is the primary factor I should use when deciding on a new laptop. Uh, what?

I appreciate value as much as anyone else, but seriously Microsoft is once again missing the boat. I’m sure the Apple execs are laughing (again) at this new attempt. I certainly am. In addition to laughing I’m also quite puzzled why Microsoft seems to be funding the advertising for Best Buy and HP. Whatever.

People like their iPods and iPhones because they feel nice to use. Ok maybe people get them because they look cool. Maybe coolness is why people buy, but that isn’t why people recommend to their friends. When you ask people who have a MacBook whether they’d recommend one, they aren’t going to tell you about price or about coolness. They tell you about the joy of using it and getting things done. They tell you about the joy of having a computer that “just works” for them.

Usability has always been a key thing for Apple and it really shows. I believe this is because Apple creates a cult-like passion amongst developers and users about it. I believe that Microsoft is interested in usability, but somehow they can’t seem to make it work. You can watch Steve Ballmer run around shouting “Developers! Developers! Developers!” but is he really trying to create the passion and commitment to design? Probably not. There is even a famous email from Bill Gates where he bitterly describes his frustration with Microsoft products.

Its almost like nobody there actually gets it, but that certainly isn’t true. There are “islands” at Microsoft where usability really shows (Visual Studio is my best example off the top of my head – it is exactly the right tool for me to write solid software) but the overall consistency is lacking across Windows as well as every other application. I gotta say I’ve never believed you can have real usability without end-to-end consistency, and Microsoft’s product portfolio seems to be a perfect example of that.

I’ve been lucky enough to have been introduced to real usability concepts, and when you understand the science behind that word you can appreciate why Apple seems drenched in it but Microsoft isn’t even in the same neighborhood.

Next Page »
Powered by: WordPress