Boe-Bot Robot Corridor Navigation
![Andy Lindsay (Parallax)](https://forums.parallax.com/uploads/userpics/601/n66C2UR7NIHRG.jpg)
This is a place holder for additional material (coming soon) for corridor navigation with infrared sensors after you have completed Chapters 7 and 8 in Robotics with the Boe-Bot. Just a couple paragraphs now, more later...
In Robotics with the Boe-Bot v3.0, your Boe-Bot used infrared object detection to avoid obstacles and drop-offs and follow objects and wide electrical tape stripes. Another popular Boe-Bot activity is navigating corridors and small mazes. This thread demonstrates two approaches to corridor navigation. The first approach utilizes simple code along with the parts in your Boe-Bot(R) Robot kit. The second approach utilizes a few extra infrared LEDs and receivers along with some subroutines for intersection detection.
Back to:
Parallax Go Boe-Bot page
Stamps in Class Mini Projects
i-box: These activities focus on navigating in corridors delimited by walls. For an electrical tape delimited course and techniques for navigating it, take a look at the Boe-Bot + QTI section in the Stamps in Class Mini Projects thread.
In Robotics with the Boe-Bot v3.0, your Boe-Bot used infrared object detection to avoid obstacles and drop-offs and follow objects and wide electrical tape stripes. Another popular Boe-Bot activity is navigating corridors and small mazes. This thread demonstrates two approaches to corridor navigation. The first approach utilizes simple code along with the parts in your Boe-Bot(R) Robot kit. The second approach utilizes a few extra infrared LEDs and receivers along with some subroutines for intersection detection.
Back to:
Parallax Go Boe-Bot page
Stamps in Class Mini Projects
i-box: These activities focus on navigating in corridors delimited by walls. For an electrical tape delimited course and techniques for navigating it, take a look at the Boe-Bot + QTI section in the Stamps in Class Mini Projects thread.
Comments
The left front and right front sensors on the Boe-Bot are probably familiar from Robotics with the Boe-Bot chapters 7 and 8. Activities in those chapters used them for object avoidance, drop-off avoidance, and object following. For corridor navigation, we’ll use them to decide when to veer away from the corridor’s walls. Then, the left side, center front, and right side detectors can be used for detecting the difference between a wall and a corridor opening.
Circuit
The corridor sensing circuit requires the two IR object detection sensors in the Robotics with the Boe-Bot kit along with three extra ones. If you need to buy three additional IR object detectors, the IR Receiver and IR Transmitter Assembly in the Parts List are linked to their product pages. The schematic shows one copy of the IR circuit and the table below it lists the I/O pin connections and IR LED series resistor values for each detector. Below that, there’s a placement and wiring close-up picture that will help with building the circuit.
Parts List
(5) Resistors – 220 Ω (red-red-brown)
(3) Resistors – 1 kΩ (brown-black-red)
(2) Resistors – 2 kΩ (red-black-red)
(5) IR Receiver
(5) IR Transmitter Assembly Kits
(IR LEDs, standoffs and shields)
(misc) Jumper wires
Schematic
There are five copies of the IR LED and IR Detect circuits on the breadboard. Use the table below for I/O pin connections and series resistance values in the IR LED circuits.
Placement and Wiring
Testing the Corridor Sensing Circuit
Before navigating any corridors, make sure to test your circuit with the Display program below. Each sensor location should display a 1 when there’s no object within a few inches of it, and 0 when there is an object.
√ Run Test IR Detection.bs2.
√ Verify that each detector displays 1 when no object is in front of it and 0 when there is an object in front of it.
√ Find an fix any circuit mistakes that might be preventing your IR detection circuits from working before you continue to the next program.
Calibrate Corridor Sensing
Now that the sensors work, they still need to be adjusted to sense a corridor. A good corridor for this circuit is two walls 12 inches apart. The Test Basic Corridor.bs2. program just monitors the right front and left front IR detectors, and makes the Boe-Bot turn slightly to correct its direction if it’s going toward one of the walls or getting too close.
The most important part of this calibration is pointing your left front and right front IR LEDs and detectors in the right direction. If they are pointing too far right/left, they might see the walls all the time and the Boe-Bot will seem confused and move forward very slowly, if at all. If they are pointing too far forward, they won’t detect a wall until it’s too late and the Boe-Bot is already sliding along the wall.
Your adjustments will be correct if you can send your Boe-Bot into a corridor like this at the angle shown (ether from the left or right), and it straightens itself out and makes it through the 12 inch wide corridor.
√ Run Test Corridor Wall Avoidance.bs2.
√ Start running your Boe-Bot through the corridor. If it seems to stall, it’s probably seeing too much wall, and the left front and right front IR detectors need to be turned more in the straight ahead direction.
√ If it gets so close to the wall that you say “uh-oh”, or if it runs into the wall, the left front and right front sensors need to be turned slightly outward.
√ Keep adjusting until you can send it in at the angle shown in the picture above. It should be able to straighten itself out and go all the way through the corridor, regardless of whether it’s coming info the corridor from the left or the right.
**************************THIS*DOES*NOT*COMPUTE***********************************************
It has been nine months since you reserved this space, I would think you would have used it by now!
***************************END*TRANSMISSION**********************************************************
***************************BOMBER*OUT*,PEACE********************************************************
Alternatively, you could make a whole new upper deck for BoeBot 2, but definitely make a backwards-compatible part for all the BoeBots out there.
Heck, I'll do it if you guys don't. But I'll use plywood. After that, I will tackle the tricky iPhone control interface...
If so, can you give some coding examples like this one?
If not, please educate (and forgive me).
thank you
I'm currently enrolled in a high school engineering course and my project is to make my boe-bot navigate through the halls and come back into the classroom. My boe-bot has two IR transmitters/sensors on it. My problem is that when it gets out of my classroom and into the halls the IR sensors work perfectly but it doesn't navigate its way back to the classroom it simple avoids crashing into objects. Would making it move a certain distance and stop when it senses something solve my problem? What suggestions do you guys have??
Do you use the PropBOE or the BS2 BOE? I would recommend recording the movements the servo motors make in EEPROM or on an SD card (SD card if you're using the PropBOE) and replaying them in reverse order so that your bot retraces it's steps.
I'd suggest a wall-following approach for an out and back path. You'll have to program around doorways and obstacles. Several posts & videos are here. Martin_H has some, here are mine:
http://www.youtube.com/watch?v=kxP7kHXBzf0
http://www.youtube.com/watch?v=glOwN-kRD4U
Bomber, im using the BS2 BOE,
Erco i think using the wall following approach would be best for this situation ill adjust for that and get back to you guys
Thank you.
Following Andy's suggestion of 1# post here is my 2nd attempt for a Boe bot wall maze navigator.
However the program I made is not the best solution for wall maze navigation. This is only a test.
The main reason I posted the video is to show the wall maze!
As I have seen from several videos with boe bots people very often use books, boxes or other thingks in order to crete wall mazes.
My wall maze suggestion is very simple, very stable and eazy to build and it is also offer the ability to build wall mazes in different shapes
Since my last post I had great progress, but i am still having trouble with my boe-bot navigating my school halls and coming back to the classroom it started from. I am using 2 IR sensors and receivers and i am using a wall following approach. The boe-bot now leaves class follows the first wall until it gets to a doorway where I am trying to program it to sense the gap and turn left as to go to the parallel wall. Any suggestion on how to do that?
My current program has a loop within a loop that is meant to do so, the loop within programs the boe-boe to turn left when the right IR receiver senses a gap. Now it senses the gap turns left but since it is within a loop it goes back to the top of the program and turns left again. What do you suggest in such a situation?
-Tommy
Can someone please tell me how to fix the loop within the loop as to make it only do it once, i mean i only want the IR sensor to sense the gap turn left and sense the opposite wall.
Here is my program:
DO
FREQOUT 8, 1, 38500 ' Store IR detection values in
irDetectLeft = IN9 ' bit variables.
FREQOUT 2, 1, 38500
irDetectRight = IN0
IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN
GOSUB Turn_Left
ELSEIF (irDetectLeft = 0) THEN ' Left IR pair detects
GOSUB Turn_Right
ELSEIF (irDetectRight = 0) THEN
GOSUB Turn_Left
GOSUB Forward_Pulse1
GOSUB Turn_Right
GOSUB Forward_Pulse
ELSEIF (irDetectRight = 1) THEN
GOSUB Turn_left
DO
GOSUB Foraward_Pulse2
LOOP UNTIL (irDetectLeft = 1)
ELSE
GOSUB Forward_Pulse
ENDIF ' and check again
LOOP
'
[ Subroutines ]
Forward_Pulse: ' Send a single forward pulse.
PULSOUT 15,850
PULSOUT 14,650
PAUSE 20
RETURN
Turn_Left: ' Left turn, about 45-degrees.
FOR pulseCount = 0 TO 20
PULSOUT 15, 750
PULSOUT 14, 650
PAUSE 20
NEXT
RETURN
Turn_Right:
FOR pulseCount = 0 TO 20 ' Right turn, about 45-degrees.
PULSOUT 15, 850
PULSOUT 14, 750
PAUSE 20
NEXT
RETURN
Back_Up: ' Back up.
FOR pulseCount = 0 TO 40
PULSOUT 15, 650
PULSOUT 14, 850
PAUSE 20
NEXT
RETURN
Forward_Pulse1: 'moves forward for a short time
FOR pulseCount = 0 TO 80
PULSOUT 15, 850
PULSOUT 14, 650
PAUSE 20
NEXT
RETURN
Foraward_Pulse2:
FOR pulsecount = 0 TO 300
PULSOUT 15, 850
PULSOUT 14, 650
PAUSE 20
NEXT
RETURN
How do I write a command that stops after a certain time, i want to my boe-bot to turn right if it senses a gap for 5 seconds but all the commands I tried did not work.
Thank you
How do I write a command that stops after a certain time, i want to my boe-bot to turn right if it senses a gap for 5 seconds but all the commands I tried did not work.
Thank you
For instance, my simple little routine here is too erratic to do what you want: http://www.youtube.com/watch?v=kxP7kHXBzf0
Motion needs to be very smooth and always parallel to the wall, so that once a doorway appears, you are headed reasonably straight across to pick up the other side.
Could you give me a better quality of the 5 ir schematic/photo above?
Thanks, Demetri