# T-S Fuzzy Algorithm Optimized by Genetic Algorithm for Dry Fermentation pH Control

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Materials and Methods

#### 2.1. System Components

#### 2.2. Modifying the pH of Biogas Production during Dry Fermentation

#### 2.3. System Model Construction

_{s}= 20 s. The preset step response with pH = 5.5 is taken as the input signal with open cycle machinery. The sample lapse is disabled at 20 s. The pH of the biogas slurry in the device is 5.5, and the step response curve of the system is fitted as a first-order similar count to calculate the system based on the pH data change. The system benefit K is determined to be 0.67, and t with delay time is 3. T of the time constant is 28. The monitoring process has a time delay.

#### 2.4. Construction of Control Algorithms

#### 2.4.1. PID Control Strategy

#### 2.4.2. T-S Fuzzy Control

_{1}is A

_{1}and u

_{2}is A

_{2}and … and u

_{k}is A

_{k},

then y = s

_{1}u

_{1}+ s

_{2}u

_{2}+ … + s

_{k}u

_{k}+ r

_{j}(j = 1, 2, …, k) is a set composed of fuzzy subsets, and the parameters s

_{j}(j = 1, 2, …, k) and r are constants, which are identified based on the input and output data of the control system. Here, the function y = s

_{1}u

_{1}+ s

_{2}u

_{2}+ … + s

_{k}u

_{k}+ r is equivalent to various fuzzy control rules in traditional fuzzy inference.

_{1}is A

_{i1}and u

_{2}is A

_{i2}and … and u

_{k}is A

_{ik},

then y = s

_{i1}u

_{1}+ s

_{i2}u

_{2}+ … + s

_{ik}u

_{k}+ r

_{i}(i = 1, 2, …, n)

_{ij}(i = 1, 2, …, n) represents the corresponding fuzzy part in the ith control rule, where s

_{ij}and r

_{i}(i = 1, 2, …, k) constants are identified according to INOUT data corresponding to the ith control rule.

#### 2.4.3. T-S Fuzzy System Identification

- (1)
- Identification of prerequisite parameters

_{1}, p

_{2}, …, and p

_{8}are prerequisite parameters. The result of the original 7 membership function methods was to represent NB as p

_{1}, NM as p

_{2}, NS as p

_{3}and p

_{4}, 0 as p

_{5}, PS as p

_{6}, PM as p

_{7}, and PB as p

_{8}. According to the above methods, use p

_{1}, p

_{2}instead of NB, p

_{3}, p

_{4}instead of N, p

_{4}, p

_{5}instead of ZO, p

_{5}, p

_{6}instead of PS, and p

_{7}, p

_{8}instead of PB. These alternate methods are used to achieve a response of 5 or 7 subsets in 3 subsets.

- (2)
- Identification of prerequisite structure

- (3)
- Identification of conclusion parameter

- (4)
- Identification of conclusion structure

#### 2.4.4. Simplifying T-S Fuzzy Reasoning

_{1}, p

_{2}, …, p

_{n}, k

_{1}, k

_{2}, …, k

_{m}. The count of unascertained arguments is the sum of the number of controller input parameters and the total number of controller rules.

_{1}, p

_{2}, …, p

_{n}based on experience and then waited until the number of optimization parameters was further reduced to the total number of control rules. The main characteristic of simplified T-S type fuzzy inference to obtain fuzzy control rules is that the parameter values of the subsequent components are proportional to each other, but each rule still changes with the input variable, so that all subsequent components of the fuzzy control rules will change according to actual needs.

#### 2.4.5. Simplified T-S Fuzzy Control Optimized by Genetic Algorithm

#### Determining Coding Strategy

#### Determination of Fitness Function

#### Selection Strategy

_{1}with the best fitness in the current population {Y

_{i}}, save it in a variable W that does not participate in mutation and crossover operations, and then select the remaining individuals in a way that is proportional to the adaptive capacity of the individual, crossover and mutation operations, to produce the next-generation population {Y

_{i}+ 1}. When the best individual Y

_{2}in {Y

_{i}− 1} is better than Y

_{1}, we use Y

_{2}instead of W; otherwise, it will remain unchanged. By doing so, the average fitness value of the population can be continuously improved while ensuring that the fitness value of the best individual does not decrease. This greatly improves the convergence speed and makes it easier to obtain the optimal solution.

#### Crossover Operation

#### Selection of Adaptive Cross-Mutation Strategies

## 3. Results

#### 3.1. Simulation Experiment on pH Control of Biogas Production by Dry Fermentation

#### 3.2. Test Materials and Equipment

#### 3.3. Precision Analysis of pH Control System for Anaerobic Dry Fermentation

