Robotic Balancing

Project Start: December 2012

Project End: July 2015

Presented at ICRA Humanoid Application Challenge, May 2013 in Karlsruhe, Germany

Selected as finalist

Master of Science thesis research project (defended July 2015)

A highlight reel showing all the algorithms used in this project

Background

Following our amazing success at the 2012 ICRA Humanoid Application Challenge, we began work on our entry for the 2013 competition. Rather than starting something completely new, we decided to continue along the same vein of real-time control systems. Given the difficulty we encountered getting the robot to balance on a single skate, Dr Baltes and I decided that the bongo board (also known as a balance board) would be a good follow-up project, as it isolates the lateral balance that was missing from the skating.

Given the complex nature of the bongo board, what began as a simple project for the ICRA competition morphed into my own Master's thesis project.

This page describes the entire project, including both the ICRA presentation and my thesis.

Definitions

Bongo board See-saw

The bongo board (left) vs the see-saw (right)

The bongo board is simply a flat deck with a free-rolling wheel located underneath it. A rider stands on the deck and attempts to keep the system balanced. Bongo boards are frequently used for balance training and physiotherapy.

Unlike a see-saw (aka teeter-totter), which features a fixed fulcrum, the bongo board's wheel can roll freely from end-to-end, providing a constantly-moving fulcrum.

Building the board

front
top
underside

The bongo board used for this research

Before we could embark on developing software to control the bongo board we needed an actual board and a robot to stand on it. The robot was an easy choice; I selected Jimmy (named for Dauphin, Manitoba native and three-time Olympic medal winner in the 400m dash and 400m relay, Jimmy Ball) one of our DARwIn-OP robots. Physically Jimmy was the same as the robot Jennifer we used for the hockey project the previous year, and Jeff who we used at the 2011 FIRA HuroCup competition.

My father and I built the bongo board in his home workshop. The deck was made of plywood with a layer of high-traction foam rubber to keep the robot's feet from slipping. The wheel was made from two discs of MDF conencted with a length of wooden dowel. Reinforcement bars on the underside of the deck added rigidity and kept the wheel aligned with the deck. Note that the deck rolls directly on the rim of the wheel, not on the axle connecting the two discs.

Inverted Pendulum vs Bongo Board

Rider's joints

The joints we assume the rider can use

Superficially the bongo board problem is very similar to the better-known cart-and-rod inverted pendulum. In the cart-and-rod problem a powered cart must drive forward and backward to keep a rod above it vertical. The rod itself is anchored to the cart using a fulcrum (we often assume the fulcrum is frictionless). If you've ever tried balancing a pencil, baseball bat, or broom on the palm of your hand you've got the idea; to keep the rod from falling over you need to constantly move your hand back and forth underneath the unstable rod.

The big difference with the bongo board is that instead of the cart driving back and forth to control an unstable mass above it we have an unstable mass that can apply torque and forces to the system attempting to keep a wheel positioned below it.

Cart-and-rod Cart-and-rod Cart-and-rod

From left: A cart-and-rod, a simple bongo board with pendulum, a bongo board with rider

The rider has two ways of applying torque to the system:

  1. moving their arms in a circular fashion about the shoulder and
  2. inclining their entire body.
Furthermore, the rider can translate their body vertically and horizontally to apply forces along those directions.

Arm rotation

The effects of arm rotation

Rider neutral Rider lateral Rider vertical Rider inclination

Translating and rotating the torso

Early Software: Stiff Upper Lip

Given the general similarities between the bongo board and the cart-and-rod, my first attempt was a simple PID controller to adjust the robot's torso inclination. The idea was that as long as the robot's torso velocity remained low the system would be stable. Given this assumption, I used the robot's gyroscope data as the input, rotating the torso an amount proportional to the detected angular velocity in the frontal plane.

To put it mildly, this approach was an abject failure. The system was far more dynamic than this simple model could account for. Furthermore, the robot's gyroscope reports data in 3 deg/s increments -- far too coarse to be of use in such an application.

Because the goal of this control policy was to keep the torso velocity as low as possible we dubbed this control policy "Stiff Upper Lip."

Predictive Sensor Model and Do The Shake

In response to the poor performance of Stiff Upper Lip we modified the algorithm to control more of the robot's degrees of freedom. Specifically, we chose to use the arm rotation to perform fine corrections while the torso inclination would be used for coarse corrections. Lateral and vertical translations of the torso were not used at this stage.

