We are using YAGSL for swerve drive this year and having issues with rotation PID. Any tips for tuning?
Thank you!!
We are using YAGSL for swerve drive this year and having issues with rotation PID. Any tips for tuning?
Thank you!!
Did you see this page?
You don’t need to use SwerveController
if you dont want to. You can use the Elastic dashboard and have a PID Widget which will help you configure the heading PID. I will get around to making some docs on this if @Gold87 doesn’t beat me to it.
Ok, so the angles are now working while driving but when I stop driving the wheels go crazy. Would this still be Pid or is it something else?
Check your deadband, set it to 0.1 and then go down from there. Let me know if this solves it!
It is at 0.1 but the wheels are spinning in circles, so I don’t think it’s a dead band issue.
Hmmm, check your controller inputs on the frc driver station just to make sure the controller isn’t giving any weird inputs above the deadband.
Also could you tell me what hardware you are using such as module names, motors, cancoder, gyro?
I checked and there is nothing out of the norm there. GitHub - FireIslandFRC/YAGSL-Test: Yet Another General Swerve Library Example Project for 6420
That is our code. If you want more details that you can’t find just ask. Thank you for the help.
Ok if the wheels are spinning in circles then you need to follow the when to invert guide in the documentation found here. Also is there any specific reason you are using the closedAbsoluteDriveAdv
as opposed to driveFieldOrientedAnglularVelocity
Line 91 Robot container? First follow that when to invert guide and then let me know the results.
Thank you so much! I really appreciate the help and will let you know what happens. And no there is no particular reason I am using closedAbsoluteDriveAdv. Should I use driveFieldOrientedAnglularVelocity?
@Flint221 feel free to correct me if I’m wrong, but I believe that the control types are completely personal preference. Now that I think about it, maybe I should write up some docs about the different types, assuming nstrike hasn’t already.
My team has seen the most success with driveFieldOrientedDirectAngle
for teleop control, but it entirely depends on what type of control layout you want.
The control schemes you use are completely up to personal preference, what type of controls are you looking for? If you read the comments in these lines you can get an idea of what each ones does → here. Also do let me know if that fixed that problem!
It turns out they were not spinning in circles. They were just oscillating a lot around set points. Would this be PID? I was thinking it was but the driving works until I stop driving. I think it is the tong to get to a set point and failing. Any advice or is this a lost cause?
This is definitely PID. You may just need to tune it!
Tuning PID is super easy once you understand how it works! If you are not familiar in how to tune pid I advise you to watch this video here as once you understand what is happening, it’s only a matter of an hour or two till you have a smooth functioning swerve drive! Let me know how it goes. You can also find a lot of other guides online on how to tune PID for a swerve drive.
Is it the PID in PIDFconstants? Or is it the heading PID. Because the Pid for changing angle seems to be working. But it’s just when we stop driving that it is going weird. I think that it’s trying to snap to position and it’s not going
I can’t answer you until I see how the robot is behaving. Please send a video of the robot using FRC Web Components.
I would need to see the controller in the same frame too.
Here it is, if you have any questions just ask. https://www.youtube.com/watch?v=67QM5bvH-_o&feature=youtu.be
Sorry, should be fixed.