Design an estimator using pole placement, assuming the linear system $$AM=L$$ is solvable.

Create a plant model.

To improve the clarity of this example, call `mpcverbosity`

to suppress messages related to working with an MPC controller.

Create a model predictive controller for the plant. Specify the controller sample time as 0.2 seconds.

Obtain the default state estimator gain.

Calculate the default observer poles.

ans = *6×1*
0.9402
0.9402
0.8816
0.8816
0.7430
0.9020

Specify faster observer poles.

Compute a state-gain matrix that places the observer poles at `new_poles`

.

`place`

returns the controller-gain matrix, whereas you want to compute the observer-gain matrix. Using the principle of duality, which relates controllability to observability, you specify the transpose of `A1`

and `Cm1`

as the inputs to `place`

. This function call yields the observer gain transpose.

Obtain the estimator gain from the state-gain matrix.

Specify `M`

as the estimator for `MPCobj`

.

The pair, ($${A}_{1},{C}_{m1}$$), describing the overall state-space realization of the combination of plant and disturbance models must be observable for the state estimation design to succeed. Observability is checked in Model Predictive Control Toolbox software at two levels: (1) observability of the plant model is checked *at construction* of the MPC object, provided that the model of the plant is given in state-space form; (2) observability of the overall extended model is checked *at initialization* of the MPC object, after all models have been converted to discrete-time, delay-free, state-space form and combined together.

Restore `mpcverbosity`

.