Next Article in Journal
Assessing Sustainable Impacts of Green Energy Projects for the Development of Renewable Energy Technologies: A Triple Bottom Line Approach
Next Article in Special Issue
Infinite Horizon H2/H Control for Discrete-Time Mean-Field Stochastic Systems
Previous Article in Journal
Intelligent Optimization of Gas Flooding Based on Multi-Objective Approach for Efficient Reservoir Management
Previous Article in Special Issue
Study on a Second-Order Adaptive Sliding-Mode Observer Control Algorithm for the Sensorless Permanent Magnet Synchronous Motor
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

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

1
State Key Laboratory of Mechanics and Control for Aerospace Structures, Nanjing University of Aeronautics and Astronautics, Nanjing 210016, China
2
Nanjing Institute of Agricultural Mechanization, Ministry of Agriculture and Rural Affairs, Nanjing 210014, China
*
Author to whom correspondence should be addressed.
Processes 2023, 11(8), 2227; https://doi.org/10.3390/pr11082227
Submission received: 8 June 2023 / Revised: 3 July 2023 / Accepted: 17 July 2023 / Published: 25 July 2023
(This article belongs to the Special Issue Advances in Nonlinear and Stochastic System Control)

Abstract

:
In the process of anaerobic dry fermentation to produce biogas, maintaining a suitable pH in the environment is more conducive to the degradation of crop straw. When the pH in the fermentation environment is too low, the process of anaerobic digestion by anaerobic bacteria is inhibited. Therefore, it is necessary to quickly adjust the pH. In this work, we studied the control technology of a pH regulation system and then constructed a T-S fuzzy controller. Upon simplifying the T-S fuzzy controller, the system delay time was reduced, and two genetic algorithms with different fitness performance indicators were used to optimize the T-S fuzzy control. The simulation experiment in this study was designed through simulation software, and the results show that the improved control method has a fast regulation ability. Finally, on-site experiments were conducted using the four control methods under the acidification conditions set in the experimental device. The results show that the control method used in this study to improve performance by integrating the error sum of squares has a short control time and small oscillation and overshoot, and it can better regulate the environmental pH to achieve appropriate conditions when acidification occurs during anaerobic dry fermentation.

1. Introduction

