Swarm AI beginnings (XMOS Competition)
Last Update: 13/10/09 XK1 first look pictures.
My XK1 arrived this morning via Japan post. Being so close to Hong Kong I might be the first :P But they were sent out on the 9th so those people waiting on one should go check your post box!
First picture! The box includes the XK1, JTAG adapter and invoice. Manual and other documents should be available on www.xmos.com. A male to female USB cable is required. It should cost no more than a couple of bucks or you may have 1 already.
I should mention that the USB connector on the JTAG adapter is a standard A type so you could plug the JTAG and XK1 directly into a front USB port if you just want to try out some quick code for the onboard LEDs or something. I would recommend a USB cable if you have other things connected to the IO pins though.
I`m going to start with the tutorials and some basic microcontroller code like LEDs and servos plus get my head around the threading before jumping in and attempting the swarm stuff.
The first design version of the swarm bot. The body design is inspired by mintvelts machine here. All the levels are cut from 100mm square 2mm plates of something. Haven`t decided on aluminium or plastic yet. Maybe some kind of PP or acrylic would work fine.
Current design includes:
- 2x baby GM7 solarbotics motors
- 2x slim 36mm wheels
- 2x RPR200 reflective IR sensors as wheel encoders
- 1x 4 AAA battery box
- 8x IR LED and 38khz receiver pairs.
- 1x front panel with on/off switch, 9 point rotary switch, momentary button and 7 segment LED display
The bottom PCB will have motor driver and battery charging circuits. The 2nd PCB will contain interface circuits to the front panel and IR detector ring. The 3rd and last PCB is not shown. I`ll cut all PCBs by hand from prototyping board.
That ring on the top is actually a 46mm OD bearing that will be motorised. The very top layer which has the rest of the sensors and gripper will be able to rotate about 175 degrees either way. Communication cables between levels will be passed through the center of the bearing.
The bottom layer will come first. Once I get the motor, charging and IR circuits done I can plan the top head afterwards.
This is the beginning of my Swarm AI (SAI) project for the XMOS challenge. I`ll post all my designs, specifications, sketches, research links, products used etc and just any thoughts or ideas I have to help clarify the actual goals of the project. It will probably be updated regularly which is why it`s a blog and not a robot page. I didn`t want it going to the front page every time I change something.
Suggestions or comments on any of this rambling is welcome! Often I forget something fundamental when I plan a robot which I kick myself later for, but an observer would probably pick up on really quickly.
Project Goal: To create a low cost robot swarm overseen by a mother MCU able to give directives to each swarm bot. The swarm can be programmed to explore cooperative insect hive AI or emergent behaviour.
Description: SAI consists of 2 distinct entities that live in a symbiotic relationship. A Mother bot, and the swarm which itself will contain several individuals.
The original idea is that the central Mother uses solar cells to charge its internal high capacity battery but itself has no actuators or locomotion and hence is unable to find sunlight to charge or defend against "predators". Each swarm bot is an autonomous unit with sensors and full mobility and is able to communicate wirelessly up and down with the Mother. Unfortunately for these little guys, the only way to recharge their low capacity battery is by docking with the Mother.
In this way the whole group needs to work together for self preservation. The Mother will coordinate the swarm to seek out sunlight, and when found the swarm will latch on to the Mother and push/pull it to where the sunlight was found.
Constraints: Relatively low cost. Majority home made with hand tools.
Entity specifications: Here is a general outline of the specs of both the Mother and Swarmbots. This is not a BoM, and is likely to change often as I try to anticipate future needs.
Mother 1 per swarm.
- Powerful MCU kindly donated by xmos.
- Square base, no more than 30x30cm.
- Lead acid motorcycle battery.
- Top is a solar collector. (Possibly unfolding. If you ever played Total Annihilation you may know what I mean.)
- Points around the base for the swarm to dock to. 2 per side. Unregulated power and ground contacts.
- IR beacon for the swarms to home in on.
- Base mounted on omnidirectional castors.
- ADC to monitor battery and solar cell voltage.
- PIR for intruder detection.
- LED status indicators.
Swarm bot 4 per swarm to begin with.
- Atmega168 MCU.
- No more than 10x10cm footprint.
- 2x GM7 baby motors + encoders.
- 2x slim wheels from tamiya pulley set.
- Front and rear skids.
- 4x AAA NiMH cells.
- 3.3v LDO regulator.
- Xbee 1mW.
- Rear and both sides dock. Allows swarms to dock to each other as well as the Mother.
- Sharp IR obstacle detection.
- 360 degree IR emitters and receivers. Can send ID codes for individual bot locating.
- Front facing shielded IR receiver for locating each other and the Mother.
- LED 7 segment display status indicator.
- 350 degree rotating top level with gripper
Programming: Here are a few ideas of what I want to do with the system. I made the above general specs based on these few program concepts.
As per the original idea. If the Mother finds the solar cell voltage AND the battery voltage low she commands the swarm to find sunlight. The swarm spreads out in random directions exploring the area while attempting to keep away from others in the swarm. If 1 of the bots detects a suitable light level through its LDR it attempts to determine if the area is large enough to support the mother by scanning with its distance sensor. If the area is found to be large enough, it tells the Mother and activates its IR beacon. The Mother then coordinates the others in the swarm to move her to the bot that found the sunlight.
Swarm bots are required to "clean" a patch of sunlight in preperation for the Mother. Finding and removing obstacles using a small gripper and cooperating to move large objects.
If any of the bots or the Mother detects movement such as an approaching human or animal, the Mother commands the swarm to protect her. 1 bot could be designated as an expendable decoy like the way a lizard can drop its tail while the others dock with the Mother. The decoy goes nuts with movement and lights, hopefully distracting the intruder, while the remaining bots move the Mother away from where the intruder was seen.
This could be expanded to include robots from another swarm, or a different parasitic robot programmed to attempt to charge from the Mother. Once the swarm is docked with the Mother, the decoy starts transmitting the same ID code as the Mother to confuse the parasite as the Mother is taken to safety.
Swarm bots transmit wheel encoder data back to the Mother who compiles a map of the area. Could be very interesting combining it with other parts of the software.
Forseen problems: A few of the problems I think I may run into. This will probably get exponentially bigger the more I look at it.
- I`m not sure how much interference there could be from all the bots broadcasting their IR ID codes. Maybe I should limit the LED power to only give clear signals within an arbitrarily chosen 2 meters, or only broadcast when the Mother tells them to.
That`s all for now. I`m doing some parts research and sketching designs at the moment. While waiting for the xmos kit to be sent out I`m going to make a swarm bot prototype. I`m hoping to come up with a simple and easily reproducable chassis for the swarm bots from a single sheet of aluminium cut and folded.