<figure><img src="image_1.png" /></figure>

HAL
open science

Modeling and control of an hoverboard

Luc Jaulin

► To cite this version:

Luc Jaulin. Modeling and control of an hoverboard. 2025. hal-04953210

HAL Id: hal-04953210

https://hal.science/hal-04953210v1

Preprint submitted on 18 Feb 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

Public Domain
# Modeling and control of an hoverboard

Luc Jaulin

February 17, 2025

## Abstract

In this paper, we explain how to control an hoverboard in a two dimensional world. This means that the hoverboard can only move forward and backward on a line. An extension to a three dimensional hoverboard with a heading control is not treated here. Our planar hoverboard has only one actuator (a motor in the axle) and one inertial unit (for the acceleration and the gyrometer). Since the hoverboard has no idea of the position, the weight, and the size of the human rider, a model free approach is considered.

## 1 Introduction

The hoverboard represented on the left side of Figure 1 is a vehicle with two wheels and a single axle. This vehicle is stable since it is controlled by a micro-controller inside the board. In the modeling step, we have to assume that the engine is not controlled. Its open loop behavior is very close to that of the planar unicycle represented in Figure 1, right. In this figure, $u$ represents the exerted momentum between the board (red) and the wheel. The angle $\beta$ (called *talocrural*) between the body (blue) and the board is assumed to be constant. This angle $\beta$ is supposed to be controlled by the human rider.

<figure><img src="image_2.png" /><figcaption>Figure 1: Hoverboard</figcaption></figure>

The way the rider controls the hoverboard is illustrated by Figure 2. By tilting the board with respect to its own body with his feet, the rider can control indirectly the speed. Note that the rider does control its pitch $\theta$ or equivalently, the rider do not decide if he wants to bend forward or backward. The rider can only control the talocrural angle $\beta$ between its body and its feet.
<figure><img src="image_3.png" /><figcaption>Figure 2: The rider (blue) controls the hoverboard only through the angle $\beta$</figcaption></figure>

In Figure 3, we have the same situation as for Figure 2. But we replaced the rider by a box with different offsets. If the box is centered with respect to the board, then $\beta = 0$. From the point of view of the hoverboard, the two situations (human or box) are similar. In Figure 2 the angle $\beta$ is constant if the rider do not move his feet with respect to his body. In Figure 3 the angle $\beta$ is always constant.

<figure><img src="image_4.png" /><figcaption>Figure 3: A box (blue) lies on the board (red) with an offset which generates the talocrural angle $\beta$</figcaption></figure>

