**5. Control design**

The control techniques are Optimal linear feedback control (OLFC) and statedependent Riccati equation (SDRE).

The OLFC has control feedback as its main application for controlling nonlinear systems, it has this name because it is characteristic of the controller to have the control

#### **Figure 8.**

*(a) Phase Portrait (gray lines) and Poincare Map (black dots), (b) time series of displacement* x1 *and (b) velocity* x2.*.*

#### **Figure 9.**

*(a) Portrait phase (black line) and orbit (red line), (b) time series of displacement* x1,*, and (c) and time series of velocity* x2*.*

signal as a function of the difference between real values and the values expected by the state variables. The application of this technique in nonlinear systems is due to the simplicity of implementation. In other words, the OLFC control does not consider the nonlinearities of the system of equations for the suppression of the chaos that occurred in the microcantilever of the AFM system. However, the SDRE controller considers the nonlinearities of the system, and its state matrix is not fixed. The SDRE control technique guarantees an asymptotically stable solution over the origin [7, 29–33].

In both cases, there is a need to propose an orbit for the system to be controlled. In this chapter, we opted for simplicity of calculations to consider an orbit described by Eq. (14):

*MEMS-Based Atomic Force Microscope: Nonlinear Dynamics Analysis and Its Control DOI: http://dx.doi.org/10.5772/intechopen.108880*

$$\begin{cases} \varkappa\_1 = 0.5 \sin\left(\alpha t\right) \\ \varkappa\_2 = 0.5 \cos\left(\alpha t\right) \end{cases} \tag{14}$$

We can consider the system Eq. (8) in the matrix form given by:

$$
\dot{\mathbf{x}} = \mathbf{A}\mathbf{x} + \mathbf{g}(\mathbf{x}) + \mathbf{U} \tag{15}
$$

Where **Ax** is error dependent state matrix, **g(x)** is a nonlinear matrix, and **U** is control signal [34, 35].

Both control techniques use two controllers called feedback (uf) and feedforward (ũ), so the control signal of the nonlinear system is defined **U**=ũ+u?. While uf has the characteristic of correcting the difference between the real values and the stipulated values, taking the system to the stipulated orbit, ũ has the purpose of keeping the system in the desired orbit [24, 25]. The SDRE controller design, like the OLFC, follows some steps to obtain the optimal solution to the dynamic control problem [10, 31]:


#### **5.1 Optimal linear feedback control OLFC**

The optimal linear feedback control is used in nonlinear systems due to its simplicity in its implementation since the control uses fixed k gains. The value of **K** is obtained by solving the Riccati equation [34–36].

The nonlinear system of Eq. (7) can be written in matrix form using the general equation of nonlinear systems 14.

Then Eq. (16) shows the system rewritten in matrix form and as a function of errors, knowing that <sup>¼</sup> *<sup>X</sup>* � *<sup>X</sup>*<sup>~</sup> , then it is possible to obtain the state matrix *<sup>A</sup>* errordependent and nonlinearity matrix *g e*, *X*~ ,

which will not be used in the control and, therefore, is indicated in the equation.

$$
\dot{\mathbf{e}} = \begin{pmatrix} 0 & 1 \\ -1 & D1 \end{pmatrix} \cdot \begin{pmatrix} e\_1 \\ e\_2 \end{pmatrix} + \mathbf{g}\begin{pmatrix} \mathbf{e}, \tilde{X} \end{pmatrix} + U \tag{16}
$$

The gain is described by*<sup>k</sup>* <sup>¼</sup> *<sup>R</sup>*�<sup>1</sup> *BTP* where *P* is the Riccati matrix, *R*= 1 0 0 1 ,

#### **Figure 10.**

*uf in the transient regime and ũ is the steady-state control signal.*

$$B = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \text{ and } Q = \mathbf{1000} \* \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \\ \text{[23, 24, 33]}.$$

The matrices *P*,*R*,*B*, and *Q* guarantee the stability of the solution of the Riccati equation. Therefore, the gain found by the system is defined by

$$k = \begin{pmatrix} 1000 & 5 \times 10^{-6} \\ 5 \times 10^{-6} & 1000 \end{pmatrix} \tag{17}$$

**Figure 9a** shows the portrait phase of the uncontrolled system in black and controlled in red, and (b) and (c) the time series of the system is shown.

**Figure 10** shows the control signal u? in the transient regime, that is, at the moment when the control is taking the system to the desired orbit in the plot of ũ is the steady-state control signal.

In **Figures 11** and **12,** the controller errors in transient and steady state are presented for each time series of the system.

*MEMS-Based Atomic Force Microscope: Nonlinear Dynamics Analysis and Its Control DOI: http://dx.doi.org/10.5772/intechopen.108880*

**Figure 12.**

*eu*~ <sup>1</sup> *represents the error of* x1 *in steady state for the feedforward control. eu*<sup>~</sup> <sup>2</sup> *represents the trajectory error of* x2 *in the control feedforward.*

#### **5.2 State-dependent Riccati equation control**

The state-dependent Riccati equation (SDRE) control, unlike the OLFC, does not exclude the dependence of the error-dependent state matrix, so the controller gains change with each iteration. The SDRE methodology used to find error-dependent states used matrix like that is used for the OLFC control. It can be written from the following nonlinear matrix of errors:

$$\begin{split} \dot{e} &= \left( \frac{2c\mathcal{Q}}{\left( 1 - \mathbf{x}\_1 - \eta\_1 \sin \left( at \right) \right)^3} - \frac{3\mathbf{x}\_2 p}{\left( 1 - \mathbf{x}\_1 - \eta\_1 \sin \left( at \right) \right)^4} + \frac{8c\mathbf{1}}{\left( 1 - \mathbf{x}\_1 - \eta\_1 \sin \left( at \right) \right)^9} \frac{p^1}{\left( 1 - \mathbf{x}\_1 - \eta\_1 \sin \left( at \right) \right)^3} - d\_1 \right) \cdot \dot{e} \\ & \left( \frac{\alpha}{\alpha} \right) + \mathbf{g}(\dot{X}) + U \end{split} \tag{18}$$

where *g X*~ � � is the matrix that does not depend on errors. The gain **k** is obtained *<sup>k</sup>* <sup>¼</sup> *<sup>R</sup>*�<sup>1</sup> *BTP* where *P* is the Riccati matrix. The control *u* found from the solution of the following equation:

$$u = -\mathbb{R}^{-1}\mathbb{B}^{T}\mathbb{P}e\tag{19}$$

Being a symmetric matrix and obtained from the algebraic Riccati equations [7, 34, 36]:

$$A^T P + PA - PBR^{-1}B^T P + Q = \mathbf{0} \tag{20}$$

The controller gain *<sup>k</sup>* is defined *<sup>k</sup>* <sup>¼</sup> *<sup>R</sup>*�<sup>1</sup> *BTP* where *P* is the Riccati matrix, *R*= 1 0 0 1 � �, *<sup>B</sup>*<sup>=</sup> 1 0 0 1 � �, and *<sup>Q</sup>*=1000 1 0 0 1 � � [23, 24, 33].

The matrices *P*,*R*,*B*, and *Q* guarantee the stability of the solution of the Riccati equation. Therefore, the gain found by the system is defined in **Figure 13,** which

#### **Figure 13.**

*(a) Portrait phase (black line) and orbit (red line), (b) time series of displacement* x1, *and (c) time series of velocity* x2*.*

shows the result of the controlled system using the SDRE technique, in **Figure 13a** the portrait phase without control and with control is presented, and their respective time series in **Figure 13b** and **c**.

**Figure 14** represents the control signal *uf* in the transient regime, that is, now when the control is taking the system to the desired orbit. The **ũ** plots show the steady-state control signal.

**Figures 15** and **16** show the controller errors in transient and steady state for each time series of the system.

**Figure 17** shows the behavior of gain *k* since it is calculated at each interaction, that is, the controller gain is variable.

**Figure 18** shows the comparison of the control signal *U=ũ+uf* for the two techniques applied in this text. It is possible to notice that the OLFC control, even excluding the nonlinearities of the system, has a control signal very close to the control signal of the SDRE.

*MEMS-Based Atomic Force Microscope: Nonlinear Dynamics Analysis and Its Control DOI: http://dx.doi.org/10.5772/intechopen.108880*

#### **Figure 15.**

*e uf* <sup>1</sup> *represents the error of* x1 *for the feedback control and euf* <sup>2</sup> *represents the path of* x2 *for the feedback control.*

#### **Figure 16.**

*eu*~ <sup>1</sup> *represents the error of Eq. (7) in steady state for feedforward control. eu*<sup>~</sup> <sup>2</sup> *represents the steady-state trajectory error for the feedforward control.*

**Figure 17.** *SDRE behavior of gain k.*

**Figure 18.** *Comparison of the control signal.*
