tinybot: unauthorized biography
The sole purpose of this page is to document the progress on tinybot mk III, one of my countless
attempts to build a robot that would sufficiently confuse my cats.
The page may be of interest to other people for three reasons:
- The mechanical engineering aspects of this project are ridiculously low-level: even every single gear is custom designed, machined, and manually
cast in my home workshop.
- The electronics are cheap, easy, power-efficient, and extensible. The total cost of the robot is $30 if you count just the essential parts,
and $90 including a pretty LCD and two fancy distance sensors. Most of the comparably featured projects on the web are several times more
expensive.
- I am trying to make it look pretty, so it's purple.
In other words, enjoy your stay.
1. Electronic components
The complete inventory is:
- Motors: 2 * Mabuchi RF-300FA-12350 ($1.20 each),
- Traction sensor: Optek OPB609 ($0.75),
- Steering sensor: Toshiba TLP841 ($0.50),
- Distance sensors: 2 * LV MaxSonar EZ4 ($27.00 each),
- Motor drivers: 2 * Fairchild FAN8082 ($0.37 each),
- Microcontroller: AVR ATmega1284P ($7.50),
- Display: Newhaven NHD-0208AZ-FL-YBW ($9.50),
- Power supply: Zippy Flightmax 800 mAh 7.4V Li-poly ($6.20),
- Supply watchdog: Maxim MAX8212 ($3.00) + STM STP12PF06 ($0.80),
- Supply adjustment: Murata OKR-T3-W12-C ($6.20).
- ...plus several resistors, capacitors, switches, etc ($3.00).
The resulting robot is a GCC-supported, libc-enabled compilation
target running at up to 20 MHz, with 128 kB of program memory and 16 + 4 kB RAM. It is equipped with stereoscopic distance vision,
traction control, has good dead reckoning capabilities, and features very low power consumption, thanks to motors running near their maximum efficiency
(approx. 35 mA per motor).
2. Other components
Molds for all plastic parts were initially machined on Roland Modela MDX-540
in Huntsman RenShape 460 medium density modeling board.
Negative molds and tires were then cast in ShinEtsu KE-1310ST platinum
cure silicone, and all the remaining final parts - including around 15 spur gears - were made out of
Innovative Polymers IE-3075 polyurethane resin,
manually pigmented with quinacridone pink, titanium white, solvent blue 67, and solvent yellow 146.
The project also called for four VXB ball bearings, 16 steel dowel pins (M1, M2, M3), 30 machine
screws (M1.5, M2), and one
square steel rod.
The whole machininng and casting
process is explained in painstaking detail in my guerrilla CNC manufacturing guide, and also illustrated on
this Flickr page (an earlier project of mine).
2. Mechanical design
External dimensions of the robot are 15 x 12 cm; ground clearance is 2.7 cm. With a battery installed, it tips the scales at 275 grams.
Rear wheels of the robot are joined together with a steel rod, mounted in two low-profile
ball bearings (8 x 12 x 3.5 mm), and connected to a 130:1 gearbox that delivers about 40 RPM and 3,000 g/cm of torque, allowing the robot to effortlessly
mount most obstacles. Closeup of the rear assembly:
Front wheels have integral ball bearings and rotate freely; a reflective optointerrupter, TLP841, is used to provide traction feedback
for the motor, detecting a small white target on the inside of the wheel.
A second motor and a 490:1 gearbox can be found
in the front; instead of the usual (and crappy) differential drive system, an
oversized gear-based transmission is used to synchronize the turning of front wheels, each of them individually mounted on 3 mm dowel pins.
Turn range is +/- 30°. A small slot optointerrupter, OPB609, is used to sense 0°, +/- 15°, and +/- 30°
positions marked on the gears:
Gear tooth size is about 0.5 mm, pressure angle is about 18° for initial stages, and 25° for the final stage in the steering assembly.
Gearwheel thickness is 1 and 1.75 mm, respectively (see the aforementioned CNC machining guide for a good primer on gear geometry).
Rendered image of the entire body, with the main PCB and the battery installed:
Positive molds machined in RenShape 460 based on CAD models:
Early stages of assembly:
Several hours of work later - all sensors installed, electronics on a breadboard, distance sensor readings displayed:
Completed, turned on, and crying "put me down":
Other images of interest: initial prototype two months ago;
and the immediate predecessor to this version (note a different orientation
of the motors). If you count these iterations, the project took about 25 hours of work to get to the current stage.
3. Circuitry
The robot uses a lightweight, two-cell 800 mAh lithium-polymer battery; this choice yields a continuous running time of 8 hours with LCD backlight
turned off, or 4-6 hours when the backlight is on (depending on the desired brightness).
The battery has a nominal voltage of 7.4V (the actual range is 5.6 - 8.5V); this needs to be translated to stable 5V for the motors, sensors, and the
microcontroller. To do this, I used Murata OKR-T-3-W12-C,
a high efficiency 3A switched regulator. The voltage is set with a 270 Ω resistor; the value
needs to be set accurately, so a 500 Ω trim pot may be more practical than shopping for a 1% resistor of this exact value.
An extra 10 µF
capacitor across terminals is employed to counter motor inrush currents and the crowbarring tendencies of the H-bridge drivers used, so that the risk of
resetting the MCU is minimized.
To avoid damaging Li-poly batteries, care must be taken not to discharge them below about 2.8V per cell (5.6V total). To prevent this, I rely on a
MAX8212
voltage monitor, coupled with a medium power p-channel MOSFET transistor (STP12PF06
in this case, but any other rated for at least 3A will do). This serves as an input stage for the regulator; the threshold voltage is adjusted with a
250k resistor. This value also needs to be matched accurately, so a 220k resistor and a 50k trim pot may be a simpler choice.
The complete voltage control circuit looks as follows:
The remainder of the circuit consists of ATmega1284P
interfaced to several peripherals:
- An HD44780-compatible LCD
(NHD-0208AZ-FL-YBW) in 8-bit write-only mode (R/W pin pulled low)
for displaying status messages and offensive ASCII art. Backlight brightness can be adjusted by adding an extra 500 Ω trim pot on the
LED+ pin.
- Two narrow beam ultrasound distance sensors (MaxSonar-EZ4) used in
one-shot mode with pulse width output. The range for these devices is about 15 cm to 6.5 m.
- Two FAN8082 H-bridge controllers for the motors, with
speed control using a trim pot. FAN8082 is being phased out, but Toshiba
TA7291P or
ROHM BA6956AN are good
substitutes.
- Basic support circuitry for the optointerrupters to limit LED current, and convert phototransistor output to CMOS levels
(on the schematic, "MV" stands for traction sensing, "ST" for steering).
- A single diagnostic LED.
- An obvious and accessible self-destruct button.
The whole thing looks the following way:
Not shown on the schematic, the AVR ISP connector is also attached to pins 6-11
of the MCU to allow for easy programming.
4. Software
I have just started working on the software part; motor, sensor, and LCD drivers are complete, so is the main event loop. Environmental mapping and
a "personality" still in the works.
Click here for a video showing a test program; sensor feedback is used in this demo to
execute movements very precisely.
5. Questions? Comments?
You can reach me at lcamtuf@coredump.cx.
Your lucky number: 9563617