Welcome to Synthiam!

Program robots using technologies created by industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation, and artificial intelligence easy.

Get Started
United Kingdom
Asked — Edited

Irobot 530 Quick Advice

Hi guys.

I am currently looking at a Roomba IRobot 530 on a popular auction site I want to get. I don't wish to appear rude but I need some quick advice before I place a bid, as the clock is ticking. *eek*

Does the 530 have a comms port to connect the EZ-B4?

Is the 530 compatible with the EZ-B4?

I've never had a robot vac so it's all new to me. I know DJ does reference the iRobot but there's no mention on models.

Cheers.:)

User-inserted image

AI Support Bot
Related Content
Synthiam
United Kingdom
#75  
@Richard.

When I tried it yesterday it was in full mode. When it hit the wall the motors stopped fine but it did hit the wall with a bit of a thud, where as on a normal cleaning cycle it would detect the same wall and slow down bumping it softly.

Same thing with the cliff sensors. It was in full mode and ran the sensor script, put it on a work bench but didn't detect when it fell off (I was waiting to catch it) and the motors were still running so had to hit the stop button on the movement control. That's why I thought the running IR sensor script included the cliff sensor too. The battery check script is golden and works well.

I'll give the revised script a try and report back.

Cheers.
#76  
You could try it in safe mode if you want, but I think the Roomba will take over control of the sensors as opposed to my scripts....... So my script basically only reads the bump, stasis and light IR bump sensors. That's kind of it... It would be up to the user to do whatever with the data received back.... For instance if bump sensor returns a 3 it means the Roomba hit something in the middle of the physical bumper.... In full mode you would have complete control. It would be up to your programming to read the sensors and keep it from getting stuck, banging into things hard and or falling down the stairs...

Place your Roomba on the table (it shouldn't move because my script doesn't have a drive command in it) or somewhere you can read your pc and press the roombas physical bumpers and or hold objects in front of the light bumpers at the same time. Run the script in post #75... Now use your hand and press the roomba's bumpers... you should see numbers from 0 - 3 in the print window depending on where you press on the bumper...
United Kingdom
#77  
@Richard.

Thanks again buddy. I'll give that a try later on today. Just went to try it but the thing wouldn't move and the red light came on. Turned out that even though it was on the dock all night, it didn't charge. Got a quick pulsing orange now so it's going to be a few hours before I can try it.

Thanks again for your help (and your patience). It's really appreciated.:)
#78  
No worries Steve, keep us posted... We'll get this working for you... Quick pulsing charge light indicates your Roomba is attempting to recondition your battery... Could take up to 16 hours to complete...
United Kingdom
#79  

Quote:

Safe Mode
When you send a Safe command to the OI, Roomba enters into Safe mode. Safe mode gives you full control of Roomba, with the exception of the following safety-related conditions:
Detection of a cliff while moving forward (or moving backward with a small turning radius, less than one robot radius).
Detection of a wheel drop (on any wheel).
Charger plugged in and powered.
Should one of the above safety-related conditions occur while the OI is in Safe mode, Roomba stops all motors and reverts to the Passive mode.
If no commands are sent to the OI when in Safe mode, Roomba waits with all motors and LEDs off and does not respond to button presses or other sensor input.
Note that charging terminates when you enter Safe Mode.


So please correct me if I'm wrong, but if I have the Roomba in "Safe mode" I have full manual control of the motors, but cannot manually control the sensors which I take to mean that all the sensors, bump, light touch, cliff ect will all be on, and when it detects when it's going to hit a wall or fall down the stairs the sensors take over and over rides manual control. So what I need to do is write a "Safe mode" init script to run the Roomba via a Movement Panel ect with all the sensors automatically set to "On". Is that right?
#80  
In safe mode, the Roomba won't hurt itself and will navigate around safely like it usually does... I think you can still read the sensors via scripts in safe mode... However, say you want the Roomba to back up if it hits something in the centre bumper, but the Roomba's safe mode programming wants it to turn left... There would be a conflict and whoever issues the last command (you or the Roombas OI) would win control and override the previous "do this" command....