The easy acidification of materials in the process of anaerobic dry fermentation to produce biogas has always been a challenge in the development of this technology [1,2]. Dry fermentation for biogas production is highly favored by researchers due to its unique features, such as low water demand during fermentation, low requirements for the length of crushed straw used as raw material, and diversity of raw materials [3]. In the process of dry fermentation to produce biogas, anaerobic bacteria decompose organic matter into biogas and nitrogen-rich organic residue under anaerobic conditions. When the pH of the fermentation material is lower than 5.5, methane production during the fermentation process will be inhibited, leading to a decrease in biogas production. Therefore, in order to increase the biogas production of dry straw fermentation material, it is necessary to control the pH of the material and establish a rapidly adjustable environmental pH control system [4,5], which is of great significance for improving fermentation efficiency and success rates.
During the dry fermentation process to produce biogas, the pH of the fermentation environment may be at an inappropriate level due to factors such as device leakage or the strong acid production capacity of the fermentation materials. However, adjusting the pH during the fermentation process is often slow, and it is a nonlinear process. Therefore, efficiently and quickly adjusting the pH of the fermentation environment to meet the appropriate requirements is an important research direction. Research on pH control in fermentation environments mainly includes modeling the process of pH control and optimizing the algorithms. At present, research on modeling the process of controlling environmental pH mainly focuses on two types: linear segmented control and nonlinear intelligent control [6]. In the research on optimizing nonlinear intelligent control algorithms, feedback control and adaptive control methods are mostly used. The T-S fuzzy controller used in this investigation has difficulty handling time-varying and delayed environmental pH control, and more efficient and fast optimization algorithms need to be studied [7].
In recent years, Faanes et al. [8] established a control model for the price of liquor based on the parameters of the reaction vessel, the concentration (C) and velocity (Q) of the input and output liquids, and the concentration of the control solution. The required volume of the control solution can be calculated based on the concentration of acidic or alkaline substances added to the reaction solution. Many times, the acid–base neutralization process is too complex, and it is difficult to describe the entire process using a single model. Therefore, using multiple models for control becomes a reasonable choice. The advantage of using multiple models is that it can transform a complex process into multiple simple links, such as simple models to segment and describe the complex acid–base neutralization process. Barraud et al. [9] modeled the acid–base neutralization process by studying the reaction characteristics of acid–base reagents in the production of precipitates using batch processing technology, and they determined the model parameters through experiments to achieve accurate control of the pH of the reaction liquor. Böling et al. [10] modeled multiple adaptive algorithms for pH control. Using prior knowledge, the acid–base neutralization process was divided into multiple small intervals, and three models were established for each interval. The model parameters were adjusted through experiments, and performance indicators (the difference between actual output and model prediction) were proposed to determine whether the model could accurately describe the acid–base neutralization process. The three operation arguments of the PID controller were calculated according to the identification model to achieve control of the liquor pH in the acid–base neutralization process.
The T-S fuzzy model uses linear systems theory to solve nonlinear problems, and it can use multiple linear equations to fit the nonlinear process of solution pH changes during acid–base neutralization [11,12,13]; these linear equations are the ultimate expression of the T-S fuzzy model. When the parameters and structure of the pH control model change during the acid–base neutralization process, it is difficult to achieve good control results using offline model control methods. For nonlinear, time-varying, and random external disturbances in the pH control of solution in the acid–base neutralization process, conventional fuzzy control algorithms have poor control effects due to fixed fuzzy rules. Salehi et al. [14] advanced a flexible fuzzy control algorithm that can automatically update fuzzy rules and control parameters according to the pH output error. During the operating process, only the pH of the liquor needs to be measured. However, the design process of this algorithm is complex, and multiple control parameters need to be set according to the control object. Mészáros et al. [15] combined neural network algorithms with fuzzy control algorithms, utilizing the powerful self-learning and association abilities of neural networks. When the pH of the control object changes, the membership functions and fuzzy rules can be modified automatically, mitigating the effects of system uncertainty and pattern mismatch on the accuracy of pH control. The algorithm has strong adaptability.
At present, there are mainstream fuzzy inference algorithms of the Mamdani type. A Mamdani fuzzy system consists of three parts: a fuzzy processing operator, fuzzy reasoning mechanism, and un-fuzzification processing operator. Mamdani-type fuzzy inference can realize the inference calculation from input to output through a set of rules of inference mastered in advance so as to establish an accurate identification system. [16]
The main difference between Mamdani-type and T-S fuzzy systems lies in the end part. Compared to the post-event fuzzy subset of the Mamdani system, the post-event of the T-S fuzzy system is f(x), which can be a single value, a linear combination of inputs (corresponding to a first-order T-S fuzzy system), or a nonlinear combination. Therefore, the dynamic performance of the Mamdani system is relatively smooth, but the response speed is slow. The T-S fuzzy system has a relatively short response time but poor dynamic stability and large overshoot. Controlling the pH of anaerobic dry fermentation in this article requires rapid changes in pH when it inhibits the fermentation process. In general, acidification occurs, and the maximum pH of anaerobic fermentation can reach 8. Therefore, a fuzzy system with short response time and little overshoot is needed. The T-S fuzzy system is more suitable for use in controlling the pH of anaerobic dry fermentation than the Mamdani system.
To sum up, in the process of anaerobic dry fermentation to produce biogas in this paper, the primary tasks to improve rapidity and efficiency by adjusting the pH in the fermentation environment are as follows: (a) simplify the T-S fuzzy reasoning rules; (b) improve the genetic algorithms to optimize and simplify the T-S fuzzy operation under the two performance indicators of the fitness function; and (c) perform the T-S fuzzy operation. The simplified T-S fuzzy operation and the majorization of the optimized genetic algorithm for simplified T-S fuzzy control proposed in this article were emulated and validated on the MATLAB/Simulink platform. The conclusion drawn is that the proposed simplified T-S fuzzy operation using the error sum of squares integral as the evaluation index of the genetic algorithm is superior to other control algorithms. In this paper, we designed experimental verification for data monitoring, control terminals, data acquisition, and algorithm control. The experimental results show that the designed operating algorithm has a faster control rate and more accurate results compared to other control algorithms.
The study was performed as follows. First, we analyzed the process of pH regulation in anaerobic dry fermentation for biogas production and established a mathematical model for pH regulation through the acid–base ionization equilibrium equation. Second, we constructed a T-S fuzzy controller and optimized the simplified T-S fuzzy controller using an improved genetic algorithm. In this part, the simplified T-S fuzzy controller first used the integrated mean square error with integral absolute error and the integral of the error sum of squares as the evaluation index to improve the genetic algorithm, and finally, it used the improved genetic algorithm for majorization. Third, we compared the actual effects of four control methods through simulation software and on-site experiments, and we finally obtained the validation results of the pH control system for anaerobic dry fermentation for biogas production.

2. Materials and Methods

2.1. System Components

