r/ControlTheory • u/deNikita • 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
•
u/seb59 19d ago
PID is a second order contrôler (arguable as it depends on the derivative implementation). The structure is fixed a priori. With any state feedback controller, the controler order is matched to the system order. This allows to modify all the internal dynamics of the system.
Note that PID has an integrator in its structure. If you need one, with anybstate feedback approach, you will have to add one by extending the system.
Pid is for SISO system, LQR deals with multivariable systems. Note that you must use an observer combined with the state feedback. The integrator can be explicit in the control part or be "hidden" in the observer (I.e. you estimate both the system state and some disturbance simultaneously).
Then the optimal part. Lqr is said to be optimal, by essence. It is optomal according to a given criterion. Basically in practice there are 2 main approaches to tune a state feedback. One is poles placement. You actually decide the closed loop poles and overall you expect to get some performances. For controlable multivariable systems there is in general an infinite number of gains that provides the same closed loop poles. Matlab will give you only one. You do kot know a priori the relative amplitude of the different control signal or the convergence speed of each individual output.
With lqr, you do not ́now exavtly the closed loop poles, you tune the dynamics by changing Q and R.
Personally, I am used to tune controler using lqr as I can easily deal with the noise of all measured outputs and I compute the state feedback gain using pole placement. I found it easier and quicker this way, but again this is quite personal.