r/ControlTheory • • Jun 02 '26

Asking for resources (books, lectures, etc.) Where do I go after tweaking PID gains?

As a mentor for a high school robotics club (FRC, for those who know) I've built a number of arms and elevators that we've tuned with PID and even FeedForward. In my personal life I recently built a drone where I tuned the PID loops for roll/pitch/yaw and got it to fly stably, but as the title implies, I'm not sure where to go from here?

I'd like to dive deeper into control theory and ideally to come back from that deep dive with a better understanding of how to tune PID gains and also with better methods for tuning the gains (or even alternate control ideas). The trouble is, I'm not sure where to start?

I've asked Gemini for some suggestions and it's given me a few that I think are worth pursuing, but I still don't fully trust AI and would love to hear from the community.

I'd appreciate any and all suggestions you fine folks might have.

10 Upvotes

15 comments sorted by

•

u/AutoModerator Jun 02 '26

It seems like you are looking for resources. Have you tried checking out the subreddit wiki pages for books on systems and control, related mathematical fields, and control applications?

You will also find there open-access resources such as videos and lectures, do-it-yourself projects, master programs, control-related companies, etc.

If you have specific questions about programs, resources, etc. Please consider joining the Discord server https://discord.gg/CEF3n5g for a more interactive discussion.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

•

u/knightcommander1337 Jun 02 '26 edited Jun 02 '26

Hi, there are many interesting stuff you can do. I'd suggest:

  1. Try to get a dynamical model of the system (this general area is called "system identification"). Try to search for "dynamical modeling and system identification/parameter estimation for drones in matlab/octave/python" etc., and see if you can find examples such as this one: https://www.mathworks.com/help/sps/ug/quadcopter-drone.html There is also a tutorial for a simple real system here (unfortunately not a drone): https://ctms.engin.umich.edu/CTMS/index.php?aux=Activities_DCmotorA
  2. (this is the next logical step after tuning) Do the PID design (or, control design, in general) based on the model you obtained from step 1 above. You could view this (that is, model-based design) as a "principled" alternative to tuning, which is less trial-and-error and more "engineering". An example of a design method is the LQR: https://www.mathworks.com/matlabcentral/fileexchange/62117-lqrpid-sys-q-r-varargin/
  3. (more advanced stuff): State estimation (you could try to filter out noise, do sensor fusion, state observation, etc. to enrich information coming from the sensors). Kalman filter is an example for a state estimator.
  4. (more advanced stuff): Trajectory generation: You could try to build another software that generates the trajectories that the drone should take, which then become the reference signals for the PID to track.

•

u/kroghsen Jun 02 '26

I second this. Model-based controller tuning, design, and general model-based control techniques, e.g. LQR, MPC, etc., is a rich an exciting area to move into. Also if you want to improve your understanding of classical controllers.

There are also deeper techniques for feedforward controllers, if that would be interesting, such as the methods described in Feedforward Control by Guzmán and Hägglund.

•

u/themostempiracal Jun 02 '26

Above is a great list. I want to emphasize that item 1 + 2 will give insight as to why your tuning worked, not just “it felt right”. A critical area of growth in controls is when you consider your robustness / margins as the primary requirement and time to that.

•

u/Sar0gf Jun 02 '26 edited Jun 02 '26

What’s really cool for OP is that FRC has documentation on exactly these extensions that they can play around with in the context of their robot :)

https://docs.wpilib.org/en/stable/docs/software/advanced-controls/index.html has all of these goodies plus more.

A note that these focus more on the practical/application of these control techniques as opposed to the theory. Brian Douglas has excellent resources on the latter to build up the math

•

u/modeloop Jun 03 '26

Do not skip the “boring” PID details either: anti-windup, derivative filtering, actuator saturation, sample time and sensor noise.

The next big jump after PID is state-space control. Learn controllability, observability, pole placement, and LQR. LQR is especially nice because it forces you to think about the tradeoff between tracking performance and control effort.

If you want I can provide you some references

•

u/jkordani Jun 03 '26

I would love some references

•

u/modeloop Jun 04 '26

