We want to vary the weighting factor R for the LQR controller to see how it affects the system output response.
The R factor is the weighting coefficient for the input signal. By increasing R, we are putting more penalty on the control signal.
As such, the resulting controller will try to minimize the control efforts used to achieve the desired output.
Consider the results obtained earlier for R = 0.1.
Define Step response and Control Effort
Step response
|
Control Effort
|
First, recall the system step response output for the case R=0.1 developed previously. This will serve as our benchmark for comparison.
|
For comparison, we define an energy-like quantity (square of the input voltage) to give us an idea of the cost or the control effort required in operating the DC motor. Here, we show the control effort over time for the case R = 0.1.
|
|
|
|
|
Next, we generate the controller and the corresponding step time response for each value of R from 0.1 to 2. To compare the performance of each of the controllers, we define the control effort of the controller as the square of the input signal, summed over time. This associated control effort (or energy-like) value for each controller is the total cost in operating the individual controllers.
The following plot illustrates the total cost (integral of the energy like control function) for different values of R.
Procedure to calculate total cost
To see the effect of varying R, you can drag the slider to select different values of R and observe the resulting step response and the control effort.
Procedure controlling slider bar