## Control Design and Disturbance Compensation Using Extended State Observers

Since R2024a

An extended state observer (ESO) is a state estimation technique that allows you to estimate the states and disturbances of a plant based on the its inputs and outputs. The algorithm models disturbances as an extended state of the plant to perform the estimation. This technique is helpful when you want to compensate for unknown disturbances in your control system. These disturbances represent total disturbances, including unknown dynamics and internal and external disturbances.

### Extended State Observer Block

You can use the Extended State Observer block to implement ESO in Simulink®. The block requires you to specify system dynamics in the following form.

`$\begin{array}{c}\stackrel{˙}{x}/{x}^{+}=Ax+{B}_{u}u+{B}_{d}d\\ {y}_{m}={C}_{m}x\end{array}$`

Here:

• x is the plant states

• $\stackrel{˙}{x}$ is the state derivative in continuous time and x+ is the state update x[k+1] in discrete time.

• A, Bu, and Cm are the plant dynamics.

• ym is the measurable plant output.

• Bd is the disturbance input matrix. The block allows you to specify the disturbance matrix in the form Bd = k×Bu for matched uncertainties, where k is a gain specified using block parameters. You can also specify Bd as a block input for mismatched uncertainties [1].

• d is the total disturbances in the model, including unknown dynamics and internal and external disturbances.

Typically, you obtain these system dynamics from a physical representation or an approximation of the plant. The block does not require you to provide an actual model of the plant. Therefore, the accuracy of estimation will depend on the accuracy of the plant approximation. Based on these plant inputs u and outputs ym, the block returns estimated the states $\stackrel{^}{x}$ and disturbances $\stackrel{^}{d}$. Using these estimated states and disturbances, you can implement state feedback or disturbance compensation control techniques.

To tune the observer response, use the Bandwidth (rad/s) and Spacing (rad/s) parameters. Using these parameters, the block determines the location and spacing of the poles and calculates the observer gain matrix. You can also specify the observer gain matrix as a block input.

For an example, see Apply Extended State Observer for Reference Tracking of DC Motor.

### Disturbance Compensator Block

Use the Disturbance Compensator block to modify control actions of a nominal controller to reject and compensate for disturbances in your model. To compensate for disturbances, the Disturbance Compensator block uses an ESO to estimate total disturbances in the model and returns the modified controller actions you can use as plant input.

The block extends the implementation of ESO described in the previous section as follows.

`$\begin{array}{c}\stackrel{˙}{x}/{x}^{+}=Ax+{B}_{u}u+{B}_{d}d\\ {y}_{m}={C}_{m}x\\ u={u}_{0}+{K}_{d}\stackrel{^}{d}\end{array}$`

Here:

• u is the modified controller action.

• u0 is the nominal controller action.

• Kd is the compensation gain matrix.

A typical structure is shown in this diagram. The highlighted section shows how the Disturbance Compensator block generates the compensation signal.

Similar to the Extended State Observer block, to tune the observer response, use the Bandwidth (rad/s) and Spacing (rad/s) parameters. Using these parameters, the block determines the location and spacing of the poles and calculates the observer gain matrix and the compensation gain matrix Kd. You can also specify the gain matrices as a block inputs.

The calculation of Kd is time-domain dependent. For more information, see [1] and [2].

For an example, see Compensate for Disturbances in Spring-Mass-Damper System.

## References

[1] Li, Shihua, Jun Yang, Wen-Hua Chen, and Xisong Chen. “Generalized Extended State Observer Based Control for Systems With Mismatched Uncertainties.” IEEE Transactions on Industrial Electronics 59, no. 12 (December 2012): 4792–4802. https://doi.org/10.1109/TIE.2011.2182011.

[2] Zhang, Pengcheng, Jianyu Wang, Yun Cheng, and Shiyu Jiao. “Reduced-Order Generalized Extended State Observer Based Control for Discrete-Time Systems.” In 2022 International Conference on Cyber-Physical Social Intelligence (ICCSI), 670–75. Nanjing, China: IEEE, 2022. https://doi.org/10.1109/ICCSI55536.2022.9970623.