#### 3.4. Experimental Study on pH Control in Anaerobic Dry Fermentation Environment

#### 3.5. Experimental Study on pH Control in Anaerobic Dry Fermentation Environment

## 4. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Li, Y.; Park, S.Y.; Zhu, J. Solid-state anaerobic digestion for methane production from organic waste. Renew. Sustain. Energy Rev.
**2011**, 15, 821–826. [Google Scholar] [CrossRef] - Qiang, L.; Haoli, Q.; Lei, C. Research progress in biogas dry fermentation technology. China Biogas
**2010**, 28, 10–14. [Google Scholar] - Mataalvarez, J.; Macé, S.; Llabrés, P. Anaerobic digestion of organic solid wastes. An overview of research achievements and perspectives. Bioresour. Technol.
**2000**, 74, 3–16. [Google Scholar] [CrossRef] - Gang, L.; Lizhong, Y.; Feng, O. Analysis on the Control Factors of anaerobic digestion Process and the Influence of pH and Eh. J. Southwest Jiao Tong Univ.
**2001**, 36, 518–521. [Google Scholar] - Zhou, R.; Zhang, L.; Fu, C.; Wang, H.; Meng, Z.; Du, C.; Shan, Y.; Bu, H. Fuzzy Neural Network PID Strategy Based on PSO Optimization for pH Control of Water and Fertilizer Integration. Appl. Sci.
**2022**, 12, 7383. [Google Scholar] [CrossRef] - Hen, Z.; Wang, D. A Prediction Model of Forest Preliminary Precision Fertilization Based on Improved GRA-PSO-BP Neural Network. Math. Probl. Eng.
**2020**, 2020, 1356096. [Google Scholar] - Hu, X.; Chen, X. Uniform fertilization method based on differential pressure tank with optimal fertilizer concentration and constant fertigation flux. Irrig. Sci.
**2021**, 39, 347–362. [Google Scholar] [CrossRef] - Faanes, A.; Skogestad, S. pH-neutralization: Integrated process and control design. Comput. Chem. Eng.
**2004**, 28, 1475–1487. [Google Scholar] [CrossRef] - Barraud, J.; Creff, Y.; Petit, N. pH control of a fed batch reactor with precipitation. J. Process Control
**2009**, 19, 888–895. [Google Scholar] [CrossRef] - Böling, J.M.; Seborg, D.E.; Hespanha, J.P. Multi-model adaptive control of a simulated pH neutralization process. Control Eng. Pract.
**2007**, 15, 663–672. [Google Scholar] [CrossRef] - Pishvaie, M.R.; Shahrokhi, M. Control of pH processes using fuzzy modeling of titration curve. Fuzzy Sets Syst.
**2006**, 157, 2983–3006. [Google Scholar] [CrossRef] - Chen, X.; Chen, J.; Lei, B. Identification of pH Neutralization Process Based on the T-S Fuzzy Model. Commun. Comput. Inf. Sci.
**2011**, 215, 579–585. [Google Scholar] - Blažič, S.; Škrjanc, I.; Gerkšič, S.; Dolanc, G.; Strmčnik, S.; Hadjiski, M.B.; Stathaki, A. Online fuzzy identification for an intelligent controller based on a simple platform. Eng. Appl. Artif. Intell.
**2009**, 22, 628–638. [Google Scholar] [CrossRef] - Salehi, S.; Shahrokhi, M.; Nejati, A. Adaptive nonlinear control of pH neutralization processes using fuzzy approximators. Control Eng. Pract.
**2009**, 17, 1329–1337. [Google Scholar] [CrossRef] - Mészáros, A.; Čirka, L.; Šperka, L. Intelligent control of a pH process. Chem. Pap.
**2010**, 63, 180–187. [Google Scholar] [CrossRef] - Wang, X.; Hao, Z.; Zhang, Y. Comparing of Mamdani and Sugeno Style Fuzzy controller. J. Yantai Univ.
**2006**, 19, 341–344. [Google Scholar] - Mikula, K.; Izydorczyk, G.; Skrzypczak, D.; Mironiuk, M.; Moustakas, K.; Witek-Krowiak, A.; Chojnacka, K. Controlled release micronutrient fertilizers for precision agriculture—A review. Sci. Total Environ.
**2020**, 712, 136365. [Google Scholar] [CrossRef] - Sikora, J.; Niemiec, M.; Tabak, M.; Gródek-Szostak, Z.; Szeląg-Sikora, A.; Kuboń, M.; Komorowska, M. Assessment of the Efficiency of Nitrogen Slow-Release Fertilizers in Integrated Production of Carrot Depending on Fertilization Strategy. Sustainability
**2020**, 12, 1982. [Google Scholar] [CrossRef] [Green Version] - Wu, Y.; Li, L.; Li, S.; Wang, H.; Zhang, M.; Sun, H.; Sygrimis, N.; Li, M. Optimal control algorithm of fertigation system in greenhouse based on EC model. Int. J. Agric. Biol. Eng.
**2019**, 12, 118–125. [Google Scholar] [CrossRef] [Green Version] - Goldbergd, E. Genetic Algorithms in Search Optimization and Machine Learning; Addison-Wesley: Boston, MA, USA, 1989; Volume 13, pp. 72–74. [Google Scholar]
- Yang, Y.; Wang, G. Parameters Optimization of Polygonal Fuzzy Neural Nerworks Based on GA-BP Hybrid Algorithm. Int. J. Mach. Learn. Cybern.
**2014**, 5, 815–822. [Google Scholar] [CrossRef] - Shanben, C.; Lin, W. Artificial neural network self-learning control method for uncertain objects. J. Autom.
**1997**, 23, 112–115. [Google Scholar] - Baker, J.E. Adaptive Selection Methods for Genetic Algorithms; Lawrence Earlbaum Associates: Hilladale, NJ, USA, 1985; pp. 110–111. [Google Scholar]
- Msrinivas, M.; Patnaik, L.M. Adaptive probabilities of crossover and mutation in genetic algorithms. IEEE Trans. Syst. Man Cybern.
**1994**, 24, 656–667. [Google Scholar] [CrossRef] [Green Version]

