Galen's Robot Projects - OB2


 HOME
 Robot Projects

OB2 Index: 
 What's New?
 Overview
 Hardware
 Sensing color
 Software
 Project updates
 
 
Contact me...




Click to subscribe to Front Range Robotics!




Is that robotic blood on the gripper or a reflected light? :-)

 

OB2 Quick Stats:
CPU: OOPic II
Sensors: Sharp GP2D12 IR range, 2 - QRB1124 reflective, multispectral (color)
Drive Type:  Differential: 2 - GWS S03N 2BB modified for continuous rotation
Gripper: 1 - HiTec HS25BB
Power: 4 - AA Nmh, 1 - 9v Nmh
Weight: 21 ounces (599 grams)

 

Welcome to my OB2 project page! The amount of information I wanted to post about OB2 outgrew my original intent to have brief project summaries available on my robotic projects page. Therefore it was time to do something new... an under-the-hood look at one of my projects! As OB2 is still under development, there will be updates posted here from time to time. The content will change depending on whatever time I can spare and also upon any feedback I receive from someone reading this. Please check back here often to see what has changed!

What's New?
February 23, 2006 - page moved to silverstar server.
March 8, 2005 - schematic, page updates.
February 1, 2005 - page updates.
December 28, 2004 - page updates.

December 4, 2004 - high level and state diagrams added, text revisions, broken link to PID control fixed.
November 22, 2004 - this page created.


OB2 poses for a picture!
Click to enlarge!

Coming soon...
"OB2 The Movie"


OB2 schematic (.BMP format)

If large image is unreadable, click the "magnify" icon in your browser.

Object Bot 2 overview:
To rehash a bit from my main robotics page... OB2 is my second attempt at an object-grabbing robot. It is built for a contest designed by Front Range Robotics ( yahoo group, web site ) club member Ed Rupp.The object of the contest is find and remove targets from a MiniSumo arena (dojo), while leaving certain other targets behind. Each target has a specific size, color, weight, and "taste" (resistance value) - any of which can be sensed by the robot (click here for contest rules ).

OB2 hardware:
OB2 uses an
OOPic microcontroller, a servo gripper , and a  Sharp GP2D12 rangefinder salvaged from OB1. I considered using a Sharp GP2Y0D340K rangefinder for close range navigation, but found its sensitivity varied too widely with the different colored targets. The OOPic was upgraded to an OOPic II before installation into OB2.

The robot is built on a modified Mark III MiniSumo chassis kit . A few of my fellow FRR members noted that I run the Mark III "backwards" - this was an easy way to add the gripper without scratch building a new chassis - and the robot does not care about "direction" anyway!

Locomotion is provided by two standard model airplane servos (GWS S03N 2BB) modified for continuous rotation. A pair of QRB1134 reflective sensors are mounted  just below the gripper. These look look for the white painted edge of the arena. 

As I write this, there are four successful bots built by FRR members. These robots use either height or "taste" (electrical resistance) for determining which target it has. For me, it is often the challenge of doing something differently that interests me - thus OB2 uses the targets color!


Photo of the color sensor PCB.


Example color signatures in a graph.

Sensing color:
It was decided early in the project that OB2 would determine which target it has by visual color, so a simple sensor was built to do this. A bright surface-mount RGB LED is used to illuminate the target, and a visible-light phototransistor is used to measure the amount of reflected light. By switching the RGB LED colors (red, green, blue) on individually, OB2 can read a specific "reflectance signature" for each colored target (the chart below left shows an example profile of the target signatures).

Rather than saving the reflectance signatures for all the target colors in a lookup table, OB2 only needs to know which targets we wish to keep. This saves a bit on memory and processing. Originally, I tried a simple comparison of the values seen by the sensor with those in a lookup table was used. However, there is a bit of noise in the sensor from external lighting, so a simple lookup table was not good enough. A simple fuzzy comparison function was written. This worked well for targets that have a very different reflectance signature (for example blue vs yellow), but OB2 still had trouble telling the difference between black and blue targets. For this I use a software trick known as "normalizing" - essentially I sum all the color values then divide the sum by a specific color value - this returns a percentage value for the specified color rather than just its relative brightness.

In the present software, OB2 first uses table lookup to discriminate "easy" target colors (for example white vs black), but if a target passes that test, OB2 then normalizes as a check for more difficult colors.


OB2 high level diagram
Click to enlarge!


OB2 state machine diagram
Click to enlarge!

OB2 schematic

OB2 software:
Since OB2 is OOPic based, the robots software is written in a language similar to Visual Basic. OB2's operating software is essentially made up of a bunch of small state machines; implementing what some readers may recognize as a "subsumption architecture". The basic concept being that a larger behavior is made up of a series of small independent behaviors.

OB2 has three "primary" state machines arranged in a loop. One state machine handles finding targets, one checks the status of the floor sensors, and one checks the status of the gripper. Each of the primary machines is made up of a number of smaller state machines which may or may not be "fired" (take action) on a particular pass through the loop. OB2 also has a couple generic actions (such as motor control) that may be triggered within any of the primary machines.

It really is much simpler than it sounds! The main ideas here are that certain percepts trigger certain actions - and an action often can be broken up into a series of simpler actions. Any found redundant are "generic" and often can be made into a generalized independent action. This saves memory and makes debugging much simpler in the long run.

Explanation of the state diagram:
Looking at the diagram, OB2 starts at the orange bubble in the upper left corner (either power is turned on or OB2 is reset). Note there are two primary state loops indicated by bold arrows (the loops with green bubbles and a pink bubble). A global boolean variable "A1" is used to determine which state loop OB2 runs. The loop with green bubbles finds and approaches targets, the loop indicated by the pink bubble is what OB2 does once it has a target that needs removed from the arena. Yellow bubbles are states that can change "A1" determining which loop is run. The orange bubble at lower left is OB2's ending state where OB2 shows off a victory dance. The blue bubbles at the bottom of the diagram are "generic" behaviors which may be called from any of the other state machines.

Future enhancements?

OB2 occassionally has trouble going straight, especially when the motor batteries are getting weak. Several FRR members have been playing with PID motor control - a simple version of this should be useful in OB2.

Beacon or compass for navigation - OB2 could map out the locations of targets on the board and spend less time actually looking for them.


Project updates...
February 1, 2005 - Added a serial data link to the OOPic II board to make debug simpler for this and future projects. Added a command-line user interface to OB2's software, changes made in the diagnostics to use the new interface.

October 20, 2004 - Replaced filter cap on power leads to GP2D12 with a 220uf. Seems to have vanquished the surge noise from the GP2D12 that caused OB2 to intermittantly take off with no visible target. It also speeds up searching for new targets as far fewer "false positives" are seen that need re-checking.

July 28, 2004 - Most of OB2's operating software completed and demonstrated at our club hack meeting. The target search algorithm still needs some tuning, color detection code remains to be written. I also added more "start-up" diagnostics to make troubleshooting sensors easier without needing to connect OB2 to my laptop.

July 12, 2004 - All of OB2's hardware is functional! I gave OB2 a jazzy flame paint job (my first attempt at "hot-rod flames", turned out rather well I think!). I also added the ability to use a second GP2D12 (or some other sensor). Added a piezo speaker for "robotic noises" :-) The hard work of writing and tuning the software begins!

June 30, 2004 - OB2 assembly begun.

February, 2003 - My robotics page goes online!

November - December, 2003 - General concepts for OB2 drawn. Color sensor concept built on breadboard and tested. Initial part purchases.

Copyright ©2006 Raben Software & Graphics