Learn about the OSMO//hacker module
iRobot has produced a dizzying variety of Roomba vacuuming robots since the original Roomba model was introduced in 2002. They now have even the Scooba, a robot that washes floors.
Compared to other robotic vacuum cleaners, the typical Roomba robotic vacuum cleaner is very inexpensive at under $300 for even the most expensive Roombas and $150 for the least expensive. The cheapest new Roombas can be found for around $100 on the Internet. For a vacuum cleaner that's a pretty good price. For a robot that's also a vacuum cleaner, that's an amazing price. And for a robotic vacuum cleaner that's hackable by design?
Quick Start
If you're already familiar with Roomba, know it's compatible with the Roomba Open Interface (ROI), and you'd like to start hacking immediately, skip to Chapter 3 to begin building some hacks. If you're uncertain which Roomba you have, if it is hackable through the ROI, and want to learn the details on the ROI protocol that enables all these hacks, keep reading.
Note
All projects in this book will utilize the Roomba Open Interface (ROI). It was previously known as the Roomba Serial Command Interface (SCI) and you'll find many references to the SCI on the Internet. It's exactly the same as the ROI; only the name has changed.
What Is Roomba?
Roomba is an autonomous robotic vacuum cleaner created by iRobot Corporation. To operate, Roomba requires no computer and no technical knowledge from its owner. It only needs a power outlet and occasional cleaning, like any vacuum cleaner.
Originally released as just Roomba in 2002, the Roomba design and functionality have evolved over the years. Currently there are five varieties of Roomba available with names like Roomba Discovery and Roomba Red. According to iRobot, with over 2 million units sold, not only is Roomba one of the most successful domestic robots to date, it is also one of the very few robots to have sold over a million units. This accomplishment is the result of a long evolutionary process of robotics design at the iRobot Corporation.
iRobot Corporation
The creators of Roomba have been making robots for over 15 years. iRobot was founded by Rodney Brooks, Colin Angle, and Helen Greiner. These three MIT alumni have been instrumental in guiding robotics research for many years, not only through their research but also through the practical application of their ideas through iRobot.
Subsumption Architecture
Rodney Brooks coined the term subsumption architecture in 1986 in his classic paper "Elephants Don't Play Chess." This paper began a shift in artificial intelligence research. At the time it was believed that to create a thinking machine, one needed to start with a symbolic representation of its world from some set of base principles. (For example, a robot butler having a built-in map of a house would be a kind of basic symbol.) This top-down view of cognition is opposite to how nature works: When we enter a new house, we must explore and build up our own unique perception of how to get from place to place. Brooks codified a bottom-up, behavior-based approach to robotics.
In subsumption architecture, increasingly complex behaviors arise from the combination of simple behaviors. The most basic simple behaviors are on the level of reflexes: "avoid an object," "go toward food if hungry," and "move randomly." A slightly less simple behavior that sits on top of the simplest may be "go across the room." The more complex behaviors subsume the less complex ones to accomplish their goal.
Genghis and PackBot
In 1990 while at MIT, Rodney Brooks and iRobot created the Genghis Robot, an insect-like robot with six legs and compound eyes. It was a research platform that bucked the trend in artificial intelligence at the time by using Brook's subsumption architecture. Genghis was designed from an evolutionary perspective instead of the normal high-level cognition perspective of traditional AI. It looked and acted like an insect. This behavior-based robotics architecture would inform the design of all future iRobot robots.
From Genghis, iRobot developed a few other research robots but quickly moved into developing robots for real-world use. iRobot has had great success with their PackBot, a series of ruggedized telepresence (able to withstand harsh outdoor environments and remotely controlled) and autonomous robots for the military and law enforcement. Instead of sending soldiers or a SWAT team into a dangerous area, the PackBot can be pulled from a backpack and thrown into the area. With its onboard video and audio sensors, the area can be inspected without risking a life. The PackBot can withstand 400+ gs of force. This makes it much tougher than a human. One g is the force you feel every day from gravity. Three gs are what most roller coasters make you feel, and at five gs you black out. Although the Roomba isn't nearly so rugged, it definitely seems to have inherited some of its cousin's toughness.
Enter Roomba
The Roomba robotic vacuum cleaner is a physical embodiment of Brooks' subsumption architecture. Roomba has no room map or route plan. It has no overall view of what it is doing. Instead it functions much more like an insect: going toward things it likes (dirt, power) and away from things it dislikes (walls, stairs), moving in predefined movement routines while occasionally and randomly jumping out of a predefined routine.
This random walk feature of the Roomba algorithm is perhaps what confuses people the most at first. It will seem to be going along doing the right thing when it suddenly takes off in a different direction to do something else. But for every time it moves from the right place to the wrong place, it has moved from the wrong place to the right place. On average (and if left for a long enough time), Roomba covers the entire area. In terms of time efficiency, Roomba is not the most effective, as it takes several times longer for it to fully cover a region than it would for a person with a normal vacuum cleaner. But whose time is more valuable? Roomba can work while the person does something else.
Which Roomba Cleaners Are Hackable?
There is some confusion as to which Roomba cleaners are easily hackable through the ROI. This is complicated by the fact that iRobot doesn't make obvious the model numbers and firmware versions of the different Roomba cleaners.
All new Roomba cleaners currently have the ROI protocol built-in and ready to use. These are third-generation Roomba cleaners. The two most common Roomba cleaners, Roomba Discovery and Roomba Red, will be used in the examples in this book.
Following is a fairly comprehensive list of Roomba cleaners available in North America. International versions are functionally identical and named the same, with only small modifications to function on different mains voltages.
First Generation
The first generation of Roomba cleaners was astounding in the amount of capability they packed into a small, inexpensive package. This generation did not have any ROI capability. There was only one type of Roomba in the first generation:
* Roomba: The original Roomba model, shown in Figure 1-1, was released in 2002 and improved in 2003. It could clean small, medium, or large rooms when instructed through its S, M, and L buttons. It shipped with at least one virtual wall (a special battery-powered infrared emitter used to create virtual boundaries) and a plug-in battery charger.
Second Generation
The second Roomba generation added what many considered a necessity: a dirt sensor. This generation also featured improvements in battery life and cleaning efficiency. As with the first generation, this generation also did not have ROI functionality. The second generation of Roomba cleaners included two models:
* Roomba Pro: This model, shown in Figure 1-2, was released in 2003 as the base model of the new generation. It included the new dirt sensor and could perform spot cleaning.
* Roomba Pro Elite: This model, shown in Figure 1-3, was also released in 2003 and was the same as the Roomba Pro model, but colored red, and included both spot cleaning and max cleaning.
Third Generation
The third generation of Roomba cleaners includes a great many more improvements than were made in the first to second generation jump. In addition to a dirt sensor, these models include a home base dock for self-charging, a remote control, a scheduling capability, and, most importantly for hackers, a serial port. This generation introduced ROI functionality as a firmware upgrade in October 2005.
This is the current line of Roombas:
* Roomba Red: This model, shown in Figure 1-4, was released in 2004 and improved in 2005. It is the least expensive member of the current Roomba family. It comes with a seven-hour charger instead of a three-hour one and a single dirt sensor. It doesn't have a remote control or a self-charging home base, which are standard with the Discovery model.
* Roomba Sage: This model, shown in Figure 1-5, was released in 2004 and improved in 2005. It is the next least expensive model. It is the same as the Roomba Red model, except that it comes with a three-hour charger and is light green.
* Roomba Discovery: This model, shown in Figure 1-6, was released in 2004 and improved in 2005. It is the one seen in most advertisements. It contains everything the Sage model does, and it also includes the remote control, the self-charging home base, and dual dirt sensors.
* Roomba Discovery SE: This model, shown in Figure 1-7, was released in 2004 and improved in 2005. It is identical to the Discovery model except for the different colored exterior and the inclusion of a self-charging wall mount in addition to the self-charging home base.
* Roomba Pink Ribbon Edition: This model, shown in Figure 1-8, was released in 2005 as a promotional version of Roomba and is functionally the same as the Roomba Sage model. For every Pink Roomba sold, 20 percent of the sale price was donated to the Susan G. Komen Breast Cancer Foundation, with a $45,000 minimum guaranteed donation.
* Roomba 2.1: This model, shown in Figure 1-9, was released in 2005 as a special model sold only by the Home Shopping Network. It was the introductory model for a makeover of the third generation. All Roomba robotic vacuum cleaners released since then are 2.1. The 2.1 designator is a blanket term for over 20 enhancements to both software and hardware. The software upgrade (called AWARE robotic intelligence) includes improvements to the cleaning algorithms for better cleaning efficiency and greater room coverage. The hardware improvements are perhaps more numerous and include better battery-charging circuitry, improved brushes and sensors, and a better vacuum design.
* Roomba Scheduler: This model, shown in Figure 1-10, was released in 2005 and is the same as the Roomba Discovery model, with the inclusion of a special scheduler remote control and a blue exterior. iRobot has also released an improved Scheduler model. This improved model is black and has a Dust Bin Alert feature to let you know when its dust bin is full.
Internal and External Components
Although it's not necessary to know the details of the insides of Roomba to do the projects in this book, it is instructive and neat. Knowing how something works can help you diagnose any problems that are encountered during normal use.
The Underside
To get started on how Roomba is put together, turn it over. Figure 1-11 shows the underside of Roomba with its brushes removed.
Roomba is organized in three sections:
* Sensor front: Virtually all of the sensors (bump, wall, cliff, and home base contacts) are up front. In fact, almost all the sensors are mounted on the movable front bumper. This movable bumper both enables a mechanical means to measure contact (the give triggers a switch) and absorbs shock to minimize damage. The Roomba firmware is designed to always travel forward, so it places its most sensitive foot forward, as it were. When programming the Roomba, you can subvert this tendency and make the Roomba drive backward, but doing so makes it difficult for the Roomba to "see" anything.
* Motor middle: The main drive motors, vacuum motors, vacuum brushes, side cleaning brush, and battery are all in the center. This gives the Roomba a center-of-mass very close to the center of its body, making it very stable when moving.
* Vacuum back: Just like a normal vacuum cleaner, the entire back third contains the vacuum and vacuum bag for holding dirt. The back can be removed when in ROI mode, which slightly unbalances the Roomba and gives it more of a "hot rod" type of movement.
Power
The first consideration for any robotic system is power. Roomba is powered by a custom high-power rechargeable battery pack. This pack provides enough power to run the Roomba for up to 100 minutes of normal operation. It can be re-charged in 3 hours using the 3-hour charger.
Battery Pack Details
Internally this battery pack consists of 12 sub C size nickel metal-hydride (NiMh) cells. Each cell puts out 1.2V so 12 cells wired in series give 14.4 VDC. The newer yellow battery pack uses at least 3000 mAh cells. Some people have taken their packs apart and even found 3200 mAh cells. (The original black Roomba battery pack used 2300 mAh cells.) The mAh differences only affect run time and are otherwise the same. The batteries are good for approximately 1000 charging cycles and do not suffer from any sort of negative memory effect from partial discharge. Do-it-yourselfers can find companies like BatterySpace.com that will sell compatible battery packs using up to 3600 mAh cells. These packs give 20 percent longer run time over the yellow pack and 56 percent longer time over the original pack. Of course, such a hack does void your warranty, but it is a way to save an otherwise old and unused Roomba cleaner.
Note
The main metric of batteries is ampere-hours, which are more commonly referred to as milliamp-hours (mAh). This describes how much current can be drawn from the battery and for how long, and thus how much power a given battery can provide. A 1000 mAh (1 Ah) battery can supply either a 1000 mA (milliampere) circuit for one hour, a 5 mA circuit for 200 hours, or a 2500 mA circuit for 24 minutes. For comparison, a typical LED flashlight might draw 30 mA, while a typical AA battery can provide 1000-1800 mAh. The Roomba batteries have increased in capacity from their original 2300 mAh to at least 3000 mAh, making the current models last 30 percent longer on a charge than previous models.
Available Power
When turned on but sitting idle, the Roomba draws 150 to 250 mA, depending on the Roomba model. During normal operation, a Roomba draws from 1500 mA to 2000 mA of current. This variation in current consumption is due to the variety of floor types: Thick carpets cause more current draw than hard floors. The battery pack can be maximally discharged at a 4 Amp rate, limited by an internal polyswitch (a device that acts somewhat like a fuse that can be reset). Without the polyswitch, a short circuit would damage the battery and the unit.
The full voltage and power available from the pack is available through pins 1 and 2 on the ROI connector. Any projects using power through the ROI can draw as much power as they need. However, drawing too much will shorten the life of the battery, shorten the run time of the unit, and perhaps confuse the system's internal firmware. All projects in this book will draw less than 1 Amp of current and most draw less than 100 mA. A 100 mA project running of Roomba power would shorten the normal Roomba run time by maybe 5 percent.
(Continues...)
Excerpted from Hacking Roombaby Tod E. Kurt Copyright © 2007 by John Wiley & Sons, Ltd. Excerpted by permission.
All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.