ROMI with PathPlanner: unstable path following

I’m new to ROMI and PathPlanner. Using the WPI RomiReference project and the sample code in PathPlanner I have a bare bones implementation, without drivetrain feedforward or PID controllers, just the PathPlanner PPLTVController for path following.

Trying to follow a straight line path the ROMI jumps wildly forward and back. In trying to isolate the problem I simulated both wheel velocity and wheel distance measurements. Doing that, ROMI follows the path in a reasonable manner. Then I replaced simulated velocity with actual velocity measurements (using encoder rates from the encoder API). That too worked fine. If, however, I use the actual distance measurements from the encoders ROMI goes wild.

Looking carefully at the wheel encoder distance outputs it seems that updates are occurring roughly every 60ms or so – sometimes more, sometimes less. The software is updating the ROMI state (pose, velocity) using the command scheduler periodic loop, at 20ms. This “jerky” distance updating and corresponding robot pose causes the path controller to overshoot and become seriously unstable.

Questions:

  1. Is the output I’m seeing from the ROMI wheel encoder (~60ms updates), typical?
  2. Assuming it is, what is the best way to deal with it? I’m trying to work my way up from simple to complex so, before resorting to drivetrain controllers (feedforward, PID), is there some effective way to “smooth out” the wheel encoder updates?

Thanks
–jon

I think I solved my problem. I added a gain factor to the wheel drive values. With the path max speed set low (0.25 m/s), and the drive gain factor set way low (0.066), the open loop behavior is generally stable with path following. As expected, accuracy is low.

It seems that more important than “jittery” distance data to the path following controller is the large lag between input drive signal and output wheel distance. Hence, reducing gain keeps the controller from overshooting, which kills it. So it goes.