The Constructed 'M'
Phase 1 (Updated 29/4 - New video & code.)
Here's a little robot built on CTC's excellent Tiny Tank chassis. It's based on a Picaxe 28X2 which handles the navigation side of things and will be joined by a 14M2 to do other things in due course. Pololu motors driven by a L293D are the motion side of things, and a servo and SRF05 do the sensing.
The name is inspired by a Philip K Dick short story - The Unreconstructed 'M'. Unreconstructed in this sense meaning without morals and ineducable, and M standing for 'machine'. This M had antisocial habits including planting evidence and assassination. My one hopefully will have less of a bad attitude and I'm constructing it so . . . The Constructed 'M'.
At the moment I've just got it doing the usual thing of avoiding stuff. It explores an area with CURIOSITY (green LED) and has FEAR of hitting objects (red LED). Its path through an area is an alternation of these states. Eventually it will be actively seeking out certain objects and doing the YDM thing on them (with added accompaniment).
The tiny PCB above the M is a compass board which works but is not active in the initial video. Also, note the change in sweep rate of the U/S sensor as it gets near objects. I rewired the 28X2 project board to give full PWM control of the motors. This is not a task to attempt unless you really mean it as it requires several track cuts and joins.
I've reformatted the code to run as a finite state machine and tweaked the distance thresholds to make it get up close and personal and it is good. It is very good. Wikipedia article on FSMs here : http://en.wikipedia.org/wiki/Finite-state_machine.
The robot will always be in one of 6 states; by 'state' I mean performing a certain operation (e.g. avoiding an object slightly to the left by slowing the right track). There is a specific rule or rules to enter each state (e.g. if 30 left sensor range is less than lower range threshold) and once in a state it will continue to perform that operation until either the condition to leave the state is met (e.g. 30 left sensor value is greater than lower range threshold) or the conditions are met to enter a state with a higher priority (e.g. mid sensor range is less than lower range threshold. Crash imminent). State 0 is 'flat out straight ahead' and is the default state.
It still just wanders around with no purpose in life. That will be the next step.