QuickStart Roomba
Duane Degn
Posts: 10,588
Well, I finally gave into erco's subliminal messages and purchased a Roomba.
I didn't purchase the June 17 (dead link removed) Roomba but I did purchase one from Woot on July 9 (dead link removed).
It cost $125 shipped and came with two virtual walls.
The robot does what I wanted to great. I have a room that frequently gets dirty and the Roomba makes it easy to clean it up.
But then I read that Roombas were supposed to be easy to hack. And sure enough they have a little serial port over the charge connector.
I finally got around to hacking the Roomba this weekend. It was surprisingly easy to get the robot moving and vacuuming.
I'm still working on getting the Roomba to drive smoothly. It can easily go straight ahead or rotate in place but nice arced turns have been a little harder to program.
Nice turns can be made with some practice with the controller but I hope to make them the norm with some changes to the program.
I'm using a PlayStation 2 controller to drive the Roomba. This is the same controller setup I'm using with this project.
The challenge is the way the Roomba whats it drive information. It wants two bytes for speed and two bytes for radius. The problem arises when a particular radius can not be achieved because the given speed is too high. I just need to get out pencil and paper and compute the average speeds the wheels will have as a function of the radius given the outside wheel can travel up to max speed (500mm/s).
I use the arrow buttons on the left side of the PS2 controller to turn on and off the cleaning motors. The Roomba lets you program songs. So far I've just program an one octave scale going up then down. With a limit of 16 notes per song there isn't much room to do more than that. I do think you could make a longer song by breaking the song up in to 16 note portions and saving them as different song numbers. 16 different songs can be stored in the Roomba so that means a 256 note song could be stored.
I'm using a QuickStart board on the Roomba with a Nordic module for communication. I added a four digit 7-segment display to the setup to aid in debugging. A button on the PS2 controller toggles the display between speed and radius.
I'll post the code and hopefully a video when I get this working a bit better. I'm just excited at how far I've come in a couple of days.
Duane
Edit(2 June, 2020): Fixed links where possible. Removed unfixable links.
Edit(26 September, 2015): I've attached the archives Roomba110830c - Archive [Date 2011.08.30 Time 11.04].zip and Remote110827b - Archive [Date 2011.08.30 Time 11.05].zip to this post.
These programs were written when I was still pretty new to writing code for the Propeller. I hope the code isn't too awful.
I didn't purchase the June 17 (dead link removed) Roomba but I did purchase one from Woot on July 9 (dead link removed).
It cost $125 shipped and came with two virtual walls.
The robot does what I wanted to great. I have a room that frequently gets dirty and the Roomba makes it easy to clean it up.
But then I read that Roombas were supposed to be easy to hack. And sure enough they have a little serial port over the charge connector.
I finally got around to hacking the Roomba this weekend. It was surprisingly easy to get the robot moving and vacuuming.
I'm still working on getting the Roomba to drive smoothly. It can easily go straight ahead or rotate in place but nice arced turns have been a little harder to program.
Nice turns can be made with some practice with the controller but I hope to make them the norm with some changes to the program.
I'm using a PlayStation 2 controller to drive the Roomba. This is the same controller setup I'm using with this project.
The challenge is the way the Roomba whats it drive information. It wants two bytes for speed and two bytes for radius. The problem arises when a particular radius can not be achieved because the given speed is too high. I just need to get out pencil and paper and compute the average speeds the wheels will have as a function of the radius given the outside wheel can travel up to max speed (500mm/s).
I use the arrow buttons on the left side of the PS2 controller to turn on and off the cleaning motors. The Roomba lets you program songs. So far I've just program an one octave scale going up then down. With a limit of 16 notes per song there isn't much room to do more than that. I do think you could make a longer song by breaking the song up in to 16 note portions and saving them as different song numbers. 16 different songs can be stored in the Roomba so that means a 256 note song could be stored.
I'm using a QuickStart board on the Roomba with a Nordic module for communication. I added a four digit 7-segment display to the setup to aid in debugging. A button on the PS2 controller toggles the display between speed and radius.
I'll post the code and hopefully a video when I get this working a bit better. I'm just excited at how far I've come in a couple of days.
Duane
Edit(2 June, 2020): Fixed links where possible. Removed unfixable links.
Edit(26 September, 2015): I've attached the archives Roomba110830c - Archive [Date 2011.08.30 Time 11.04].zip and Remote110827b - Archive [Date 2011.08.30 Time 11.05].zip to this post.
These programs were written when I was still pretty new to writing code for the Propeller. I hope the code isn't too awful.
Comments
Okay, I've got the Roomba at least controllable.
I'm posting the code I have so far in case anyone else have one of these they'd like to control with a Prop.
Here's some notes from the program.
I've used these program with a PlayStation 2 controller. There is code for a Wii Nunchuck as well but I have not tested it with a Nunchuck.
As I mentioned in my first post, I can steer the Roomba and I can turn the cleaning motors on and off from the remote.
I have not added any feedback from the sensors yet.
Duane
Edit(3/11/15): I have deleted the archives Roomba110830c - Archive [Date 2011.08.30 Time 11.04].zip (64 views)
and Remote110827b - Archive [Date 2011.08.30 Time 11.05].zip (62 views)
Edit(26 September, 2015): Since it's still possible to edit forum posts, I've attached the two archives to the top post of this thread. I didn't see a way of attaching these archives to this post.
Somebody actually READS my posts?
@Duane - with your "Time to Implement" on any project exceeding mine by 2 or 3 orders of magnitude, I greatly enjoy my hobby vicariously through your successes. Some day, I aspire to complete something I've begun....or even begin something I've contemplated!
This is very cool and inspiring.....makes me want to get a Roomba and add it to the pile of things I Need to vacuum around.
Ray
Ray,
There's a big difference in buying "another" robot verses buying an automated vacuum cleaner.
As you said, this is an older model but it does have a communication port so I can add capabilities if I want to. Besides $125 is a good deal IMO.
My wife was very pleased about being able to control the Roomba with a remote. The Roomba can skip an area of a room sometimes. Now those areas will be easy to redo. Often the whole room doesn't need to be cleaned. The "Spot" feature works well but being able to remotely control it is even better.
I've thought about adding a couple of IR LEDs and use a Wii camera to watch the Roomba and aid its navigation. With a Wii camera watching the Roomba, I could have virtual walls with complex shapes. A Prop attached to the Wii camera could give the Roomba instructions to keep it out of restricted areas. This system could also be used to make sure there aren't any areas missed by the Roomba. Not only would this project be fun, it would also earn me extra points with my wife.
For now, I'm still trying to get the Roomba to drive smoother. I added ramping which actually made it behave worse. I'm confident I'll get it to behave better.
Duane
PS: Start thinking about how much your wife might benefit from getting a dozen PINGs for her birthday. Chicks dig 'em!
Um, how do I say this? The Roomba was an anniversary present for my wife.
I had a hard time explaining to my visiting nieces that the box with a big "iRobot" label (that arrived while they were staying one night) was a present for my wife.
I could see them thinking of how to explain to their mother that her sister had married a selfish bum.
Duane
My understanding from the QS maximum specs is that up to 18v could be connected to Vin(pin 40). As I recall, the Roomba provides 14-16v at the serial port... Would that be an option to take power from the Roomba?
What the QS specs don't make clear, if the 18v max vin is based on 500mA or (for example) 100mA current consumption. That info might be available in the regulator datasheet. Your led-display and wireless device will add some extra load, but surely not enough to go over the 500mA rating? That would be interesting to measure..?
anyhow, congratulations on a great use of the QuickStart. I really like it. You could use the QS touch buttons to make a little piano too, or to execute each of your stored songs!!
I'm still not thrilled with the steering algorithm but the Roomba is drivable with this code.
@Rick,
I think you statement is ironic since this project uses code and parts from two other uncompleted projects.
Thanks for your comments.
@Ray(Cluso99),
I'll leave the dirt detection with a camera to someone else. I might use a Wii camera to aid with navigation.
@Maxwin,
Yes, it's a battery pack. I've wondered about using the Roomba's power but when I tried to measure it with my multi-meter it read close to zero volts (the Roomba had sat for several days without being charged). I haven't investigated when there is and isn't power present on the battery power pins (I think there are two pins for power and two ground pins).
For now, I like using the battery pack because it has a switch on its side and I like being able to turn the Propeller and Roomba on and off separately. I may revisit using the Roomba's power in the future.
@All,
I told my wife about admitting the Roomba had been her anniversary present. She wanted be to assure everyone that she was/is very pleased with the present.
Duane