With the following state space system and setting for the Linear Quadratic Integrator (LQI) Q = diag([1,1,1]) and r = 1; for optimal gains computation, the system is not reaching the desired output by an unit step input (reaching 0.5 as shown in image below), strangely when I set the C matrix to measure position C = [1 0], the output does track the reference input.

Jm  = 0.008; % Rotor inertia
dm  = 0.015; % Damping

A = [0 1;0 -dm/Jm];
B = [0;1/Jm];
C = [0 1];
D =0;
sys  = ss(A,B,C,D);

Q = diag([1,1,1]);
r = 1;

[K,S,e] = lqi(sys,Q,r,0);

Aa = [A [0;0];-C 0];
Ba = [B;0];
Ca = [C 0];

Bi = [0;0;1];
sys_cl = ss(Aa-Ba*K,Bi,Ca,D);

Response for speed control

Response for position control

Is it ppossible that the corresponding Q and r values to be off causing this?

  • $\begingroup$ Why don't you post this on stackoverflow? $\endgroup$
    – abacaba
    Apr 19, 2022 at 14:23
  • $\begingroup$ Are you taking print-screens from Matlab? If you save in PNG, it should be possible to have much nicer-looking plots than this. Also, why don't you choose better titles for the plots? Also, LQI stands for... ? $\endgroup$ Apr 19, 2022 at 14:37
  • $\begingroup$ @RodrigodeAzevedo Linear Quadratic Integrator, thank you for the edit. $\endgroup$
    – abraguez
    Apr 19, 2022 at 17:53
  • $\begingroup$ You provide neither a reference nor a brief explanation of what you mean by LQI. $\endgroup$ Apr 19, 2022 at 18:26

1 Answer 1


If you are only interested in controlling angular speed (not the angle itself) your model is first order. You don't need the integrator (and in fact you are not measuring it anyway when $C = [0 ~~ 1]$ and it is not observable).

When you set $C = [1 ~~ 0]$ you are basically controlling the angle, not angular speed.

  • $\begingroup$ I see now that rank(obsv(A,[0 1])) = 1, Yet I still dont understand the physical sense of it, why measuring speed only makes the system unobservable? $\endgroup$
    – abraguez
    Apr 19, 2022 at 18:50
  • $\begingroup$ Observability means one may reconstruct the states initial position and therefore current position by observation of the output. Only by looking for the angular speed, you may not find out where does the system come from, which is not helpful for multivariable control. $\endgroup$
    – Bruno Lobo
    Apr 19, 2022 at 19:01
  • $\begingroup$ Furthremore, you MUST discern between output matrix $C$ and integration matrix $C_i$. The former corresponds to the sensor matrix, for example, the angular position. The latter corresponds to matrix you wish to track, for example, the angular speed. $\endgroup$
    – Bruno Lobo
    Apr 19, 2022 at 19:08
  • $\begingroup$ @BrunoHenriquePeixoto For integration matrix C_i you mean the one used for the output of the closed loop system? But the lqi gains are computed with respect to the original C, in this case, [1 0] $\endgroup$
    – abraguez
    Apr 19, 2022 at 19:41
  • $\begingroup$ The LQI MUST utilize the tracking output $C_i$. $\endgroup$
    – Bruno Lobo
    Apr 19, 2022 at 20:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .