Path planner swerve overshooting in auto

This is our teams first successful year getting swerve with MK4i modules working and we tried to implement path planner however instead of following the path it moves back and forth in a semi-straight line until we E-stop it. It makes absolutely zero progress to the endpoint. The intended path just goes left downfield for a bit and then it stops and goes halfway back diagonally down.

This is our git code Wallmart battlepass

1 Like

hi im a different student on this team, we still have not found an answer and any help is still very appreciated, thanks!

This is a difficult thing to do the first time, working through it myself in non-swerve land.

What are the possible changes that can be made, which have you tried, what changed?

For example, each path has a constraint of max speeds, acceleration, angular velocities, etc. Are you doing this in the simulator, or just on the real robot?

Did you have telemetry updating in PathPlanner to see what the pathplanner expected results were, relative to the real result?

Could you provide your code for following paths? I couldn’t find it when looking through your github.

2 Likes

All of your gains are zero, that can’t be right.

See Swerve Module PIDF Properties · BroncBotz3481/YAGSL Wiki · GitHub

4 Likes

They have it here, here, and here

1 Like

There’s also more docs here.

1 Like

well that would uh… most likely be the issue :joy: i’ve informed the programming team about this

1 Like

A little off topic but your “LeanProtection” subsystem is intriguing and I couldn’t help to comment on it

8 Likes

knowing our programmers this is quite normal for them

2 Likes

We messed with the all max velocities and how the path is set up, which seemed to do the trick for our first path (just about a foot of movment forward). We also changed the hot reload and holographic [somthing, edit later].

I believe we do have telemetry working but when we start auto the robot teleports across the sim field

I would suggest putting your max velocity very slow, and your acceleration about 1/3 of your velocity. That way your path will drive slow, and accelerate slow. Then you can tune with higher speeds as you get closer.

We tried changing these and seemingly nothing happened. We did find some other values related to path planner translation PID and the Max module speed, editing the translation PID seems to help but it’s stuttering around quite a bit although there is a stutter around the corner.

1 Like

Try adding a small bit of d value to the pid because it sounds like there’s oscillation and adding a derivative value should help dampen it a bit.

1 Like

Does your odometry correctly reflect what the robot is actually doing? I say this because one problem I had while setting up PathPlanner was my math for converting the angular velocity (rpm) to linear velocity (mps).

So we got some progress by following the 8 step process in the yagsl documentation, now we’re stuck on some (what we think) PID issues, specially the pathplanner translation PID. Video in the video here the robot is supposed to stop right on the bit of tape without overshooting (I stuck the pathplanner view in there as well) From here we’re not really sure how to fix this as our PID tuning seems to be as good as it gets, any higher or lower and it gets worse.

Hey all, we ended fixing the problem by added a rotation PID and moved the max speed up from sds numbers. The code is on git if you want to look at it!