Max speed at maze solving

My thinking is that we increase “reliability” of maze following by lowering its speed. Because it can miss the intersection , am i right?

And is the max speed dependent upon thickness of line ?

what max speed u tried on it ?


In general, tasks like line-following and maze-solving become easier the more slowly you move because there is less chance of losing the line, missing an intersection, skidding on a turn, etc. The faster you go, the better your code needs to be to ensure reliable performance. For this reason, I recommend a conservative, low-speed strategy while exploring and learning the maze since going quickly here doesn’t have much benefit and greatly increases the chances that something will go wrong and you won’t finish. In the 3pi maze-solving video, I believe the motors are running at a maximum speed of 150 out of 255. I recommend something slower, like 100, if you really want to be safe.

You can afford to be more aggressive during the solution runs if your code is clever because you know what turns are coming next and can prepare for them adequately. My speed was limited by overshooting intersections or skidding on turns and failing to recover. My solution was to not only learn the path from start to finish but also the length of each segment of that path. This allowed me to drive at maximum speed (255 of 255) for the first 80% or so of the longer paths and slow down to a more conservative speed for the final 20% so as to be in better control by the time I reached the next turn. You can see the 3pi slowing down before the turns in the video. Getting the timing right was mostly a matter of trial and error. I think this modification made the most significant impact on performance. You can find more information about this in the improving the maze-solving code section of the 3pi user’s guide.

The code running on the robot in the video is something I came up with from scratch the night before a competition and represents my first attempt at making a maze-solver, so I would not be surprised if you can match or exceed it with a little work, especially given our sample program as a starting point. Once you have the basic algorithm, the rest is a lot of tuning tweaking while repeatedly running it on a sample course coupled with some clever additions like timing the path lengths so you can better predict what’s coming next and when, making the turns smoother, etc. Note that the faster you drive, the less time your sensors will spend over the intersections, so you might have to adjust your intersection-detecting code accordingly to make sure it continues to work reliably (this became an issue for me as I increased my speed).

Ultimately, I reached a point where the traction of the tires became an issue that affected the reliability of my performance. My 3pi would perform well while the tires were clean, but it would start to fishtail as the tires picked up dust from the course, which would sometimes cause it to mess up on the turns. You can see the fishtailing in the video because I hadn’t cleaned the tires in several runs. One part of the solution was to slow down before the turns, and the other part was to keep the tires clean. In the competitions, I made sure to clean the tires with rubbing alcohol before every run.

- Ben

thanks for great tip

my course will be 7 feet by 7 feet and line will be spaced 6 inches apart, with 6 inches as border. so i dont think there will be long straight lines. what your suggestion for this course , and it will be surprise so i cannot build it at home.

I got tiles on my floor and i think that makes tunning robot difficult, because my last robot have poorer time on home made course ( which was declared with dimension previously ) then actual course which was on wood. also at home it didnt take 90 and at competition it was okey. do you think it is the problem of my flooring or tires
i will post pic of my robot

one more thing

in your maze solving complex code video i got some question

what was line spacing ?
what was speed of robot for finding phase ?
what was turning time and speed ?

i know your code is complex but cant you share with me ? please email me or pm for email id( i dont know that you can see my mail id or not )
if it is your trade secret just say it. i wont bother you
i just want it to know how to decide to speed up bot on long track. i have read the resources but want to see in program form

7’x7’ is plenty large and will have a lot of room for straight segments. The maze in the video is 8’x8’ with a 6" spacing. I’m not suggesting you build the actual course to test your robot on, I’m suggesting you build your own maze that has the same line thickness, grid spacing, and surface material if possible. Your goal is to design a robot that can reliably traverse any maze that has these attributes.

I think a tile floor could definitely cause problems. You should try to tune your robot on a surface that is as close to the competion surface as possible. Robot behavior can be highly dependent on surface texture, so tuning your robot to perform as well as possible on tiles could result in a robot that performs very poorly on other surfaces.

I say the motor speed used in the video (and I wrote it in my above post): 150 out of 255 for the exploring phase (slowing down some as I cross intersections).

I don’t remember the parameters used for the turns, but they’re not very important. I figured them out in a few minutes using trial and error. Just set your robot down and try turning the motors in opposite directions at some speed for some duration and tweak the parameters until the robot turns 90 degrees. You can do the same kind of thing to find parameters for smooth turns. You really should try some of this for yourself!

I am not willing to share my code. Even I have trouble understanding how it works when I look back at it (because it was written in such a rush). Writing your own program following the suggestions I’ve given you would be easier than trying to understand mine.

- Ben