This robot can balance on 2 wheels for 30 seconds. It runs on an Arduino Nano and uses 9-DOF IMU and 2x NEMA 17 stepper motors.
- Take data in from the accelerometer (noisy absolute pitch) and gyroscope (smooth delta-pitch).
- Fuse the data together with a complementary filter to get relatively un-noisy absolute pitch.
- Calculate the error and feed it into a PID loop.
- Feed the PID data into the stepper motors.
- The sensors are extremely noisy. They tended to get even noisier when the stepper motors were active. This was mitigated by using a physical low-pass isolation medium (fancy term for a piece of foam between the frame and the IMU).
- The wheels, being slippery PLA plastic, have very low traction. This was mitigated by adding a metaphorical warning label to the robot saying that it can't be used on smooth surfaces, but it does very well on carpet.
- Drawings and schematic
- CAD Model (Slightly outdated, as it mentions a MPU6050 instead of a LSM303DLHC/L3GD20 system, but it's I2C so it's still compatible.)