lqgtrack
Form Linear-Quadratic-Gaussian (LQG) servo controller
Syntax
C = lqgtrack(kest,k)
C = lqgtrack(kest,k,'2dof')
C = lqgtrack(kest,k,'1dof')
C = lqgtrack(kest,k,...CONTROLS)
Description
lqgtrack forms a Linear-Quadratic-Gaussian
(LQG) servo controller with integral action for the loop shown in
the following figure. This compensator ensures that the output y tracks
the reference command r and rejects process disturbances w and
measurement noise v. lqgtrack assumes
that r and y have the same length.

Note
Always use positive feedback to connect the LQG servo controller C to the plant output y.
C = lqgtrack(kest,k) forms a two-degree-of-freedom
LQG servo controller C by connecting the Kalman
estimator kest and the state-feedback gain k,
as shown in the following figure. C has inputs and generates
the command , where is the Kalman
estimate of the plant state, and xi is
the integrator output.

The size of the gain matrix k determines
the length of xi. xi, y,
and r all have the same length.
The two-degree-of-freedom LQG servo controller state-space equations are
Note
The syntax C = lqgtrack(kest,k,'2dof') is
equivalent to C = lqgtrack(kest,k).
C = lqgtrack(kest,k,'1dof') forms a one-degree-of-freedom
LQG servo controller C that takes the tracking
error e = r – y as
input instead of [r ; y], as
shown in the following figure.

The one-degree-of-freedom LQG servo controller state-space equations are
C = lqgtrack(kest,k,...CONTROLS) forms
an LQG servo controller C when the Kalman estimator kest has
access to additional known (deterministic) commands Ud of
the plant. In the index vector CONTROLS, specify
which inputs of kest are the control channels u.
The resulting compensator C has inputs
[Ud ; r ; y] in the two-degree-of-freedom case
[Ud ; e] in the one-degree-of-freedom case
The corresponding compensator structure for the two-degree-of-freedom cases appears in the following figure.

Examples
See the example Design an LQG Servo Controller.
Tips
You can use lqgtrack for both continuous-
and discrete-time systems.
In discrete-time systems, integrators are based on forward Euler
(see lqi for details). The
state estimate is either x[n|n]
or x[n|n–1],
depending on the type of estimator (see kalman for
details).
For a discrete-time plant with equations:
connecting the "current" Kalman estimator to the LQR gain is optimal only when and y[n] does not depend on
w[n] (H = 0). If these conditions are not satisfied, compute the optimal LQG
controller using lqg.
Version History
Introduced in R2008b