How Does an Electric Unicycle Work?

Inmotion V14 Adventure

An electric unicycle (EUC) is a remarkable form of personal vehicle. Considered one of the most efficient forms of transportation in terms of overall energy requirements and carbon emissions, capable of handling most terrains, yet quiet and convenient for carrying (or at least wheeling) around.

Although the side-to-side balance must be managed by the rider, similarly to riding a bicycle, the forward-and-back balance is completely handled by the EUC motor. The motor adjusts its speed to keep itself under the rider, allowing the rider to control speed by making small forward and back tilt adjustments to the wheel.

Measuring the Tilt of an EUC

For self-balancing the EUC uses sensors to determine the tilt angle of the EUC so when tilted forward it increases speed of the wheel to accelerate, and when tilted backward it decreases speed to brake, or even move in the reverse direction.

An accelerometer measures (linear) acceleration (change in velocity in one direction). Typically three perpendicular accelerometers are combined so acceleration can be measured along all three axes. A key use for many accelerometers is to determine the downward direction – as Earth’s gravity exerts a strong downward force on any mass a three-axis accelerometer can measure tilt of an object relative to the downward direction.

However, accelerometers use internal mechanical components which give imprecise results, and EUC are usually moving around and changing speed. When the EUC accelerates or decelerates by being tilted the rotation of the EUC results in a centripetal acceleration on the accelerometer, and rotating the accelerometer also causes an apparent acceleration as the gravitational force will change across the three axes. This makes it difficult for a three-axis accelerometer to itself accurately measure tilt.

A gyroscope instead measures angular velocity, the rate at which an object is rotating. Gyroscopes can measure the rotation causing a change in tilt, and a microcontroller within an Inertial Measurement Unit (IMU) can combine accelerometer and gyroscope readings to quite accurately determine tilt (and other parameters) in real-time, even while accelerating, braking, and turning.

See a video explaining accelerometers and gyroscopes in more detail.

Balance Control Algorithm

There are many choices of control algorithm for deciding how the EUC motor should react to the measured tilt of an EUC. The basic PID algorithm is widely used in self-balancing robots to determines how a wheel should spin to counter the tilt, preventing the robot from falling over, and has three main components:

  • Proportional: the greater the tilt the faster the wheel is made to spin.
  • Integral: the longer the tilt occurs the faster the wheel is made to spin.
  • Derivative: the faster the tilt is changing the faster the wheel is made to spin.

EUC balancing is similar to an inverted pendulum, a pendulum whose centre of mass is above its pivot point, such as balancing a stick on a finger. A little testing shows it is easier to prevent a taller stick from falling than a shorter stick, so perhaps counter-intuitively it is easier for an EUC to maintain balance for an upright rider (ideally affixed to the EUC with pads) than a crouching or seated rider, provided the motor has adequate torque available.

In addition to the basic control algorithm to keep the EUC balanced there are various settings to configure the algorithm, typically changed via a mobile app. For instance hard mode versus soft mode pedal settings configure how quickly the EUC should respond to a tilt (affecting how sensitive the pedals are), and whether or how quickly the pedals should return to horizontal (allowing less bend at the ankle during acceleration). These configurations are often bundled together into ride modes, such as commuter versus off-road which can be switched while riding. This allows for a comfortable and plush riding experience on pavement, but also a more aggressive response while on trails, where the EUC should be more responsive and not dip forward when it encounters a bump.

See a video discussion some common EUC ride settings.

There are other settings used for safety, including how close the motor should be allowed to be pushed to its limits before tilt back and audio alarms are triggered to warn the rider. Another is the sideway angle tilt that should trigger the motor to cut out – when an EUC has fallen on its side the motor must stop spinning, but when riding aggressively on a steeply banked berm the cutoff angle needs to be set higher. Also settings might be configured for assisting jumps as by default the EUC would free spin making landing tricky if the wheel were to start spinning too fast while in the air.

BLDC Motor

An EUC uses a brushless direct current (BLDC) motor, where a DC voltage is supplied by a battery mounted either atop the wheel (for small batteries) or split into packs either side of the wheel. Most DC motors have a stator (stationary components) with electric conductive windings that generate a magnetic field, and a rotor (rotating components) with permanent magnets that get attracted or repelled by the magnetic field generated by the stator causing it to rotate. The stator has at least three sets of windings, each of which can be provided current in either direction via a Metal Oxide Semiconductor Field-Effect Transistor (MOSFET). A MOSFET regulates the flow of current through a winding – the faster they trigger one after another the faster the rotor will turn. By alternating which windings are generating a magnetic field in each direction at the right timing the rotor can be made to smoothly rotate and have its speed controlled.

