segway with MPU6050 (IMU)

Hello to all
In this project my segway work good but my robot just move forward and backward.
i want try to move around circular place.
help how can i write the code.

Hamed_single_file.ino (8.65 KB)

ayanatblogfa:
Hello to all
In this project my segway work good but my robot just move forward and backward.
i want try to move around circular place.
help how can i write the code.

Likely the current code tries to keep the robot standing straight up. Actually you want it to lean forward or back in an amount proportional to the designed acceleration. Use acceleration is get to and maintain the speed you want.

Now to turn, the wheels will need to turn at different speeds but the sum of the speeds must remain the same for balance. Good google search terms are differential drive steering, or differential drive odometry.