

The software fixed the hardware - J3L2404
http://www.jwz.org/gruntle/roomba.html

======
djcapelis
This type of thing happens all the time with embedded platforms. Software
fixes for hardware defects are common. When we were building robots invariably
the electronics team would always wire some motor backwards. Since the motors
had similar power in both directions they would always ask me to just write
the code to run motors they wired the wrong way backwards.

It was simple enough to do, but it always feels a bit wrong.

Other types of software workarounds are possible though too. I once modified
the acceleration curve of the robot (clamped down the jerk) so that there
would be reduced stress on the poorly made drive train and under many failure
modes this changed the robot from essentially dead in the water to workable.

It seems surprising how many issues you can solve with code if you aren't used
to it. But these hacks are actually everywhere in a lot of embedded systems
and allow teams to continue to quick, cheap and dirty work when needed that
can get patched up later.

~~~
dkarl
_it always feels a bit wrong_

It helps to think of it as "don't care" code rather than "error compensation"
code. Which way should the engine be wired? It's cool; the software doesn't
care. Just wire it up however. What order should I start these services? It's
cool; they don't care. Just start them up however. As soon as your users stop
caring about the stuff you can take care of, they'll have time to care about
something else that's more important.

~~~
djcapelis
Well, the values actually sent out to the PWM were backwards. Thankfully I
could just invert it at the last step in the code where it got sent and so
while writing the actual code I could pretend everything was correct. It's
hard to think of -127 going forward and 127 going backwards as anything but a
dirty hack.

While the underlying electronics thankfully didn't care, the digitized values
set up certain expectations.

~~~
HeyLaughingBoy
Typically I get around this by having each motor's direction defined
separately. Since you very often need to define the logic of a sensor ('1' can
mean either ON or OFF depending on the sensor type) on a sensor-by-sensor
basis, it makes sense to do this for motors as well.

------
HeyLaughingBoy
Meh! If I had a dime for every time that I was told to fix a hardware problem
in software, or provide a "limp home" mode if software detected a hardware
fault, well... I'd have a lot of dimes. It's pretty standard behavior for
electromechanical embedded systems.

The really important take home here is that the manufacturer sent out a
software fix _to a consumer product that is not online!_ That's a huge leap
forward and is something the industry has been pondering for a long time.

------
Maciek416
I had a similar problem with my Roomba. Recently it began to bump into phantom
walls where there were none, to the point where it would get stuck in the
middle of the floor, turning around and around, stuck in a jail of invisible
walls.

The Roomba detects this problem and emits a failure code of 9 beeps. I
contacted iRobot about the problem, and their response was to ship me a fresh
Roomba (without the battery + charging station) right away. Here are some
pictures of the battery transplant:

<http://dl.dropbox.com/u/1149620/roombasurgery/index.html>

From the troubleshooting instructions that iRobot gives you upon encountering
the 9-beep code, I suspect that there's probably just a faulty or possibly
dirty (likely very inexpensive) sensor on the front bumper of the robot. I
wonder if there's a similar fix to jwz's Roomba where I could patch for the
bad sensor somehow (the roomba appears to have more than one way to detect
it's stopped moving), and perhaps accept a slightly "dumber" but otherwise
working Roomba.

~~~
jrockway
My roomba has this problem from time to time. It's because the front wheel
accumulates goo and stops rotating. The sensor that detects the wheel rotation
then thinks the wheel is not rotating, and the robot moves erratically to free
itself from the wall that it thinks is in its way.

Clean out the goo, and the robot is fine again.

------
jtnak
This is nothing new. Read about Voyager 2. Specifically its platform problems
between Saturn and Uranus in 1981, about 3 decades ago.

------
jeffbarr
Can they send one to Mars to fix the rover?

~~~
dandelany
They can and have! I always thought this was very cool. However, the current
Mars rover problem is not a hardware problem, per se, it's a stuck-in-the-mud
problem.

~~~
bockris
An elderly robot that walks with a limp that's stuck in the mud problem.;-)

------
pcc
Also it should be noted that devices like FPGAs allow for directly altering
certain hardware structures via software.

In these cases it can actually be possible to fix a hardware bug (or add a
hardware feature) via software, where the hardware itself actually gets fixed
(ie its not just firmware working around an ongoing hardware constraint).

------
DannoHung
So, does it actually "fix" the hardware by say, oscillating the wheel in such
a way as to clean or jiggle the sensor, or does it update the firmware to
compensate for the wheel sensor's spotty readings?

~~~
djcapelis
The entry itself speculates that the new firmware simply compensates for the
spotty sensor(s).

------
RiderOfGiraffes
Another example occurs on this thread:
<http://news.ycombinator.com/item?id=1032063>

Here's the link: <http://news.ycombinator.com/item?id=1032152>

------
e40
When I saw it was jwz being linked to, I was worried I would have to suffer
through a green on black web page. Oh, the relief.

------
DavidSJ
Why can't this be done with a download and USB?

~~~
kelnos
Does the Roomba have a USB port? jwz mentioned a 'serial' port...

~~~
brk
It does not have a USB port.

The serial port is also a non-standard (for serial ports) connector (it is a
standard DIN connector). My guess is that the average Roomba owner doesn't
have a PC with a serial port, and probably wouldn't want to acquire an
uncommon connector and wire up a serial converter cable, and then run some
program on their PC to dump the firmware image in to the Roomba. The osmo
dongle makes the process near foolproof for soccer moms and grandmothers and
so on.

~~~
torpor
Incidentally, there is evidence that the OSMO dongle collects data, also ..

------
torpor
I work in embedded. Primarily, my work involves fixing hardware bugs in
software. This is not surprising to anyone who works in embedded, but for
those of my programmer friends who just see the hardware and have no clue just
how much software is under the hood, it always seems to be a big shock to them
that I have had to spend a few weeks fixing a hardware design that had one pin
wired around the wrong way, instead of just getting the hardware fixed.

That said, one of the things I really like to see these days is new
generations of extremely competent hardware designers who have absolutely no
problems with the expenses of hardware iterations .. even though it means less
work for me in the end, its good to see. I have lost count of the times I've
had to write some god-awful driver code that just makes me want to puke my
lungs out, just because the hardware guys were too lazy to breadboard
something ..

------
andrewljohnson
Roombas are no match for Golden Retrievers.

~~~
astine
As pets maybe... but I've _never_ seen a Golden Retriever clean a floor.

~~~
tricky
Wrong breed. I've got a food-motivated wiener dog that'll destroy any roomba
in a floor cleaning contest.

