Ramsette Controller Not Going Straight

Hi all,
We are trying to implement the Ramsette Controller to follow a path, however, we are experiencing some difficulties. Whenever we run it, the left side of our drivetrain goes significantly faster than the other side. Printing out the encoder readings, we notice that the path following is super inconsistent. Sometimes the left side travels 5ft, while the right side travels 12 feet. The distances always vary. The trajectory we created should only be going 8ft. forward. We are using the SparkMaxes with the integrated NEO encoder with a NavX gyro. I’ve attached the code and the diagnostic plots if this is any help to anyone. 2020robot.zip (20.5 MB)

(Excuse the fact that Drivetrain and RamseteSystem are two separate subsystems. This is pretty messy for now)
The relevant classes would be RamseteFollowPath, RamseteSystem, IO, Converter, and RamseteConstants (in Constants class)

1 Like

I’ll check out your code when I can, but for now have you tried just pushing the robot in a straight line and making sure that the encoders report approximately similar values?

It looks like whole sections of the characterization graphs are missing. Could it be that one of your encoders isn’t reporting anything? Check the motor controller status lights and try graphing the output of both the left and right encoders.

Take a look at this post for some tips. I see a couple potential issues:

  1. You need to zero your encoders before constructing DifferentialDriveOdometry.
  2. Make sure left rotation results in a larger heading. You probably have to invert the navX heading.
  3. Heading should be in a range of [-180, 180]. NavX getAngle() is a continuous value.
  4. Make sure your robot pose matches the trajectory starting pose.

Our graphs look similar and we have Ramsete working.

Is it fine that one side of the drivetrain is reporting positive rpm and the other side is returning negative rpm, since it is inverted? Or does this need to be changed so they both report positive encoder counts?

I was able to get good ksV, kvV, and kaV values with the characterization tool reporting negative drive distances for the right side of the robot while driving forward. (This was using brushless NEOs)

At the end of each characterization run it would report the right side of the drivetrain traveling in the opposite direction as the left. The distances should be similar (but with opposite signs) if the robot is going in a straight line.

The reported distances should be close to what the robot moved. Get out a tape measure and check. If it’s off you probably have the gear ratio and/or wheel diameter wrong. I found measuring the wheel circumference for left and right, averaging them, and then calculating the wheel diameter was more accurate than trying get an accurate measure of the wheel diameter. (FYI 6" wheels aren’t 6" when they have tread on them.)

They recently updated the frc-characterization tool to correctly estimate the track width even when one encoder is reporting inverted distances. So, I guess this condition isn’t unexpected. The estimated track width should be close to the actual track width. Ours was pretty close, just off by about 4mm.

1 Like

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