As explained in the hoverboard manual or in some tutorials (see e.g., https://youtu.be/fDzTkS_3g8), the principle of the hoverboard is the following. If the hoverboard has a tilt angle $\delta = \theta + \beta$ positive, then the wheels turn forward, if $\delta < 0$, then the wheels turn backward. It is not clear if such a simple strategy will be sufficient to keep the rider standing. Moreover, we need to understand how $\delta$ can be estimated from the inertial unit which is only able to measure the accelerations and the rotation speed.

This paper is organized as follows. Section 2 proposes a model that will be used for the simulation and for proving the stability only. This model will not be known by the controller presented in Section 3. The controller can thus be qualified as *model-free* [2]. Section 4 provides an observer for the tilt of the board. This observer is purely inertial and does not use the model of the hoverboard. Section 5 gives a simulation to illustrate the stability of the controller. Section 6 concludes the paper.
## 2 Model

Modeling an hoverboard can be done using a Lagrangian approach [4][3]. Here, we propose to use a Newton-Euler approach, as for the Segway [1].

Denote by **b** the center of gravity of the rider and by **a** is the wheel's center. Take one point **c** on the wheel. Let us denote by **s** the angle between the vector $\vec{ac}$ and the horizontal axis and by **θ** the pitch angle. This system has two degrees of freedom **s** and **θ**. The state of our system is given by the vector **x** = (s, **θ**, v, **ω**)T, where v = $\dot{s}$, **ω** = $\dot{\theta}$. The parameters are:

* for the wheel: its mass **M**, its radius **ρ**, its moment of inertia $J_M = \frac{1}{2}M\rho^2$;

* for the rider: its mass **m**, its moment of inertia supposed to be $J_p = m\ell^2$ where the distance $\ell$ between its center of gravity and the center of the wheel.

In order to find the state equations, we apply the fundamental principle of dynamics on each subsystem, more precisely the wheel and the body. We have:

$$ egin{cases} -r_x + f_x = -M\rho\ddot{s} & \text{(wheel in translation)} \\ f_x\rho + u = \frac{1}{2}M\rho^2\ddot{s} & \text{(wheel in rotation)} \\ r_x\mathbf{i} + r_y\mathbf{j} - mg_0\mathbf{j} = m\ddot{\mathbf{b}} & \text{(body in translation)} \\ r_x\ell\cos\theta + r_y\ell\sin\theta - u = m\ell^2\ddot{\theta} & \text{(body in rotation)} \end{cases} \quad (1) $$

where $f_x, r_x, r_y$ are the reaction forces and $g_0 = 9.81\,\text{ms}^{-2}$ is the gravity. Since

$$ \mathbf{b} = (-\rho s - \ell \sin \theta) \mathbf{i} + (\ell \cos \theta + \rho) \mathbf{j}, \quad (2) $$

we have

$$ \begin{aligned} \dot{\mathbf{b}} &= (-\rho \dot{s} - \ell \dot{\theta} \cos \theta) \mathbf{i} - \ell \dot{\theta} \sin \theta \mathbf{j} \\ \ddot{\mathbf{b}} &= (-\rho \ddot{s} - \ell \ddot{\theta} \cos \theta + \ell \dot{\theta}^2 \sin \theta) \mathbf{i} - (\ell \ddot{\theta} \sin \theta + \ell \dot{\theta}^2 \cos \theta) \mathbf{j} \end{aligned} \quad (3) $$

Thus

$$ \begin{cases} -r_x + f_x = -M\rho\ddot{s} \\ f_x\rho + u = \frac{1}{2}M\rho^2\ddot{s} \\ r_x = m(-\rho\ddot{s} - \ell\dot{\theta}\cos\theta + \ell\dot{\theta}^2\sin\theta) \\ r_y - mg_0 = -m(\ell\ddot{\theta}\sin\theta + \ell\dot{\theta}^2\cos\theta) \\ r_x\ell\cos\theta + r_y\ell\sin\theta - u = m\ell^2\ddot{\theta} \end{cases} \quad (4) $$

Isolating $\ddot{s}$ and $\ddot{\theta}$ and eliminating the internal forces (here $r_x, r_y$ and $f_x$) yields

$$ \left\{ \begin{aligned} \ddot{s} &= \frac{\mu_3 (\mu_2 \dot{\theta}^2 - \mu_g \cos \theta) \sin \theta + (\mu_2 + \mu_3 \cos \theta) u}{\mu_4 + \mu_3^2 \sin^2 \theta} \\ \ddot{\theta} &= \frac{(\mu_1 \mu_g - \mu_3^2 \dot{\theta}^2 \cos \theta) \sin \theta - (\mu_1 + \mu_3 \cos \theta) u}{\mu_4 + \mu_3^2 \sin^2 \theta} \end{aligned} \right. \quad (5) $$

where

$$ \begin{aligned} \mu_1 &= \frac{3}{2} M \rho^2 + m \rho^2 \\ \mu_2 &= 2m\ell^2 \\ \mu_3 &= \rho m \ell \\ \mu_4 &= \rho^2 m \ell^2 (3M + m) \\ \mu_g &= g_0 \ell m \end{aligned} \quad (6) $$
The state equations are thus:

$$ \begin{pmatrix} \dot{s} \\ \dot{\theta} \\ \dot{v} \\ \dot{\omega} \end{pmatrix} = \begin{pmatrix} v \\ \omega \\ \frac{\mu_3(\mu_2\omega^2 - \mu_g \cos\theta)\sin\theta + (\mu_2 + \mu_3 \cos\theta)u}{\mu_4 + \mu_3^2 \sin^2\theta} \\ \frac{(\mu_1\mu_g - \mu_3^2\omega^2 \cos\theta)\sin\theta - (\mu_1 + \mu_3 \cos\theta)u}{\mu_4 + \mu_3^2 \sin^2\theta} \end{pmatrix} \quad (7) $$

All parameters $\mu_1, \mu_2, \mu_3, \mu_4, \mu_g$ are positive.

## 3 Controller

All sensors are inertial (two accelerometers and a gyrometer) and are located at the center of the board, i.e., at the wheel's center. The tilt, i.e., angle of the board, is $\delta = \theta + \beta$. Since there is no external sensors such as a GPS, camera or a pitch sensor to get the angle $\theta$ of the rider, we guess that we have to find a controller which uses the inertial unit only. Assume first that this inertial sensor returns only the tilt $\delta$ (see next section) and its derivative $\omega$. This leads us to the proportional and derivative control given by

$$ u = k_1\delta + k_2\omega. \quad (8) $$

This controller considers $\delta$ as an error that has to be canceled. Equivalently, the controller tries to maintain the board flat.

**Proposition 1.** If $k_1$ is large enough and if $k_2 > 0$ the controller (8) stabilizes the pitch $\theta$.

*Proof.* We study the stability of the subsystem

$$ \begin{pmatrix} \dot{\theta} \\ \dot{\omega} \end{pmatrix} = \left( \frac{\omega}{\mu_1\mu_g - \mu_3^2\omega^2 \cos\theta} \sin\theta - (\mu_1 + \mu_3 \cos\theta)u}{\mu_4 + \mu_3^2 \sin^2\theta} \right) \quad (9) $$

With the controller

$$ u = k_1(\theta + \beta) + k_2\omega, \quad (10) $$

the closed loop system is

$$ \begin{pmatrix} \dot{\theta} \\ \dot{\omega} \end{pmatrix} = \left( \frac{\omega}{\mu_1\mu_g - \mu_3^2\omega^2 \cos\theta} \sin\theta - (\mu_1 + \mu_3 \cos\theta)(k_1(\theta+\beta) + k_2\omega)}{\mu_4 + \mu_3^2 \sin^2\theta} \right) \quad (11) $$

