I am trying to construct a self-balancing robot and I have attached the specifications below.
The problem is that when I try to tune the PID constants for the robot, I jitters and then the program crashes, making the wheel move in one direction. The only way to stop the robot is to reset.
I have tried using a 9V duracell battery and a HIW battery, but both give the same results. I think that it is a problem with the current rating of the motor and the battery, but not so sure. Is there an alternative? Thanks in advance!
P.S the circuit diagram I’ve attached shows 2 AA batteries which are not the case - it is a single 9V battery
Components used:
motors: https://robu.in/product/300-rpm-l-shape-bo-motor/
Arduino Uno
MPU6050
LM298N
Last attachment shows the output of the serial monitor as the code crashes
final_code.ino (6.61 KB)
serial moitor.txt (1 KB)