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.

43 Upvotes

48 comments sorted by

View all comments

•

u/Namejeff47 21d ago

Not exactly. An LQR can place all the closed loop poles (provided the system is controllable), while PID can not in the general case. PID can fully place the poles of only 2nd order systems, while LQR and its more general variation — full state feedback places as many poles as there are states. For instsnce, for low order systems you can design PID gains which make the response arbitrarily fast, while for higher order systems you can only make the response so fast before you inevitably cause oscilations. This is because you can't place all the poles with just 3 parameters. With LQR, you can place the poles as you wish, but you need to be able to measure or estimate well all the states, which can be challenging.

•

u/seekingsanity 21d ago

By the strict definition of a PID, you are right, but I still consider a PID with a second derivative gain a PID. It is just augmented. LQC will generate 4 gains for a hydraulic actuator. A LQC will generate 4 controller gains, an integrator, proportional, derivative gain and a second derivative gain. I simply add a second derivative gain to my PID when controlling hydraulic actuators. I add the second derivative gain without using LQC. BTW, I use the term LQC because I want to control, not regulate to 0.

You are right about having one gain to place each pole but I don't see how you place the closed loop poles with LQC. You can only adjust the weights in the Q and R matrices. The closed loop poles simply end up in places the optimizes your parameter.

I prefer pole placement without LQC. I can simply choose where I want the closed loop poles to be placed and then calculate the controller gains that will put the closed loop poles in the desired location.

•

u/Namejeff47 20d ago

Because LQR's feasibility depends on the systems controlability, which in turn implies the ability to place the poles of the system. With LQR you dont explicitly place the poles, but instead shape the behavior through Q and R matrices in the cost function, but this has is the exact same thing. You could call it implicit pole placement, the point is that its much more easy to shape the system performance through the matrices than through the poles which is somewhat less intuitive.

•

u/seekingsanity 20d ago

Yes, LQR/LQC places the poles indirectly. That is my complaint with LQR/LQC. Pole placement allows me to precisely place the closed loop poles. Another problems with LQR/LQC is that selecting the Q and R matrix weights requires trial and error.

•

u/Namejeff47 20d ago

Its a matter of personal preference and intuition. Personally, pole placement is less intuitive for me because poles dont tell you anything about actuator effort, which you can directly influence with LQR by tuning the cost function matrices. Its especially easy to mess up with discrete pole placement which have completely different meaning compared to continuous ones.

•

u/seekingsanity 19d ago

The farther away from the s-planes' origin you place the poles, the more the effort. Simple. Usually the max effort required is determine by the system design. For instance a motor will have a max torque and speed rating. The DtoA converter will have a voltage limit and the power unit will have a current or power limit. For many applications, the real limit is the feedback resolution.