Near $(\theta, \omega) = (0, 0)$, we have

$$ \begin{pmatrix} \dot{\theta} \\ \dot{\omega} \end{pmatrix} = \left( \frac{\omega}{\mu_1\mu_g\theta - k_1(\mu_1 + \mu_3)(\theta + \beta) - k_2(\mu_1 + \mu_3)\omega}{\mu_4} \right) \quad (12) $$

i.e.

$$ \begin{pmatrix} \dot{\theta} \\ \dot{\omega} \end{pmatrix} = \left( \frac{0}{\mu_1\mu_g - k_1(\mu_1 + \mu_3)} + \frac{1}{-k_2(\mu_1 + \mu_3)} \right) \begin{pmatrix} \theta \\ \omega \end{pmatrix} + \left( \frac{0}{-k_1(\mu_1 + \mu_3)} \right) \beta \quad (13) $$
The characteristic polynomial is

$$ \det \left( \frac{s}{-\mu_1\mu_g+k_1(\mu_1+\mu_3)} + \frac{-1}{s+\frac{k_2(\mu_1+\mu_3)}{\mu_4}} \right) = s^2 + \frac{k_2(\mu_1+\mu_3)}{\mu_4}s + \frac{-\mu_1\mu_g+k_1(\mu_1+\mu_3)}{\mu_4} \quad (14) $$

Now, the polynomial $P(s) = s^2 + p_1s + p_0$ is Hurwitz iff $p_0$ and $p_1$ are positive. Since $\mu_1, \mu_3, \mu_g$ are positive, we get that the parameters of the controller should satisfy

