This documentation will focus on the second AAIMI robot, AAIMIv2.
Just a quick mention first, I'm trying a new scrolling layout for long technical articles like these. The left-hand index column is semi-static, while the right-hand column is independently scrollable. If you have any thoughts on the layout, leave a message at the bottom of the page.
AAIMIv2 is made up of the materials listed below.
- A Raspberry Pi model B with good quality 4GB sd card.
- An Arduino Uno or similar
- A Gertboard expansion board (optional)
- Two 24V stepping motors and driver boards
- A 5V UBEC or similair voltage step-down converter to power the Raspberry Pi
- A 10K resistor
- About 30 breadboard cables, female, male and female-to-male
- Two distance sensors
- 2 Trip-L-grip brackets
- 2 wheels (around 100mm)
- 1 castor wheel
- One battery at least 7V for computers and microcontrollers, one battery of at least 12V for the drive motors.
- Micro USB lead for powering the Pi
- USB Wifi dongle
- A 6mm MDF timber board for the base
- A 5v stepper motor and motor controller
- A stainless steel shaft from a printer, with the matching bearings
- One gear to fit the shaft and one to fit the motor.
Now for a more detailed description.
The raspberry Pi is a tiny computer that runs an ARM version of Linux. It has a variety of input and output pins that can control sensors and motors.
This will set you back about $40 in Australia, they may cost more or less in other countries. They are quite powerful for that price, and in my experience they are extremely reliable and they run well from batteries. The biggest strength of the Pi is that they are all the same, meaning code that works on one Pi will work just the same on another. You avoid having to worry about driver issues or quirky hardware components. There are also many Raspberry Pi enthusiasts on the web, so there is heaps of information available to help with your projects.
The Pi uses a SD card for its operating system(OS) and internal storage. While most cards will work, cheaper models may be slower.
While an Arduino board has capabilities the Pi lacks such as analogue to digital converters and multiple PWM pins, there is another reason I wanted to include one in this robot. I want to separate the drive functions from the rest of the control and brain functions.
Python can't do two things at once, meaning while the robot is driving it cannot do anything else until it stops. To overcome this issue I have programmed the drive wheel functions on the Arduino. The Python brain simply has to call these functions on the Arduino and it is free to do other tasks while the robot travels.
The Gertboard is a breakout board that attaches to the Pi and provides otions such as a DC motor cotroller, Analogue to Digital converters and Digital to Analogue converters. It also has 6 open collectors that can control devices with much higher voltage than the Pi.
This version of AAIMI with its current configuration can run without the Gertboard. I included it in my design because I plan to add more features to the design and it will reach the limit of the pins available on the Pi and Arduino.
Another advantage of the Gertboard is that it lays out all the GPIO pins in order, saving the hassle of connecting devices to the Raspberry Pi's confusing muddle of pins.
Stepping motors can rotate the robot tiny fractions of a degree at a time. AAIMI can currently align itself perfecftly square to the a wall by rocking back and forth until the measurements line up. She can then rotate 360 degrees, taking 4 measurements at precise angles and calculating the length, width and area of the room. You could not do this easily with traditional DC motors.
The motors were salvage from a HP color laser printer. They are designed to run at 24V but I am currently running them from a 12V battery. I plan to add a step-up boost circuit soon to bring the voltage up to 24V.
The Raspberry Pi runs off a 5V USB phone charger with at least 500mA of current. The UBEC takes the higher voltage from your battery and converts it to 5V at 3Amps, a good supply for the Pi, even while it is powering the Arduino through its USB connection.
A cheaper option could be a 7805ct serial voltage regulator. These output a steady 5 volts but they are only rated at 1.5A, and I would not recommend putting even that much current through them. This should power the Pi, but you would need to power the Arduino separately with 12V into its dedicated power plug. As I already had the more powerful UBEC, I used that instead.
You need a 10K resistor between the Echo pin on the distance sensor and the input pin on the Pi.
These cables connect the GPIO pins from your Pi and Arduino to the motors and sensors. They also connect the power system together.
You'll need a mixture of female, male and female to male cables.
This is vital to tell AAIMI about its environment. It cost $1.60 but it does have limitations. The field of measurement is too wide for really fine work, and the range maxes out at about four metres, but it is fine for initial development. In clear spaces it seems to be accurate within 2mm. I am looking for a better quality unit now.
These brackets are used in the construction industry and they cost me 45 cents each at the hardwore store. The existing holes were closely enough matched to the holes on the motor so I just had to widen one hole with a drill.
I bought some cheap but rugged plastic wheels from the hardware store for about $3 each. They have rubber tyres, albeit a bit shiny, and the have a small contact-area with the floor to aid accurate turning.
It can often be a challenge to mount wheels onto salvaged motors but in this case I got lucky.
The cogs on my reclaimed stepper motors had an outside diameter of just over 8mm. The holes in the wheels were 9.6mm. With two wraps of duct-tape around the cogs, the wheels pressed firmly on and they are still tightly mounted after some thorough test driving.
I recommend 100mm wheels, as narrow as possible with round-profile tyes. Depending on which wheels you buy you still may need to modify them to attach the the motors.
For a few dollars I found a suitably-sized caster with a rubberized wheel and a 30KG weight rating. It has a little too much sidewards throw for my liking but doesn't seem to disprupt the robot's turning accuracy too much.
I have included two batteries in this robot, one to power the drive motors and one for the Pi, Arduino and sensors. You may get the same results from one larger battery but I chose to split the systems to protect my digital circuilts from any potential spikes caused by the large drive motors starting and stopping
The Raspberry Pi runs on 5v with a minimum 500ma but you will need a larger battery than that. This is because the UBEC will need at least 6V to produce a steady 5V. The Arduino can run from 7V to over 12V. I am using a 12V, 1300mAH drill battery with a true voltage of about 11.5V. It is probably not intended for this purpose but I already had a couple of them and they seem to work well.
I split the power from this battery into two lines, one into the UBEC to power the Pi, the other directly to the power plug on the Arduino.
I am getting over two hours computer runtime from this battery.
The drive battery will be a higher voltage evtually to suit the 24V motors. For now I am using what I have, which is another 12V drill battery the same as the first one.
The big motors run okay from the 12 volts, but they lack a bit of torque compared to running off the printer power supply. I am looking for a light-weight replacement of at least 18V, but the smaller power source is good enough for initial testing.
Overall, I am happy with two hours runtime for now, but I would like to see how a 4AH battery would go.
These leads are used to charge Android phones among other things, so you probably have a couple laying around. You can cut the USB end off and solder the power wires directly to the UBEC.
You really need to buy the right Wifi adaptor for the Pi. The ones I have tried off Ebay do not work out of the box, regardless of what they claim. It is not easy installing the driver manually.
Here you will find a list of wifi dongles that do work with the Pi. You will save a lot of hassles.
The base for AAIMIv2 is made from 8mm MDF board. The one I am using (pictured above) is actually salvaged from one of my first robots as you can see by the multitude of different holes and cutouts.
AAIMIv2 has a sensor mast that rotates 360 degrees so it can measure in any direction regardless of the robot's orientation.
This build was a little fiddly but it works incredibly well. You could build the robot without this feature but it does add a lot of functionality.
The base of the mast is cut from the internal frame of a PC CD drive.
This is topped with a steel plate with a large square opening covered with 3mm MDF board
Inside the base is a 5V stepper motor available on ebay for a few bucks
The shaft, bearing and gears are from an inkjet printer.
The top of the mast has a plastic bracket with an MDF backing plate to which the sensor attaches.
I have a full description of the build for this mast, along with the Python code to drive it, over on Anth's Computer Cave.
I am working on the diagrams for the wiring now, check back in a few days.