Teenagers know what is “cool”. And this week I have two teenage votes in the cool column for the PID control algorithm on the Segway Human Transporter. Well…almost! This week, I took a family vacation to California. It was great to get away from the cold, wind, and snow of Pennsylvania. My two teenage sons and I decided to take a Segway tour of San Francisco, with San Francisco Segway Tours.
If you haven’t seen one, a Segway is a two-wheeled scooter-like device that somehow manages to stand upright, go forward and reverse, and turn tight zero-radius circles. You can find pictures and product info on http://www.segway.com/
After a short training session, we followed our tour guide for a 2+ hour tour of San Francisco. We went up and down hills, through North Beach, past many San Francisco landmarks, and finally out onto the piers near San Francisco Bay. At a top speed of about 10 miles per hour, it was a lot more efficient and less tiring than walking. It was a sunny day, and the sight-seeing was great. But that’s not the best of it…
The controls are actually the cool part. The Segway has mini gyroscope-like devices to measure the angles and the angular momentum of the Segway (and its passenger). The controller moves the two wheels to keep you upright. When you first step up onto the platform, and it feels for a second like you will thrown off. This is because your own system is fighting the Segway to keep you upright. Just relax, and in 5 seconds, you are standing upright, balanced by the machine.
Lean slightly forward, and the machine glides forward. Shift back toward your heels, and it stops. Even though you are only on two wheels, you remain perfectly upright. The angle is being controlled by a PID algorithm, execution 100 times per second, making minute adjustments to the two motors.
There is great article on the Segway available on How Stuff Works. Check it out if you want more details.
In just a few minutes of riding time, the Segway seems completely natural. You don’t even have to think about starting and stopping. You body adapts to the weight shifts pretty easily. In a couple of hours, we covered most of downtown San Francisco, including Lombard Street (not the steep part!), Coit Tower, North Beach, Fisherman’s Wharf, and Ghirardelli Square.
As we finished our trip, zooming around a concrete pier that juts into San Francisco Bay, I couldn’t resist being the “nerdy dad”. I had to explain to my sons how this contraption works. Believe it or not, they actually thought that PID was “cool”!