Hey everyone! So for the past 2 and a half weeks, I have been working on a global position system for my robot. After a lot of all nighters and late nights, I finally got it working! It works decently well, but sometimes it an inch or two off. I’ve come to the realization that it is my encoder values I use for odometry. I was wondering what the best way to get accurate encoder values are. I am using inches/degrees currently, but I was wondering if there is a better way? Thanks in advance!
How did you come to this conclusion? There are a number of things that require tuning such as the exact radii of the wheels from the center of the robot or the exact diameter of the tracking wheels.
Assuming that it is an issue with the encoder values, other than making sure that your tracking wheels have enough tension to the ground to prevent slipping, there’s nothing you really do to improve accuracy. You can’t make the sensors any more precise than they already are.
If you’re using the old quad encoders, you could try switching to the new V5 Rotation sensors for ~10x the precision in degree measurements. A lot of people are saying that they’re too friction-y, but I’m using them for tracking wheels and I haven’t had any issues.
it will always be off after a bit. Its best to not rely on odometry too much, and to maybe realign the robot to reset the odometry by slamming into a wall in p skills.
I have measured the center of the bot of the wheels in CAD as well as in person, and got the same values. The radii of the wheels I have searched online and gotten a rough measurement myself. Encoder values are the last thing I can think of before I re-check my code.
Am I assuming you are using external encoders? If not, do so. Also, how far they are from the center affects their precision. Twice as far from the center will give you twice as good results. Hope that helps.
Assuming all your measurements are correct, then as I said above there’s nothing much you can do. Sensors can’t be made more accurate without getting a better sensor. Like @Drew2158U said, odometry will become less accurate the longer the program is running. Its a good idea to have reset points during autonomous to help negate any drift that might occur.
I recommend tuning the diameter and wheel offset constants experimentally. Drive the robot straight a known distance (longer is better)–it’s probably going to be a little off. Then change the diameter constant to account for whatever error there is. Follow the same principle for tuning the wheel offset constants, but instead rotate the robot (the more rotations the better) to measure the error.