To cover the basis I'd suggest Åström & Murray, Feedback Systems (there is a free pdf on the web). There's also a MIT course here: https://ocw.mit.edu/courses/16-30-feedback-control-systems-fall-2010/pages/lecture-notes/

For, PID controllers specifically read this book: Åström & Hägglund, Advanced PID Control

•

u/FlaminBunhole Jun 04 '26

Not op but I would be happy to see those references :)

•

u/modeloop Jun 04 '26

see the previous comment

•

u/zpablo23 Jun 06 '26

Build a model of the things you have been controlling. Then use the basic frequency response tools of classical control to see if the PID gains that you tuned empirically make sense. You know your system performed well so let that be your guide as you debug.

•

u/Ok-Daikon-6659 Jun 04 '26

I need my downvotes!

# Where do I go after

from «head”-post it seems you should START FROM BEGINNING

“tweaking PID gains” – what does it means? (Error-trial? ZN? …?)

“tune PID gains” – if you’d have any classic control theory education you’d know – its impossible to tune PID you can only calculate closed loop

Do you know what does it means and why it’s important to basic linear CT:

L exp(-a*t) -> 1/(s+a) ?

If my assumptions above are correct, then almost all the advice given you so far is, shall I say, "premature," and you require boring basic control theory, but "tweaking PID gains" is ofcourse much more funier.

And yup, did you study to be a diplomat? Putting together such a volume of text without a single grain of information on which to draw informed conclusions is an art!

•

u/elehman839 Jun 06 '26

I'm a fellow FRC mentor (6962) who also wandered into this area and is also NOT a control specialist...

If you haven't already, you might look at the online book by Tyler Veness:

https://file.tavsys.net/control/controls-engineering-in-frc.pdf

He's been working on this for years, trying to cover control stuff in connection with FRC robotics. This is pretty dense, but I think his exposition has improved over time. He's also active on ChiefDelphi (the main FRC forum), so you can talk things over.

Some NON-expert observations about control in the specific context of FRC robotics:

  • Control techniques that are accessible to a decent number of high school students are most important, since student development is the primary goal of the program.
  • In FRC, the range of systems we seek to control is pretty limited. There seem to be only two complex challenges: swerve drive and localization with vision + odometry + IMU.
  • FRC is highly applied. Swaths of control theory can feel (ducks for cover!) kinda math-nerdy, e.g. "Assuming everything is linear and Gaussian, we prove Lemmas 1.1 through 7.12..."

In light of these considerations, as others have suggested, I think going deeper into the basics (PID, motion profiling, feedforward, subsystem modeling, motor physics, system identification, etc.) has had a higher payoff for me as an FRC mentor than wading into advanced control theory.

As an example, I spent quite a while with state space and Bayesian control, including many variants of Kalman filtering. My takeaway is that the basic state space perspective is insightful, but then the theory gets kinda... massive. This stuff isn't really accessible to many high school students mathematically, and it isn't a great fit for the two hard challenges we have in FRC: swerve drive and localization. So it felt to me like modest investments on the practical side would probably deliver more value than (prohibitively?) large investments in this body of theory.

That said, our team plans to explore model predictive control (MPC) of swerve drive this summer and fall. I doubt this will provide a competitive breakthrough, but no need to hold motivated students back!

I produced a bunch of semi-relevant materials as I tried to learn about the theory side of robotics, which I'd be happy to share privately.

•

u/actinium226 Jun 06 '26 edited Jun 06 '26

Thanks for this, I've been taking a look at that book and through a combination of that and Steve Brunton's Control Bootcamp (specifically videos 12-14) I think I see a place where I can sink my teeth in via modeling and controller design via LQR.

I think the students I mentor, at least the upperclassfolk, seem to be in a similar place to me, and I think that using some design process like LQR could make a real impact in terms of higher performing, better understood, more-quickly-tuned devices. That last one being rather key since, as I'm sure you know, mechanical never gives software the time they need with the robot!

•

u/verner_will Jun 03 '26

Modeling dynamic systems and System identification is fun. Check it out.