How does a Segway maintain its balance and move on its own?

In this blog post, we’ll explore why a Segway—which runs on an electric motor and battery—can move without falling over, covering everything from its features to its inverted pendulum control mechanism, balance control using gyro sensors and a CPU, and the principles behind the equations of motion and control gains.

 

The Segway is a single-rider, stand-up vehicle developed long ago by American inventor Dean Kamen. It is powered by a rechargeable battery and an electric motor; at the time, the Segway’s average speed was 13 km/h, and its top speed reached 19 km/h. Since 20 km/h is equivalent to covering 100 meters in 18 seconds, if you compare it to your own running time, you’ll realize it can travel at a fairly fast pace. Because it runs on electricity, the Segway has long been hailed as a futuristic, eco-friendly vehicle, but it’s also true that it seemed it would take time for it to become mainstream due to its high cost. The Segway’s unique control method is also one of the main reasons it has garnered attention. You can move forward and backward simply by leaning your body forward or backward while riding, and you can turn by rotating the handlebars. Compared to how humans walk—by leaning forward or shifting their center of gravity—this control method can be considered highly intuitive. People seeing a Segway for the first time often wonder, “That’s amazing. How can it move like that without falling over?” Living within Earth’s gravitational field, we know instinctively or from experience that tilted objects fall over. Yet the Segway does not fall over even when you lean forward or lean back. Moreover, it actually moves while in that position. How is this possible?
The Segway’s operating principle is that it maintains its own balance. Every vehicle designed to move requires an acceleration device, such as an accelerator, and a deceleration device, such as a brake. However, the Segway was not originally designed to move, but rather to maintain balance. Movement is merely a byproduct of maintaining balance. When the user shifts their body forward or backward, disrupting their balance, the Segway automatically moves in the direction of the tilt to regain balance. By adjusting this degree of tilt, we can move as far and as fast as we want. That’s why the Segway doesn’t need separate acceleration or deceleration devices. All propulsion is achieved simply by maintaining balance and intentionally disrupting it. This balancing mechanism used in the Segway is called the “inverted pendulum control mechanism.” An inverted pendulum is a configuration in which a standard pendulum—such as a clock’s pendulum—is flipped 180 degrees; it is an unstable model that drops rapidly in the direction toward which its weight shifts. The mechanism that controls this unstable model to keep the inverted pendulum upright is called the inverted pendulum control mechanism.
The principle of inverted pendulum control can be understood through a simple mental experiment. Imagine balancing a 1-meter-long rod on the tip of your finger. To keep the rod from falling over, you’ll have to move your hand back and forth. If the pole starts to fall forward, you’d reach your hand forward to regain balance; if it starts to fall backward, you’d pull your hand back to regain balance. If the pole continues to tilt forward, you’d have to keep running forward to prevent it from falling. We were simply trying to balance the pole, but that action caused us to move. This is the core principle of inverted pendulum control, and in this mental exercise, we’ve essentially become a Segway ourselves. In this analogy between a person and an inverted pendulum, the pole represents the body and the rider, while the hands represent the Segway’s wheels. Furthermore, the eyes that detect the pole’s tilt are the gyro sensors, and the brain that calculates how much to move is the CPU. Gyro sensors measure the degree of tilt and convert it into numerical data; they are so widely used that they are even built into smartphones.
The principle behind inverted pendulum control is that simple. It boils down to this: “When it tilts, it moves to regain balance.” However, the method of controlling an inverted pendulum is not that simple. The CPU, which acts as our brain, is a device that only executes the commands it is given. When controlling an inverted pendulum with our hand, our brain doesn’t issue commands like, “Since it’s tilted 30° forward, extend your hand forward at a speed of 1 m/s.” We control it using what is commonly called “instinct.” But a CPU has no instinct. Therefore, to control such an inverted pendulum, we must establish a precise command system based on accurate information. In other words, we need a mathematical relationship that uses the angle measured by a gyro sensor to calculate the velocity required for attitude control. This is where what experts refer to as “equations of motion” and “control gain selection” come into play.
Equations of motion are equations that describe the state of motion of an object or changes in that state. The most famous and simplest example of an equation of motion is Newton’s Second Law (F=ma). It states that when a certain force is applied, a certain amount of acceleration occurs depending on the mass; in other words, it is an equation of motion that describes the state and changes in an object’s motion. Generally, equations of motion are expressed as differential equations; however, in the case of an inverted pendulum, Newton’s equations of motion alone have limitations, so a higher-order Lagrangian method must be used to derive the equations of motion. The Lagrangian method is a type of equation transformation technique that converts expressions for potential and kinetic energy into force relationships through differentiation; since the calculations are much simpler than those using Newton’s method, it is the most commonly used method for deriving the equation of motion. The equation of motion for an inverted pendulum, which has angles (angle, angular velocity, angular acceleration) and velocities (displacement, velocity, acceleration) as variables, is simply a formalization of the inverted pendulum itself—a natural object that will topple over if tilted even slightly. Now, to control this, we must set what is called a “control gain.” A control gain is a type of weight that induces changes in one variable by assigning a weight to it, thereby causing changes in other variables. If a specific weight is assigned to the angle measured by the gyro sensor, velocity is generated as a result of the equation of motion. For example, consider the equation y = 5 – x: when x is 5, y is 0, and when x is 3, y is 2. The role of the control gain is to take the input—which was originally 5—and change it to 3, thereby altering the value of the resulting output. In an inverted pendulum control system, the input is the angle of the inverted pendulum, and the output is its velocity.
Determining the value of this control gain is up to the designer. Some designers may want a system that regains balance immediately even with a slight tilt, while others may prefer a system that sways like a metronome but never actually falls over. There is no single, fixed answer for this control gain. The system’s response simply varies depending on the value of the control gain. Therefore, by using a program to input various control gain values and calculating the corresponding system responses one by one, the designer selects the control gain value that produces the desired response. When these equations of motion and the selected control gain are loaded into the CPU, the inverted pendulum is able to maintain its balance and stand upright. As mentioned earlier, this balanced body alone constitutes the simplest form of a Segway model. However, despite having been developed quite some time ago, the Segway—with its simple operating principle—still carries the label of a “next-generation futuristic vehicle.” Factors that hindered its widespread adoption included its high price—13 million won at the time—its relatively slow speed for a vehicle, and its poor battery capacity, which allowed it to travel only up to 25 km on a single charge. Although the Segway is sometimes called a failure for these reasons, its creative concept—which broke away from conventional drive systems and principles—will remain a major milestone in the history of human transportation.

 

About the author

Cam Tien

I love things that are gentle and cute. I love dogs, cats, and flowers because they make me happy. I also enjoy eating and traveling to discover new things. Besides that, I like to lie back, take in the scenery, and relax to enjoy life.