**Figure 1.**Diagram of anaerobic dry fermentation pH control device: 1—dry fermentation equipment; 2—solenoid valve; 3—flow meter; 4—water pump; 5—soda solution tank; 6—master computer; 7—pH sensor.

Controller | Response Time (s) | Overshoot |
---|---|---|

PID | 102 | 0.37 |

T-S fuzzy | 98 | 0.14 |

Simplified T-S fuzzy | 73 | 0.19 |

IAE-optimized simplified T-S fuzzy | 36 | 0.08 |

ISE-optimized simplified T-S fuzzy | 27 | 0.03 |

Controller | Response Time (s) | Overshoot |
---|---|---|

PID | 124 | 0.37 |

T-S fuzzy | 136 | 0.22 |

Simplified T-S fuzzy | 113 | 0.28 |

IAE-optimized simplified T-S fuzzy | 71 | 0.17 |

ISE-optimized simplified T-S fuzzy | 47 | 0.09 |

Controller | Response Time (s) | Overshoot |
---|---|---|

PID | 113 | 0.36 |

T-S fuzzy | 98 | 0.15 |

Simplified T-S fuzzy | 76 | 0.18 |

IAE-optimized simplified T-S fuzzy | 52 | 0.11 |

ISE-optimized simplified T-S fuzzy | 29 | 0.04 |

Controller | 5.4–7 | 6–7 | ||||
---|---|---|---|---|---|---|

pH Value | Max Overshoot | Relative Error | pH Value | Max Overshoot | Relative Error | |

PID | 6.76 | 0.38 | 3.4% | 6.81 | 0.36 | 2.7% |

T-S fuzzy | 7.19 | 0.21 | 2.7% | 6.89 | 0.12 | 1.5% |

Simplified T-S fuzzy | 6.87 | 0.23 | 1.9% | 7.11 | 0.16 | 1.6% |

IAE-optimized simplified T-S fuzzy | 7.08 | 0.18 | 1.1% | 7.05 | 0.09 | 1.4% |

ISE-optimized simplified T-S fuzzy | 6.98 | 0.09 | 0.3% | 7.01 | 0.05 | 0.1% |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Wang, P.; Shen, X.; Li, R.; Qu, H.; Cao, J.; Chen, Y.; Chen, M.
T-S Fuzzy Algorithm Optimized by Genetic Algorithm for Dry Fermentation pH Control. *Processes* **2023**, *11*, 2227.
https://doi.org/10.3390/pr11082227

**AMA Style**

Wang P, Shen X, Li R, Qu H, Cao J, Chen Y, Chen M.
T-S Fuzzy Algorithm Optimized by Genetic Algorithm for Dry Fermentation pH Control. *Processes*. 2023; 11(8):2227.
https://doi.org/10.3390/pr11082227

**Chicago/Turabian Style**

Wang, Pengjun, Xing Shen, Ruirong Li, Haoli Qu, Jie Cao, Yongsheng Chen, and Mingjiang Chen.
2023. "T-S Fuzzy Algorithm Optimized by Genetic Algorithm for Dry Fermentation pH Control" *Processes* 11, no. 8: 2227.
https://doi.org/10.3390/pr11082227