PathPlanner with Falcon 500 Tank Drive

Does anyone have example of a Falcon 500 tank drive following a PathPlanner generated trajectory? The robot overshoots the end point and it goes way too fast.
Here is my code: GitHub - JaiCode08/4065-2023-code
Edit: Latest code uploaded

I can’t access your code, but if your code is overshooting, it could be your PID is tuned too high. Again, if I could look at your code, that would be helpful. Last year, for pathplanner with a Falcon 500 drive train, we had a P value of 1.73.

1 Like

The kp value for is ~0.02

Our team used PathPlanner and trajectory tracking with a 4 falcon tank last year. The github is here: 2022-Season/InfiniteRecharge 2022-Imported-Imported-Real at main · mparobotics/2022-Season · GitHub The code is works but the documentation is not the best, I never got around to documenting that part over the summer. I was able to reverse engineer it for our 2023 code though, so it should be at least somewhat useable. If its generally following the path there’s a chance you got one of your conversions or constants wrong. It’s easy to do and finding where can feel like searching for a needle in a haystack. This was the issue we faced in 2021 and last year.

1 Like

How is your encoderTPR 2048? I thought it’s 4096. Thank you for sharing your code btw!

Falcons are 2048 per rotation. Mag encoders are 4096. Could be part of your issue. The repo you linked also doen’t have any up to date code in it, its just the starter code, so I can’t take a look.

2 Likes

Wow, never knew that. That’s probably the issue. I will update once I try it out.

1 Like

I just updated the code, I don’t know what’s wrong :man_facepalming:

In SysId, what were your Feedback Analysis settings?

I finally solved the problem. I didn’t set the robot’s initial pose from the trajectory. It assumed it started at (0, 0) or somewhere off the field and try to compensate for that. Thank you so much!

2 Likes

Just in case - we tested all the “fancy” things offered by PathPlanner, such as starting from a point different than start of trajectory, on-the-fly path generation, commands running on markers, and all of those work. I found that PathPlanner trajectory does not work quite as well on very short distances (e.g. drive straight 0.5m). But some longer trajectories do what you need them to do. And as always, reducing top speed will make it smoother and more precise.
Characterization via SysID is a key - some of the findings about our robot were “unusual” to say the least - meaning - I would not have guessed some of the parameters’ values we determined from characterization.

1 Like

Hi Atsekhan,
We are planning on this tool. Not sure where to start and how to integrate this wpilib. Any pointers to get started are much appreciated
Thanks

Absolutely!

Here is what we did:

  1. We went to the site that offers it and downloaded the tool that allows you to make PathPlanner path.
  2. We ran it and created a simple path (got forward 1 meter). Then we opened a resulting json file, looked inside and made sure we understand how the generated trajectory looks like.
  3. We went to the documentation for both “standard” Ramsete command and the one offered by PathPlanner and made sure that we understand every single parameter it needs and more importantly, how can we obtain it (e.g. - is it a physical property of the robot? Is it something you get from characterization? Is it something you need to make a code for?). If you hit an issue there, I can certainly help.
  4. We ran robot characterization using the SysID. That is actually reasonably simple nowadays. Again, ask for help if/when needed.
  5. We started with a simple example - drive a 1-meter-forward trajectory using the one we drew. So, we created a code for it. We use Command Robot framework, so we made sure we adopt those commands to it properly.
  6. We progressed to complex complex features as we went along and made sure we understand every feature that we go through.

Majority of these tasks were done by the Advanced Programming team (meaning - students) under my guidance. The process is not very difficult, and as long as the students have the basics of the robot programming, that would be much fun for them.

3 Likes

Congrats! Would you be able to share or update the code? Would love to look at how you guys did it.

Thanks a lot Atsekhan…I will try and let you know

Can you please share the config file and Feedback Analysis settings in SysID? I feel like my measurements are incorrect for Falcons.

Sorry for the late reply but here is the code.

1 Like

Thanks

all good much appreciated!

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