$$ \begin{aligned} k_1 &> \frac{\mu_1\mu_g}{\mu_1+\mu_3} \\ k_2 &> 0 \end{aligned} \quad (15) $$

to have the stability.

<figure><img src="image_5.png" /></figure>

# 4 Observer

To implement the controller, we need two quantities:

* the tilt $\delta$ which can be deduced from an accelerometer (see below).

* the rotation rate $\omega$ which can be directly measured from a gyrometer (since $\beta$ is constant).

We now show how we can get the tilt $\delta$. As illustrated by Figure 4, the measured acceleration $\mathbf{a}^m$, expressed in the board frame, satisfies

$$ \mathbf{a}^m = \begin{pmatrix} \cos \delta & \sin \delta \\ -\sin \delta & \cos \delta \end{pmatrix} \begin{pmatrix} \dot{v} \\ g_0 \end{pmatrix} \quad (16) $$

where $\dot{v}$ is the horizontal acceleration and $g_0 = 9.81$ corresponds to the gravity.

<figure><img src="image_6.png" /><figcaption>Figure 4: Left: acceleration in the world frame; Right: in the board frame</figcaption></figure>

We have

$$ \|\mathbf{a}^m\|^2 = \dot{v}^2 + g_0^2. \quad (17) $$

Thus, the acceleration of the hoverboard satisfies

$$ \dot{v} = \sigma \cdot \sqrt{\|\mathbf{a}^m\|^2 - g_0^2} \quad (18) $$
where

$$ \sigma = \operatorname{sign} \dot{v}. \qquad (19) $$

The existence of two solutions is illustrated by Figure 5. In (a), $\dot{v} < 0$ (i.e., $\sigma = -1$) and in (b) $\dot{v} < 0$ (i.e., $\sigma = 1$). In both situations, the inertial unit feels a vertical acceleration greater than $g_0$. The inertial unit can guess that it accelerates, but cannot deduce in which direction $\sigma$ the vehicle goes.

<figure><img src="image_7.png" /><figcaption>Figure 5: (a) and (b): two symmetrical situations where the inertial unit collects the same data; (c) In the board frame; (d) acceleration triangle</figcaption></figure>

The sign $\sigma$ for $\dot{v}$ is difficult to determine without using the model, which is not available since we have no idea of the position and the weight of the rider. To remain model free, we will only assume that $\delta$ is continuous in $t$. To estimate $\sigma = \operatorname{sign}(\dot{v})$ we may use the gyrometer. Indeed, from the previous estimation $\delta^m(t - dt)$ we can predict that as time $t$, the tilt angle $\delta(t)$ is approximately

$$ \delta^p(t) = \delta^m(t - dt) + dt \cdot \omega^m(t) \qquad (20) $$

Since

$$ \begin{pmatrix} \dot{v} \\ g_0 \end{pmatrix} = \begin{pmatrix} \cos \delta^p & -\sin \delta^p \\ \sin \delta^p & \cos \delta^p \end{pmatrix} \begin{pmatrix} a_1^m \\ a_2^m \end{pmatrix}. \qquad (21) $$

an estimation of $\dot{v}$ is

$$ \dot{v} \approx \cos \delta^p \cdot a_1^m - \sin \delta^p \cdot a_2^m. \qquad (22) $$

Thus

$$ \sigma = \operatorname{sign}(\cos \delta^p \cdot a_1^m - \sin \delta^p \cdot a_2^m). \qquad (23) $$

Therefore an approximation $\hat{\delta}$ of $\delta$ is

$$ \begin{aligned} \hat{\delta} &= \operatorname{angle}\left(\mathbf{a}^m, \begin{pmatrix} \dot{v} \\ g_0 \end{pmatrix}\right) \\ &= \operatorname{angle}\left(\mathbf{a}^m, \begin{pmatrix} \operatorname{sign}(\cos \delta^p \cdot a_1^m - \sin \delta^p \cdot a_2^m) \\ g_0 \end{pmatrix} \cdot \sqrt{\|\mathbf{a}^m\|^2 - g_0^2}\right) \end{aligned} \qquad (24) $$

