BugBrain + IR Sensors code Introduction: This is my first robotics project. It is built on the BugBrain kit from Yost Engineering (www.yostengineering.com.) I added an Infrared "vision" system to BugBrain and reprogrammed the processor to detect objects and walk toward them. The robot was entered in the Atlanta Hobby Robot Club's (AHRC) May 2004 Robot Rally. There were a lot of interesting robots there, and BugBrain won first prize in the Open competition (www.botlanta.org). Hardware: The BugBrain kit provided almost everything, except for the brown daughter- board, the eyestalks, and header connectors to the expansion port. Those I made after a presentation of the DeltaForce robot's IR sensors by Dale Heatherington at an AHRC meeting. The only thing that I changed in the schematics was the connections to the bug brain are obviously different. Also, since BugBrain has a 6V power supply and 5V regulated, I didn't need the voltage regulator, and I modifed the 8.2 ohm current limiting resistor(s) to 4 ohms. (Dale has 2 versions of his schematic - one at 9V and one at 18V, and these resistors are all that really change.) Software: The programs in this directory are what I developed over the past 2 months or so to experiment with BugBrain. Some of the code contains examples from Yost Engineering, others I wrote myself. The WalkToObject project is the final project I used before the AHRC Robot Rally. It includes walking based on state tables, vision code, and a task to blink the LEDs all setup as sub tasks. - Main - The main control program Commands the other tasks. The basic logic is to wait until an object is sensed. If an object is in front, walk forward. If it is to the left or right, turn the robot. If an antenna detects an object, make some noise, back up, and turn around. After a lot of programming, the robot works very similar to the Yost Engineering provided sample code! - See - Vision control (and reads antennae inputs) This drives the IR daughterboard and reads the output of the Op Amp. There is a lot of debugging in this task that is commented out. - LEDs - Blinks the LEDs according to state set by other tasks The two outer LEDs indicate if the robot sees an object to the left, right, or in front of the robot. The two center LEDs indicate the percieved distance of the object. One pin on my BX-24 is in latch up - that one controls LED5. It was stuck always on, so I cut the trace on the PCB. That's why I'm not using LEDs 2 and 5 in my program! - Walk - Moves the servos that control the legs Instead of using separate procedures to move the legs inline, I decided to create state tables. This makes it a lot easier to change, I think, and the robot is smart about switching from one gait to another - the leg moves to the closest position that is next in the new gait. The walking gaits are stored as external tables. I wish BasicX allowed you to put comments in this file. The Half Gait is untested. Licensing: The file 'Constants.bas' came from a web site. I have no idea what the licensing is on it. The routines moveservos, centerservos, and "CrowAboutIt are from the Yost Engineering examples. They have given permission to reuse the example code. If you want to use code that I have written or images, you are free to use it under the terms of the Creative Commons Attribution Non-commerical License. See LICENSE.txt for more info. Feel free to contact me if you have other uses in mind that the license does not cover. ir.gif is the original schematic for the vision sensor from Dale Heatherington's DeltaForce mini sumo robot (online at www.wa4dsy.net). The IR Pulse I attached to pins 9 and 10 on BugBrain. The output of the OpAmp circuit I attached to pin 18 (also used for one of the PCB Buttons.) Dale's mini sumo code is licensed under the GNU General Public License. That may go for the schematic as well, but I'm not sure since the license covers software explicitly. Here is the license for the DeltaForce code anyway. ----------------------------------------------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA ----------------------------------------------------------------- Contact: Eric Z. Ayers zunguard-bbrm092204@yahoo.com Wed May 19 05:57:19 EDT 2004