In runner DC motors have the stator arranged in a cylindrical shape with the rotor within it, and the rotor attached to an axle to turn a wheel, along with two bearings around the axle to let it freely rotate within the fixed outer casing. In a hub motor for an EUC these positions are swapped to be an out runner motor: the stator is mounted on a fixed axle (and the power cables are fed either through the axle or affixed alongside) and is surrounded by the rotor, with the rotor directly attached to the wheel rim. This means the outer casing holding the rotor in position around the stator must also rotate, and the bearings are to allow the outer casing and rotor to rotate around the fixed axle. Out runner motors have lower top speed than in runner motors but provide much more torque, important when the EUC must keep a rider upright.

Inmotion V14 Motor Side View
Inmotion V14 side view of motor
Inmotion V14 Motor Exploded View
Inmotion V14 motor with left outer casing, wheel rim, rotor magnets attached to rim, stator with copper windings, right outer casing, bearing

See a video with detail on BLDC motors.

The optimum coil lengths and magnet sizes are a compromise between maximum speed, how efficient the motor operates at high versus low speed, and how much torque it can deliver. As a result often EUC models such as the Inmotion V12 offer high-speed motor (more efficient at higher speeds and higher top speed) and high-torque motor (more efficient at lower speeds and with higher torque) options.

KingSong S22 Motor Internals
KingSong S22 motor disassembled with stator on left and rotor with magnets in rim on right
Inmotion V13 Stator
Inmotion V13 stator showing the copper windings and Hall-effect sensors mounted at top right, and three stator winding cables from the hollow core axle

Electronic Speed Controllers

The control of the MOSFETs is handled by a microprocessor mounted on a motor controller board commonly called an Electronic Speed Controller (ESC). MOSFETs work at the battery voltage and and pass very high currents, over 80 Amp on larger models (compare to household circuit breakers typically between 15-30 Amp). With such high currents they generate quite a lot of heat, so usually the ESC is mounted to a thermal plate to help dissipate the heat before it damages components. At higher voltages they might also include a fuse to prevent excessive currently drawn from or returned to the battery (or might trust the MOSFET to burn out at extreme currents to avoid damaging the battery). With the MOSFET quickly switching on and off large voltage spikes can result from the battery (multiple times about its rated voltage), so the ESC also includes large capacitors to smooth out the voltage spikes.

Inmotion V14 Raptor Controller
The Inmotion V14 Raptor Controller with 42 MOSFET (black) on the base, 18 capacitors (green), and posts for the three stator winding cables
KingSong F22 Pro Main Board
The KingSong F22 Pro Main Board with 8 capacitors (black/white), 30 MOSFET (not shown), and posts for the three stator winding cables

The ESC needs to precisely know the position of the rotor so that it can activate the MOSFETs at exactly the right times to keep the rotor turning smoothly. Small hobby motors measure this by noting when the rotor magnets are passing a non-charged winding – as it passes the magnet induces a current in the winding resulting in a measurable voltage – called back EMF. This back EMF can be detected and the ESC can predict when the magnet will pass the next winding to help it estimate when to next activate the MOSFET for the adjacent winding.

See a video explaining ESCs or the first half of this video for RC vehicles.

However, using back EMF to measure rotor position is not accurate at low speeds, so to ensure smooth EUC riding at low speeds most motors incorporate dedicated sensors. A Hall-effect sensor measures the variation in a magnetic field, being able to determine how close a magnet (such as the magnets in a rotor) is to the sensor.

See a video explaining Hall-effect sensors.

When a Hall-effect sensor is placed on the stator close to the rotor it gives real-time feedback on the precise position of the rotor so the correct winding is activated. As they are non-contact they are generally very reliable, although care is required when working inside a motor to not damage them nor their fine cables.

See a video showing an EUC motor and its Hall-effect sensors.

As the rotor (and wheel) speed increases the back-EMF increases linearly, essentially fighting the rotation, requiring the ESC to provide more voltage to maintain the same torque. As the maximum voltage is restricted by the battery (and gets lower as the battery charge gets depleted) the motor eventually cannot maintain the same toque as it spins faster and becomes limited at its rated speed. More advanced ESC can be configured to allow field weakening. Field weakening alters the timing of the winding currents at high speeds to reduce the back EMF, allowing a higher top speed from the motor and more efficient operation but further sacrificing the torque available. This relies on the presumption that very little torque is required at high speed, so it becomes essential to not suddenly accelerate nor brake while at high speed nor hit a small bump.

Field Weakening Torque Versus Speed

See a video for a more technical explanation of field weakening.