As part of the lecture “Data Processing in Technology” (DT), the Regensburg Balance Bot (ReBaBo) was developed – an autonomous, two-wheeled robot that balances on the principle of the inverted pendulum. My focus in this project was on the conception and implementation of the control technology using fuzzy logic.

System Architecture

The ReBaBo is based on a dual-platform strategy:

The Fuzzy Control

Instead of a classic PID controller, fuzzy logic was used to map the complex balancing behavior. The control processes three essential input variables:

  1. Angular Velocity ($\omega$): Supplied directly by the gyro sensor.
  2. Tilt Angle ($\alpha$): Calculated from the accelerometer values.
  3. Position Deviation: Determined via the wheel encoders to prevent uncontrolled drifting.

Fuzzification and Rule Base

The input variables are translated into linguistic terms (fuzzy sets) like Negative Big (NB), Zero (ZE), or Positive Small (PS). The rule base links these terms to determine the necessary motor speed.

Angle \ $\omega$NBNMZEPSPB
NBNBNBNM--
NMNBNMNS--
ZENMNSZEPSPM
PM--PSPMPB
PB--PMPBPB

Excerpt from the decision table for angle and angular velocity.

Implementation Details (Embedded C)

Implementation was done in C on the XE167F using the real-time operating system µC/OS-II. Since the controller had no floating-point unit (FPU), the entire fuzzy arithmetic was optimized for efficient execution to keep computational load low.

Result

The fuzzy control enabled the ReBaBo to balance stably at standstill and autonomously compensate for external disturbances (like slight nudges). By including wheel encoder data, position in space could also be stabilized.