I built a "squarebot" using the VEX kit provided by the school to compete in the competition held at the end of an 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 only the software - assuming you don't do anything "radical" in the hardware.
I used a simple differential drive design with two motors, each driving two wheels. Reliable, well-tested, simplest to build.
The gist of the challenge is just wall-following. To make things simpler, there's no turn decisions to be made as it's not a maze.
The simplest solution to the wall-following problem is just
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 else it may get caught by the walls. With the primitive algorithm, the bot wobbles along the center of the lane as it travels down the lane and there is no guarantee that it will be at the center of the lane when it reaches the end of a straight section. The system is not stable.
After staring at it for a few laps, I had this idea that stopped the drunk walk and won the 1st place: 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. Price paid for not learning enough theory.
Our team placed first in the final competition. The prof had to change the grading scheme because our bot vastly outperforms even the runner-up.
The difference in engineering programs matters a lot. When I was doing the course, emphasis was placed on project management and design methodologies (draw CAD before building, making project timeline and budget, leave no time for iterative development). Management might be important for real-world projects, but I am more interested in the technical side of things - control theory, embedded systems, programming. The experience would have been much more meaningful had we studied LTI system theory before the course.
*1: passed down from previous generations of students with loose connectors, bent wheel shafts, worn out rechargeable batteries and mismatched motors - typical of any shared resource in schools.
Stanley Lio >