5. State Feedback: Linear Quadratic Regulator - JoshSilver8/ENGR454_Buck_Converter GitHub Wiki

For LQR we are using the same method to apply state feedback as hand placing poles, except that our poles are not being arbitrarily placed. To calculate our pole matrix K using the lqr() function in MATLAB. Using the same method as hand placing poles, we can calculate our G matrix to apply LQR feedback.

By controlling u we can say the following:

The small-signal linear model we used to model this system was:

The linear quadratic regulator is a method to add β€œcost” to our state variable feedback. To do this we have to define the Q and R parameters.

R: How controllable is our system (Higher = Less Control) Q: Cost matrix (Higher Element = More expensive to adjust)

The theory behind LQR is by defining the R and Q parameters we can minimize the following cost function.

MATLAB Implementation

Using a similar method as hand placing poles for simulation, we replace our hand place poles with the use of MATLAB's LQR function to determine our poles.

Arduino Implementation

This was then implemented into Arduino code to be tested using the Buck Converter. Using the LQR poles we were able to adjust the voltage between 8V – 12V and Vout remained relatively stable. The Arduino code used was identical to the hand placing poles code and by sweeping our Vin from 8V – 12V (Operating Range) we could compare the hand placed poles, LQR poles, and No feedback given the desired output is 5V. The poles are optimized for Vin=9V. The Arduino code can be found in the code section of the repository.

We can see that the implementation of LQR poles in the buck converter was a success compared to the Hand Place Poles which did give us some feedback to correct the offset from our desired Vout