Hi there! During the district event, I noticed that some folks had integrated an auto-balance feature for their Tank Drive robot. Since I’m currently programming a Tank Drive robot as well, I’m interested in implementing this feature too. However, I’m not sure how to get started with it.
Would you be able to provide me with a code sample and a basic explanation of how it works?
Additionally, I’m not sure if any extra tools are required to make it work, so any guidance on that would be appreciated. Thanks in advance!
We’ve been having difficulties with our auto code lately on a KoP tank chassis.
The latest iteration of it drives towards the charge station until the NavX detects a significant change in pitch, then drives up a bit more on a timer. We used to have a PID loop running on the pitch but that didn’t work so we went back to a janky time-based auto which did.
I’m a mechanical mentor, but since I saw this, I think I’ll take a crack.
We use the ADIS16470 gyro to get pitch angle:
And use that pitch to set our drive train power as proportional to the pitch.
There’s more in there that I’m not too sure about, but this worked at competition last week. The auto code folder is a bit messy, but there’s good stuff in there! Have fun browsing.