# Balancing on a stick

Consider a pole of length $h$, with a motor and flywheel attached to one end.  The motor can spin up the flywheel.  The other end is on a non-slip floor.

If the stick is at angle $\theta$, and the total mass of motor $M_m$ plus mass of flywheel, $M_f$ is $M_m + M_f = M_t$, the torque due to gravity, $\tau_g$ is:

$\tau_g = M_t gh \cdot \sin(\theta)$

For a solid and hollow flywheel, the moment of inertia is:

$I_s = \dfrac{M_f r^2}{2}$ and $I_h = M_f r^2$

If the motor applies torque $\tau_m$, then the angular acceleration of the flywheel is:

$\alpha = \dfrac{d\omega(t)}{dt} = \dfrac{\tau_m}{I}$

And this will require a power at time t, $P(t)$ of:

$P(t) = \tau_m \cdot \omega(t) = \tau_m \cdot \int{\dfrac{\tau_m}{I}}dt$

If we start the flywheel from rest, and keep the torque constant:

$P(t) = \dfrac{\tau_m^2}{I}\cdot t$

(In units, we’ve got on the left: $J/s = Nm/s$ and on the right $(Nm)^2 (kg^{-1} m^{-2}) s = Nm (kg m^2 s^{-2}) (kg^{-1} m^{-2}) s = Nm/s$, thus the units match and check our work)

So the power required to keep a given torque increases linearly with time.

Notice that $I \propto M_f$ and the torque required to counter gravity is $\tau_m \propto M_t$, so if the mass is dominated by the flywheel then $P \propto M_t$.

So we want to minimize the mass of the flywheel (while keeping the assumption that the flywheel mass dominates the total mass) while maximizing the moment of inertia.

That means that we want to use a hollow flywheel, since this has twice the moment of inertial for a given mass.

Combining the equation $P(t)$ with the equation for $\tau_m$, we get

$P(t) = \dfrac{\tau_m^2}{I}\cdot t = \dfrac{(M_t gh \cdot \sin(\theta))^2}{I}\cdot t = \dfrac{M_t^2 g^2h^2 \cdot \sin^2(\theta)}{I}\cdot t$

And substituting in the equation we had for $I_h = M_f r^2$:

$P(t) = \dfrac{M_t^2 g^2h^2 \cdot \sin^2(\theta)}{M_f r^2}\cdot t$

If we want to minimize the power, then we want to minimize $M_t^2/M^f = (M_m + M_f)^2/M_f$. Differentiating gives $(M_f^2 - M_m^2)/M_f^2$ which has a zero at $M_f = M_m$.

So the minimum power required is when $M_f = M_m$ !

## Three flywheels

If we consider the case of having two or three flywheels on the box, perpendicular to each other to give us more control, then we can consider each flywheel individually, and consider $M_m$ to include the mass of the other flywheels. For minimum power usage, this would mean that we’d want to minimize $(M_m + 3M_f)^2/M_f$ which is minimum at $M_f = M_m/3$.

So if we have 1kg of motors, payload, etc, then we’d want the flywheels to be 1/3 kg each.

## Radius of flywheel

Since $P \propto 1/r^2$ we want to maximize the radius of the flywheel.

## Example

A random example EDF motor has weight 148 grams (which we’ll round up to 0.2kg) and produces 450 Watts of power. We’ll consider this on a stick of length 1 meter and with a hollow flywheel.

If we begin at an angle of 10 degrees (0.17 radians) and desire a torque sufficient to balance against gravity:

$\tau_g = (M_f + M_m) gh \cdot \sin(\theta) = (M_f + M_m) \cdot (1m * 10m/s^2) \cdot 0.17 = (M_f + M_m) \cdot (1.7m^2/s^2)$

So:

$P(t) = \dfrac{\tau_m^2}{I}\cdot t = \dfrac{(M_f + M_m)^2 \cdot (2.89 m^4/s^4)}{M_f r^2} \cdot t$

Let’s make the radius 0.1m – i.e. 10% of the length of the stick. We’ll consider the case of using a single flywheel and minimizing the power usage.

So this gives a power of $P(t) = (2M_f)^2/M_f \cdot (0.0289 m^2/s^4) \cdot t = 4 M_f \cdot (0.0289 m^2/s^4) \cdot t = M_f \cdot (0.1156 m^2/s^4) \cdot t$

Using the EDF motor mass of 0.2kg:

$P(t) = (0.023 kg m^2/s^4) \cdot t = (0.023 J/s^2) \cdot t$

The motor can provide a maximum of 450 Watts, meaning that it could maintain a 10 degree angle for 450/0.023 s = 19565 seconds = 5.4 hours.