where

$$ \operatorname{angle}(\mathbf{u}, \mathbf{v}) = \arcsin \left( \frac{u_1 v_2 - u_2 v_1}{\|\mathbf{u}\| \cdot \|\mathbf{v}\|} \right). \qquad (25) $$
The expression of the controller is thus

$$u = k_1 \hat{\delta} + k_2 \omega^m. \qquad (26)$$

As illustrated by Figure 6, the control is purely inertial. There is no need of any exteroceptive sensor. All the information is in the red box (an IMU) fixed with respect to the board. The hoverboard does not know what is its own speed, neither its position or its heading. The controller tries to cancel $\delta$, which is considered as an error, i.e., it tries to maintain the board horizontal. The human rider influences the closed loop system by tuning the talocrural angle $\beta$. This will create a disequilibrium that the controller will have to compensate. As a result, the hoverboard will go forward or backward depending of the sign of $\beta$.

<figure><img src="image_8.png" /><figcaption>Figure 6: The inertial control of the hoverboard</figcaption></figure>

# 5 Simulation

To illustrate the behavior of the control strategy, we emulate the action of the rider by a second controller, named human controller (see Figure 7). This controller has two inputs

* The measured speed corresponding to the speed of the vehicle seen by the rider

* The desired speed $\bar{v}$.

The difference $\bar{v} - v^m$ expresses the will of the rider to increase or decrease its speed. At first sight, the rider has no possibility to communicate (via a joystick or any remote control system) with the inertial controller of the hoverboard. The rider can only modify the talocrural angle $\beta$ with its feet in order to create a bias between its pitch $\theta$ and the tilt $\delta$. It is via this bias that the rider can communicate with the hoverboard.
<figure><img src="image_9.png" /><figcaption>Figure 7: The inertial control of the hoverboard is supervised by the human controller</figcaption></figure>

Let us propose the proportional control

$$ \beta = k_3(\bar{v} - v^m). \qquad (27) $$

As illustrated by Figure 8, for $t \in [0, 20s]$, after a few seconds, the hoverboard reaches the desired speed. For the simulation, we have chosen: $m = 10Kg$, $M = 1Kg$, $\ell = 1m$, $g_0 = 9.81ms^{-2}$ and $\rho = 1m$. For the parameters of the controller we have taken $k_1 = 200$, $k_2 = 100$, $k_3 = -0.2$.

<figure><img src="image_10.png" /><figcaption>Figure 8: The rider starts in blue and ends in green at a constant speed $v = 1$</figcaption></figure>

Figure 9 shows that the controller gets a good estimation of the tilt $\delta$ and generates a control input $u$ which is smooth.
<figure><img src="image_11.png" /><figcaption>Figure 9: The hoverboard is stable and the speed converges to the desired value</figcaption></figure>

# 6 Conclusion

In this paper, we have presented a model of an hoverboard and we have shown how a pure inertial controller can allow us to stabilize the tilt angle $\delta$ of the board. The controller is model-free, i.e., it does not use the state equation of the system. There is no possibility with this controller to control the speed. With a human in the loop, an estimation of the speed can be performed in order to get a velocity control of the vehicle. Using odometers (between the board and the wheels) we could probably have a speed control independent from the action of the human, but there is no such a need in practice, except for security reasons: to limit the speed of the vehicle and to avoid the saturation of the motors.

The Python source code associated with the test-case can be found at:

https://www.ensta-bretagne.fr/jaulin/hoverboard.html

# References

[1] L. Jaulin. *Automation for Robotics*. ISTE editions, 2015. 2

[2] L. Jaulin. *Mobile Robotics*. ISTE editions, 2015. 1

[3] D. Sangotra, M. Mendhe, S. Kshirsagar, and R. Tamboli. Mathematical modelling of hoverboard. *Journal of Physics: Conference Series*, 1913:012102, 05 2021. 2

[4] D.A. Wells. *Lagrangian Mechanics*. Schaum's outlines, London, 1967. 2