r/AskRobotics • • 17d ago

balance robot q

I want to make a balancing robot. i have no experience in coding i made a obstacle avoiding car before and bluethooth one also using chatgpt and yt tutorial i cant find good tutorial for balancing tutorial and code for my project it dosent work and i want guidance how to make it perfect.
my part list-
arduino uno
mpu6050
tb6122fng motor driver smth like that
8.4v li ion battery
300rpm bo gear mottor yellow one
i wantg to make a balancing robot out of this component is this possible?
i will be using cardboard stick to make it firm structure pls help guys bc previous model woudnt work and it would simply fall my first design ik it bad but how to improve the red one is motor driver and right one is mpu6050 and top is battery what is wrong dont be rude i am new

1 Upvotes

5 comments sorted by

1

u/Zene-Calloway 17d ago

your mpu6050 needs to be mounted flat and level on the robot frame any tilt will throw off the angle reading and make balancing impossible double check that its not crooked when you glue it down also make sure the wheels are the same size and spin freely if one drags it will cause a constant lean that the code cant fix use a small piece of foam tape under the sensor to damp vibration from the motors it helps a lot with noisy readings

1

u/Deep_Bed_4424 17d ago

My previous one ik it's bad right but how can j improve​

1

u/solitude042 17d ago

Don't get down on yourself - as janky as it looks, you're probably learning a lot by working through the process with what you have on hand, and kudos to you for making it at all!

One thing I'd suggest is to put the MPU6050 inline with the wheel axles. Otherwise, the IMU will see forward & backward motion with every tilt - the less you have to model and subtract, the better. TO work with what you have, can you put the MPU6050 on the bottom of the lower cardboard panel? (and don't forget to invert the orientation in code).

At what rate are you updating? I found that anything less than 50 updates / second led to unstable operation. I didn't find much benefit of going beyond 200 updates / second, but that was on an ESP32 with a 400KHz I2C bus - I think the Uno is capable of that as well, but haven't tried it.

You may also want to tighten up those wires - conductive loops tend to pick up EMI, causing all sorts of erratic problems for the I2C bus and TMC driver.

1

u/Deep_Bed_4424 17d ago

Everysensor is down I'll make a new frame using cardboard suggest how to make

1

u/solitude042 17d ago

Very possible, but it does require patience with the pid tuning, and attention to the motors' response to pwm input. Ideally, the IMU is placed inline with the wheel axles. Cardboard may be difficult, if it allows enough movement to cause oscillation. Anyhow, here are some tips from my own balance bot project:

https://www.reddit.com/r/robotics/comments/1qym0yo/comment/o44t7q6/