The pH control device for anaerobic dry fermentation for biogas production is shown in Figure 1. During the fermentation process, the computer is used as the main control unit to control how long the alkaline tank outlet solenoid valve is open and closed. Alkaline solution is injected through a pump, and the input amount of alkaline solution is monitored through a flow meter to modify the pH range of the fermentation material in the device. The stirring device is used to mix and stir the materials and the alkaline solution. The fermentation device monitors the liquid pH range in the fermentation environment using a pH sensor. If we consider whether the instant pH range fits the requirements for dry fermentation biogas production through the main control equipment, when there is a discrepancy, the alkali pump can be turned on to supplement the fermentation device with alkali. In the fermentation process, acid–base regulation is mainly implemented by the master control module of the upper computer, which collects the flow meter data and controls the alkali pump and solenoid valve for regulation.

2.2. Modifying the pH of Biogas Production during Dry Fermentation

In order to provide a suitable environment for dry fermentation to produce biogas, alkali liquor is added to the fermentation device when acidification occurs. Adding alkaline solution requires starting and stopping the pump so that the solution can be pumped into the fermentation device. In the actual process of adding alkaline solution, the mixing process is controlled by the control system, and the delay in response time caused by the opening of the pump and the use of the system can lead to a lag in pH adjustment.
When acidification occurs in the production of biogas through dry fermentation, it is necessary to adjust the pH of the fermentation material. When alkali liquor and biogas slurry are mixed together, it can be considered as an acid–base neutralization process, making the pH of the material consistent with the pH required for the environment and similar to the control system settings. The process of adjusting and controlling pH is nonlinear. Adjusting the pH during the actual fermentation material mixing process is influenced by many changing factors. Therefore, in this study, we designed an operable control model and analyzed it from the perspective of fermentation principles. Assuming that alkali liquor is injected into the fermentation device and mixed with the biogas slurry as the input of the pH model, the acid is quickly neutralized, and the mixed liquor concentration is output. The mixed liquor in the spray pipe is constantly filled, and the concentration at the top and bottom of the fermentation device is the same, as shown in Figure 2.
According to the laws of material and atomic conservation in the acid–base neutralization process, the state of equilibrium of the acid slurry in the control system will be related to the conservation of liquid and volume; thus, we can construct equations for controlling the conductivity and pH of the biogas slurry fermentation process:
V d H b d t = H x L x H b L b L i n = L x + L b H b 1 1 + 10 p H P K b 10 p H = 0
In the formula, V is the volume of the mixed liquid; H b is the density of alkali in the mixture; H x is the density of biogas slurry in the device; L x is the volume of biogas slurry; L b is the input amount of alkaline solution, and L b = t × L n , where t is the time for starting the pump and L n is the flow rate of alkali solution per minute each time the pump starts; L i n is the input flow rate within the system device; K b is the weak base ionization equilibrium constant, and P K b = log ( K b ) ; and pH is a variable in output process [6,7,17,18].

2.3. System Model Construction

Based on the effect of the pH control system on the dry fermentation biogas production described above, this study adopts a classic first-order object as the research model:
G s = K T s + 1 e τ s
The object parameters have step- and time-varying characteristics, and their variation patterns are as follows:
k ( t ) = a b + t T ( t ) = c + d t τ ( t ) = e + f t
Take a = b = 30, c = 90, d = 3, e = 110, and f = 5. The step signal is in units of the input signal. Sampling time ts = 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

pH control during anaerobic dry fermentation is mainly achieved by adding alkaline solution to the device to achieve an acid–base balance. The process of adding liquid can be achieved using classic PID control. The system diagram is shown in Figure 3. PID control mainly tracks and differentiates the difference between the required value and the actual measured value. The results of the system’s copper drum ratio, integration, and differentiation can be used as a means of controlling the liquid pH value. However, adding alkaline solution produces hysteresis and nonlinearity in the mixing process. Therefore, PID control generally performs in the pH value adjustment control process and cannot quickly and easily increase the pH in the fermentation device [19].

2.4.2. T-S Fuzzy Control

