YAGSL modules steering wrong

My team is using a swerve drive with:

  • Krakens x60 for drive
  • Neo with SparkMAX & cancoders for steering
  • NavX as the gyro

we tried using yagsl for the swerve code, and whenever we move to a direction the wheels dont get to the right position and instead are offseted by about ~25deg until i leave the joystick for a second (no power to the motors from the gamepad) and then they rotate to the right position, why that may be?
We were told it may be PID, but nothing seemed to fix it when modifying the PID gains
image (in the image blue is desired red is measured)

1 Like

Do you have code to share (Github, screenshots, code snippets, etc.)? It really helps in these kinds of situations.

Just a quick thought, are your encoder conversion factors set correctly? If I remember correctly, YAGSL will initially set the motor’s internal encoders to whatever the absolute encoder is reading. Then while driving, it uses the internal encoders and the conversion factors to drive. As soon as you stop putting input in, I believe it again sets the internal encoder value to the absolute encoder value. If your conversion factors are wrong, that would seem to explain this issue.

I am referring to the “conversionFactor” setting in the physicalProperties.json file in the YAGSL configuration, specifically the “angle” part of it.
image

I’m not 100% sure about this but it’s something that came to mind when I read this.

1 Like

Ye it was that, thanks, i forgot to close this topic (if thats even possible to close)

1 Like

You should mark that response as the “solution”. That is as close as you can get to closing the topic.

Ok, thanks!