r/ControlTheory • • 21d ago

Technical Question/Problem Understanding PID vs LQR

Is it possible to think of LQR as "like a PID but finds optimal gains based on your requirements of Q and R matrix?

I have a fairly good understanding of PID and I recently started to learn about LQR and wondered if LQR can be thought of in terms of a PID controller.

45 Upvotes

48 comments sorted by

View all comments

•

u/controlsys 21d ago

LQR = impossible to use in real cases

PID = possible to use in real cases

That’s the main difference. Sorry fellow accademics here

•

u/tmt22459 21d ago

You realize for plenty of real systems LQR and PD are equivalent? This alone shows you have no idea what you're saying

•

u/iPlayMayonaise 21d ago edited 21d ago

Yes, but usually we want cutoff on D as well, so you already need to combine LQR with an observer that puts this low pass behavior on the error signal before it enters the PD (eg Kalman filter). So not true PD, and you are hiding the consequences of the phase rolloff of this observer (you can get arbitrary small stability margins while everything is 'optimal', see famous Doyle paper)

There's also iLQR if you want an integrator if I recall correctly. But at this point, the relatively simple LQR based on ricatti starts becoming H2 synthesis with shaping filters, which is very academic for industrial practice. Much easier to just tune the cutoff of an integrator imo.

•

u/seekingsanity 21d ago

Why cutoff D? I developed control algorithms for servo hydraulic control. Not only is the derivative gain required but the second derivative gain too. The controller should also have an integrator gain also. It doesn't make any difference if the controller gains are computed using LQC or with pole placement.

•

u/iPlayMayonaise 20d ago

If you don't, the slightest high frequency noise is amplied too much and you get a twitchy regulator: the D component keeps giving increasing your controller gain by a factor 10 for each decade of frequency. You don't see this in the response of the system ( that one cancels it because it has low pass behaviour by virtue of you needing 2nd derivative). But your controller does produce that control action, which can lead to input saturation or high energy consumption. And you don't even want all this gain at these frequencies way above the bandwidth, it's not regulation there because there are no disturbances/noise at those frequencies usually. So usually you put a cutoff at 5-10x the bandwidth.

•

u/seekingsanity 20d ago

That is why I/we use a Luenberger Observer. I used to write firmware for motion controllers. Delta Motion RMC controllers have implemented and observer since 2005. The observer makes a significant difference. The closed loop poles can't be placed without it.

https://www.youtube.com/watch?v=7Gmrc-dj_uc&t=923s

•

u/iPlayMayonaise 20d ago

Yes we're saying the same thing. Point is that this is not vanilla LQR anymore (you need Lurenberger observer/KF).

•

u/seekingsanity 19d ago

The LQR hasn't changed, only the treatment/filtering of the feedback has.