Stanley H.I. Lio‎ > ‎

ENG1000 Final Competition

The Project

I built a "squarebot" using the VEX kit to compete in the challenge held at the end of an undergraduate engineering course. Each team builds a bot that runs on a known track autonomously. The one that travels the most laps in a fixed amount of time wins. Every team gets the same set of used kit *1, so the key to win is the software. Our team placed first in the final competition. The bot performed so well that the prof had to change the grading scheme to raise everyone else's grade.

The track in 2010

A simple differential drive with one motor on each side. Well-understood, reliable, and easy to build.

A VEX "squarebot"

The core of the challenge is just wall-following. There's no turn decisions to be made as it's not a maze. The simplest solution to the wall-following problem is just to lean to the opposite side when the bot drifts.

The track is narrow, so before making a turn, the bot needs to be at the center of the lane to clear a corner or it may hit the wall during the turn. With the primitive method, the bot wobbles along the center of the lane as it travels down the lane so there is no guarantee that it will be at the center of the lane when it reaches the end of a straight section.

The Champion - showing its ultrasonic sensor mounted on a servo motor

Position, and its Time Derivatives

After staring at it for a few laps, I got an idea: in addition to centering the bot on the lane, also align its heading to the direction of the lane. Heading can be inferred from consecutive readings from the distance sensor mounted on the side. For example, if the distance to the left wall is decreasing, it is leaning to the left and thus should adjust its heading to the right before proceeding. With this modification, the bot quickly settles along the center of the lane after every turn - the system is stable and converges quickly.

The effectiveness of that simple modification amazes me even to this day, but I only recognized the solution several years later: it was just a PD-controller.

*1: passed down from previous generations of students with broken connectors, bent wheel shafts, worn-out rechargeable batteries and mismatched motors - typical of any shared resource.