UPDATED: Drive-by-wire issues with Roomba and Arduino

Inside the Roomba and Scooba and more, Cool mods, Repair and Upgrades - including the all new iRobot Create Kit. Let's void that warranty baby!

UPDATED: Drive-by-wire issues with Roomba and Arduino

Postby genesisfactor » April 1st, 2012, 2:31 pm

NEW ISSUE: 4/2/12
Right now, i have figured out that it is definitely a type case issue that i was having in issue #2 and after some intensive research, fixed it. Stay tuned for more of my merry screw ups!


SOLVED and THANKS thus far:
:thanks: mfortuna

ISSUE#1
Hey,

So I have a roomba 540 and I want it to drive-by-wire through an arduino (both MEGA and UNO). I've have successfully had it work PERFECTLY with a BlueSmirf dongle I built and an android phone using a free software. Everything moves as needed and intended. The vacuum doesn't turn on. I was happy.

I have spent about a week trying to figure out how to interface this with the arduino. I have tried Tod's bump example, Mike's library, and finally someone's take on mike's library. Either way I'm using mike's library found here
http://www.open.com.au/mikem/arduino/Roomba/index.html

The code that I am using is simple:
Go forward for 5 seconds.
Stop for .5 seconds.
Go backwards for 5 seconds.

At the end of it all, I manage to get it to run. However it does this: before it moves, it does the "start up chine" and then runs forward. It stops, chimes, and then runs forward again. It never runs backwards. The vacuum is always on. It is like I turn it on and it goes directly into cleaning mode.

Please help me do these things:
- Turn off the vacuum
- Make it start moving without the need for stopping and chiming
- Make it go backward (possibly related to the above problem)

I should note that it does similar things with the Microsoft robotics studio using VPL tutorial 1, although that is connected via bluetooth, like the phone was. In that case, it moves as if it was cleaning, and I don't actually have control of the system really. It beeps when I move the joystick.

Please help!

ISSUE#2
I have my arduino using directDrive class of mike's library. Roomba will take hard coded instrcutions, like
Code: Select all
  roomba.driveDirect(100 ,-100);
  delay(1000);
  roomba.driveDirect(-100,100);
  delay(1000);


However, it iwll not take soft coded instructions like
Code: Select all
  roomba.driveDirect(left ,right);


These values are ever changing, so it is not likely that it will go to 0 unless i send a value of 0. Now, the only things i can think of is a polling time or instituting a delay or it could be that i'm sending a value that isn't roomba happiness (i'm converting serial bytes to integers, but the integers are between 0 and 220). I don't have any delay in my code on that, as there are other instructions being sent around to other devices. However, i'm pretty sure the ardunio, which waits to send a new value when it gets a new instruction has a 1 cycle delay in the serial code, as it takes 2 cycles for it to echo the values it was sent.

Does anyone haw a known delay time or have any clues into why the this i happening, please let me now. For now, i'll try casting.
Last edited by genesisfactor on April 2nd, 2012, 6:23 pm, edited 2 times in total.
genesisfactor
 
Posts: 4
Joined: April 1st, 2012, 6:03 am

Re: Drive-by-wire issues with Roomba and Arduino

Postby mfortuna » April 1st, 2012, 5:31 pm

It almost sounds like a BAUD rate issue. It should not be doing a start up chime.
Mike
Reds x 3, Dirt Dog, Disco (now a parts bot), Create, Scooba 350, and Security Dawg
Evolution Mint
User avatar
mfortuna
Robot Master
 
Posts: 4525
Joined: February 5th, 2006, 10:35 am
Location: NH

Re: Drive-by-wire issues with Roomba and Arduino

Postby genesisfactor » April 1st, 2012, 5:44 pm

Hey, i have been working on it since my last post. I actually signed back on to share the news. I found out that was reading the SCI interface instructions, which were 57600, but the iRobot 500 series use 115200. I tried first with Tod's manual setting of the motion. It now works, when i hard code stuff, which is great! I'm going to try and see if it will do the same using mike's library, which i just changed to the new baud rate and saved it as a different code. I'm really excited!

And thank you for confirming that though. That info seriously would have helped. I feel like a tutorial or known set up for the 500 series robots is going to be necessary as they run different form the Create and the previous models. I'm in the middle of it, so i will post up in about a week :).

Also, if you are familiar with the arduino/C libraries, I figured i want to add a module for direct drive PWM code, and i want to make sure i don't miss anything. If someone shows me that, i might also get some more motions in the mix.

Thanks again!!! ECSTATIC!!!
genesisfactor
 
Posts: 4
Joined: April 1st, 2012, 6:03 am

Re: UPDATED: Drive-by-wire issues with Roomba and Arduino

Postby genesisfactor » April 2nd, 2012, 3:22 pm

updated with new issue! Thanks in advance!
genesisfactor
 
Posts: 4
Joined: April 1st, 2012, 6:03 am


Return to Robotic Hacking

Who is online

Users browsing this forum: neato and 83 guests