Skip to content
Balance Robot Version 1
C++ C Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes
.gitignore
A4988.cpp
A4988.h
BBalance1.ino
ESP8266.cpp
ESP8266.h
MPU6050.cpp
MPU6050.h
MPU6050Reg.h
README.md

README.md

BBalance1

Balance Robot Version 1

The BRobot code has an accelerometer and gyro IMU the determines the angle the robot it at. This drives the two stepper motors to adjust the angle back to zero.

This code breaks out the code for the two stepper motors as one class and the IMU as the other class.

This can make it easier to understand the two functions and build new functions and understanding.

The code also outputs at regular intervals the values of the accelerometer and gyro. It also outputs the calculated angle and PID value that can later be plotted.

Since the IMU is mounted sideways the Y access has the pitch angle and the x axes has the gyro value.

The angle is determine by using a simple complementary filter sampled at regular intervals.

You can’t perform that action at this time.