In line with the pH control system model obtained above, the pH value during the acid–base neutralization process can be controlled.
Controlling the pH of dry fermentation biogas production is a multi-input single-output system (MISO) with n inputs of u1, u2, … un, where the output is O; after that, the T-S fuzzy rules model are as follows:
R: If u1 is A1 and u2 is A2 and … and uk is Ak,
then y = s1u1 + s2u2 + … + skuk + r
Among them, Aj (j = 1, 2, …, k) is a set composed of fuzzy subsets, and the parameters sj (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 = s1u1 + s2u2 + … + skuk + r is equivalent to various fuzzy control rules in traditional fuzzy inference.
The output of existing fuzzy systems is determined by multiple T-S fuzzy rules, and a specific set of input data m can simultaneously trigger x rules. The model can be represented as follows:
Ri: If u1 is Ai1 and u2 is Ai2 and … and uk is Aik,
then y = si1u1 + si2u2 + … + sikuk + ri (i = 1, 2, …, n)
Among them, Aij (i = 1, 2, …, n) represents the corresponding fuzzy part in the ith control rule, where sij and ri (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

The T-S fuzzy system is divided into a prerequisite section and a conclusion section, each of which can be divided into parameter identification and conclusion identification. These four parts will be introduced here.
(1)
Identification of prerequisite parameters
This refers to the prerequisite parameter for obtaining the minimum value of the performance function to install INOUT data. The fuzzy set can be divided according to needs. It is commonly divided into seven parts: negative large (NB), negative medium (NM), negative small (NS), 0, positive small (PS), positive medium (PM), and positive large (PB). This T-S fuzzy control mainly fuzzies the control process when the input and output are not clear. Controlling the pH in anaerobic dry fermentation for biogas production mainly involves quickly adjusting the pH to 7 in case of acidification in the fermentation device so that the anaerobic bacteria are at a comfortable pH level. The input of this process is specified in this study. When the pH value is less than or equal to 6, the pH control system is activated to regulate the pH in the fermentation device. The correct input–output data in the system are known, and only one input variable is used in this study when controlling the input. Therefore, 7 commonly used fuzzy rules can be combined into 3. The 3 fuzzy rules divide the domain of a function into 3 subsets: [small], [medium], and [large]. Their membership functions are composed of segmented straight lines, as shown in Figure 4, where p1, p2, …, and p8 are prerequisite parameters. The result of the original 7 membership function methods was to represent NB as p1, NM as p2, NS as p3 and p4, 0 as p5, PS as p6, PM as p7, and PB as p8. According to the above methods, use p1, p2 instead of NB, p3, p4 instead of N, p4, p5 instead of ZO, p5, p6 instead of PS, and p7, p8 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
This refers to determining the specific number of input variables in the problem, optimizing the fuzzy space of input variables, and enabling the identified fuzzy model to accurately describe the target system.
(3)
Identification of conclusion parameter
This refers to determining the coefficients in each rule conclusion output equation, usually using least squares or other methods to identify parameters using input and output data.
(4)
Identification of conclusion structure
This refers to determining the number of variables to include in the output equation for each rule conclusion.
The above is the calculation processes for T-S fuzzy system identification. Through these 4 steps, the T-S fuzzy model can be determined based on the INOUT data. However, when the quantization level of the controller input is refined, it is necessary to determine the amount of fuzzy rule increase, and the subsequent parameters of the fuzzy rules to be determined rapidly increase, thereby increasing the difficulty of controller design. The T-S fuzzy control process for adjusting the biogas pH in dry fermentation is shown in Figure 5.

2.4.4. Simplifying T-S Fuzzy Reasoning

The T-S fuzzy controller for dry fermentation biogas production has K rules, with (n + 1) k subsequent parameters. The more adjustable the subsequent parameters, the more difficult the on-site control. Therefore, this article simplifies the T-S model.
Compared with the T-S fuzzy operation, we simplified it with the advantages of simple operation and fast answer speed. Operators accumulate data on the pH control of dry fermentation biogas production and set reasonable simplified T-S fuzzy control laws according to existing data. The input parameters of the system are targeted, making it convenient for operating processes to fulfill structured control demands, yet, due to the lack of optimization ability, T-S fuzzy rules rely on simple control strategies. This leads to a low control accuracy and large steady-state error of the system, making it difficult to achieve fast and accurate adjustment [20].
This article mainly adopts the following methods for simplification:
R 1 : I f   u 1   i s   A 1 1   ,   a n d   u 2   i s   A 2 1 , ,   a n d   u n   i s   A n 1 t h e n   s 1 = p 1 + p 2 u 2 + + p n u n R 2 : I f   u 1   i s   A 1 2 ,   a n d   u 2   i s   A 2 2   , ,   a n d   u n   i s   A n 2 t h e n   s 2 = k 1 s 1 R 1 : I f   u 1   i s   A 1 m   ,   a n d   u 2   i s   A 2 m   , ,   a n d   u n   i s   A n m t h e n   s m + 1 = k m s m
Therefore, the unascertained arguments of simplified T-S fuzzy controller are p1, p2, …, pn, k1, k2, …, km. The count of unascertained arguments is the sum of the number of controller input parameters and the total number of controller rules.
In this study, we first set values for p1, p2, …, pn 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.
A diagram of the simplified T-S fuzzy controller structure can be seen in Figure 6.

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

Genetic algorithms, as more classic algorithms, have been widely used [21,22]. However, in the process of planning the T-S fuzzy controller in this study, the optimization effect using a classical genetic algorithm was poor, and better improvements can be made. To address the problems in controlling the pH of biogas production in dry fermentation, in this study, we employed comparisons to select a better coding method and objective function. In order to improve the reaction time and optimization efficiency, some improvements were made to the classical genetic algorithm. The flowchart (Figure 7) is as follows:

Determining Coding Strategy

Genetic algorithms generally use binary encoding, but when solving specific problems, long code strings are prone to occur, and decoding and encoding operations can take a lot of time and present other problems [23]. In order to make the problem description more straightforward, easily introduce heuristic information from relevant fields, and enhance the search ability of genetic algorithms, this article adopts real number encoding. With this method, there is no need for binary encoding and decoding operations, and the genetic operation process is directly carried out in the problem space, which can overcome the shortcomings of solving continuous optimization problems and improve the accuracy and speed of the optimization algorithm. The controller-aided design in this article mainly adopts the inheritance algorithm, and the variables involved are continuous variables, so the real number encoding method is adopted.

Determination of Fitness Function

As long as an improved genetic algorithm is used to intelligently optimize the design of the controller, the optimization of the objective function must be closely related to the system regulation index function, reflecting the regulation effect of the system.
In this paper, two optimization target modes are adopted. The first is the integrated mean squared error and absolute error (IAE):
J I A E = 0 e ( t ) d t
The second is the integrated squared error (ISE):
J I S E = 0 e ( t ) 2 d t
In this paper, the optimization objective of the controller is J * = m i n J ( I A E ) or J * = m i n J ( I S E ) , and the fitness function is the directly selected objective function.

Selection Strategy

There are individuals in the genetic population that we choose to eliminate based on their ability to adapt to the problem environment. Those with strong adaptability are left as breeding offspring. In this study, we used the combination of an optimal retention strategy and the roulette wheel selection method. First, we find the individual Y1 with the best fitness in the current population {Yi}, 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 {Yi + 1}. When the best individual Y2 in {Yi − 1} is better than Y1, we use Y2 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

In a genetic algorithm, the crossover operation is used to select the parent chromosomes that participate based on a certain probability of crossover. Here, we use directional crossover to effectively expand the search space.
The intersection based on direction is as follows:
r 1 = θ r 1 r 2 + r 1 r 2 = θ r 2 r 1 + ( 1 θ ) r 2
In the equation, r 1 ,   r 2 is the chromosome vector and θ is a random number between [0, 1].

Selection of Adaptive Cross-Mutation Strategies

The performance of control algorithms is directly determined by the quality of the mutation operator design [24]. The method of designing an adaptive mutation operator in this paper was to avoid using mutation operations during the standard evolution process, allowing it to evolve quickly. Once it enters the precocious state, measures are taken to quickly leave that state and allow the evolution process to continue. The formula is as follows:
W n m = N T × c o v + 0.001
where m represents the current algebra, NT represents the continuous and unevolutionary algebra from the last evolution to the end of the current generation, and cov is the coefficient of increased variability; this number is usually taken as the minimum value.

3. Results

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

In order to check the function of the T-S fuzzy control plan optimized by the genetic algorithm, we designed a simulation of the T-S fuzzy controller using MATLAB. The T-S fuzzy control machinery model optimized by the genetic algorithm with simplified T-S fuzzy control and two fitness indicators is shown in Figure 8. The pH of the alkaline solution is 9, the flow rate of the water entering the fermentation device is 1.2 L/s, and the machinery delay is 2 s. We used the pH values of 5.4 and 6.0 collected by the two sensors as input signals in the fermentation test device and set a stable-state pH of 7. Using the pH sensors to monitor changes in pH levels, two control processes to increase the pH from 5.4 to 7 and from 6.0 to 7 were compared. By analyzing the relative error, response time, and overshoot, we can conclude that the T-S fuzzy control optimized by the genetic algorithm has a good control effect.
The pH inside the fermentation device was tracked with a 200 s simulation time. A step signal with an amplitude of 1 at t = 0 was entered. The simulation waveforms of different control algorithms are shown in Figure 9. In the graph, we find the T-S fuzzy control had a long response time of 98 s and a medium overshoot of 0.14. The simplified T-S fuzzy controller had a faster response time of 73 s and a larger overshoot of 0.19. The T-S fuzzy controller optimized by the genetic algorithm using a mean integrated squared error with integral absolute error had a response time of 36 s and overshoot of 0.08. The T-S fuzzy controller optimized by the genetic algorithm using the error sum of squares as the fitness measure had a short response time of 27 s and small overshoot of 0.03, and it is able to modify the pH in a short time. Compared with the other three control algorithms, it performs well at regulating the pH in dry fermentation biogas production. From the graph, it can be seen that the T-S fuzzy control has the slowest response time and medium overshoot, while the simplified T-S fuzzy control has a faster response time but a large overshoot over time. The T-S fuzzy control optimized by the IAE genetic algorithm had a moderate overshoot, but compared to the ISE optimized algorithm, it had a larger overshoot and a longer response time.
The function arguments of the four algorithms are shown in Table 1. The table shows the overshoot and response time. The response time of the simplified T-S fuzzy control was 25 s less and the overshoot was 0.05 more than the T-S fuzzy control technique. The response time of T-S fuzzy control optimized by the genetic algorithm using the integrated mean squared error and integral absolute error was 66 s, 62 s and 37 s less and the overshoot was 0.29, 0.06 and 0.11 less than PID, T-S fuzzy and simplified T-S fuzzy control, respectively. The response time of T-S fuzzy control optimized by the genetic algorithm using the sum of squared error as the fitness measure was 75 s, 71 s, 46 s and 9 s less and the overshoot was 0.34, 0.11, 0.16 and 0.05 less than T-S fuzzy, simplified T-S fuzzy and T-S fuzzy control optimized by the genetic algorithm using the integrated mean square error and integral absolute error, respectively.

3.2. Test Materials and Equipment

The pH control experiment for dry fermentation biogas production was conducted in March 2023 at the East Laboratory of Nanjing Agricultural Mechanization Research Institute of the Ministry of Agriculture and Rural Affairs. The test platform included a 2W-25 solenoid valve, Siemens s200 PLC, SEN-HZ21WI flow meter, JUMO pH sensor, and niMU11 pump. The maximum flow rate of the water pump was 1.5 L/min. The small and medium-sized water pumps on the experimental platform were powered by 220 V AC points, and the controller and sensor power were converted from 220 to 24 V DC before being supplied to the control system. The height of the test platform was 1.5 m and the width was 1 m.
The experimental control objects were electromagnetic valves and small water pumps, and the experimental material was biogas slurry without solid floating particles. T-S fuzzy control, simplified T-S fuzzy control, IAE-optimized T-S fuzzy control and ISE-optimized T-S fuzzy control were used to measure and verify the pH of the anaerobic dry fermentation process.
To test the stability of the algorithms, anaerobic dry fermentation pH control experiments were conducted. A schematic diagram of the experimental equipment is shown in Figure 10. The testing system mainly consisted of an upper computer, a signal acquisition unit, a signal processing unit, a pH sensor, and an alkali injection module. The signal was transmitted through the RS232 protocol. The control module was the alkali injection module. The experiment took input values equal to the set pH values, with configuration software as the core, and received coupled data from the pH sensor and flow meter. During mixing and stirring of solid and liquid, the main control module of the system adjusted the pH in the fermentation environment by controlling the injection amount of alkali solution. The amount of alkali solution added was controlled based on the calculated demand, and the mixing was completed by the stirring device. When the pH met the required value, the system maintained a stable state.

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

In this study, the control efficiency of the anaerobic dry fermentation pH control system was reflected by the flow error and electromagnetic valve response time. The main positions affecting the efficiency of pH control are at the front and rear ends of the solenoid valve. There are certain errors in the intermittent liquid supply by small water pumps, and there are also errors in the monitoring of flow meters. Flow meter error is a key error. The main cause of flow error is the uncertainty of the viscosity of the biogas slurry. In addition, the electromagnetic flow meter can affect monitoring accuracy based on changes in the electromagnetic field.

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

To verify the stability of the algorithms, two sets of anaerobic dry fermentation pH control experiments were conducted. The pH experiment collected data from the pH sensor through the PLC after the system was running stably. The experiment involved a combination of adjusting the pH of the biogas slurry and maintaining the fixed pH of 9 of the alkaline liquor. T-S fuzzy control, simplified T-S fuzzy control, simplified T-S fuzzy control optimized by the IAE genetic algorithm and simplified T-S fuzzy control optimized by the ISE genetic algorithm were used.
Experiment 1: The control algorithm is described using floating-point precision with a sampling period of 2 s. A set of pH adjustment schemes is set with an initial pH of 5.4 in the simulation scheme and a target pH of 7 after adjustment (Table 2). A comparison of the test results is shown in Figure 11. From the graph, it can be seen that as the initial pH of the fermentation environment increases, the performance of all four control algorithms improves. The response time of T-S control is 12 s more than PID control and the overshoot is 0.15 less than PID control. The response time of simplified T-S fuzzy control is 11 s and 23 s less than PID and T-S fuzzy control, respectively, and the overshoot is 0.09 less than PID and 0.06 more than T-S fuzzy control. The response time of T-S fuzzy controller optimized by the IAE genetic algorithm is 53 s, 65 s and 42 s less and the overshoot is 0.2, 0.05 and 0.11 less than PID, T-S fuzzy and simplified T-S fuzzy control, respectively. The response time of T-S fuzzy control optimized by the ISE genetic algorithm is 77 s, 89 s, 66 s and 24 s less and the overshoot is 0.28, 0.12, 0.19 and 0.08 less than PID, T-S fuzzy, simplified T-S fuzzy and T-S fuzzy control optimized by the IAE genetic algorithm.
Experiment 2: The control algorithm is described using floating-point precision with a sampling period of 2 s. A set of pH adjustment schemes is set with an initial pH of 6 in the simulation scheme and a target pH of 7 after adjustment (Table 3). A comparison of the test results is shown in Figure 12. From the graph, it can be seen that as the initial pH of the fermentation environment increases, the performance of all four control algorithms improves. The response time of T-S control is 15 s less and the overshoot is 0.21 less than PID control. The response time of simplified T-S fuzzy control is 37 s and 22 s less and the overshoot is 0.18 and 0.03 more than PID and T-S fuzzy control. The response time of T-S fuzzy control optimized by the IAE genetic algorithm is 61 s, 46 s and 24 s less and the overshoot is 0.25, 0.04 and 0.07 less than PID, T-S fuzzy and simplified T-S fuzzy control, respectively. The response time of the T-S fuzzy controller optimized by the ISE genetic algorithm is 84 s, 69 s, 47 s and 23 s less and the overshoot is 0.32, 0.11, 0.14 and 0.07 less than PID, T-S fuzzy, simplified T-S fuzzy and T-S fuzzy control optimized by the ISE genetic algorithm.

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

The above experimental results are from one experiment. We measured the control results of the actual pH sensor control system at 80 s. According to the experimental requirements, we adjusted the initial pH values in the fermentation device to 5.4 and 6.0, and we used five algorithms to control the results for each initial value at 80 s. Then, we took the average value from 10 experiments. Under the condition of inputting a control solution with a pH of 9, the pH in the fermentation device was adjusted to 7 according to the system control requirements. The experimental results are shown in Table 4.
According to the experimental results in Table 4, when the initial pH is 5.4 and the target value is 7, the simplified T-S fuzzy control optimized by the ISE genetic algorithm reduces the relative error by 3.1% compared to PID control, by 2.4% compared to T-S fuzzy control, by 1.6% compared to simplified T-S fuzzy control, and by 0.8% compared to simplified T-S fuzzy control optimized by the IAE genetic algorithm IAE. When the initial pH is 6 and the target value is 7, the simplified T-S fuzzy control optimized by the ISE genetic algorithm reduces relative error by 2.6% compared to PID control, by 1.4% compared to T-S fuzzy control, by 1.5% compared to simplified T-S fuzzy control, and 1.3% compared to simplified T-S fuzzy control optimized by the IAE genetic algorithm. According to the above experimental results, the simplified T-S fuzzy control optimized by the ISE genetic algorithm has the best control effect.

4. Conclusions

This study proposes an improved genetic algorithm to optimize the T-S fuzzy controller, which has better response time for addressing the acidification problem in the process of dry fermentation for biogas production and reduces hysteresis, thereby reducing the fermentation time in the acidified environment.
Through the control simulation and actual experimentation with the pH of the dry fermentation biogas production process, the function of the monitor designed in this study was checked by comparing the response time, steady-state time, overshoot data, and rise time among all algorithms.
The test results indicate that the T-S fuzzy control system optimized by the improved genetic algorithm has good dynamic performance. Compared with the other three algorithms, this algorithm is significantly superior in overshoot, response time and steady-state time. This controller can reduce the adjustment of pH during the actual fermentation process, and the results are excellent. In the future, further consideration will be given to combining it with other control algorithms to better adapt to the more complex pH regulation of anaerobic dry fermentation for biogas production.

Author Contributions

This study was conceptualized by P.W. and X.S. The test setup was completed by P.W., R.L. and H.Q. The software was designed by P.W. and Y.C. M.C. and J.C. provided resources and P.W. curated the data. The original draft of the manuscript was prepared by P.W. M.C. reviewed and edited the manuscript. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Social Development Project of Key Research and Development Plan in Jiangsu Province (BE2022681) and funded by the Chinese Academy of Agricultural Sciences Innovation Project.

Data Availability Statement

All relevant data presented in the article are stored according to institutional requirements and, as such, are not available online. However, all data used in this manuscript can be made available upon request to the authors.

Acknowledgments

We are grateful to Wei Zhao for his help in project management.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. 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]
  2. Qiang, L.; Haoli, Q.; Lei, C. Research progress in biogas dry fermentation technology. China Biogas 2010, 28, 10–14. [Google Scholar]
  3. 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]
  4. 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]
  5. 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]
  6. 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]
  7. 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]
  8. Faanes, A.; Skogestad, S. pH-neutralization: Integrated process and control design. Comput. Chem. Eng. 2004, 28, 1475–1487. [Google Scholar] [CrossRef]
  9. 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]
  10. 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]
  11. 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]
  12. 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]
  13. 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]
  14. 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]
  15. Mészáros, A.; Čirka, L.; Šperka, L. Intelligent control of a pH process. Chem. Pap. 2010, 63, 180–187. [Google Scholar] [CrossRef]
  16. Wang, X.; Hao, Z.; Zhang, Y. Comparing of Mamdani and Sugeno Style Fuzzy controller. J. Yantai Univ. 2006, 19, 341–344. [Google Scholar]
  17. 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]
  18. 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]
  19. 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]
  20. Goldbergd, E. Genetic Algorithms in Search Optimization and Machine Learning; Addison-Wesley: Boston, MA, USA, 1989; Volume 13, pp. 72–74. [Google Scholar]
  21. 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]
  22. Shanben, C.; Lin, W. Artificial neural network self-learning control method for uncertain objects. J. Autom. 1997, 23, 112–115. [Google Scholar]
  23. Baker, J.E. Adaptive Selection Methods for Genetic Algorithms; Lawrence Earlbaum Associates: Hilladale, NJ, USA, 1985; pp. 110–111. [Google Scholar]
  24. 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.
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.
Processes 11 02227 g001
Figure 2. Process of pH regulation in anaerobic dry fermentation.
Figure 2. Process of pH regulation in anaerobic dry fermentation.
Processes 11 02227 g002
Figure 3. PID control.
Figure 3. PID control.
Processes 11 02227 g003
Figure 4. Prerequisite parameters and fuzzy subsets.
Figure 4. Prerequisite parameters and fuzzy subsets.
Processes 11 02227 g004
Figure 5. T-S fuzzy pH control system.
Figure 5. T-S fuzzy pH control system.
Processes 11 02227 g005
Figure 6. Simplified T-S fuzzy control structure.
Figure 6. Simplified T-S fuzzy control structure.
Processes 11 02227 g006
Figure 7. GA–T-S fuzzy control flowchart.
Figure 7. GA–T-S fuzzy control flowchart.
Processes 11 02227 g007
Figure 8. Simulation of pH control system for anaerobic dry fermentation.
Figure 8. Simulation of pH control system for anaerobic dry fermentation.
Processes 11 02227 g008
Figure 9. Simulation of different controllers.
Figure 9. Simulation of different controllers.
Processes 11 02227 g009
Figure 10. Test setup.
Figure 10. Test setup.
Processes 11 02227 g010
Figure 11. Result of pH control test with values from 5.4 to 7.
Figure 11. Result of pH control test with values from 5.4 to 7.
Processes 11 02227 g011
Figure 12. Results of pH control test with values of 6 to 7.
Figure 12. Results of pH control test with values of 6 to 7.
Processes 11 02227 g012
Table 1. Performance comparison of different algorithms.
Table 1. Performance comparison of different algorithms.
ControllerResponse Time (s)Overshoot
PID1020.37
T-S fuzzy980.14
Simplified T-S fuzzy730.19
IAE-optimized simplified T-S fuzzy360.08
ISE-optimized simplified T-S fuzzy270.03
Table 2. Control test data with pH values of 5.4–7.
Table 2. Control test data with pH values of 5.4–7.
ControllerResponse Time (s)Overshoot
PID1240.37
T-S fuzzy1360.22
Simplified T-S fuzzy1130.28
IAE-optimized simplified T-S fuzzy710.17
ISE-optimized simplified T-S fuzzy470.09
Table 3. Control test data with pH values of 6–7.
Table 3. Control test data with pH values of 6–7.
ControllerResponse Time (s)Overshoot
PID1130.36
T-S fuzzy980.15
Simplified T-S fuzzy760.18
IAE-optimized simplified T-S fuzzy520.11
ISE-optimized simplified T-S fuzzy290.04
Table 4. System control error.
Table 4. System control error.
Controller5.4–76–7
pH ValueMax OvershootRelative ErrorpH ValueMax OvershootRelative Error
PID6.760.383.4%6.810.362.7%
T-S fuzzy7.190.212.7%6.890.121.5%
Simplified T-S fuzzy6.870.231.9%7.110.161.6%
IAE-optimized simplified T-S fuzzy7.080.181.1%7.050.091.4%
ISE-optimized simplified T-S fuzzy6.980.090.3%7.010.050.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.

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

APA Style

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

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop