*5.3.2 Elevation control using PID controller*

Summing the rows of (41) results the following [21]:

*A Hybrid Control Approach Based on the Combination of PID Control with LQR Optimal Control DOI: http://dx.doi.org/10.5772/intechopen.94907*

$$u\_1 + u\_2 = -(2k\_{11}c + 2k\_{13}\dot{c} + 2k\_{16}\xi) = -\left(2k\_{11}c + 2k\_{13}\dot{c} + 2k\_{16}\left[\epsilon dt\right]\right) \tag{48}$$

The above equation can be written as

$$W\_s = 2k\_{11}(\varepsilon\_d - \varepsilon) - 2k\_{13}\dot{\varepsilon} + 2k\_{16} \int (\varepsilon\_d - \varepsilon)dt\tag{49}$$

It is obvious that Eqs. (43) and (49) have the same structure, this means that the gain parameters of the pitch PID controller can be obtained from the gain elements of the LQR controller. Thus, comparing Eq. (43) with Eq. (49), yields the following gain relationships:

$$K\_{cp} = 2k\_{11}$$

$$K\_{cd} = 2k\_{13}\tag{50}$$

$$K\_{ci} = 2k\_{16}$$

The block diagram of closed-loop control system for 3DOF helicopter system based on hybrid LQR-PID controller is shown in **Figure 9**. Taking Laplace transform for elevation axis model Eq. (31) yields the following equation:

$$J\_{\varepsilon}\varepsilon(\mathfrak{s})\,\mathfrak{s}^{2} = K\_{\varepsilon}l\_{1}V\_{\varepsilon}(\mathfrak{s})\tag{51}$$

The transfer function of the elevation axis plant is given by:

$$\frac{\epsilon(s)}{V\_s(s)} = \frac{K\_c l\_1}{J\_c s^2} \tag{52}$$

The transfer function of the PID controller is as follows:

$$\frac{V\_s(s)}{E\_c(s)} = \frac{K\_{ed}s^2 + K\_{ep}s + K\_{ci}}{s} \tag{53}$$

where *Eϵ*ðÞ¼ *s ϵd*ðÞ�*s ϵ*ð Þ*s ,* the open loop transfer function of the elevation axis control *Gϵ*ð Þ*s* is given by:

$$G\_{\epsilon}(\mathfrak{s}) = \frac{\epsilon(\mathfrak{s})}{E\_{\epsilon}(\mathfrak{s})} = \frac{V\_{\epsilon}(\mathfrak{s})}{E\_{\epsilon}(\mathfrak{s})} \frac{\epsilon(\mathfrak{s})}{V\_{\epsilon}(\mathfrak{s})} \tag{54}$$

Based on Eqs. (52) and (53), the open loop elevation transfer function becomes:

$$G\_{\epsilon}(\mathbf{s}) = \frac{K\_{c}l\_{1}}{J\_{c}s^{2}}\frac{K\_{cd}\mathbf{s}^{2} + K\_{cp}\mathbf{s} + K\_{ci}}{s} \tag{55}$$

The closed loop transfer function for elevation angle control is as follows:

$$\frac{\varepsilon(\mathbf{s})}{\varepsilon\_{\varepsilon}(\mathbf{s})} = \frac{G\_{\varepsilon}(\mathbf{s})}{\mathbf{1} + G\_{\varepsilon}(\mathbf{s})} = \frac{K\_{\varepsilon}l\_{1}K\_{el}\mathbf{s}^{2} + K\_{\varepsilon}l\_{1}K\_{cp}\mathbf{s} + K\_{\varepsilon}l\_{1}K\_{ci}}{J\_{\varepsilon}\mathbf{s}^{3} + K\_{el}\mathbf{s}^{2} + K\_{cp}\mathbf{s} + K\_{ci}}\tag{56}$$

#### *5.3.3 Pitch control using PD controller*

Similarly, the difference of the rows of Eq. (41) results in

*Vs* ¼ *Kϵp*ð Þ� *ϵ<sup>d</sup>* � *ϵ Kϵdϵ*\_ þ *Kϵ<sup>i</sup>*

The travel rate is gonverned by the following PI control equation:

*ρ<sup>d</sup>* ¼ *Krp*ð Þþ *rd* � *r Kri*

Where *e<sup>ϵ</sup>* ¼ *ϵ<sup>d</sup>* � *ϵ*,*e<sup>ρ</sup>* ¼ *ρ<sup>d</sup>* � *ρ*,*er* ¼ *rd* � *r*,*e*\_

Summing the rows of (41) results the following [21]:

*5.3.2 Elevation control using PID controller*

*LQR controller based on GA for 3DOF helicopter system.*

**Figure 8.**

**30**

*ρ<sup>d</sup>* ¼ *Krper* þ *Kri*

While the pitch angle is controlled by the following PD control equation:

*Control Based on PID Framework - The Mutual Promotion of Control and Identification…*

*Vd* ¼ *Kρpe<sup>ρ</sup>* þ *Kρde*\_

ð

ð

*<sup>ϵ</sup>* ¼ �*ϵ*\_ and*e*\_

ð

*Vd* ¼ *K<sup>ρ</sup>p*ð Þ� *ρ<sup>d</sup>* � *ρ K<sup>ρ</sup>dρ*\_ (45)

ð Þ *ϵ<sup>d</sup>* � *ϵ dt* (43)

*<sup>ρ</sup>* (44)

*erdt* (46)

ð Þ *rd* � *r dt* (47)

*<sup>ρ</sup>* ¼ �*ρ*\_ *.*

#### **Figure 9.**

*Control system block diagram for helicopter elevation, pitch and travel axis using PID controller.*

$$
\mu\_1 - \mu\_2 = -2k\_{12}\rho - 2k\_{14}\dot{\rho} - 2k\_{15}(r - r\_d) - 2k\_{17}\gamma \tag{57}
$$

$$dV\_d = -2k\_{12}\rho - 2k\_{14}\dot{\rho} - 2k\_{15}(r - r\_d) - 2k\_{17}\left[(r - r\_d)dt\right] \tag{58}$$

Substitution Eq. (47) in Eq. (45) results,

$$\mathbf{V}\_{d} = -\mathbf{K}\_{\rho p}\rho - \mathbf{K}\_{\rho d}\dot{\rho} + \mathbf{K}\_{\rho p}\mathbf{K}\_{rp}(r\_{d} - r) + \mathbf{K}\_{\rho p}\mathbf{K}\_{ri}\left[(r\_{d} - r)dt\right] \tag{59}$$

It is clear that Eqs. (58) and (59) have exactly the same structure. Then, by comparing these equations, it can obtain the feedback gains for the PID controller from the LQR gains parameters as follows:

$$\begin{aligned} K\_{\rho p} &= 2k\_{12} \\ K\_{\rho d} &= 2k\_{14} \\ K\_{rp} &= \frac{k\_{15}}{k\_{12}} \\ K\_{ri} &= \frac{k\_{17}}{k\_{12}} \end{aligned} \tag{60}$$

where *Eρ*ðÞ¼ *s ρd*ð Þ�*s ρ*ð Þ*s ,* based on Eqs. (62) and (63) the open loop transfer

*A Hybrid Control Approach Based on the Combination of PID Control with LQR Optimal Control*

*Vd*ð Þ*s*

*<sup>ρ</sup>c*ð Þ*<sup>s</sup>* ¼ � *KclρKρds* <sup>þ</sup> *KclρK<sup>ρ</sup><sup>p</sup>*

*Jρs*<sup>2</sup> þ *KclρKρds* þ *lρK<sup>ρ</sup><sup>p</sup>*

*<sup>E</sup>ρ*ð Þ*<sup>s</sup>* <sup>¼</sup> *Kcl<sup>ρ</sup> <sup>K</sup>ρds* <sup>þ</sup> *<sup>K</sup><sup>ρ</sup><sup>p</sup>*

*Jes*<sup>2</sup> (64)

*ρd*ð Þ*s* (66)

*Jrs*<sup>2</sup> (69)

(65)

(67)

(68)

(70)

function of the pitch axis control is given by:

*DOI: http://dx.doi.org/10.5772/intechopen.94907*

*Gp*ðÞ¼ *s*

*5.3.4 Travel control using PI controller*

control is given by:

*ρ*ð Þ*s <sup>E</sup>ρ*ð Þ*<sup>s</sup>* <sup>¼</sup> *<sup>ρ</sup>*ð Þ*<sup>s</sup> Vd*ð Þ*s*

*ρ*ð Þ*s*

The closed loop transfer function of pitch angle is given by:

Taking Laplace transform for travel axis model Eq. (33) results:

The transfer function for travel axis model is given by:

The transfer function of the PI controller is as follows:

*Gr*ðÞ¼ *s*

*r s*ð Þ

**5.4 Controller simulation and results**

*5.4.1 GA-LQR controller*

**33**

*r s*ð Þ*<sup>s</sup>* <sup>¼</sup> *Wl*<sup>1</sup> *Jr*

> *r s*ð Þ *<sup>ρ</sup>d*ð Þ*<sup>s</sup>* <sup>¼</sup> *Wl*<sup>1</sup> *Jr s*

*ρρ*ð Þ*s*

*r s*ð Þ *ρd*ð Þ*s*

The closed loop transfer function for travel angle is as follows:

*Er*ð Þ*<sup>s</sup>* <sup>¼</sup> *Krp* <sup>þ</sup>

where *E s*ðÞ¼ *ρd*ðÞ�*s ρ*ð Þ*s* , the open loop transfer function of the travel axis

*ρρ*ð Þ*s*

*rd*ð Þ*<sup>s</sup>* <sup>¼</sup> *Gl*1*Krps* <sup>þ</sup> *Gl*1*Kri*

*Jts*<sup>2</sup> þ *Gl*1*Krps* þ *Gl*1*Kri*

In order to validate the proposed helicopter stabilizing system, the LQR controller is analysed mathematically using Matlab tool. Based on objective function *(J)* and using the Matlab command *"lqr"* the elements of the LQR weighting matrices *Q, R* are tuned using GA optimization method. For this application, each chromosome in GA tuning approach is represented by nine cells which correspond to the weight matrices elements of the LQR controller as shown in **Figure 10**. By this representation it can adjust the LQR elements in order to achieve the required performance. The parameters of the GA optimization approach chosen for the tuning process of the helicopter control system are listed in **Table 2**. Converging

*Kri s*

*Er*ð Þ*<sup>s</sup>* <sup>¼</sup> *Wl*<sup>1</sup> *Krps* <sup>þ</sup> *Kri*

Taking Laplace transform for pitch axis model Eq. (32) yields:

$$J\_{\rho}\rho(\mathfrak{s})\mathfrak{s}^{2} = K\_{\mathfrak{c}}l\_{\rho}V\_{d}(\mathfrak{s})\tag{61}$$

The transfer function for pitch axis model is given by:

$$\frac{\rho(s)}{V\_d(s)} = \frac{K\_c l\_\rho}{J\_\rho s^2} \tag{62}$$

The transfer function of the PD controller is as follows:

$$\frac{V\_d(s)}{E\_\rho(s)} = K\_{\rho d}s + K\_{\rho p} \tag{63}$$

*A Hybrid Control Approach Based on the Combination of PID Control with LQR Optimal Control DOI: http://dx.doi.org/10.5772/intechopen.94907*

where *Eρ*ðÞ¼ *s ρd*ð Þ�*s ρ*ð Þ*s ,* based on Eqs. (62) and (63) the open loop transfer function of the pitch axis control is given by:

$$\mathbf{G}\_p(\mathbf{s}) = \frac{\rho(\mathbf{s})}{E\_\rho(\mathbf{s})} = \frac{\rho(\mathbf{s})}{V\_d(\mathbf{s})} \frac{V\_d(\mathbf{s})}{E\_\rho(\mathbf{s})} = \frac{K\_c l\_\rho \left(K\_{\rho d} \mathbf{s} + K\_{\rho p}\right)}{J\_c \mathbf{s}^2} \tag{64}$$

The closed loop transfer function of pitch angle is given by:

$$\frac{\rho(\mathfrak{s})}{\rho\_c(\mathfrak{s})} = -\frac{K\_c l\_\rho K\_{\rho d} \mathfrak{s} + K\_c l\_\rho K\_{\rho p}}{J\_\rho \mathfrak{s}^2 + K\_c l\_\rho K\_{\rho d} \mathfrak{s} + l\_\rho K\_{\rho p}} \tag{65}$$

### *5.3.4 Travel control using PI controller*

Taking Laplace transform for travel axis model Eq. (33) results:

$$r(s)s = \frac{Wl\_1}{J\_r} \rho\_d(s) \tag{66}$$

The transfer function for travel axis model is given by:

$$\frac{r(s)}{\rho\_d(s)} = \frac{\mathcal{W}l\_1}{f\_r s} \tag{67}$$

The transfer function of the PI controller is as follows:

$$\frac{\rho\_{\rho}(s)}{E\_r(s)} = K\_{rp} + \frac{K\_{ri}}{s} \tag{68}$$

where *E s*ðÞ¼ *ρd*ðÞ�*s ρ*ð Þ*s* , the open loop transfer function of the travel axis control is given by:

$$\mathbf{G}\_r(\mathbf{s}) = \frac{r(\mathbf{s})}{\rho\_d(\mathbf{s})} \frac{\rho\_\rho(\mathbf{s})}{E\_r(\mathbf{s})} = \frac{\mathcal{W}l\_1(\mathbf{K}\_{rp}\mathbf{s} + \mathbf{K}\_{ri})}{J\_r s^2} \tag{69}$$

The closed loop transfer function for travel angle is as follows:

$$\frac{r(s)}{r\_d(s)} = \frac{Gl\_1K\_{rp}s + Gl\_1K\_{ri}}{J\_ts^2 + Gl\_1K\_{rp}s + Gl\_1K\_{ri}}\tag{70}$$

### **5.4 Controller simulation and results**

### *5.4.1 GA-LQR controller*

In order to validate the proposed helicopter stabilizing system, the LQR controller is analysed mathematically using Matlab tool. Based on objective function *(J)* and using the Matlab command *"lqr"* the elements of the LQR weighting matrices *Q, R* are tuned using GA optimization method. For this application, each chromosome in GA tuning approach is represented by nine cells which correspond to the weight matrices elements of the LQR controller as shown in **Figure 10**. By this representation it can adjust the LQR elements in order to achieve the required performance. The parameters of the GA optimization approach chosen for the tuning process of the helicopter control system are listed in **Table 2**. Converging

*u*<sup>1</sup> � *u*<sup>2</sup> ¼ �2*k*12*ρ* � 2*k*14*ρ*\_ � 2*k*15ð Þ� *r* � *rd* 2*k*17*γ* (57)

ð

ð

<sup>2</sup> <sup>¼</sup> *KclρVd*ð Þ*<sup>s</sup>* (61)

*<sup>E</sup>ρ*ð Þ*<sup>s</sup>* <sup>¼</sup> *<sup>K</sup>ρds* <sup>þ</sup> *<sup>K</sup><sup>ρ</sup><sup>p</sup>* (63)

*<sup>J</sup>ρs*<sup>2</sup> (62)

ð Þ *r* � *rd dt* (58)

ð Þ *rd* � *r dt* (59)

(60)

*Vd* ¼ �2*k*12*ρ* � 2*k*14*ρ*\_ � 2*k*15ð Þ� *r* � *rd* 2*k*<sup>17</sup>

*Control system block diagram for helicopter elevation, pitch and travel axis using PID controller.*

*Control Based on PID Framework - The Mutual Promotion of Control and Identification…*

It is clear that Eqs. (58) and (59) have exactly the same structure. Then, by comparing these equations, it can obtain the feedback gains for the PID controller

> *Kρ<sup>p</sup>* ¼ 2*k*<sup>12</sup> *Kρ<sup>d</sup>* ¼ 2*k*<sup>14</sup> *Krp* <sup>¼</sup> *<sup>k</sup>*<sup>15</sup> *k*<sup>12</sup>

*Kri* <sup>¼</sup> *<sup>k</sup>*<sup>17</sup> *k*<sup>12</sup>

Taking Laplace transform for pitch axis model Eq. (32) yields:

*Jρρ*ð Þ*s s*

*Vd*ð Þ*s*

*ρ*ð Þ*s Vd*ð Þ*<sup>s</sup>* <sup>¼</sup> *Kcl<sup>ρ</sup>*

The transfer function for pitch axis model is given by:

The transfer function of the PD controller is as follows:

*Vd* ¼ �*Kρpρ* � *Kρdρ*\_ þ *KρpKrp*ð Þþ *rd* � *r KρpKri*

Substitution Eq. (47) in Eq. (45) results,

**Figure 9.**

**32**

from the LQR gains parameters as follows:


**Figure 10.** *Definition of GA chromosome.*

elements of the LQR weight matrices *Q* and *R* through iteration based on GA optimization method are presented in **Figure 11**.

Based on the proposed fitness function stated in Eq. (40), the LQR weighting matrices *Q* and *R* obtained based on the GA tuning approach are given by:

$$\begin{aligned} Q &= blkdig(26.258, 0.869, 0.431, 0.475, 1.87, 0.026, 0.705), \\ R &= blkdig(0.469, 0.469), \end{aligned}$$

The feedback gain matrix of the LQR controller can be mathematically calculated using Eq. (13), where P matrix is the stabilizing solution of the Riccati equation stated in Eq. (14).

In this application, by using the state matrix ð Þ *A* , input matrix ð Þ *B* and the tuned weighting matrices (*Q*, *R*Þ, the optimized feedback gain matrix *K* stated below is determined using the Matlab software instruction:

$$K = lqr(A, B, Q, R)$$

$$K = \begin{bmatrix} 5.3232 & 2.6817 & 1.1719 & 0.7399 & 2.0590 & 0.1651 & 0.8661\\ 5.3232 & -2.6817 & 1.1719 & -0.7399 & -2.0590 & 0.1651 & -0.8661 \end{bmatrix}$$

Based on the feedback gain matrix and using Eq. (11), the LQR control effort vector for the 3DOF helicopter system is dertermined as follows:

$$
\begin{bmatrix} u\_1 \\ u\_2 \end{bmatrix} = - \begin{bmatrix} 5.323 & 2.682 & 1.172 & 0.739 & 2.059 & 0.165 & 0.866 \\ 5.323 & -2.682 & 1.172 & -0.739 & -2.059 & 0.165 & -0.866 \end{bmatrix} \mathbf{x}^T \tag{71}
$$
