Shop OBEX P1 Docs P2 Docs Learn Events
QuickStart Roomba — Parallax Forums

QuickStart Roomba

Duane DegnDuane Degn Posts: 10,588
edited 2020-06-02 22:22 in Robotics
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.

RoombaPort110829a.png


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

  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-09-27 04:14
    [Reserved for code and video.]

    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.
    ----------------- Public Notes ------------------
      This program is used in a QuickStart board
      to control a Roomba.  Control information
      needs to be sent to the QS board from another
      Propeller board.
      The other Propeller board was programmed with
      Remote110827b.spin.
      Presently there isn't any autonomous activity
      programmed.
      This program allows remote driving of the Roomba.
      The cleaning motors can also be controlled from
      the remote.
      Both this program and the remote program were
      adapted from other projects.  I have not gone
      through the program to clean it up.
      There are a lot of unused variables and methods.
    

    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.
  • Mark_TMark_T Posts: 1,981
    edited 2011-08-29 09:49
    Clever! Sometimes the propeller really sucks ;)
  • ercoerco Posts: 20,244
    edited 2011-08-29 10:50
    Duane Degn wrote: »
    Well, I finally gave into erco's subliminal messages and purchased a Roomba.

    Somebody actually READS my posts? :)
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-08-29 10:55
    @erco - I read and comment on them too.....usually, I just don't type the comments! :lol:

    @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.
  • RsadeikaRsadeika Posts: 3,822
    edited 2011-08-29 12:12
    @Duane, I see you got an old, old version of Roomba. I think you would have liked the iRobot Create better, which I still think costs about $130. Although, it does not have a carpet cleaning capability, it is more suited to hacking. For me the Create was to technically challenging, I could not figure out how some of the built in commands worked, so I put that project on the side.

    Ray
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-08-29 15:14
    Rsadeika wrote: »
    I think you would have liked the iRobot Create better. . . Although, it does not have a carpet cleaning capability

    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
  • ercoerco Posts: 20,244
    edited 2011-08-29 16:12
    Duane, you're a GOOD MAN for not buying another robot for yourself. You're a giver, and a sterling example of a "keeper" husband who only thinks of his wife, and how an automated vacuum cleaner can spare her some drudgery. God bless you, your wife is a VERY lucky lady. ;)

    PS: Start thinking about how much your wife might benefit from getting a dozen PINGs for her birthday. Chicks dig 'em!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-08-29 17:11
    erco wrote: »
    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
  • Cluso99Cluso99 Posts: 18,066
    edited 2011-08-30 04:14
    OK, so who can mount a wifi camera on the ceiling and detect dirt? Then you can send the roomba out to clean that spot(s).
  • VonSzarvasVonSzarvas Posts: 3,273
    edited 2011-08-30 06:59
    Duane- Is that a battery pack under the QS?

    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!!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-08-30 11:17
    I posted the code I'm using with Roomba and controller in post #2. I haven't cleaned it up. If I waited until I cleaned it up before posting it, it might have never been posted.

    I'm still not thrilled with the steering algorithm but the Roomba is drivable with this code.
    mindrobots wrote: »
    Some day, I aspire to complete something I've begun....or even begin something I've contemplated!

    @Rick,

    I think you statement is ironic since this project uses code and parts from two other uncompleted projects.

    Thanks for your comments.
    Cluso99 wrote: »
    OK, so who can mount a wifi camera on the ceiling and detect dirt? Then you can send the roomba out to clean that spot(s).

    @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 wrote: »
    Duane- Is that a battery pack under the QS?

    @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
Sign In or Register to comment.