To compensate for the poor resolution of the gyroscope we relied exclusively on the three-axis accelerometer in the robot's torso to determine both the robot's inclination (based on the assumption that the hypotenuse of the three acceleration vectors would be equal to gravity) and the torso's angular velocity (by taking the difference between consecutive inclinations divided by the time between samples -- 8ms).

This policy, dubbed "Do The Shake" was a marked improvement. The robot was able to successfully balance on the bongo board for short periods of time.

Let's Sway

The final control policy developed was dubbed "Let's Sway," as the robot pumps its legs up and down continuously, inducing a rhythmic oscillation in the bongo board. The thought was that rather than trying to maintain static stability, the system would perform better if it instead attempted to maintain a state of dynamic stability, smoothly rocking the board back and forth.

Upon analysis we discovered that the robot's torso did in fact remain more stable when using the Let's Sway policy, lending credence to the hypothesis that dynamic stability would be effective.

ICRA Presentation

It was at this point in the research that we attended the 2013 ICRA Humanoid Application Challenge in Karlsruhe, Germany. Our presentation was well-received, and we demonstrated that realtime balancing on highly dynamic terrain -- for short periods of time at least -- was possible using such a small robot.

Unfortunately, unlike the previous and next ICRA challenges, we did not finish in first place. We finished the competition as a finalist, taking home a modest prize.

My time in Germany preparing for the competition did reveal several possible avenues of future research, which would form the bulk of my thesis research over the next two years.

Jimmy demonstrating the Let's Sway policy at ICRA 2013

A Short Break

Once back from Germany we immediately began preparations for RoboCup 2013 in Eindhoven, Netherlands and FIRA HuroCup 2013 in Shah Alam, Malaysia. During this time I focused mainly on those competitions, but always had future balancing research in the back of my mind and imagining ways to apply this research to broader competitions.

(Ultimately the time off paid dividends; we may not have won the ICRA challenge that year, but we won third-place at the RoboCup Technical Challenge and advanced to the second round of the main kid-size humanoid tournament, and we finished best-overall at HuroCup.)

Back to Work

With FIRA and RoboCup behind me it was finally time to get back to the bongo board. I decided that I would see about implementing additional control algorithms to use in combination with the Let's Sway and Do The Shake policies to see which (if any) had better performance. For my additional algorithms I chose one standard inverted-pendulum solution -- Fuzzy Logic -- and one more novel solution -- Always-On Artificial Neural Networks.

For the fuzzy logic controller I based my rules on Yamakawa's cart-and-rod rules, only with additional outputs to control the robot's arm rotation, torso rotation, and vertical and horizontal hip translation. The AOANN implementation used similar outputs, encoded using a single-hot output neuron design. Finally the PID controller was modified to include additional control over the hip translation (as this was missing from the earlier implementation).

Once the fuzzy logic controller was implemented and the fuzzy thresholds set (defining small/medium/large inclinations and velocities) I performed multiple trials with both PID and fuzzy logic, recording the robot's state every 8ms. From this data I created training sets for my AOANNs.

My ANNs were implemented using the open-source FANN library. Unfortunately this library does not support parallelization using a GPU, so all training was done through the CPU -- a very lengthy process. The ANNs trained over the entire winter break of 2013 and into 2014 while I worked on writing other parts of my thesis.

Finally, once the ANNs were trained I could finally perform my final experimental trials and data collection.

Final Analysis

In the end I determined that the fuzzy logic controller used with the Do The Shake policy was the best-performing algorithm overall; it was able to balance for the longest periods of time, and had the lowest overall average change in angular velocity. That said, it was not a statistically-significant improvement over the PID controller.

As our initial research indicated, the Let's Sway policy did tend to produce lower average velocities in the torso, but resulted in higher velocities in the deck. This trade-off was not entirely unexpected, as the introduction of the rhythmic oscillation would cause the deck to move more quickly.

Disappointingly the AOANNs did not perform to my expectations. Two AOANNs were too large to actually calculate their outputs on a single core CPU quickly enough for the robot to react. The other two seemed to over-fit the problem and reacted incorrectly to the input data.

Despite the setback with the AOANNs, I had successfully demonstrated two algorithms that could control a small-scale bongo board autonomously. With these results I submitted my thesis to the department and did my defense on July 8, 2015. My defense was successful, and I graduated with my Master of Science degree in October 2015.

This project was the longest and last project I worked on while at the University of Manitoba. I have been in talks with some students who came after me about modifying my bongo board software for use with some of the lab's newer robots and/or extending it from the effectively 2D balance board to the 3D wobble board (which features a spherical wheel). Hopefully my contributions are only the beginning of a longer-term research project into active balancing.

Jimmy

Jimmy on the bongo board in the lab

Publications