This is a toy for learning control theory. You can start learning control theory right now. No formal training required.
The inverted pendulum is sort of the "hello world" of control theory. Students often study and build one in grad school. The Exploratorium in San Francisco used to have a balancing pendulum at its entrance.
You can try balancing it right now using the left/right arrows on your keyboard (it is much easier if you slow it down). You can also program your computer to balance it on its own.
The inputs to the JavaScript on the right are position, velocity, angle (in degrees), and angular velocity. Try running it now!
People use control theory to teach robots how to move. They use it to prevent buildings from collapsing during an earthquake. They use it to harvest energy from the wind, and to make airplanes fly smoothly during a long flight.
People who distribute electricity to the grid also use control theory to make sure our lights and refrigerators stay working all the time, not to mention our hospitals and airports.
Control theory underpins a lot of the systems we take for granted. By building toy models yourself, you can get a taste of how these systems work, while appreciating their complexity.
The traditional route of learning control theory involves perhaps 2+ semesters of math after high school calculus, ending in control theory itself and / or closely related fields, like signal processing. All of this happens before the student gets to actually use control theory in a real system.
While this formal training is probably necessary for working in a professional setting, I think it is too long for someone who just wants a feel for control theory, perhaps to decide if they want to pursue it further.
The toy model above provides just this feeling, without the mathematics curriculum. There are already plenty of free resources online for that.
Most of us have the experience of learning something formally versus in a project-based setting. These two types of learning feel very different, and the hands-on approach is often more engaging and memorable for the learner, not to mention practical.
What if a child could learn control theory, without any of the formal training that is traditionally required? You may think it is impossible for a child to understand something that most people wait until graduate school to start learning. But, I believe this is an unnecessary delay. There are many deep and significant lessons a child can learn from playing around with a system like the one shown above.
You can build "advanced" mathematical concepts in your mind without writing down equations with pen and paper (although this can help). This is exactly what Seymour Papert did with the LOGO programming language, which is a programming language plus philosophy that introduced children to abstract geometry without any formal training.
This playground takes its inspiration from the work of Seymour Papert and his book Mindstorms (1980), which introduced the idea of "learning without curriculum" to a wider audience, as well as the role of computers in the future of education.
Papert's influence on programming is hard to overstate. Ask any programmer who grew up on LOGO, and they will likely tell you about the wonder and excitement they felt exploring the world of "turtle graphics," and how it shaped their perspective on computing even to today. The popular Scratch programming language was heavily influenced by LOGO.
The "microworld" that LOGO created for elementary school children allowed them to explore mathematics in sort of "mathland," similar to the way someone might learn French by simply living in France: you learn the language to make use of it in everyday life, not just to pass a test.
In Papert's mathland, children learn math in order to create pictures, play games, or just explore what is possible. Each child brings a special intention to programming, not a set of requirements handed-down by a standardized curriculum. The role of the teacher is primarily that of mentorship, encouraging positive work habits like of breaking down problems into smaller chunks, comparing new problems to previous solutions, and creating useful abstractions. These skills apply to any type of engineering, extending well beyond the context of programming.
In the spirit of mathland, the toy model above provides a first step into "control theory land," where you can encounter powerful ideas like PID controllers, Kalman filters, and stability criteria completely by accident, without being taught them. If that isn't cool, I don't know what is.
Please enjoy!
~ Rex