Hi, my name is SY.
I'm studying BBR(Ball Balancing Robot) - (Ball Balancing Robot - YouTube) with Arduino mega.
but, My robot is out of balance. I think there are two reasons for failure.
The first is my control loop & coding, and the second is the Arduino Mega computing power.
First of all, my system is as follows.
- IMU : MPU6050 x 1
- Control board : Arduino mega 2560 x 1
- Motor drive : L298N x 4
- DC motor : SE-DM185 x 4
- Robot weight : 3kg
[Q.1]Control loop
- IMU
- Calculate angle using complementary filter for gyro and angular acceleration.
- Apply PID control to the angle and get RPM as output (RPM is Command at 5).
-Motor
3. Get encoder value using external interrupt.
4. Timer interrupt applied.
5. Calculate rpm and apply PID control.
6. PID contor output is PWM.
As a result, the robot keeps vibrating and is out of balance...
I refer to the following paper.
(Han, Hew Yeong, Tiong Yih Han, and Hudyjaya Siswoyo Jo. "Development of omnidirectional self-balancing robot." 2014 IEEE International Symposium on Robotics and Manufacturing Automation (ROMA). IEEE, 2014.)
Am I misunderstanding the paper?
Or is there something wrong with my code?
If there is something wrong, I would like to get some advice.
[Q.2] Arduino computing power.
I'm wondering if the system and code I have built can be controlled in real time with one Arduino Mega.
Finally, I attach my robot and Arduino code.
20200519_timerinter_v1.ino (21.4 KB)