How can we improve the accuracy of our autonomous?

My team struggled with autonomous this year. We’d be able to get short, low-scoring paths executed somewhat reliably, but if we tried to do better than that it would cause the robot to drift, rotate, and subsequently collide with field elements.

We use a mk4i swerve drivebase with PathPlanner. I feel like the issue may lie within our X/Y/Theta controllers, but idk. Any help would be appreciated.

1 Like

We were having issues with wildly inconsistent autos during practice and competitions, and we found that making the switch to Colson swerve wheels on our mk4i modules made a world of difference. As the tread would wear (we simply do not have the money to change swerve tread after every 3-4 matches), the wheels would slip slightly throwing our paths off. Making the switch to Colson wheels increased both our overall speed and consistency in auto.

1 Like

#1: check your current limits and acceleration to avoid wheel slippage
#2: confirm your basics: does a 10 foot drive forward command ACTUALLY take you 10 feet? Test 10 times, average, update…
#3: confirm that your rotation commands actually rotate the right amount. Program a 10 turn slow spin and measure your error. Look at your gyro data!
#4: take some data and see if your errors are consistent (ie, do the same routine 10 times and plot your final position). You will want some simple routines to facilitate this data taking. Using cones to mark the bounds of your path will help too.

13 Likes

I can’t agree with these enough. Jumping into an autonomous routine is something that needs to be slow and careful.
We spent a lot of time this year running basic movements and understanding how the swerve behaves before even starting to do perform motions of our actual paths.
Next thing is to break up your auto into small bites. Repeat one spot over and over until you’re happy with it, then move into the next leg. It’s all about repetition and making sure things stay consistent.

Naturally if you can do things like implementing vision feedback that helps leaps and bounds, but it’s not always necessary for a robust auton path.

1 Like

We were thinking about doing something like this. Maybe something like using apriltag pose estimation to update our odometry. That, coupled with @Weldingrod1’s careful testing methods will probably get our auton to a reliable state eventually. Thank you both :slight_smile:

However, I feel that quite a few of our difficulties in auton reliability come from our pid loops which we pass into our PPSwerveControllerCommand. If any of you guys use similar control methods I’d love to hear how you go about finding gain values for your auton loops.

1 Like

I would skip vision based solutions until you nail the fundamentals - they often can be a band aid for larger problems that need to be solved first.

7 Likes

Echoing this question for others reading. Would love to hear how other teams go about doing this!

(Bonus points if you can walk me through it step-by-step like I’m a 5-year old :sweat_smile:)

1 Like

Connect the PathPlanner UI and see where your robot thinks it is. (The way to do this varies between 2023 PP and 2024 beta PP)
See if your robot is where it thinks it is. Depending on the problem, you may see the robot follow the planned path, or you may see it deviate without being able to correct. This will help you narrow down the problem.

1 Like

Could you share which Colsons you used? I wonder if there is a Colson solution for the Rev modules (I know those wheels are smaller) Also, how often did you need to replace them?

Yes, mechanically this is absolutely a solid solution. I need to preach this to more people; colsons are the way to go.

To the best of my knowledge, there is no COTS option for colson wheels compatible with the 3in MAX Swerve modules.

There are multiple options out there now for SDS compatible colson wheels, just not for REV currently.

I’ve been keeping my eyes out for any companies, new or established, offering such a product :grin:

1 Like

The wheels we used we actually got from the silent auction at IRI, but they’re the ones from buyswervewheels.com. So far they’re perfectly fine after three offseason events. I don’t know if any options are available for maxswerve or not.

https://www.buyswervewheels.com/

2 Likes

One of the fundamentals is understanding the -actual- relationship between the robot wheels’ rotation, the encoders, and the physical motion. In order to understand this, you need to create a smooth motion profile with a smooth acceleration, cruise, and deceleration phases that moves a specific distance. Choose a nice long distance that you can drive all on one piece of carpet.

Calculate the expected encoder pulses per wheel revolution and the expected circumference of your wheels. Get that into your code. Use a clear, understandable description!!! Something like either wheel circumference or diameter; you will tweak it.

Once you have that ready, put a reference object (like a battery) against your bumpers, zero your odometry, and drive straight forward with your motion profile. Measure the exact distance with respect to the reference surface. It will NOT match your plan… it never does. After you have sorted out the silly stuff like forgetting the gear ratio and pulses per revolution, you will end up adjusting your wheel circumference/diameter by the ratio of actual distance to planned distance. Repeat as needed to get this right!

For really fancy autons you will need to do this on the -real- carpet.

Bonus points: comment in code the expected values for pulses, gear ratio, and circumference/diameter. Double bonus: add an error if the circumference is entered more than 10% off of the expected number… Just protecting against oopsies :wink:

1 Like

So, it turned out we had a lot of errors…

  1. Our drive wheel velocity was completely wrong (i.e. 1 m/s for one second would take us about halfway across the field)

  2. Our odometry was completely wrong and our swerve drive kinematics were off (FL module was not ++)

  3. CCW motion was not registering as a positive increase on our drive encoders or gyro

We fixed all this and our swerve is somewhat accurate now :slight_smile:

Glad we could help out! I’ve asked my team the same type of questions… And also gotten the “Wow! That’s not what we asked the bot to do!” results :wink:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.