Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Maze solver not working

I built a maze as per Pololu - 4. Building the Line Maze Course with 3inch spacing.

I modified the thickness to 0.6 from 0.75 in zumo-shield/MazeSolver.ino at master · pololu/zumo-shield · GitHub as my tape thickness is 0.6 inches. But, the behavior of my zumo is as shown in attached video. Any suggestions on how to resolve this?

Hello, tnkumar.

Can you clarify if that video is showing the first time the Zumo runs the maze after being powered on? With the unmodified maze solving example, the Zumo should take any left turns it finds during the first run and simplify it during subsequent runs to go straight to the end. So, it would be helpful to know which portion of the code that video is showing. If it is not showing the first run of the maze, can you also post a video showing that?

Also, could you show the full maze, so we can see where the maze is supposed to finish?


It is showing the learning phase. The maze is the exact same as in the pololu document

I am also wondering why it did not take the left turn. Let me reset the system tomorrow and test again.

But from a software change, the only change I made to the sketch was to change from 0.75 to 0.6

Here are videos starting from 3 different starting points. Suggestions?

I also tried with speed reduced to 150 from the default 200 and it is still not able to reach the destination during the learning phase

The impression I am getting is that the zumo thinks it has reached the destination.
Sometimes, the zumo is stopping when it is not perpendicular to the line it reaches

@BrandonM @Pololu team. Any suggestions on parameters I can tweak to get this working?

I am not sure why it passed the left turn in your first video, but from your updated videos, it definitely looks like it is finding a false finish.

The Zumo maze solving program works by following the line until it senses a turn or intersection. Then, it reads the line sensors, moves the Zumo forward a little bit, and reads the sensors again to compare the readings. Comparing the readings determines whether the line continues forward and also if the endpoint is found. To me, it looks like your robot is not quite moving far enough forward to clear the line before taking the new readings.

The distance it moves before taking a new reading is determined by the line_thickness, SPEED, and INCHES_TO_ZUNITS parameters. The INCHES_TO_ZUNITS parameter was determined experimentally and found using 75:1 HP motors with partially drained batteries, so it could be too low if you are using a different gear ratio or your batteries are too drained. I would recommend trying again with fresh or fully-charged batteries first, and then if that doesn’t work, could you try setting the line_thickness back to 0.75 and see if you get any better results? (You could also try increasing the INCHES_TO_ZUNITS value instead, but I suggest trying the default values first.)


1 Like

@BrandonM - Makes sense. Let me check the things you have suggested. Appreciate the feedback and suggestions.

I have a 75:1 motor

Thanks @BrandonM - The issue has been resolved by using fully charged batteries and adjusting line_thickness to 0.85 and SPEED to 150.

1 Like

I am glad you got it working; thank you for letting us know!