EV3 Parade Control

Click to enlarge.

To keep all of the monkeys, pirates, Santas, and other characters riding in the zig-zag, stop-go robot parade from getting nauseous, let's improve their control loops to provide a smoother ride.  The reason that the robots drive that way is that their EV3 code uses something called bang-bang control, where the robot’s only choices are to stop or go, steer hard left or hard right.

With only a few extra EV3 blocks we can do much better, by switching to a method called proportional control. A robot using proportional control can steer smoothly and match its speed to the speed of the robot in front, slowing down or speeding up to maintain a set following distance. In addition to avoiding nausea, smooth driving requires much less energy—all that stop and go zig-zagging is just wasted motion.

Here is the Gizmo Garden EV3 parade program. You'll find some comments inside, with more complete descriptions coming.