Igor, My first robot
This is igor, my first robot. His brains are a Make controller, a SAM7-based microcontroller which I gotta say was NOT the cheapest but for the most part is a joy to program. The chassis is an octobot chassis from budget robotics, with an extra deck which is not attached in the photo..
Anyway, I just put him mostly together tonight, and wrote a real quick app to test the IR rangefinders. I'm not really sure what his mission in life should be yet, but for now I'm just gonna try to make him able to roam around and avoid stuff.
I had been trying to solder up some simple (HAHA!) boards to host voltage regulators and some input voltage scaling circuits for the IR sensors, but despite having done about 3 learn-to-solder kits (2 never did work...the other just looks awful) I am still amazingly bad at soldering. for the moment I will probably just try to get breakout boards for everything, but SOMEDAY, I will figure it out. (perhaps not)
Anyway, I found this site inspiring, so I wanted to share :-)
OK, small update, due to my epic soldering fail, I ordered all new voltage regulators in 5,6,and 9 volt varieties from digi-key and 2 of those nifty regulator breakout boards from dimension engineering. My intention is to run everything off one 12v 8xAA powerpack for now, with a 5v or 6v regulator providing servo power, and a 9v regulator providing electronics power. If the regulators work as well as I hope, this should isolate the motors from the electronics without the added weight and complexity of a second battery pack. All the regulators I got are 1.5A rated, which I hope is enough, and I have nice heatsinks to mount to them. sound workable to you guys?
Another update, Still waiting for the breakout boards from dimension, but I have my digi-key linear regulators. I worked out a problem with my test setup, and now I have working navigation code! It's not perfect or particularly clever, but it works and effectively avoids obstacles. I will try to get another video up tonight.
Okie dokie, finally shot some video of igor navigating around my kitchen, and there it is for your amusement :-) For the moment I am just having him do an extremely simple "turn away from the obstacle" kind of navigation, but since I have such a powerful (well relatively..) microcontroller with it's fancy 32-bits and all Im going to continue iterating on his code and see how smart I can make him. I am trying to make some kind of neural network for him based on http://www.gamedev.net/reference/articles/article1988.asp and http://lwneuralnet.sourceforge.net/, but at the moment I think im overflowing the available memory. WIll have to trim it if possible and see what I can make it do. So far, Im having a lot of fun! I think next time though, If I make another robot I will go with something cheaper like an arduino... we shall see :-)
due to the lack of an FPU, I'm not sure the neural net can ever be made to produce useful results or to even really function at all. Even with a big memory hogging pre-generated table for sigmoid function I still need to be able to do floating point arithmetic and it ain't happening on a SAM7. Im gonna see if I can get a similar effect with some other technique in fixed-point. In other news, I ordered a new arduino and LCD and super cheapy wireless thinger from sparkfun, gonna try to get some visual feedback with the LCD and use the arduino to act as a sub-processor to handle additional sensors and serial devices in the future. The wireless thing should be a way to have igor talk to other devices or my PC maybe. Still not sure on that one but really wanted to play with it anyway heh.
My stuff from sparkfun arrived, and I mounted my new arduino deicimila on the 3rd deck, and for the moment just hooked up the LCD and have it sitting there. Still considering how I want to mount it permanently. The Arduino is programmed to listen on its real serial port for characters from the MAKE controller and echo them to software serial, which is what the LCD is hooked to. The arduino basically will let me connect to any serial or I2C devices I want to without having to tie up ports on the make controller :-) Also I scavenged an old reset switch from a PC case and made an erase switch for the make controller so I dont have to short the pins with a screwdriver every time I upload new firmware :-)
As suggested by jip in the comments, I looked into fuzzy logic, and after skimming a few tutorials came up with a quick little program that does a real cheap pseudo-form of it. I have arrays that define rules, and possible actions, given 3 IR inputs, and 2 motors and a sleep time output, it checks which apply, accumulates the values, and then averages them. The values themselves need tweaking, as igor gets closer to things than I'd like now before correcting his path, but it works, and somewhat better than the old method! When he approaches a wall, he will now very smartly turn perpendicular to it, which looks real great. And also, he used to get confused when he entered a dead-end, he would twitch back and forth until he slipped out, now instead he kind of smoothly follows the perimeter of it out. I'll have to shoot some video of it, once I tweak the values a bit, its really neat. Maybe once it's a bit cleaner I will post the C code too. Gimme a few days and I should have it locked up :-)
iGor has been cannabalized for other projects, so long iGor!!