Understanding Nonlinear Feedback Controllers

I am looking for a way to implement some sort of controller that takes the field-relative pose of the robot into account to a) compensate for the robot being off the path and b) ensure that it ends up in the right spot facing the right way. I was looking at Pure Pursuit, but from reading into it the algorithm does not take into account headings. RAMSETE, however, does take into account the current and desired headings.

How is the RAMSETE controller supposed to work? Say I had the robot at the state (x,y,theta, linear velocity, angular velocity) of (0,0,0,0,0) and gave it a goal state of (1,5,0,2,0). What does the robot look like if it follows the controller properly and gets to (1,5)? Facing the same direction as the initial state and moving at 2 units/s forward?

Are there other strategies in the realm of pure pursuit, RAMSETE, etc. that could also be applied? It seems RAMSETE is all the rage right now. This is for a personal project of mine, so I am not looking for FRC-specific code, but more of a general understanding of the techniques to implement myself. Any help would be appreciated.

1 Like

Ramsete needs a trajectory to follow as it’s not a pose stabilization controller. You can’t just give it the end pose and expect it to converge because the velocity command goes to zero when the desired velocity goes to zero. If you want a more in-depth explanation of the control law, read section 8.6 “Ramsete unicycle controller” in Controls Engineering in FRC. There’s some plots there if you want to get a feel for how it behaves. You can also tweak the scripts that generated the plots, like this one (here’s instructions on how to run the examples):

There are also pose stabilization controllers in the original paper that control law came from, but we haven’t seen a need for them; you basically always have a desired trajectory anyway.

We included Ramsete in WPILib because it’s globally asymptotically stable when the desired velocity is nonzero, and it requires basically no tuning because it doesn’t deal with acceleration dynamics. It’s used in a hierarchy with lower level velocity controllers where Ramsete’s output provides the reference for the velocity controllers. Other controllers exist of course, and we’ll be including some in WPILib next year. There’s a couple derived in the “differential drive” section of Controls Engineering in FRC’s chapter 8. We’re looking at including the linear time-varying unicycle and differential drive controllers because they are locally optimal controllers (for some sense of optimal), unlike Ramsete. I suggest reading chapter 7 “Nonlinear control theory” first, then reading chapter 8 from the beginning since it covers a couple flavors of controllers for both linear and nonlinear systems.

If you want a more complete introduction to nonlinear control, I highly recommend watching this lecture series from MIT on underactuated robotics. Since the 2020 series was suspended partway through due to COVID-19, you can continue watching the 2019 playlist after watching the 2020 playlist (I like the 2020 playlist’s topic organization over the 2019 one). The lecture notes are here.


Thank you for the resources Tyler, will definitely take a look at those soon.

How could one go about implemented a pose stabilization controller? My first thought would be something like what 1114/2056 uses where you drive to an (x,y) on the field and then adding a simple turn to target heading at the end.

Chapter 6 (page 24 and on) of https://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf has examples. You could do something like run a linear time-varying controller until the velocity hits zero, then enable a heading controller, but it’s very jerky in simulation last I tried.

1 Like

Interesting stuff. Thanks for the help.

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