In full mode (which I usually use)... You have to do all the thinking for the Roomba... If it senses a cliff and you don't tell it to stop, backup or turn, well the poor little guy is going to commit suicide by attempting to drive down the stairs...:D
#81  
Maybe the best way to approach this is to switch modes on the fly... when you want full control issue a full ControlCommand() to take over... When want the Roomba to wander around by itself, just switch back to safe mode....
United Kingdom
#82  
Thats what I was thinking. Having separate "Full" and "Safe" init scripts to change when needed (don't think I will need a "Passive" init). I don't have a problem using full mode when myself or a script is controlling it, but later down the line I want to make it as autonomous as possible, so thinking safe mode would be the better option for this. I'll have to do some trial and error before attaching body parts to it.

Yeah, when it docked last night I think I did it manually so it was still in full mode, hence why it didn't charge. *eyeroll* Lesson learned.
#83  
@Steve... Yeah, that may be why the Roomba is reconditioning charging as possibly the battery got too depleted over night while failing to charge...

If you keep reading the IO PDF I uploaded it will do two things... 1) Put you to sleep really fast LOL and 2) Get you the most out of programming and controlling the Roomba...
United Kingdom
#84  
@Richard.

Yes, between the Zzzzz's *sleep*, I keep going back to it and having a good read. A lot to take in for a novice like myself lol, but I'm starting to make some sense of it and it is a good read. So if I have this right, taking this for example...

uartwrite(0,1,142,45)

Which is...

uartwrite(Board, Port, data, data)

So writing something like this...

Serial sequence: [145] [Right velocity high byte] [Right velocity low byte] [Left velocity high byte] [Left velocity low byte]

Would be written in script something like this...

uartwrite(Board, Port, data, data, data, data, data)

Is that correct?
#85  
Yep you got it right...
uartwrite(0,1,142,45)
...so
uartwrite(board, port, request for a data packet, data packet requested)

If you open my custom Movement Panel for roomba driving you can just use all those commands in a script for forward, reverse, left, right and stop... That way you don't have to mess with the velocity high and low byte stuff...
#86  
With the forward command you can adjust speed via a variable if you want..

uartWrite(0,1,137,0,$speed,0,0) #forward movement
where $speed is (I think) any number between 1 to 255... 100 seems to be a nice slow speed for most situations....
United Kingdom
#87  
That's cool thanks for confirming Richard. What I wrote above was just an example to help get my head around it, which its starting to. I already used your Movement Panel scripts in a mobile interface control, so it's all good. Still can't play with my poor lil Roomba. Orange LED is still pulsing so deffo going to need that 16 hour charge, but it gave me a chance to get my hands dirty and almost finish of the build part of my new bot.:)
United Kingdom
#89  
@Richard.

All being well, Vic (yes he has a name now, explanation to follow) should be ready to showcase in a week or two. Just waiting for some regulators to turn up (not the magnificent seven kind) so I can get this puppy wired up. This should be right up your alley as it a fabricated bot using odds and ends I had laying around... Oh, and a Roomba of course lol.:D
United Kingdom
#90  
Okay, so a bit of an update.

I wrote a init script for "Safe Mode" and took the Roomba for a little drive to see if the sensors took over when it hit, or was going to hit a wall. It didn't. In my eyes, it was no different to "Full mode". I had control of it, but driving it off a work bench or bumping it in to walls didn't activate any of the safety features which according to the PDF doc, it was supposed to.

Next I tried to script the "Cliff sensors" with pretty good results. here's the code...

Code:

REPEATUNTIL(1=2)
uartWrite(0,1,142,9) # cliff left
sleep(5)

uartWrite(0,1,142,10) # cliff front left
sleep(5)

uartWrite(0,1,142,11) # cliff front right
sleep(5)

uartWrite(0,1,142,12) # cliff front right
sleep(5)

uartWrite(0,1,142,58) # Motor Stasis
sleep(5)

$x = UartAvailable(0, 1)
IF ($x>5)

# print("Bytes in buffer: " + $x) checks how many bytes are in the buffer

$RX_DATA = UARTRead(0, 1, $x) #places all the bytes RX into $RX_DATA

$RX_0=GetByteAt($RX_DATA,0)
$RX_1=GetByteAt($RX_DATA,1)
$RX_2=GetByteAt($RX_DATA,2)
$RX_3=GetByteAt($RX_DATA,3)
$RX_4=GetByteAt($RX_DATA,4)
ENDIF
IF ($RX_0!=0 or $RX_1!=0)
uartWrite(0,1,137,255,100,128,0)
sleep(2000)
uartWrite(0,1,137,0,0,0,0) #stop Roomba

