Repository navigation
dengebot v1.7.1 — Adaptive Sensor Fusion & Stability Improvements
Pre-releasedengebot v1.7.1 — Adaptive Sensor Fusion & Stability Improvements
Community Preview | Arduino Balancing Robot Library
We're pleased to introduce dengebot v1.7.1, featuring adaptive sensor fusion, gyroscope bias calibration, expanded telemetry, and improved reliability for two-wheel self-balancing robots.
This release builds on v1.6.1 while preserving the existing PID controller and motor command behavior.
What's New in v1.7.1
1. Adaptive Complementary Filter
- Combines accelerometer and gyroscope measurements for pitch estimation.
- Optional adaptive alpha switching between 0.980 and 0.998.
- Acceleration-magnitude-based switching with hysteresis.
- Updated default thresholds: 0.03 g activation / 0.02 g deactivation.
- Preserves the original fixed-alpha filtering API.
- Provides
usedAlpha()for monitoring filter behavior.
Adaptive filtering remains disabled by default for backward compatibility.
2. Gyroscope Bias Calibration
- New
EDAGyroBiasCalibratorhelper. - Supports stationary gyroscope bias measurement.
- Rejects invalid or excessive-motion calibration samples.
- Allows calibrated bias compensation in the complementary filter.
- Includes a new
GyroBiasCalibrationDemoexample.
3. Extended Telemetry and Diagnostics
- New lightweight telemetry support for embedded systems.
- CSV output for sensor and controller analysis.
- Optional reference pitch angle.
- Event codes for recording test events.
- Sensor timestamps and active alpha reporting.
- Extended CSV output works without a reference angle.
4. Reliability and Safety Improvements
- Improved adaptive-alpha configuration validation.
- Protection against inverted normal/high-alpha settings.
- Validation of sensor values and time intervals.
- Shared portable floating-point validation utilities.
- Existing PID fault handling and motor safety behavior retained.
5. Examples and Testing
Includes four Arduino examples:
BasicBalanceMotorCommandDemoFilterTelemetryDemoGyroBiasCalibrationDemo
Host regression tests cover the controller, motor conversion, filtering, telemetry, and gyro calibration functionality.
Simulation Results
In a 50-scenario inverted-pendulum simulation, the updated adaptive filter reduced average peak pitch-estimation error during the first second after a disturbance:
| Configuration | Average peak estimation error |
|---|---|
| Fixed alpha 0.980 | 4.95° |
| Adaptive alpha, previous thresholds | 4.92° |
| Adaptive alpha, v1.7.1 thresholds | 1.92° |
This represents approximately a 61% reduction compared with fixed alpha 0.980 under the simulated conditions.
Gyroscope bias calibration also reduced simulated true upright-angle deviation from 0.48° to 0.25° for the adaptive configuration.
Important: These are model-dependent simulation results, not guaranteed improvements on physical robots. Sensor vibration, mechanical configuration, motor characteristics, and calibration can affect performance.
Compatibility
Designed for Arduino-compatible platforms including:
- Arduino Nano / Uno / Mega 2560
- ESP8266
- ESP32
- ESP32-S3
The existing PID core and motor command conversion remain unchanged. Physical compatibility and behavior depend on the selected board, sensors, drivers, and application code.
Development Status
This is a Community Preview release. Host tests and simulations have been performed, and initial user-reported robot testing is encouraging. Comprehensive physical validation of adaptive sensor fusion is still in progress.
We welcome community feedback, hardware testing, bug reports, and contributions.
Repository: https://github.com/Gmby06/dengebot
License: MIT