Tuesday, August 30, 2011

Building a telepresence Robot - part 3

My last post left off where I was playing around with the Parallax Propeller micro controller. There are two official ways to program the controller these are either via SPIN or via assembler and a number of unofficial unsupported ways. I played a bit with both and as I am more comfortable with C, I decided to use the Catalina C compiler package which includes the Code::Blocks editor. Unfortunately there is no easy way to use SPIN objects obtained from the Object Exchange with C so I had to rewrite the Object I downloaded to do the Wheel Control in C. The propeller chip has 8 cores, cogs as they are officially named, this is great as one can have an isolated routine run on each cog.



As you can see in the photo I have installed some of the ultrasonic pings, on the front and a single one on the back. I still have a few more but I will install them when I need them. The base kit came with an additional mounting board for a battery but as it had holes that matched the proto board I mounted the proto board on it and the board over the motors. I had to make a quick trip to Home Depot to get a couple of 2.5" stainless bolts and a few nuts.
When I ordered the proto board I got also ordered the adapter kit to allow me to connect a VGA monitor to it. This makes debugging a lot easier as you don't need to fire up a serial terminal every time to see what is going on.
Using each component is pretty simple - you compile your program on a PC and you download it to the controller board via a USB cable. The pings are also simple to use - you signal the pin that it is attached to and count the number of processor ticks it takes to get a response. This gives the distance to an object in clock cycles which can be converted to time and distance. The motors are a little more complex - therefore I just downloaded a routine to manage them. You pass a distance to the motor controller and it rotates the wheels until you cover the distance.
The next step in this project will be to use the information I am getting from the pings and have the robot guide itself through the office without hitting anything. I will cover this in the next post on this blog.

No comments:

Post a Comment