ToppleBot

Project Website

Refer to the project website to create your own ToppleBot!

Summary

The ToppleBot project builds off of related momentum wheel cubes like Astrobee, Cubli, and REM-RC's Balancing Cube. This project served as my senior design project for my Engineering Physics Bachelor's degree.

As the software and communications engineer I implemented a ROS based system using Micro-ROS to interface with the onboard microcontroller, an ESP32. Through this implementation, I sharpened my skills in C, C++, controls, and ROS2. The project repos can be found here and here.

Balancing Control

In the balancing configuration, the orientational error \(\boldsymbol{q}_\text{err}\) from the desired balancing point \(\boldsymbol{q}_{\text{des}}\) at time step \(k\) is defined by $$ \boldsymbol{q}_{\text{err},k} = \boldsymbol{q}_{\text{des}}^{-1} \otimes \boldsymbol{q}_{k}. $$ Using a first-order approximation, we can find an error vector in Euler angles \(\boldsymbol{\eta}_{\text{err},k} \triangleq \left[\phi_{\text{err},k}, \theta_{\text{err},k}, \psi_{\text{err},k}\right]^\top\) utilizing $$ \boldsymbol{q}_{\text{err},k} \approx \begin{bmatrix} \frac{\phi_{\text{err,k}}}{2} \\ \frac{\theta_{\text{err,k}}}{2} \\ \frac{\psi_{\text{err,k}}}{2} \\ 1\end{bmatrix} = \begin{bmatrix} \frac{\boldsymbol{\eta}_{\text{err},k}}{2} \\ 1 \end{bmatrix}. $$ To aid with damping, the controller used the gyroscopic values to avoid differentiation of the system error. I also implemented a lightweight low-pass filter to help with noisy measurements, namely: $$ \boldsymbol{\omega}_{k} = \alpha \boldsymbol{\omega}_{\text{raw},k} + (1 - \alpha) \boldsymbol{\omega}_{k-1}. $$ Assuming independant axis control, the momentum wheel speed to mantain balancing can be designed using the classic PID control. $$ \boldsymbol{u}_k = K_p \boldsymbol{\eta}_{\text{err},k} + K_i \sum_{i=0}^{k} \boldsymbol{\eta}_{\text{err},k} + K_d \boldsymbol{\omega}_{k} $$

Balancing Demonstration

After a "considerable" amount of tuning, the following balancing capabilities are achieved (video below).

Odometry and Demonstration

The ToppleBot also featured an odometry tracking system, based solely off the IMU data. Defining each corner of the cube as a node, we dynamically updated their positions using the quaternion from the AHRS algorithm. Then, using the projected gravity vector, we determined which corner/node is the "balancing node" and used its displacement from the previous balancing node to update the ToppleBot's world pose. Through multi-threading, the system can quickly send updates to the control station where the odometry can be visualized on RViz (as shown below).