ENDIF


print($RX_0+" cliff left")
print($RX_1+" cliff f left")
print($RX_2+" cliff f right")
print($RX_3+" cliff right")
print($RX_4+" stasis")

sleep(100)
ENDREPEATUNTIL


It works fairly well, but I'm not sure I 100% trust it though. Most of the time it will stop and reverse back before it reaches the edge, but a few occasions the caster went over the edge but rescued itself before I intervened. I do have a slight issue with it though... When it stops and reverses back for 2 seconds, it wants to reverse again. Have I missed something in the script?

After that, I had a play around getting the "Light touch" sensors working. I managed to put a script together that when it detects a wall, the speed reduces to a very slow crawl which works, but I have a few issues with it...

1) It detects walls and objects that are not even close to the Roomba which triggers the crawl speed). Is there a way to reduce the detection distance the Roomba receives, much like you can with a ping sensor?

2) When I start the script, 50% of the time the Roomba will take off on it's own without me pressing a forwards control. I guess its because of what I mentioned above in point 1, but don't know how to write a script to get around it.

3) Now this is probably due to my scripting skills (lol, or lack of), but I wrote it so when it detects a wall it will slow down, then when it hits the wall, the "Bump and wheel drop" sensors trigger the bumper sensors and stops the Roomba in it's tracks... but it doesn't and the motors continue to turn until I kill the script and press a STOP control. here's the script...

Code:

REPEATUNTIL(1=2)
uartWrite(0,1,142,45,46,47,48,49,50,51,) # soft bump sensors
sleep(10)

uartWrite(0,1,142,7) # Bump detection
sleep(10)

uartWrite(0,1,142,58) # Motor Stasis when going forwards
sleep(10)




$x = UartAvailable(0, 1)
IF ($x>3)

# print("Bytes in buffer: " + $x) checks how many bytes are in the buffer

$RX_DATA = UARTRead(0, 1, $x) #places all the bytes RX into $RX_DATA

$RX_0=GetByteAt($RX_DATA,0)
$RX_1=GetByteAt($RX_DATA,1)
$RX_2=GetByteAt($RX_DATA,2)


ENDIF
IF ($RX_0!=0 or $RX_1!=0)
uartWrite(0,1,137,0,100,128,0) #forward very slow

ELSEIF ($RX_0!=0 or $RX_1!=0)
Uartwrite(0,1,137,0,0,0,0) # Stops forward movement

ENDIF


print($RX_0+" Wall detected") various values depending on which IR was triggered
print($RX_1+" wheels stopped") 0, 1, 2, 3 depending on where the Roomba bumped

sleep(250)
ENDREPEATUNTIL


I'm a lot closer to where I want to be with this, but obviously still got some bugs to iron out, so I'd appreciate if you could tell me where I went wrong with my scripts.

Thanks. :)
#91  
@Steve... This won't work...
uartWrite(0,1,142,45,46,47,48,49,50,51,) # soft bump sensors
You can only make only one call at a time for a sensor...
Single byte returns like bump sensors are pretty simple but you can only ask for the data one packet at a time...
uartWrite(0,1,142,45) #one sensor packet call at a time (single byte)

Some are 2 byte returns so see my voltage script to see how to read 2 byte returns....

To be honest, what I have given you is all I have looked into with the Roomba.... I would have to spend more time to see what else I can do... But this is it for now
United Kingdom
#92  
@Richard.

Okay buddy. No problem, thanks good to know. Thanks anyway. What if I broke it down to separate uartWrite commands like I did with the cliff sensors script. Would that make a difference, or would that still read as multiple bytes?
#93  
You can break them down into multiple writes... each write has to have a corresponding read from the buffer... If you have 3 writes to various sensors you would get 3 bytes in the buffer so 3 reads... 4 writes and then 4 reads from the buffer etc... This is only if you are reading sensors that return only 1 byte... As mentioned 2 byte reads are more complicated... So far the only 2 byte read that I have working is the voltage check...
United Kingdom
#94  
Right gotcha. I'll have a look and your voltage check script and see if I can adapt it to the light touch sensors. Thanks again.:)