# A GODFIP Control Algorithm for an IRC Grain Dryer

Authors: Aini Dai; Xiaoguang Zhou; Xiangdong Liu
Journal: Mathematical Problems in Engineering
 (2017)

---

## Abstract

Drying is an energy intensive and complex nonlinear process and it is difficult to control and make the traditional control meet the challenges. In order to effectively control the output grain moisture content of a combined infrared radiation and convection (IRC) grain dryer, taking into account the superiority of the fuzzy control method in dealing with complex systems, in this article, a genetic optimization dual fuzzy immune PID (Proportional-Integral-Derivative) (GODFIP) controller was proposed from the aspects of energy savings, stability, accuracy, and rapidity. The structure of the GODFIP controller consists of two fuzzy controllers, a PID controller, an immune algorithm, and a genetic optimization algorithm. In addition, a NARX model which can give relatively good predictive output information of the IRC dryer was established and used to represent the actual drying process to verify the control performance in the control simulation and anti-interference tests. The effectiveness of this controller was demonstrated by computer simulations, and the anti-interference performance comparative study with the other controllers further confirmed the superiority of the proposed grain drying controller which has the least value of performance objective function, the shortest rising time, and the best anti-interference ability compared to the other three compared controllers.


---

## Body

## 1. Introduction

Grain drying control is very important because it can decrease the grain loss by controlling the grain moisture and temperature to the desired level and maintain the quality, freshness, and longer life storage of grain. There are parameter uncertainties or variations in the grain dying process, and the establishment of a good control system for a grain dryer is difficult. Drying is an energy intensive process, one of the main control objectives is to dry the moisture content to desired level with efficient energy consumption and good quality, besides that stability of the system and robustness of the controller towards any disturbances are also the fundamental requirements of a dryer controller ‎[1, 2].In this research, the control object is a combined infrared radiation and convection (IRC) grain dryer designed by our research group which combines the direct and indirect heating drying technology. Infrared radiation drying is a new drying technology developed in recent 30 years and now has become more popular because of its advantages, such as its low drying time, the reasonable quality of the final dried product, and its greater energy savings capability, in addition to its lower price compared to microwave and vacuum drying methods ‎[3]. So far, the research scope of the infrared radiation drying technology mainly focuses on the study of experiments and simulation of drying, but there are no studies in the aspect of infrared radiation grain drying control ‎[4–11]. In order to meet the drying control requirements of the IRC dryer, effective control strategies for the grain dryer should be further researched on. Usually, in the whole grain drying process, the speed of the discharging grain motor is controlled (i.e., the adjustment of the drying time of grain in the dryer) to realize the drying target by detecting the error and its rate of change between the desired and the actual grain output moisture content according to the corresponding control algorithm.Traditional control methods have encountered a lot of obstacles because grain drying is a complicated heat and mass transfer process which is characterized by long delay process, highly nonlinearity, multidisturbance, strong coupling, and so on. It is difficult to make an accurate mathematical model of grain drying, so the control of grain drying is a challenging job ‎[2, 12]. Liu and Bakker-Arkema have also reviewed some traditional control limitations, such as the controllers designed by Marchant, Whitfied, McFarlane, and Courtois et al. Indeed, the classical feedback control is necessary but is inadequate for controlling grain dryer ‎[2]. The control effect of the feed-forward control is much better than that of the feedback control only, but the accuracy of the feed-forward control is affected by whether or not the system disturbance is measurable‎ [13]. In addition, Proportional-Integral-Derivative (PID) controller is successfully applied in the classic automatic control and still used in the control of grain drying now, but it relies on the mathematical model and has some limitations of which the values of the control parameters (kp′, ki′, kd′) are not changed in the whole control process, and when the controlled object and the environment are uncertain, the PID controller will be difficult to achieve satisfactory control effect and difficult to reach the control requirements with more strict restriction on overshoot. Model-predictive control (MPC) is a compound optimization algorithm which is based on model, rolling optimization, and feedback correction; it will control output changes by tracking the change of the set valve, so it is effective for the nonlinear and large lag process control ‎[2]. In a series of Liu and Bakker-Arkema’s papers, a model-predictive controller (MPC) was especially designed for grain drying. The simulation and field tests both showed that the controller performed well over a wide range of drying conditions. The distributed-parameter process model that the MPC employs is more comprehensive than the lumped parameter model and provides more detailed information on the process, but it requires more computation time and still relies on the accuracy of the system mathematical model ‎[2].In all, a drawback of the above-mentioned studies is that the authors generally made several simplifications in developing the dryer mathematical model based on some assumptions and observations. These simplifications are expected to affect the performance of these models and consequently their reliability in representing the real process when using these models for control purposes. Moreover, the mathematical models generally consist of sets of highly complex and nonlinear partial differential equations (PDES) with several auxiliary algebraic equations that involve transfer coefficients and thermophysical properties that require highly complicated numerical techniques to solve, rendering them undesirable options in control systems ‎[14].Since the 1970s, the research development of computer control technology and artificial intelligence has provided new ways for advanced control of the grain drying; thereafter drying control comes into the intelligent control period, of which the fuzzy logic controller (FLC) is a typical intelligent controller which imitates humans’ decision-making and common sense ‎[15, 16]. The FLC does not need to know the mathematical model of the controlled object and only needs to accumulate the experience data of a skilled human operator, which is the biggest difference from the conventional control. In essence, the FLC provides an algorithm which can convert the linguistic control strategy based on expert knowledge into an automatic control strategy. The FLC is not only widely used in industry but also a hot research topic in the control of grain drying now ‎[17–25]. Combining FLC algorithm with traditional control algorithms, the problem of grain drying control can be effectively solved.Fuzzy immune PID controller based on the immune feedback mechanism combines the intelligent FLC with the traditional PID controller and has the advantages of simple, good robustness and independence on the system model, which uses the characteristics of fuzzy control to learn the biological immune feedback mechanism under the complex disturbance and uncertain environment ‎[26–29]. However, the algorithm also has some limitations, although the PID control parameters in the control process can be changed, the change rates of parameters are the same, affecting the control performance to a certain extent. Aiming at this limitation, in this paper, an improved fuzzy immune PID controller is designed to solve the limitation of the general fuzzy immune PID control algorithm.In all, based on the idea of artificial intelligence, this paper proposes an improved fuzzy immune PID controller combined with two kinds of evolutionary algorithms: the immune feedback algorithm and the genetic optimization algorithm, which has improved the limitation of the traditional PID controller and the general fuzzy immune PID controller. Because the algorithm adopts two kinds of fuzzy controller and uses the genetic algorithm to optimize the initial controller parameters of the model, the proposed controller in this paper is called the genetic optimization dual fuzzy Immune PID (GODFIP) controller. Based on the GODFIP, the speed of discharging grain motor can be automatically adjusted to achieve the precise control of the output grain moisture of the IRC grain dryer according to the difference and its change rate between the output grain moisture content and the target moisture content. Finally, the NARX (Nonlinear Autoregressive models with Exogenous Inputs) model is used to represent the actual drying process to test the effectiveness of the proposed controller, and the comparative study with the other related controllers is also made, and the simulation results show that the control effect of GODFIP is better than that of other compared controllers.


## 2. The Mathematical Model of Grain Drying and Its Control Algorithm Structure

### 2.1. The Mechanical Structure of the New Grain Dryer

The IRC grain drying system has been put into use in Harbin Development Zone, Binxi town, China, Dongyu Machinery Co. Ltd. Fresh, mature corns were purchased from a local farm (an agricultural area in north of China).The IRC grain dryer mechanism system is shown in Figure1. It can be seen that the system mainly consists of the following parts: a wet grain barn, a grain dryer, and dried grain barn, and 3 elevators used to raise grains to the barns and 5 belt machines used to transport, of which the new radiation-convection grain dryer is rectangularity in shape and the overall dimensions are 4.75 m in height, 2.06 m in length, and 1.3 m in depth as shown in Figure 2. Figure 2 is the schematic diagram of the IRC grain dryer which consists of four sections: the storage grain section (0.8 m in height), the convection section (1.1 m in height), the radiation section (0.8 m in height), and the discharging grain section (1.2 m in height), of which the convection section is a combination design and there are three kinds of drying process to choose: counter flow drying; concurrent and counter flow drying; mix flow drying, and the combustion furnace of radiation section is a side heat radiation type equipped with some corresponding safety devices and can be automatically ignited. Capacitive moisture sensor is installed in the inlet and outlet of the grain dryer for the need of control and some other online sensors detecting the real drying parameters are also installed as shown in Figure 2 (numbers (1)–(13)).Figure 1
Mechanic structure diagram of the IRC grain dryer. (1) Bucket elevator T1, (2) wet grain barn, (3) belt conveyor P1, (4) bucket elevator T2, (5) belt conveyor P3, (6) belt conveyor P5, (7) dried grain barn, (8) bucket elevator T3, (9) belt conveyor P4, (10) dryer, and (11) belt conveyor P2.Figure 2
Scheme of the IRC grain dryer. (1) Main hot air speed. (2) Hot air temperature. (3) Infrared exhaust gas temperature. (4) Infrared exhaust gas velocity. (5) Exhaust gas temperature and humidity. (6) Drying waste gas. (7) Inlet grain temperature and moisture. (8) Outlet grain temperature and moisture. (9) Postdrying grain temperature. (10) Infrared grain temperature. (11) Combustion tube temperature. (12) Flue-gas temperature. (13) Ambient temperature and humidity.


### 2.2. The Control System of the IRC Dryer

The controlling situation and some equipment for the grain dryer are shown in Figure3. Programmable controller technology (PLC) + frequency converter are adopted in the control system and the drying parameters can be real-time detected, such as the air temperature and humidity, the grain moisture, and temperature. The grain discharging speed is controlled by the frequency converter (VFD-007M43B) installed in the control cabinet which worked in two operating modes (manual mode or automatic mode); when working in manual mode, long-term work experiences are generally needed to manually adjust the discharging grain speed to achieve the drying target. In automatic mode, a reliable control algorithm is also needed to automatically control the dryer.Figure 3
Controlling situation and equipment for the IRC grain dryer.The control system of the IRC dryer is also equipped with a computer, which is connected with PLC (S7-300) through Ethernet. The experimental data can be analyzed and processed in the computer, and different drying algorithms can be designed and tested.


### 2.3. The Process of Radiation-Convection Grain Drying

As seen from Figures1 and 2, the drying process is as follows. (1) First, raise the wet grain into the dryer from the wet grain barn by the bucket elevator T2 and belt conveyors P2 and P3; when the upper limit grain level sensor is installed in the storage section of the grain dryer alarms, the wet grain feeding is stopped and ready for drying. (2) Secondly, let oil furnace heat the radiator and begin to carry out radiation drying in the radiation section by use of the high temperature of the radiator. (3) Reuse the radiation exhaust gas of infrared radiation section and mix it with appropriate amount of cold air to achieve the regulation of the mixed air temperature by controlling the opening of solenoid valve, and blow the mixed air into the convection section through pipe to carry out the convection drying in the convection section based on the heat and mass exchange principle. (4) Finally, start the discharging grain wheel and other relevant devices, then discharge the dried grain into the dried grain barn by the bucket elevator T3 and belt conveyor P5, and end the drying.In the whole drying, the speed of discharging grain motor can be adjusted automatically by an intelligent control algorithm every time interval or adjusted manually by an experience worker according to the detected drying parameters.


### 2.4. The Identification Equation of Drying Process

For the complex IRC grain dryer, the description of the dynamic process of grain drying is more difficult. It is an effective way to learn the characteristics of the drying process by modeling the input and output data ‎[30].


#### 2.4.1. Autoregressive Exogenous (ARX)

Autoregressive Exogenous (ARX) model has been widely applied in the prediction control. It does not need to know the physical mechanism inside the complex process, so it is regarded as a “black box” model. It provides a fast and efficient solution to the actual system output by means of a least squares approach, and it has the advantages of simple structure and strong robustness. It is an autoregressive model which has exogenous inputs, and it relates the current output value of a time series to past output values of the same series and current and past values of the driving (exogenous) series. More details about ARX can be found in ‎[31, 32]. The basic structure of ARX model identification is shown in (1)Azyk=Bzuk+ek,Az=1+∑i=1naa1z-i,Bz=z-td∑j=0nb-1bjz-j,where the ARX order is determined as [nanbtd], na is the model order of A(Z), nb is the model order of B(Z), and td is the estimated pure time delay between the exogenous input signal u(k) and the output signal y(k); e(k) is a white noise term, generally assumed to be Gaussian and White; k represents the discrete time step.The input and output data for identification model of grain drying are from the drying experiment of the IRC grain dryer (corn mixed flow and radiation) in December 4, 2015, a total of 384 sets of data, and the sampling frequency is 60 HZ. The input data of the identified drying model is the current and past drying time of grain being experienced in the dryer and the past output grain moisture content of the grain dryer; the output data of the model is the current output grain moisture of the grain dryer real detected by the output grain moisture sensor which has been calibrated using the 105°C standard oven method (GB 5497-1985).The corn of the drying experiment purchased from the local farmers is a natural harvest species: number 1 XingXing (a breed name of corn), and its initial grain moisture content is about 26%. The ambient temperature is about minus 10°C, relative humidity 60–70%. The hot air temperature is between 80 and 120°C, and the hot wind speed is 12 m/s.By using the identification toolbox in Matlab, ident, the identified transfer function of the model is a two-order lag system as shown in (2), of which the identification model order is [221] (the input and output order are, resp., equal to 2 and the time delay td is equal to 1), and A(Z) and B(Z) are as shown in (3) and (4).(2)Gz=BZAZ=0.3799z-1-0.3804z-21-0.7471z-1-0.2277z-2×Z-1,(3)Az=1-0.7471z-1-0.2277z-2,(4)Bz=0.3799z-1-0.3804z-2.In this study, we use mean squared error (MSE) and squared correlation coefficient(R) to evaluate the prediction performance of the designed drying model shown in (5)MSE=1m∑i=1myi-yi^2,R=m∑i=1myi^yi-∑i=1myi^∑i=1myi2m∑i=1myi^2-∑i=1myi^2m∑i=1myi2-∑i=1myi2∈01,where m is the actual total number of the dataset and yi and yi^ are actual and predicted values, respectively; the closer MSE is to zero, the better the prediction performance of model is, and the closer R (range from 0 to 1) is to 1, the better the model fits.Experimental model identification results are shown in Figure4. The squared correlation coefficient R between the model and the measured data is equal to 95.5%, and the MSE error is equal to 2.29∗10-4, showing that the resulting linear model has a good approximation of the actual drying process.Figure 4
Fitting effect curve of the ARX model with the actual curve.


#### 2.4.2. Nonlinear Autoregressive with Exogenous Input (NARX) Model

The theory of linear systems identification is a relatively matured field ‎[33]; however, as seen from Figure 4, the ARX identified linear models can not adequately capture all the magnitudes of the real output response due to the high degree of nonlinearity of the system, so in this paper a nonlinear model known as the Nonlinear Autoregressive with Exogenous input (NARX) model is developed.The NARX model has been proven to have a superior performance and has been successfully employed in solving various types of complex nonlinear model problems in recent years ‎[34–38]. The NARX model uses a nonlinear function to predict the output grain moisture content of drying by regressing from the past values of system output y and the past values of exogenous input u. The form of the NARX model is shown in (6)y^k=fyk-1,yk-2,…,yk-na,xk-td,xk-td-1,…,xk-td-nb+1,where f[∙] is a nonlinear mapping function that estimates the output y^(k) at time sample k. In this study the artificial neural network is used to regress the nonlinear function f[∙]. The NARX network model structure consists of an input layer, a hidden layer, and an output layer of which the number of hidden neurons is 10 and the time lags order for the input and output series is 2 (i.e., na=nb=2). The architecture of the NARX model adopted in this study to predict the output moisture content is shown in Figure 5, where x(t) is the system input (drying time); y(t) is the system output (output grain moisture content); w is the weights value; b is the bias value.Figure 5
The architecture of the NARX model.In the case of modeling, the input-output data of 384 samples are randomly divided into three parts to develop a NARX model: 268 training datasets, 58 validation datasets, and 58 testing datasets. During the training phase, the past input and output data of training are presented to train and adjust the neural network by using the Levenberg-Marquardt algorithm; during validation, the validation data are used to measure network generalization and to halt training when generalization stops improving; during testing, the testing data have no effect on training data, so an independent measure of network performance can be provided during and after training.Table1 and Figure 6 show the regression prediction results of the NARX model, and it shows that the NARX model has high prediction accuracy of which the MSE and R on testing data are equal to 1.062∗10-5 and 99.78%, respectively, and the predicted errors (the difference values between the predicted output values of model and the practical output values of dryer) are basically within in ±1%. These results indicate that the developed NARX model is considered as a much better representative for the nonlinear grain drying process than the ARX model (MSE: 2.29∗10-4; R: 95.5%).Table 1
The simulation prediction results of the NARX model.
Data
Size
Model prediction results
MSE
R
Training data
268
1.70
∗
10
-
5
99.68%
Validation data
58
1.08
∗
10
-
5
99.78%
Testing data
58
1.06
∗
10
-
5
99.78%Figure 6
The prediction results of the NARX model on the testing data.


### 2.5. The Control Algorithm Structure of Grain Dryer

There are many factors that affect the control performance of grain drying as shown in Figure7, the main factors of which are the grain initial temperature and inlet moisture, the ambient environment temperature and moisture, the hot air and cooling air flow, the hot air temperature, and the speed of discharging grain. In addition, the corn used in the experiment is purchased from different local farmers and each batch of grain moisture is different, so it will easily lead to the variations of the grain moisture content in the dryer. Furthermore, the ambient temperature is below zero, the ice inside the grain will affect the detection accuracy of the grain moisture sensor. Therefore, grain drying is such a complex process that satisfactory control effect is difficult to achieve.Figure 7
Factors affecting grain drying.Under a certain period of time and environmental conditions, some variables can be thought to be unchanged for a certain batch of grain drying, such as the grain initial temperature and initial moisture content, the ambient environment temperature and moisture, the hot air temperature, humidity, and the hot air flow rate. Usually, in the engineering practice of grain drying, the drying time is often taken as the control variable and the output grain moisture content as the important controlled variable; the other affection factors are taken as the disturbance signals.The designed control scheme of this paper is shown in Figure8, where the intelligent controller in this paper refers to the designed dual fuzzy immune PID controller, and the immune algorithm refers to the feedback control law, e(t) is the error between the output and the target value, de/dt is the change rate of e(t), and the interference signal can be the inlet grain moisture, the ambient temperature, and so on. The drying time of grain in the dryer can be tuned by controlling the speed of the discharging grain motor in the whole drying process according to the corresponding intelligent control algorithm to achieve the target value; in addition, the controller’s initial parameters are optimized by a genetic algorithm.Figure 8
Block diagram of the control model scheme for the IRC grain dryer.


## 2.1. The Mechanical Structure of the New Grain Dryer

The IRC grain drying system has been put into use in Harbin Development Zone, Binxi town, China, Dongyu Machinery Co. Ltd. Fresh, mature corns were purchased from a local farm (an agricultural area in north of China).The IRC grain dryer mechanism system is shown in Figure1. It can be seen that the system mainly consists of the following parts: a wet grain barn, a grain dryer, and dried grain barn, and 3 elevators used to raise grains to the barns and 5 belt machines used to transport, of which the new radiation-convection grain dryer is rectangularity in shape and the overall dimensions are 4.75 m in height, 2.06 m in length, and 1.3 m in depth as shown in Figure 2. Figure 2 is the schematic diagram of the IRC grain dryer which consists of four sections: the storage grain section (0.8 m in height), the convection section (1.1 m in height), the radiation section (0.8 m in height), and the discharging grain section (1.2 m in height), of which the convection section is a combination design and there are three kinds of drying process to choose: counter flow drying; concurrent and counter flow drying; mix flow drying, and the combustion furnace of radiation section is a side heat radiation type equipped with some corresponding safety devices and can be automatically ignited. Capacitive moisture sensor is installed in the inlet and outlet of the grain dryer for the need of control and some other online sensors detecting the real drying parameters are also installed as shown in Figure 2 (numbers (1)–(13)).Figure 1
Mechanic structure diagram of the IRC grain dryer. (1) Bucket elevator T1, (2) wet grain barn, (3) belt conveyor P1, (4) bucket elevator T2, (5) belt conveyor P3, (6) belt conveyor P5, (7) dried grain barn, (8) bucket elevator T3, (9) belt conveyor P4, (10) dryer, and (11) belt conveyor P2.Figure 2
Scheme of the IRC grain dryer. (1) Main hot air speed. (2) Hot air temperature. (3) Infrared exhaust gas temperature. (4) Infrared exhaust gas velocity. (5) Exhaust gas temperature and humidity. (6) Drying waste gas. (7) Inlet grain temperature and moisture. (8) Outlet grain temperature and moisture. (9) Postdrying grain temperature. (10) Infrared grain temperature. (11) Combustion tube temperature. (12) Flue-gas temperature. (13) Ambient temperature and humidity.


## 2.2. The Control System of the IRC Dryer

The controlling situation and some equipment for the grain dryer are shown in Figure3. Programmable controller technology (PLC) + frequency converter are adopted in the control system and the drying parameters can be real-time detected, such as the air temperature and humidity, the grain moisture, and temperature. The grain discharging speed is controlled by the frequency converter (VFD-007M43B) installed in the control cabinet which worked in two operating modes (manual mode or automatic mode); when working in manual mode, long-term work experiences are generally needed to manually adjust the discharging grain speed to achieve the drying target. In automatic mode, a reliable control algorithm is also needed to automatically control the dryer.Figure 3
Controlling situation and equipment for the IRC grain dryer.The control system of the IRC dryer is also equipped with a computer, which is connected with PLC (S7-300) through Ethernet. The experimental data can be analyzed and processed in the computer, and different drying algorithms can be designed and tested.


## 2.3. The Process of Radiation-Convection Grain Drying

As seen from Figures1 and 2, the drying process is as follows. (1) First, raise the wet grain into the dryer from the wet grain barn by the bucket elevator T2 and belt conveyors P2 and P3; when the upper limit grain level sensor is installed in the storage section of the grain dryer alarms, the wet grain feeding is stopped and ready for drying. (2) Secondly, let oil furnace heat the radiator and begin to carry out radiation drying in the radiation section by use of the high temperature of the radiator. (3) Reuse the radiation exhaust gas of infrared radiation section and mix it with appropriate amount of cold air to achieve the regulation of the mixed air temperature by controlling the opening of solenoid valve, and blow the mixed air into the convection section through pipe to carry out the convection drying in the convection section based on the heat and mass exchange principle. (4) Finally, start the discharging grain wheel and other relevant devices, then discharge the dried grain into the dried grain barn by the bucket elevator T3 and belt conveyor P5, and end the drying.In the whole drying, the speed of discharging grain motor can be adjusted automatically by an intelligent control algorithm every time interval or adjusted manually by an experience worker according to the detected drying parameters.


## 2.4. The Identification Equation of Drying Process

For the complex IRC grain dryer, the description of the dynamic process of grain drying is more difficult. It is an effective way to learn the characteristics of the drying process by modeling the input and output data ‎[30].


### 2.4.1. Autoregressive Exogenous (ARX)

Autoregressive Exogenous (ARX) model has been widely applied in the prediction control. It does not need to know the physical mechanism inside the complex process, so it is regarded as a “black box” model. It provides a fast and efficient solution to the actual system output by means of a least squares approach, and it has the advantages of simple structure and strong robustness. It is an autoregressive model which has exogenous inputs, and it relates the current output value of a time series to past output values of the same series and current and past values of the driving (exogenous) series. More details about ARX can be found in ‎[31, 32]. The basic structure of ARX model identification is shown in (1)Azyk=Bzuk+ek,Az=1+∑i=1naa1z-i,Bz=z-td∑j=0nb-1bjz-j,where the ARX order is determined as [nanbtd], na is the model order of A(Z), nb is the model order of B(Z), and td is the estimated pure time delay between the exogenous input signal u(k) and the output signal y(k); e(k) is a white noise term, generally assumed to be Gaussian and White; k represents the discrete time step.The input and output data for identification model of grain drying are from the drying experiment of the IRC grain dryer (corn mixed flow and radiation) in December 4, 2015, a total of 384 sets of data, and the sampling frequency is 60 HZ. The input data of the identified drying model is the current and past drying time of grain being experienced in the dryer and the past output grain moisture content of the grain dryer; the output data of the model is the current output grain moisture of the grain dryer real detected by the output grain moisture sensor which has been calibrated using the 105°C standard oven method (GB 5497-1985).The corn of the drying experiment purchased from the local farmers is a natural harvest species: number 1 XingXing (a breed name of corn), and its initial grain moisture content is about 26%. The ambient temperature is about minus 10°C, relative humidity 60–70%. The hot air temperature is between 80 and 120°C, and the hot wind speed is 12 m/s.By using the identification toolbox in Matlab, ident, the identified transfer function of the model is a two-order lag system as shown in (2), of which the identification model order is [221] (the input and output order are, resp., equal to 2 and the time delay td is equal to 1), and A(Z) and B(Z) are as shown in (3) and (4).(2)Gz=BZAZ=0.3799z-1-0.3804z-21-0.7471z-1-0.2277z-2×Z-1,(3)Az=1-0.7471z-1-0.2277z-2,(4)Bz=0.3799z-1-0.3804z-2.In this study, we use mean squared error (MSE) and squared correlation coefficient(R) to evaluate the prediction performance of the designed drying model shown in (5)MSE=1m∑i=1myi-yi^2,R=m∑i=1myi^yi-∑i=1myi^∑i=1myi2m∑i=1myi^2-∑i=1myi^2m∑i=1myi2-∑i=1myi2∈01,where m is the actual total number of the dataset and yi and yi^ are actual and predicted values, respectively; the closer MSE is to zero, the better the prediction performance of model is, and the closer R (range from 0 to 1) is to 1, the better the model fits.Experimental model identification results are shown in Figure4. The squared correlation coefficient R between the model and the measured data is equal to 95.5%, and the MSE error is equal to 2.29∗10-4, showing that the resulting linear model has a good approximation of the actual drying process.Figure 4
Fitting effect curve of the ARX model with the actual curve.


### 2.4.2. Nonlinear Autoregressive with Exogenous Input (NARX) Model

The theory of linear systems identification is a relatively matured field ‎[33]; however, as seen from Figure 4, the ARX identified linear models can not adequately capture all the magnitudes of the real output response due to the high degree of nonlinearity of the system, so in this paper a nonlinear model known as the Nonlinear Autoregressive with Exogenous input (NARX) model is developed.The NARX model has been proven to have a superior performance and has been successfully employed in solving various types of complex nonlinear model problems in recent years ‎[34–38]. The NARX model uses a nonlinear function to predict the output grain moisture content of drying by regressing from the past values of system output y and the past values of exogenous input u. The form of the NARX model is shown in (6)y^k=fyk-1,yk-2,…,yk-na,xk-td,xk-td-1,…,xk-td-nb+1,where f[∙] is a nonlinear mapping function that estimates the output y^(k) at time sample k. In this study the artificial neural network is used to regress the nonlinear function f[∙]. The NARX network model structure consists of an input layer, a hidden layer, and an output layer of which the number of hidden neurons is 10 and the time lags order for the input and output series is 2 (i.e., na=nb=2). The architecture of the NARX model adopted in this study to predict the output moisture content is shown in Figure 5, where x(t) is the system input (drying time); y(t) is the system output (output grain moisture content); w is the weights value; b is the bias value.Figure 5
The architecture of the NARX model.In the case of modeling, the input-output data of 384 samples are randomly divided into three parts to develop a NARX model: 268 training datasets, 58 validation datasets, and 58 testing datasets. During the training phase, the past input and output data of training are presented to train and adjust the neural network by using the Levenberg-Marquardt algorithm; during validation, the validation data are used to measure network generalization and to halt training when generalization stops improving; during testing, the testing data have no effect on training data, so an independent measure of network performance can be provided during and after training.Table1 and Figure 6 show the regression prediction results of the NARX model, and it shows that the NARX model has high prediction accuracy of which the MSE and R on testing data are equal to 1.062∗10-5 and 99.78%, respectively, and the predicted errors (the difference values between the predicted output values of model and the practical output values of dryer) are basically within in ±1%. These results indicate that the developed NARX model is considered as a much better representative for the nonlinear grain drying process than the ARX model (MSE: 2.29∗10-4; R: 95.5%).Table 1
The simulation prediction results of the NARX model.
Data
Size
Model prediction results
MSE
R
Training data
268
1.70
∗
10
-
5
99.68%
Validation data
58
1.08
∗
10
-
5
99.78%
Testing data
58
1.06
∗
10
-
5
99.78%Figure 6
The prediction results of the NARX model on the testing data.


## 2.4.1. Autoregressive Exogenous (ARX)

Autoregressive Exogenous (ARX) model has been widely applied in the prediction control. It does not need to know the physical mechanism inside the complex process, so it is regarded as a “black box” model. It provides a fast and efficient solution to the actual system output by means of a least squares approach, and it has the advantages of simple structure and strong robustness. It is an autoregressive model which has exogenous inputs, and it relates the current output value of a time series to past output values of the same series and current and past values of the driving (exogenous) series. More details about ARX can be found in ‎[31, 32]. The basic structure of ARX model identification is shown in (1)Azyk=Bzuk+ek,Az=1+∑i=1naa1z-i,Bz=z-td∑j=0nb-1bjz-j,where the ARX order is determined as [nanbtd], na is the model order of A(Z), nb is the model order of B(Z), and td is the estimated pure time delay between the exogenous input signal u(k) and the output signal y(k); e(k) is a white noise term, generally assumed to be Gaussian and White; k represents the discrete time step.The input and output data for identification model of grain drying are from the drying experiment of the IRC grain dryer (corn mixed flow and radiation) in December 4, 2015, a total of 384 sets of data, and the sampling frequency is 60 HZ. The input data of the identified drying model is the current and past drying time of grain being experienced in the dryer and the past output grain moisture content of the grain dryer; the output data of the model is the current output grain moisture of the grain dryer real detected by the output grain moisture sensor which has been calibrated using the 105°C standard oven method (GB 5497-1985).The corn of the drying experiment purchased from the local farmers is a natural harvest species: number 1 XingXing (a breed name of corn), and its initial grain moisture content is about 26%. The ambient temperature is about minus 10°C, relative humidity 60–70%. The hot air temperature is between 80 and 120°C, and the hot wind speed is 12 m/s.By using the identification toolbox in Matlab, ident, the identified transfer function of the model is a two-order lag system as shown in (2), of which the identification model order is [221] (the input and output order are, resp., equal to 2 and the time delay td is equal to 1), and A(Z) and B(Z) are as shown in (3) and (4).(2)Gz=BZAZ=0.3799z-1-0.3804z-21-0.7471z-1-0.2277z-2×Z-1,(3)Az=1-0.7471z-1-0.2277z-2,(4)Bz=0.3799z-1-0.3804z-2.In this study, we use mean squared error (MSE) and squared correlation coefficient(R) to evaluate the prediction performance of the designed drying model shown in (5)MSE=1m∑i=1myi-yi^2,R=m∑i=1myi^yi-∑i=1myi^∑i=1myi2m∑i=1myi^2-∑i=1myi^2m∑i=1myi2-∑i=1myi2∈01,where m is the actual total number of the dataset and yi and yi^ are actual and predicted values, respectively; the closer MSE is to zero, the better the prediction performance of model is, and the closer R (range from 0 to 1) is to 1, the better the model fits.Experimental model identification results are shown in Figure4. The squared correlation coefficient R between the model and the measured data is equal to 95.5%, and the MSE error is equal to 2.29∗10-4, showing that the resulting linear model has a good approximation of the actual drying process.Figure 4
Fitting effect curve of the ARX model with the actual curve.


## 2.4.2. Nonlinear Autoregressive with Exogenous Input (NARX) Model

The theory of linear systems identification is a relatively matured field ‎[33]; however, as seen from Figure 4, the ARX identified linear models can not adequately capture all the magnitudes of the real output response due to the high degree of nonlinearity of the system, so in this paper a nonlinear model known as the Nonlinear Autoregressive with Exogenous input (NARX) model is developed.The NARX model has been proven to have a superior performance and has been successfully employed in solving various types of complex nonlinear model problems in recent years ‎[34–38]. The NARX model uses a nonlinear function to predict the output grain moisture content of drying by regressing from the past values of system output y and the past values of exogenous input u. The form of the NARX model is shown in (6)y^k=fyk-1,yk-2,…,yk-na,xk-td,xk-td-1,…,xk-td-nb+1,where f[∙] is a nonlinear mapping function that estimates the output y^(k) at time sample k. In this study the artificial neural network is used to regress the nonlinear function f[∙]. The NARX network model structure consists of an input layer, a hidden layer, and an output layer of which the number of hidden neurons is 10 and the time lags order for the input and output series is 2 (i.e., na=nb=2). The architecture of the NARX model adopted in this study to predict the output moisture content is shown in Figure 5, where x(t) is the system input (drying time); y(t) is the system output (output grain moisture content); w is the weights value; b is the bias value.Figure 5
The architecture of the NARX model.In the case of modeling, the input-output data of 384 samples are randomly divided into three parts to develop a NARX model: 268 training datasets, 58 validation datasets, and 58 testing datasets. During the training phase, the past input and output data of training are presented to train and adjust the neural network by using the Levenberg-Marquardt algorithm; during validation, the validation data are used to measure network generalization and to halt training when generalization stops improving; during testing, the testing data have no effect on training data, so an independent measure of network performance can be provided during and after training.Table1 and Figure 6 show the regression prediction results of the NARX model, and it shows that the NARX model has high prediction accuracy of which the MSE and R on testing data are equal to 1.062∗10-5 and 99.78%, respectively, and the predicted errors (the difference values between the predicted output values of model and the practical output values of dryer) are basically within in ±1%. These results indicate that the developed NARX model is considered as a much better representative for the nonlinear grain drying process than the ARX model (MSE: 2.29∗10-4; R: 95.5%).Table 1
The simulation prediction results of the NARX model.
Data
Size
Model prediction results
MSE
R
Training data
268
1.70
∗
10
-
5
99.68%
Validation data
58
1.08
∗
10
-
5
99.78%
Testing data
58
1.06
∗
10
-
5
99.78%Figure 6
The prediction results of the NARX model on the testing data.


## 2.5. The Control Algorithm Structure of Grain Dryer

There are many factors that affect the control performance of grain drying as shown in Figure7, the main factors of which are the grain initial temperature and inlet moisture, the ambient environment temperature and moisture, the hot air and cooling air flow, the hot air temperature, and the speed of discharging grain. In addition, the corn used in the experiment is purchased from different local farmers and each batch of grain moisture is different, so it will easily lead to the variations of the grain moisture content in the dryer. Furthermore, the ambient temperature is below zero, the ice inside the grain will affect the detection accuracy of the grain moisture sensor. Therefore, grain drying is such a complex process that satisfactory control effect is difficult to achieve.Figure 7
Factors affecting grain drying.Under a certain period of time and environmental conditions, some variables can be thought to be unchanged for a certain batch of grain drying, such as the grain initial temperature and initial moisture content, the ambient environment temperature and moisture, the hot air temperature, humidity, and the hot air flow rate. Usually, in the engineering practice of grain drying, the drying time is often taken as the control variable and the output grain moisture content as the important controlled variable; the other affection factors are taken as the disturbance signals.The designed control scheme of this paper is shown in Figure8, where the intelligent controller in this paper refers to the designed dual fuzzy immune PID controller, and the immune algorithm refers to the feedback control law, e(t) is the error between the output and the target value, de/dt is the change rate of e(t), and the interference signal can be the inlet grain moisture, the ambient temperature, and so on. The drying time of grain in the dryer can be tuned by controlling the speed of the discharging grain motor in the whole drying process according to the corresponding intelligent control algorithm to achieve the target value; in addition, the controller’s initial parameters are optimized by a genetic algorithm.Figure 8
Block diagram of the control model scheme for the IRC grain dryer.


## 3. Design of the Genetic Optimization Dual Fuzzy Immune PID (GODFIP) Controller

### 3.1. The General Fuzzy Immune PID Controller Design

#### 3.1.1. Biological Immune Principle

Biological immune system can produce antibodies against a foreign invasion of the antigen, which plays the defense role. The most important cells in the immune system are the lymphocytes which are mainly two kinds: B and T cells; B cells are responsible for antibody production and carry out the immunity function and T cells regulate the whole immune process. T cells are composed of inhibit T cells (TS) and helper cells (TH), which, respectively, inhibit and help B cells respond to a stimulus. When the antigen is increasing, there are more TH cells and less TS cells in the body which will produce more B cells, that is, more antibodies; when the antigen is gradually reduced, TS cells will increase and inhibit the generation of TH cells; thereby reducing the B cells, antibodies decreased. When the antigen is eliminated, the immune response is completed.Assuming that thek generation amount of antigen is ε(k), the change rate of the number of antigens is Δε(k); the output of TH cells is TH(k); the output of TS cell is TS(k); according to the immune feedback mechanism, the total stimulation received by B cells is S(k), as shown in (7)Sk=THk-TSk.Among themTH(k)=k1ε(k); TS(k)=k2f[ε(k),Δε(k)]ε(k); f· is a nonlinear control function that represents the ability to suppress external stimuli. Its feedback control law is shown in (8) and thus is also called the nonlinear p-type controller.(8)Sk=THk-TSk=k1-k2fεk,Δεkεk=k1-ηfεk,Δεkεk=Kpεk,Kp=k1–ηfεk,Δεk.Among them,k=k1 is the speed of control response, η=k1/k2 is related to the stability of the response, and Kp will change with the amount of the antigen. Moreover, a reasonable adjustment of k and η is also crucial, and it will enable the control system to have smaller overshoot and faster response rate.


#### 3.1.2. Design of General Fuzzy Immune PID Feedback Controller

Imitating the above immune feedback mechanism, ap-type fuzzy immune PID feedback controller is designed, which combines the fuzzy immune controller with the general PID controller.The discrete form of the ordinary PID controller is as shown in(9)u′k=kp′+ki′z-1+kd′z-1zek.The discrete output of the fuzzy immune PID is shown in (10) by replacing the antigen ε(k) and its change rate Δε(k) of the fuzzy immune system with the output of general PID controller u′(k) and its change rate Δu′(k), respectively.(10)uk=Kpu′k=k1-ηfu′k,Δu′kkp′+ki′z-1+kd′z-1zek=kp+kiz-1+kdz-1zek,where(11)kp=kkp′1-ηf∙=Kpkp′,ki=kki′1-ηf∙=Kpki′,kd=kkd′1-ηf∙=Kpkd′.Its controller structure is shown in Figure9, and the controlled object is the IRC dryer; the controller variable is the output of the model: y(k) is the outlet grain moisture; r(k) is the input of the control model which is a step response function (the target moisture content value); e(k) is the error between the output and the target value; de/dt is the change rate of e; u′(k) is the output of the general PID controller;u(k) is the immune controller’s output which can control the drying time of grain in the dryer (i.e., u(k) can be used to control the speed of discharging grain motor to obtain the tuning of the grain drying time).Figure 9
Structure of the fuzzy immune PID feedback controller.The Mamdani fuzzy controller designed in the control algorithm is used to approximate the nonlinear function (f[u′k,Δu′k]), and it has two inputs and one output. The two input variables of the fuzzy controller are the output of the PID algorithm (u′k) and its change rate of error (Δu′k), and the output variable of the fuzzy controller is a nonlinear function (f[u′k,Δu′k]). As seen in (11), the parameters of the controllers kp, ki, and kd can be adjusted adaptively with the change of u′(k) and Δu′(k), which overcomes the limitations that the general PID controller’s parameters can not be dynamically adjusted during the control process.Firstly, the fuzzy method of the input variables should be used to transform from the basic domain to the corresponding fuzzy set domain and define the quantification factor of input variables (Ku′; KΔu′) to get the fuzzy input (U′=Ku′∗u′; ΔU′=KΔu′∗Δu′), so the output needs to transform from the fuzzy set to the basic domain. In this paper, the fuzzy set domain of the input and output is [-1,1].Secondly, the membership functions of input and output lingual variables should be formed to determine the distribution of different variables. There are commonly three types of membership function to be used: (1) normal distribution; (2) triangle; (3) trapezoidal. The numbers of the fuzzy sets for the input variable and output variable are used to meet the requirements of accuracy. As the numbers of the fuzzy sets increase, the numbers of fuzzy control rules increase accordingly, which will improve the accuracy of control, but meantime the complexity of control is increased; on the premise of satisfying the requirement of control precision, the least numbers of the fuzzy sets can be equal to 3 based on the principle of determining the minimum inference rules numbers; in addition, the numbers of the fuzzy sets for the input and the output can be unequal; in order to improve the accuracy of control, the fuzzy sets numbers for the output variable can be increased ‎[39]. Based on the above analysis, in this paper each of the input variables has three fuzzy sets: positive, zero, negative or P, Z, N; the output adopts five fuzzy sets: positive big, positive small, zero, negative small, negative big or PB, PS, Z, NS, NB. The Mamdani fuzzy controller can use the following 9 knowledge rules shown in the Table 2 (e.g., if u′k is P and Δu′k is P then fu′k,Δu′k is NB), which imitating the control principle of biological immune feedback. The input and output membership functions of the fuzzy controller are shown in Figures 10(a)–10(c).Table 2
Knowledge rules of the fuzzy controller.
f
u
′
k
,
Δ
u
′
k
Δ
u
′
k
P
Z
N
u
′
k
P
NB
NS
PS
Z
NS
Z
PS
N
NS
PS
PBFigure 10
Degree of membership function plots (a)u′(k), (b) Δu′(k), (c) f, and (d) relationship surface figure of the output and input.
(a)
(b)
(c)
(d)And then, the fuzzy output can be obtained by the fuzzy inference synthesis algorithm according to the rules of Table2.Finally, according to the fuzzy rules, defuzzification will transform the outputf∙ of the fuzzy controller from a fuzzy set to a crisp number by using the gravity method (centroid) and the Zadeh fuzzy logic operation (AND). The relationship surface figure of the output and input in the universe of discourse is shown in Figure 10(d).


### 3.2. Genetic Optimization Dual Fuzzy Immune PID (GODFIP) Controller

#### 3.2.1. The Structure of GODFIP

It can also be seen from (11) that the PID parameters (kp, ki, kd) have the same change rate (Kp) which should be different in the actual control process, thus affecting the control effect to some extent. In this paper, by adding a fuzzy PID parameter adjusting controller on the general fuzzy immune PID controller to adjust the increment values of the PID parameters in (11), making kp′, ki′, kd′ variable in the process of control shown in (12), the change rates of the PID parameters (kp, ki, kd) in (11) are not the same.(12)kp′k=kp′+Δkp′k,ki′k=ki′+Δki′k,kd′k=kd′+Δkd′k.In addition, in the process of control, there is some difficulty in selecting the parameters (kp′, ki′, kd′,k, η), which is often time consuming and affects the control effect to some extent. Moreover, a reasonable adjustment of k and η is also crucial, and it will enable the control system to have smaller overshoot and faster response. So genetic algorithm is adopted to optimize the parameters of the GODFIP controller, and the optimal control is realized.Therefore, in this paper, a genetic optimization dual fuzzy immune PID (GODFIP) controller is designed, which not only can improve the limitation of the general fuzzy immune PID control but also can find the optimal parameters (kp′, ki′, kd′,k, and η) according to the control situation. The structure of GODFIP controller is as shown in Figure 11.Figure 11
Structure of the genetic optimization dual fuzzy immune PID (GODFIP) controller.In Figure11, r(k) is the reference target input; e(k) is the error between the output and the target value; de/dt is the change rate of e; u′(k) is the output of the PID controller after parameter adjustment (i.e., the input of fuzzy immune controller); f(∙) is the nonlinear function; u(k) is the immune controller’s output which can control the drying time; the drying model is the controlled object; y(k) is the output of model (i.e., the output grain moisture).Taking the output grain moisturey(k) as the controlled variable and the output of the fuzzy immune controller u(k) as the control variable, the drying time of grain Tdry(k) in the dryer can be adjusted to realize the control target.In the drying experiment, by the experiment of calculating the grain weight of being discharged from the dryer within an hour (20 HZ: 3.126 t/h; 10 HZ: 1.753 t/h), the linear inverse relationship between the speed of discharging motor and the drying time is obtained((u=-ku∗Tdry(k)+c)).A brief introduction to the design principle of fuzzy PID parameter controller and genetic algorithm of the control structure of GODFIP are as follows (Sections3.2.2 and 3.2.3).


#### 3.2.2. Fuzzy PID Parameter Controller

In Figure11, there are two inputs for the fuzzy PID parameter controller, e and de/dt; three outputs, Δkp′, Δki′, and Δkd′ (i.e., three PID parameters increment values); the universe of discourse of the input and output is [-3,3]; Δkp′, Δki′, and Δkd′ can be deduced from the fuzzy rules shown in Table 3. The fuzzy PID parameter controller can change the increment values of the PID parameters dynamically according to the fuzzy rules by tracking the error signal and its change rate.Table 3
PID parameters tuning rules of fuzzy PID parameters controller.
d
e
/
d
t
Δ
k
p
′
Δ
k
i
′
Δ
k
d
′
NB
NM
NS
ZE
PS
PM
PB
NB
NM
NS
ZE
PS
PM
PB
NB
NM
NS
ZE
PS
PM
PB
e
NB
PB
PB
PM
PM
PS
ZE
ZE
NB
NB
NM
NM
NS
ZE
ZE
PS
NS
NB
NB
NB
NM
PS
NM
PB
PB
PM
PS
PS
ZE
ZE
NB
NB
NM
NS
NS
ZE
ZE
PS
NS
NB
NB
NB
NM
PS
NS
PM
PM
PM
PM
ZE
NS
NS
NB
NM
NS
NS
ZE
PS
PS
ZE
NS
NM
NM
NS
NS
ZE
ZE
PM
PM
PS
ZE
NS
NM
NM
NM
NM
NS
ZE
PS
PM
PM
ZE
NS
NS
NS
NS
NS
ZE
PS
PS
PS
ZE
NS
NS
NM
NM
NM
NS
ZE
PS
PS
PM
PB
ZE
ZE
ZE
ZE
ZE
ZE
ZE
PM
PS
ZE
NS
NM
NM
NM
NB
ZE
ZE
PS
PS
PM
PB
PB
PB
NS
PS
PS
PS
PS
PB
PB
ZE
ZE
NM
NM
NM
NB
NB
ZE
ZE
PS
PM
PM
PB
PB
PB
PM
PM
PM
PS
PS
PB


#### 3.2.3. Genetic Optimization Algorithm

Genetic algorithm is a stochastic global optimization method that mimics the metaphor of the natural biological evolution. According to the fitness function value, the global optimal solution can be obtained by the genetic evolution. The fitness value of each individual in the population is calculated by the fitness function and provided to the operator for selection, crossover, and mutation and screening individuals to find the best by retaining the best fitness value and eliminating the poor fitness values. If the termination condition is satisfied, then the optimal individual is used to be assigned to the parameters of the controller; otherwise continue to calculate the new species until the global optimal value is found.So we can use genetic algorithm to optimize the control parameters (kp′, ki′, kd′, k, η). The basic genetic processes are selection, crossover, and mutation. The process of genetic algorithm is as follows:(1)
Parameter coding: real code is adopted, and for a given parameter range [min, max], the real number coding is equal tomin+(max-min)∗rand.(2)
Population initialization: the individual coding length is8 (kp, ki, kd, k, η, and 3 proportional coefficients used in the control structure), the population size is 20, the generations of evolution are 100, and the termination error is 1e-6. In order to avoid the blindness of searching for the best, the initial values of parameters are firstly obtained by the first run of the genetic algorithm and then take this as the center to both sides to find the best.(3)
Determining fitness function: the minimum objective function of parameter selection is obtained from the aspects of reducing energy loss, stability, accuracy, and rapidity and to be provided for the operator selection and judgment. To prevent the control input of the controlled object too large and save the energy consumption, the output of the fuzzy immune controller is also added to the objective function, and the optimal function of the controller is shown in(13)J=∫0∞w1et+w2ut2dt+w3tr,where e(t) is the system error; u(t) is the output of the fuzzy immune controller; tr is the rising time; w1, w2, and w3 are the weights.In order to avoid overshoot, the penalty function is adopted as shown in (14) (w4≫w1), erry(t)=y(t)-y(t-1), where y(t) is the output of the controlled object; δ is the size of the overshoot to be controlled; once the overshoot is generated, it will be used as the optimal indicator. (14)ifet>δthenJ=∫0∞w1et+w2u2t+w4errytdt+w3tr.


## 3.1. The General Fuzzy Immune PID Controller Design

### 3.1.1. Biological Immune Principle

Biological immune system can produce antibodies against a foreign invasion of the antigen, which plays the defense role. The most important cells in the immune system are the lymphocytes which are mainly two kinds: B and T cells; B cells are responsible for antibody production and carry out the immunity function and T cells regulate the whole immune process. T cells are composed of inhibit T cells (TS) and helper cells (TH), which, respectively, inhibit and help B cells respond to a stimulus. When the antigen is increasing, there are more TH cells and less TS cells in the body which will produce more B cells, that is, more antibodies; when the antigen is gradually reduced, TS cells will increase and inhibit the generation of TH cells; thereby reducing the B cells, antibodies decreased. When the antigen is eliminated, the immune response is completed.Assuming that thek generation amount of antigen is ε(k), the change rate of the number of antigens is Δε(k); the output of TH cells is TH(k); the output of TS cell is TS(k); according to the immune feedback mechanism, the total stimulation received by B cells is S(k), as shown in (7)Sk=THk-TSk.Among themTH(k)=k1ε(k); TS(k)=k2f[ε(k),Δε(k)]ε(k); f· is a nonlinear control function that represents the ability to suppress external stimuli. Its feedback control law is shown in (8) and thus is also called the nonlinear p-type controller.(8)Sk=THk-TSk=k1-k2fεk,Δεkεk=k1-ηfεk,Δεkεk=Kpεk,Kp=k1–ηfεk,Δεk.Among them,k=k1 is the speed of control response, η=k1/k2 is related to the stability of the response, and Kp will change with the amount of the antigen. Moreover, a reasonable adjustment of k and η is also crucial, and it will enable the control system to have smaller overshoot and faster response rate.


### 3.1.2. Design of General Fuzzy Immune PID Feedback Controller

Imitating the above immune feedback mechanism, ap-type fuzzy immune PID feedback controller is designed, which combines the fuzzy immune controller with the general PID controller.The discrete form of the ordinary PID controller is as shown in(9)u′k=kp′+ki′z-1+kd′z-1zek.The discrete output of the fuzzy immune PID is shown in (10) by replacing the antigen ε(k) and its change rate Δε(k) of the fuzzy immune system with the output of general PID controller u′(k) and its change rate Δu′(k), respectively.(10)uk=Kpu′k=k1-ηfu′k,Δu′kkp′+ki′z-1+kd′z-1zek=kp+kiz-1+kdz-1zek,where(11)kp=kkp′1-ηf∙=Kpkp′,ki=kki′1-ηf∙=Kpki′,kd=kkd′1-ηf∙=Kpkd′.Its controller structure is shown in Figure9, and the controlled object is the IRC dryer; the controller variable is the output of the model: y(k) is the outlet grain moisture; r(k) is the input of the control model which is a step response function (the target moisture content value); e(k) is the error between the output and the target value; de/dt is the change rate of e; u′(k) is the output of the general PID controller;u(k) is the immune controller’s output which can control the drying time of grain in the dryer (i.e., u(k) can be used to control the speed of discharging grain motor to obtain the tuning of the grain drying time).Figure 9
Structure of the fuzzy immune PID feedback controller.The Mamdani fuzzy controller designed in the control algorithm is used to approximate the nonlinear function (f[u′k,Δu′k]), and it has two inputs and one output. The two input variables of the fuzzy controller are the output of the PID algorithm (u′k) and its change rate of error (Δu′k), and the output variable of the fuzzy controller is a nonlinear function (f[u′k,Δu′k]). As seen in (11), the parameters of the controllers kp, ki, and kd can be adjusted adaptively with the change of u′(k) and Δu′(k), which overcomes the limitations that the general PID controller’s parameters can not be dynamically adjusted during the control process.Firstly, the fuzzy method of the input variables should be used to transform from the basic domain to the corresponding fuzzy set domain and define the quantification factor of input variables (Ku′; KΔu′) to get the fuzzy input (U′=Ku′∗u′; ΔU′=KΔu′∗Δu′), so the output needs to transform from the fuzzy set to the basic domain. In this paper, the fuzzy set domain of the input and output is [-1,1].Secondly, the membership functions of input and output lingual variables should be formed to determine the distribution of different variables. There are commonly three types of membership function to be used: (1) normal distribution; (2) triangle; (3) trapezoidal. The numbers of the fuzzy sets for the input variable and output variable are used to meet the requirements of accuracy. As the numbers of the fuzzy sets increase, the numbers of fuzzy control rules increase accordingly, which will improve the accuracy of control, but meantime the complexity of control is increased; on the premise of satisfying the requirement of control precision, the least numbers of the fuzzy sets can be equal to 3 based on the principle of determining the minimum inference rules numbers; in addition, the numbers of the fuzzy sets for the input and the output can be unequal; in order to improve the accuracy of control, the fuzzy sets numbers for the output variable can be increased ‎[39]. Based on the above analysis, in this paper each of the input variables has three fuzzy sets: positive, zero, negative or P, Z, N; the output adopts five fuzzy sets: positive big, positive small, zero, negative small, negative big or PB, PS, Z, NS, NB. The Mamdani fuzzy controller can use the following 9 knowledge rules shown in the Table 2 (e.g., if u′k is P and Δu′k is P then fu′k,Δu′k is NB), which imitating the control principle of biological immune feedback. The input and output membership functions of the fuzzy controller are shown in Figures 10(a)–10(c).Table 2
Knowledge rules of the fuzzy controller.
f
u
′
k
,
Δ
u
′
k
Δ
u
′
k
P
Z
N
u
′
k
P
NB
NS
PS
Z
NS
Z
PS
N
NS
PS
PBFigure 10
Degree of membership function plots (a)u′(k), (b) Δu′(k), (c) f, and (d) relationship surface figure of the output and input.
(a)
(b)
(c)
(d)And then, the fuzzy output can be obtained by the fuzzy inference synthesis algorithm according to the rules of Table2.Finally, according to the fuzzy rules, defuzzification will transform the outputf∙ of the fuzzy controller from a fuzzy set to a crisp number by using the gravity method (centroid) and the Zadeh fuzzy logic operation (AND). The relationship surface figure of the output and input in the universe of discourse is shown in Figure 10(d).


## 3.1.1. Biological Immune Principle

Biological immune system can produce antibodies against a foreign invasion of the antigen, which plays the defense role. The most important cells in the immune system are the lymphocytes which are mainly two kinds: B and T cells; B cells are responsible for antibody production and carry out the immunity function and T cells regulate the whole immune process. T cells are composed of inhibit T cells (TS) and helper cells (TH), which, respectively, inhibit and help B cells respond to a stimulus. When the antigen is increasing, there are more TH cells and less TS cells in the body which will produce more B cells, that is, more antibodies; when the antigen is gradually reduced, TS cells will increase and inhibit the generation of TH cells; thereby reducing the B cells, antibodies decreased. When the antigen is eliminated, the immune response is completed.Assuming that thek generation amount of antigen is ε(k), the change rate of the number of antigens is Δε(k); the output of TH cells is TH(k); the output of TS cell is TS(k); according to the immune feedback mechanism, the total stimulation received by B cells is S(k), as shown in (7)Sk=THk-TSk.Among themTH(k)=k1ε(k); TS(k)=k2f[ε(k),Δε(k)]ε(k); f· is a nonlinear control function that represents the ability to suppress external stimuli. Its feedback control law is shown in (8) and thus is also called the nonlinear p-type controller.(8)Sk=THk-TSk=k1-k2fεk,Δεkεk=k1-ηfεk,Δεkεk=Kpεk,Kp=k1–ηfεk,Δεk.Among them,k=k1 is the speed of control response, η=k1/k2 is related to the stability of the response, and Kp will change with the amount of the antigen. Moreover, a reasonable adjustment of k and η is also crucial, and it will enable the control system to have smaller overshoot and faster response rate.


## 3.1.2. Design of General Fuzzy Immune PID Feedback Controller

Imitating the above immune feedback mechanism, ap-type fuzzy immune PID feedback controller is designed, which combines the fuzzy immune controller with the general PID controller.The discrete form of the ordinary PID controller is as shown in(9)u′k=kp′+ki′z-1+kd′z-1zek.The discrete output of the fuzzy immune PID is shown in (10) by replacing the antigen ε(k) and its change rate Δε(k) of the fuzzy immune system with the output of general PID controller u′(k) and its change rate Δu′(k), respectively.(10)uk=Kpu′k=k1-ηfu′k,Δu′kkp′+ki′z-1+kd′z-1zek=kp+kiz-1+kdz-1zek,where(11)kp=kkp′1-ηf∙=Kpkp′,ki=kki′1-ηf∙=Kpki′,kd=kkd′1-ηf∙=Kpkd′.Its controller structure is shown in Figure9, and the controlled object is the IRC dryer; the controller variable is the output of the model: y(k) is the outlet grain moisture; r(k) is the input of the control model which is a step response function (the target moisture content value); e(k) is the error between the output and the target value; de/dt is the change rate of e; u′(k) is the output of the general PID controller;u(k) is the immune controller’s output which can control the drying time of grain in the dryer (i.e., u(k) can be used to control the speed of discharging grain motor to obtain the tuning of the grain drying time).Figure 9
Structure of the fuzzy immune PID feedback controller.The Mamdani fuzzy controller designed in the control algorithm is used to approximate the nonlinear function (f[u′k,Δu′k]), and it has two inputs and one output. The two input variables of the fuzzy controller are the output of the PID algorithm (u′k) and its change rate of error (Δu′k), and the output variable of the fuzzy controller is a nonlinear function (f[u′k,Δu′k]). As seen in (11), the parameters of the controllers kp, ki, and kd can be adjusted adaptively with the change of u′(k) and Δu′(k), which overcomes the limitations that the general PID controller’s parameters can not be dynamically adjusted during the control process.Firstly, the fuzzy method of the input variables should be used to transform from the basic domain to the corresponding fuzzy set domain and define the quantification factor of input variables (Ku′; KΔu′) to get the fuzzy input (U′=Ku′∗u′; ΔU′=KΔu′∗Δu′), so the output needs to transform from the fuzzy set to the basic domain. In this paper, the fuzzy set domain of the input and output is [-1,1].Secondly, the membership functions of input and output lingual variables should be formed to determine the distribution of different variables. There are commonly three types of membership function to be used: (1) normal distribution; (2) triangle; (3) trapezoidal. The numbers of the fuzzy sets for the input variable and output variable are used to meet the requirements of accuracy. As the numbers of the fuzzy sets increase, the numbers of fuzzy control rules increase accordingly, which will improve the accuracy of control, but meantime the complexity of control is increased; on the premise of satisfying the requirement of control precision, the least numbers of the fuzzy sets can be equal to 3 based on the principle of determining the minimum inference rules numbers; in addition, the numbers of the fuzzy sets for the input and the output can be unequal; in order to improve the accuracy of control, the fuzzy sets numbers for the output variable can be increased ‎[39]. Based on the above analysis, in this paper each of the input variables has three fuzzy sets: positive, zero, negative or P, Z, N; the output adopts five fuzzy sets: positive big, positive small, zero, negative small, negative big or PB, PS, Z, NS, NB. The Mamdani fuzzy controller can use the following 9 knowledge rules shown in the Table 2 (e.g., if u′k is P and Δu′k is P then fu′k,Δu′k is NB), which imitating the control principle of biological immune feedback. The input and output membership functions of the fuzzy controller are shown in Figures 10(a)–10(c).Table 2
Knowledge rules of the fuzzy controller.
f
u
′
k
,
Δ
u
′
k
Δ
u
′
k
P
Z
N
u
′
k
P
NB
NS
PS
Z
NS
Z
PS
N
NS
PS
PBFigure 10
Degree of membership function plots (a)u′(k), (b) Δu′(k), (c) f, and (d) relationship surface figure of the output and input.
(a)
(b)
(c)
(d)And then, the fuzzy output can be obtained by the fuzzy inference synthesis algorithm according to the rules of Table2.Finally, according to the fuzzy rules, defuzzification will transform the outputf∙ of the fuzzy controller from a fuzzy set to a crisp number by using the gravity method (centroid) and the Zadeh fuzzy logic operation (AND). The relationship surface figure of the output and input in the universe of discourse is shown in Figure 10(d).


## 3.2. Genetic Optimization Dual Fuzzy Immune PID (GODFIP) Controller

### 3.2.1. The Structure of GODFIP

It can also be seen from (11) that the PID parameters (kp, ki, kd) have the same change rate (Kp) which should be different in the actual control process, thus affecting the control effect to some extent. In this paper, by adding a fuzzy PID parameter adjusting controller on the general fuzzy immune PID controller to adjust the increment values of the PID parameters in (11), making kp′, ki′, kd′ variable in the process of control shown in (12), the change rates of the PID parameters (kp, ki, kd) in (11) are not the same.(12)kp′k=kp′+Δkp′k,ki′k=ki′+Δki′k,kd′k=kd′+Δkd′k.In addition, in the process of control, there is some difficulty in selecting the parameters (kp′, ki′, kd′,k, η), which is often time consuming and affects the control effect to some extent. Moreover, a reasonable adjustment of k and η is also crucial, and it will enable the control system to have smaller overshoot and faster response. So genetic algorithm is adopted to optimize the parameters of the GODFIP controller, and the optimal control is realized.Therefore, in this paper, a genetic optimization dual fuzzy immune PID (GODFIP) controller is designed, which not only can improve the limitation of the general fuzzy immune PID control but also can find the optimal parameters (kp′, ki′, kd′,k, and η) according to the control situation. The structure of GODFIP controller is as shown in Figure 11.Figure 11
Structure of the genetic optimization dual fuzzy immune PID (GODFIP) controller.In Figure11, r(k) is the reference target input; e(k) is the error between the output and the target value; de/dt is the change rate of e; u′(k) is the output of the PID controller after parameter adjustment (i.e., the input of fuzzy immune controller); f(∙) is the nonlinear function; u(k) is the immune controller’s output which can control the drying time; the drying model is the controlled object; y(k) is the output of model (i.e., the output grain moisture).Taking the output grain moisturey(k) as the controlled variable and the output of the fuzzy immune controller u(k) as the control variable, the drying time of grain Tdry(k) in the dryer can be adjusted to realize the control target.In the drying experiment, by the experiment of calculating the grain weight of being discharged from the dryer within an hour (20 HZ: 3.126 t/h; 10 HZ: 1.753 t/h), the linear inverse relationship between the speed of discharging motor and the drying time is obtained((u=-ku∗Tdry(k)+c)).A brief introduction to the design principle of fuzzy PID parameter controller and genetic algorithm of the control structure of GODFIP are as follows (Sections3.2.2 and 3.2.3).


### 3.2.2. Fuzzy PID Parameter Controller

In Figure11, there are two inputs for the fuzzy PID parameter controller, e and de/dt; three outputs, Δkp′, Δki′, and Δkd′ (i.e., three PID parameters increment values); the universe of discourse of the input and output is [-3,3]; Δkp′, Δki′, and Δkd′ can be deduced from the fuzzy rules shown in Table 3. The fuzzy PID parameter controller can change the increment values of the PID parameters dynamically according to the fuzzy rules by tracking the error signal and its change rate.Table 3
PID parameters tuning rules of fuzzy PID parameters controller.
d
e
/
d
t
Δ
k
p
′
Δ
k
i
′
Δ
k
d
′
NB
NM
NS
ZE
PS
PM
PB
NB
NM
NS
ZE
PS
PM
PB
NB
NM
NS
ZE
PS
PM
PB
e
NB
PB
PB
PM
PM
PS
ZE
ZE
NB
NB
NM
NM
NS
ZE
ZE
PS
NS
NB
NB
NB
NM
PS
NM
PB
PB
PM
PS
PS
ZE
ZE
NB
NB
NM
NS
NS
ZE
ZE
PS
NS
NB
NB
NB
NM
PS
NS
PM
PM
PM
PM
ZE
NS
NS
NB
NM
NS
NS
ZE
PS
PS
ZE
NS
NM
NM
NS
NS
ZE
ZE
PM
PM
PS
ZE
NS
NM
NM
NM
NM
NS
ZE
PS
PM
PM
ZE
NS
NS
NS
NS
NS
ZE
PS
PS
PS
ZE
NS
NS
NM
NM
NM
NS
ZE
PS
PS
PM
PB
ZE
ZE
ZE
ZE
ZE
ZE
ZE
PM
PS
ZE
NS
NM
NM
NM
NB
ZE
ZE
PS
PS
PM
PB
PB
PB
NS
PS
PS
PS
PS
PB
PB
ZE
ZE
NM
NM
NM
NB
NB
ZE
ZE
PS
PM
PM
PB
PB
PB
PM
PM
PM
PS
PS
PB


### 3.2.3. Genetic Optimization Algorithm

Genetic algorithm is a stochastic global optimization method that mimics the metaphor of the natural biological evolution. According to the fitness function value, the global optimal solution can be obtained by the genetic evolution. The fitness value of each individual in the population is calculated by the fitness function and provided to the operator for selection, crossover, and mutation and screening individuals to find the best by retaining the best fitness value and eliminating the poor fitness values. If the termination condition is satisfied, then the optimal individual is used to be assigned to the parameters of the controller; otherwise continue to calculate the new species until the global optimal value is found.So we can use genetic algorithm to optimize the control parameters (kp′, ki′, kd′, k, η). The basic genetic processes are selection, crossover, and mutation. The process of genetic algorithm is as follows:(1)
Parameter coding: real code is adopted, and for a given parameter range [min, max], the real number coding is equal tomin+(max-min)∗rand.(2)
Population initialization: the individual coding length is8 (kp, ki, kd, k, η, and 3 proportional coefficients used in the control structure), the population size is 20, the generations of evolution are 100, and the termination error is 1e-6. In order to avoid the blindness of searching for the best, the initial values of parameters are firstly obtained by the first run of the genetic algorithm and then take this as the center to both sides to find the best.(3)
Determining fitness function: the minimum objective function of parameter selection is obtained from the aspects of reducing energy loss, stability, accuracy, and rapidity and to be provided for the operator selection and judgment. To prevent the control input of the controlled object too large and save the energy consumption, the output of the fuzzy immune controller is also added to the objective function, and the optimal function of the controller is shown in(13)J=∫0∞w1et+w2ut2dt+w3tr,where e(t) is the system error; u(t) is the output of the fuzzy immune controller; tr is the rising time; w1, w2, and w3 are the weights.In order to avoid overshoot, the penalty function is adopted as shown in (14) (w4≫w1), erry(t)=y(t)-y(t-1), where y(t) is the output of the controlled object; δ is the size of the overshoot to be controlled; once the overshoot is generated, it will be used as the optimal indicator. (14)ifet>δthenJ=∫0∞w1et+w2u2t+w4errytdt+w3tr.


## 3.2.1. The Structure of GODFIP

It can also be seen from (11) that the PID parameters (kp, ki, kd) have the same change rate (Kp) which should be different in the actual control process, thus affecting the control effect to some extent. In this paper, by adding a fuzzy PID parameter adjusting controller on the general fuzzy immune PID controller to adjust the increment values of the PID parameters in (11), making kp′, ki′, kd′ variable in the process of control shown in (12), the change rates of the PID parameters (kp, ki, kd) in (11) are not the same.(12)kp′k=kp′+Δkp′k,ki′k=ki′+Δki′k,kd′k=kd′+Δkd′k.In addition, in the process of control, there is some difficulty in selecting the parameters (kp′, ki′, kd′,k, η), which is often time consuming and affects the control effect to some extent. Moreover, a reasonable adjustment of k and η is also crucial, and it will enable the control system to have smaller overshoot and faster response. So genetic algorithm is adopted to optimize the parameters of the GODFIP controller, and the optimal control is realized.Therefore, in this paper, a genetic optimization dual fuzzy immune PID (GODFIP) controller is designed, which not only can improve the limitation of the general fuzzy immune PID control but also can find the optimal parameters (kp′, ki′, kd′,k, and η) according to the control situation. The structure of GODFIP controller is as shown in Figure 11.Figure 11
Structure of the genetic optimization dual fuzzy immune PID (GODFIP) controller.In Figure11, r(k) is the reference target input; e(k) is the error between the output and the target value; de/dt is the change rate of e; u′(k) is the output of the PID controller after parameter adjustment (i.e., the input of fuzzy immune controller); f(∙) is the nonlinear function; u(k) is the immune controller’s output which can control the drying time; the drying model is the controlled object; y(k) is the output of model (i.e., the output grain moisture).Taking the output grain moisturey(k) as the controlled variable and the output of the fuzzy immune controller u(k) as the control variable, the drying time of grain Tdry(k) in the dryer can be adjusted to realize the control target.In the drying experiment, by the experiment of calculating the grain weight of being discharged from the dryer within an hour (20 HZ: 3.126 t/h; 10 HZ: 1.753 t/h), the linear inverse relationship between the speed of discharging motor and the drying time is obtained((u=-ku∗Tdry(k)+c)).A brief introduction to the design principle of fuzzy PID parameter controller and genetic algorithm of the control structure of GODFIP are as follows (Sections3.2.2 and 3.2.3).


## 3.2.2. Fuzzy PID Parameter Controller

In Figure11, there are two inputs for the fuzzy PID parameter controller, e and de/dt; three outputs, Δkp′, Δki′, and Δkd′ (i.e., three PID parameters increment values); the universe of discourse of the input and output is [-3,3]; Δkp′, Δki′, and Δkd′ can be deduced from the fuzzy rules shown in Table 3. The fuzzy PID parameter controller can change the increment values of the PID parameters dynamically according to the fuzzy rules by tracking the error signal and its change rate.Table 3
PID parameters tuning rules of fuzzy PID parameters controller.
d
e
/
d
t
Δ
k
p
′
Δ
k
i
′
Δ
k
d
′
NB
NM
NS
ZE
PS
PM
PB
NB
NM
NS
ZE
PS
PM
PB
NB
NM
NS
ZE
PS
PM
PB
e
NB
PB
PB
PM
PM
PS
ZE
ZE
NB
NB
NM
NM
NS
ZE
ZE
PS
NS
NB
NB
NB
NM
PS
NM
PB
PB
PM
PS
PS
ZE
ZE
NB
NB
NM
NS
NS
ZE
ZE
PS
NS
NB
NB
NB
NM
PS
NS
PM
PM
PM
PM
ZE
NS
NS
NB
NM
NS
NS
ZE
PS
PS
ZE
NS
NM
NM
NS
NS
ZE
ZE
PM
PM
PS
ZE
NS
NM
NM
NM
NM
NS
ZE
PS
PM
PM
ZE
NS
NS
NS
NS
NS
ZE
PS
PS
PS
ZE
NS
NS
NM
NM
NM
NS
ZE
PS
PS
PM
PB
ZE
ZE
ZE
ZE
ZE
ZE
ZE
PM
PS
ZE
NS
NM
NM
NM
NB
ZE
ZE
PS
PS
PM
PB
PB
PB
NS
PS
PS
PS
PS
PB
PB
ZE
ZE
NM
NM
NM
NB
NB
ZE
ZE
PS
PM
PM
PB
PB
PB
PM
PM
PM
PS
PS
PB


## 3.2.3. Genetic Optimization Algorithm

Genetic algorithm is a stochastic global optimization method that mimics the metaphor of the natural biological evolution. According to the fitness function value, the global optimal solution can be obtained by the genetic evolution. The fitness value of each individual in the population is calculated by the fitness function and provided to the operator for selection, crossover, and mutation and screening individuals to find the best by retaining the best fitness value and eliminating the poor fitness values. If the termination condition is satisfied, then the optimal individual is used to be assigned to the parameters of the controller; otherwise continue to calculate the new species until the global optimal value is found.So we can use genetic algorithm to optimize the control parameters (kp′, ki′, kd′, k, η). The basic genetic processes are selection, crossover, and mutation. The process of genetic algorithm is as follows:(1)
Parameter coding: real code is adopted, and for a given parameter range [min, max], the real number coding is equal tomin+(max-min)∗rand.(2)
Population initialization: the individual coding length is8 (kp, ki, kd, k, η, and 3 proportional coefficients used in the control structure), the population size is 20, the generations of evolution are 100, and the termination error is 1e-6. In order to avoid the blindness of searching for the best, the initial values of parameters are firstly obtained by the first run of the genetic algorithm and then take this as the center to both sides to find the best.(3)
Determining fitness function: the minimum objective function of parameter selection is obtained from the aspects of reducing energy loss, stability, accuracy, and rapidity and to be provided for the operator selection and judgment. To prevent the control input of the controlled object too large and save the energy consumption, the output of the fuzzy immune controller is also added to the objective function, and the optimal function of the controller is shown in(13)J=∫0∞w1et+w2ut2dt+w3tr,where e(t) is the system error; u(t) is the output of the fuzzy immune controller; tr is the rising time; w1, w2, and w3 are the weights.In order to avoid overshoot, the penalty function is adopted as shown in (14) (w4≫w1), erry(t)=y(t)-y(t-1), where y(t) is the output of the controlled object; δ is the size of the overshoot to be controlled; once the overshoot is generated, it will be used as the optimal indicator. (14)ifet>δthenJ=∫0∞w1et+w2u2t+w4errytdt+w3tr.


## 4. Simulation and Discussion

### 4.1. Control Simulation Based on NARX Model

In order to verify the effectiveness of the proposed GODFIP controller in the grain drying control, the following controllers, the general PID controller, the fuzzy PID controller, the fuzzy immune PID controller, and the GODFIP controller, are, respectively, designed and simulated to be compared with the GODFIP controller by programming in the Matlab. As can be seen from Section2.5, the NARX drying model has a better modeling accuracy and performs much better than the ARX drying model, so it can be considered to be a reliable representative of the IRC dryer. In this control simulation, the NARX model is selected to represent the actual drying process to verify the control performance.During the simulation, the controlled variable is the output grain moisture contenty(k) of which the initial value is set to 26%; the control variable is the speed of the discharging grain motor; the input of each model is the step response function (final value = 15%) mimicking the target grain moisture; the step response curves of different controllers are compared within 100 sampling events.The optimal solutions of control parameters of the GODFIP controller are evaluated by a real-coded genetic algorithm. The fitness curve of the optimization simulation is shown in Figure12, and the best objective function value J is equal to 1.6448 after 63 generations, and the optimal PID parameters are, respectively, as follows:Figure 12
The fitness curve of optimization simulation for the GODFIP controller.(1)kp′=2.601; (2) ki′=1.551; (3) kd′=1.137; (4) k=2.53; (5) η=8.328; (6)–(8) other three proportional coefficients: −8.426, 5.062, 1.939.In order to achieve a fair comparison, the genetic optimization algorithm is also used to optimize the other three controllers. Moreover, three runs of the genetic optimization algorithm program are made to avoid the stochastic error for each controller; finally, the average value of the objective function valueJ is considered as the performance measure of each controller.Figure13 compares the performances of different controllers in controlling the NARX drying model and the control simulation results are as shown in Table 4, where the definition of tr, δ%, y(tp), y(∞), ts1, and ts2 is as follows.Table 4
Control performance comparisons of different controllers.
Controllers
J
δ
y
(
t
p
)
t
r(number of samples)
t
s
1(number of samples)
t
s
2(number of samples)
General PID
26.046
0.13%
0.1502
57
0
39
Fuzzy PID
20.348
0.07%
0.1501
20
0
30
General fuzzy immune PID
1.7052
0.00%
0.1500
8
0
13
GODFIP
1.6450
0.00%
0.1500
5
0
10Figure 13
Simulation results comparison of different controllers for the grain drying process of IRC dryer.The rising time to the target valuetr is the time to reach 95% of the steady state for the first time in the transient process.Maximum overshootδ% is as shown in (15)δ%=ytp-y∞y∞,where y(tp) is the first peak value of the system response and y(∞) is the steady value of the system response.Adjusting timets1is the time required from the first peak value y(tp) to the steady value y(∞) that falls between the deviations allowed (±5%) and is maintained within the allowable range.The adjusting timets2 is the time to the steady value after the interference disappears.


### 4.2. The Anti-Interference Test Simulation Based on NARX Model

The dynamic influence factors of the grain drying process are a lot, and the influence of various disturbance factors in the control process easily leads to the variations of the output grain moisture. In order to verify the anti-interference performances of the controllers, the interference signal with the amplitude of 0.02 at sampling number 105 is added to represent a possible increase in the initial moisture of grain that enters the IRC dryer which is shown in Figure14(a), and this anti-interference simulation test is within 200 sampling events. The anti-interference performance comparison results are shown in Figure 14(b).Figure 14
The anti-interference effect comparisons between the GODFIP controller and the other controllers: (a) the interference signal and (b) the anti-interference effect comparison results.
(a)
(b)


### 4.3. Simulation Result Discussion

(
1) The Optimization Results. The genetic optimization algorithm is used to achieve the optimal control of the GODFIP controller, the fuzzy immune PID controller, the fuzzy PID controller, and the general PID controller based on the performance objective function from the aspects of energy savings, stability, accuracy, and rapidity. As can be seen from the comparison results shown in Table 4, the J value of the GODFIP is equal to 1.6450 and is obviously less than the compared controllers which is about 3.53% decrease compared to the fuzzy immune PID controller, about 91.9% decrease compared to the fuzzy PID controller, and about 93.68% decrease compared to the general PID controller. Hence, the GODFIP controller has achieved the best control performances in terms of accomplishing the least value of J compared to the other three controllers, showing the effectiveness of the GODFIP controller.(
2) The Overshoot, the Adjusting Time
t
s
1,and the Rising Timetr. Overshoot, adjusting time, and rising time are important indexes to judge a controller’s performance reflecting the control stability of the system, not oscillating wildly (in the drying control reflecting the output moisture content fluctuations), and the rapidity of the system response-rapidly tracking control of the target signal. By the simulation comparisons of Figure 13 and the control performance values of Table 4, owing to the adopted genetic optimization algorithm on the controllers, the overshoot and the adjusting time ts1 of all compared controllers are almost zero, showing the excellent optimal ability of genetic algorithm. It can also be seen that the rising time to the target value of the GODFIP controller is 5 samplings which is about 37.5% decrease compared to the general fuzzy immune PID controller (8 samples), about 75% decrease compared to the fuzzy PID controller (20 samples), and about 91.2% decrease compared to the general PID controller (57 samples), showing the effectiveness of the GODFIP control algorithm.Under the same optimization conditions, the PID controller and the fuzzy PID controller need more samples to the target value than the other two immune controllers (the GODFIP and the fuzzy immune PID) in order to accomplish the optimal control target; in fact, it is impractical for the grain drying process because it will cause an inefficient energy consumption and bad dried grain quality. The GODFIP controller and the fuzzy immune PID controller are both superior to the PID controller and the fuzzy PID controller, which not only can the stability of the control system be achieved, but also the system output can be rapidly adjusted to the target value, showing the advantage of the immune algorithm. In addition, the GODFIP controller has performed better compared to the fuzzy immune PID controller, so the GODFIP controller is more suitable for the IRC dryer than the other compared controllers.(
3) The Anti-Interference Test. As can be seen from Figure 14, the GODFIP controller has the best anti-interference performances compared to the other three controllers that it can quickly respond to and track the interference signal and can adjust the output value to the target value rapidly and steadily after the interference disappears; moreover, the fluctuations affected by the interference are less. However, for the same test, the general PID controller and the fuzzy PID controller have showed oscillatory behavior when an interference exits during the drying process, of which the general PID controller has taken nearly 39 samples and the fuzzy PID controller has taken nearly 30 samples to reach the desired moisture content level, showing the inefficiency of handling the effect of interference by the two controllers and inferior to the anti-interference ability of the GODFIP controller. Moreover, the GODFIP controller has improved the anti-interference performance of the fuzzy immune PID controller of which 3 samples to the target value are reduced compared to the fuzzy immune PID controller. The anti-interference performance test further verifies the robustness of the proposed GODFIP controller over an uncertainty range of condition and demonstrates that it is a suitable controller for the IRC grain dryer.


## 4.1. Control Simulation Based on NARX Model

In order to verify the effectiveness of the proposed GODFIP controller in the grain drying control, the following controllers, the general PID controller, the fuzzy PID controller, the fuzzy immune PID controller, and the GODFIP controller, are, respectively, designed and simulated to be compared with the GODFIP controller by programming in the Matlab. As can be seen from Section2.5, the NARX drying model has a better modeling accuracy and performs much better than the ARX drying model, so it can be considered to be a reliable representative of the IRC dryer. In this control simulation, the NARX model is selected to represent the actual drying process to verify the control performance.During the simulation, the controlled variable is the output grain moisture contenty(k) of which the initial value is set to 26%; the control variable is the speed of the discharging grain motor; the input of each model is the step response function (final value = 15%) mimicking the target grain moisture; the step response curves of different controllers are compared within 100 sampling events.The optimal solutions of control parameters of the GODFIP controller are evaluated by a real-coded genetic algorithm. The fitness curve of the optimization simulation is shown in Figure12, and the best objective function value J is equal to 1.6448 after 63 generations, and the optimal PID parameters are, respectively, as follows:Figure 12
The fitness curve of optimization simulation for the GODFIP controller.(1)kp′=2.601; (2) ki′=1.551; (3) kd′=1.137; (4) k=2.53; (5) η=8.328; (6)–(8) other three proportional coefficients: −8.426, 5.062, 1.939.In order to achieve a fair comparison, the genetic optimization algorithm is also used to optimize the other three controllers. Moreover, three runs of the genetic optimization algorithm program are made to avoid the stochastic error for each controller; finally, the average value of the objective function valueJ is considered as the performance measure of each controller.Figure13 compares the performances of different controllers in controlling the NARX drying model and the control simulation results are as shown in Table 4, where the definition of tr, δ%, y(tp), y(∞), ts1, and ts2 is as follows.Table 4
Control performance comparisons of different controllers.
Controllers
J
δ
y
(
t
p
)
t
r(number of samples)
t
s
1(number of samples)
t
s
2(number of samples)
General PID
26.046
0.13%
0.1502
57
0
39
Fuzzy PID
20.348
0.07%
0.1501
20
0
30
General fuzzy immune PID
1.7052
0.00%
0.1500
8
0
13
GODFIP
1.6450
0.00%
0.1500
5
0
10Figure 13
Simulation results comparison of different controllers for the grain drying process of IRC dryer.The rising time to the target valuetr is the time to reach 95% of the steady state for the first time in the transient process.Maximum overshootδ% is as shown in (15)δ%=ytp-y∞y∞,where y(tp) is the first peak value of the system response and y(∞) is the steady value of the system response.Adjusting timets1is the time required from the first peak value y(tp) to the steady value y(∞) that falls between the deviations allowed (±5%) and is maintained within the allowable range.The adjusting timets2 is the time to the steady value after the interference disappears.


## 4.2. The Anti-Interference Test Simulation Based on NARX Model

The dynamic influence factors of the grain drying process are a lot, and the influence of various disturbance factors in the control process easily leads to the variations of the output grain moisture. In order to verify the anti-interference performances of the controllers, the interference signal with the amplitude of 0.02 at sampling number 105 is added to represent a possible increase in the initial moisture of grain that enters the IRC dryer which is shown in Figure14(a), and this anti-interference simulation test is within 200 sampling events. The anti-interference performance comparison results are shown in Figure 14(b).Figure 14
The anti-interference effect comparisons between the GODFIP controller and the other controllers: (a) the interference signal and (b) the anti-interference effect comparison results.
(a)
(b)


## 4.3. Simulation Result Discussion

(
1) The Optimization Results. The genetic optimization algorithm is used to achieve the optimal control of the GODFIP controller, the fuzzy immune PID controller, the fuzzy PID controller, and the general PID controller based on the performance objective function from the aspects of energy savings, stability, accuracy, and rapidity. As can be seen from the comparison results shown in Table 4, the J value of the GODFIP is equal to 1.6450 and is obviously less than the compared controllers which is about 3.53% decrease compared to the fuzzy immune PID controller, about 91.9% decrease compared to the fuzzy PID controller, and about 93.68% decrease compared to the general PID controller. Hence, the GODFIP controller has achieved the best control performances in terms of accomplishing the least value of J compared to the other three controllers, showing the effectiveness of the GODFIP controller.(
2) The Overshoot, the Adjusting Time
t
s
1,and the Rising Timetr. Overshoot, adjusting time, and rising time are important indexes to judge a controller’s performance reflecting the control stability of the system, not oscillating wildly (in the drying control reflecting the output moisture content fluctuations), and the rapidity of the system response-rapidly tracking control of the target signal. By the simulation comparisons of Figure 13 and the control performance values of Table 4, owing to the adopted genetic optimization algorithm on the controllers, the overshoot and the adjusting time ts1 of all compared controllers are almost zero, showing the excellent optimal ability of genetic algorithm. It can also be seen that the rising time to the target value of the GODFIP controller is 5 samplings which is about 37.5% decrease compared to the general fuzzy immune PID controller (8 samples), about 75% decrease compared to the fuzzy PID controller (20 samples), and about 91.2% decrease compared to the general PID controller (57 samples), showing the effectiveness of the GODFIP control algorithm.Under the same optimization conditions, the PID controller and the fuzzy PID controller need more samples to the target value than the other two immune controllers (the GODFIP and the fuzzy immune PID) in order to accomplish the optimal control target; in fact, it is impractical for the grain drying process because it will cause an inefficient energy consumption and bad dried grain quality. The GODFIP controller and the fuzzy immune PID controller are both superior to the PID controller and the fuzzy PID controller, which not only can the stability of the control system be achieved, but also the system output can be rapidly adjusted to the target value, showing the advantage of the immune algorithm. In addition, the GODFIP controller has performed better compared to the fuzzy immune PID controller, so the GODFIP controller is more suitable for the IRC dryer than the other compared controllers.(
3) The Anti-Interference Test. As can be seen from Figure 14, the GODFIP controller has the best anti-interference performances compared to the other three controllers that it can quickly respond to and track the interference signal and can adjust the output value to the target value rapidly and steadily after the interference disappears; moreover, the fluctuations affected by the interference are less. However, for the same test, the general PID controller and the fuzzy PID controller have showed oscillatory behavior when an interference exits during the drying process, of which the general PID controller has taken nearly 39 samples and the fuzzy PID controller has taken nearly 30 samples to reach the desired moisture content level, showing the inefficiency of handling the effect of interference by the two controllers and inferior to the anti-interference ability of the GODFIP controller. Moreover, the GODFIP controller has improved the anti-interference performance of the fuzzy immune PID controller of which 3 samples to the target value are reduced compared to the fuzzy immune PID controller. The anti-interference performance test further verifies the robustness of the proposed GODFIP controller over an uncertainty range of condition and demonstrates that it is a suitable controller for the IRC grain dryer.


## 5. Conclusion

In this paper, a genetic optimization dual fuzzy immune PID (GODFIP) controller based on the immune feedback mechanism is designed and simulated to control an IRC grain dryer represented by an identified Autoregressive with Exogenous input (NARX) model. The NARX model has a higher model approximation accuracy (MSE:1.062∗10-5;R: 99.78%) than the identified linear ARX model (MSE: 2.29∗10-4;R:95.5%), so the NARX model is a better candidate in representing the nonlinear dynamics of the IRC grain dryer to verify the control performances of the GODFIP controller. In order to achieve a fair comparison, the genetic optimization algorithm is utilized to optimize the proposed GODFIP controller and the other three compared controllers based on the performance objective function J from the aspects of energy savings, stability, accuracy, and rapidity. Finally, the control simulation comparison and the anti-interference simulation test are made. As can be seen from the simulation results of Figures 13 and 14 and Table 4, the GODFIP controller has the least value of J compared to the other three controllers which is equal to 1.645 about 3.53% decrease compared to the fuzzy immune PID, about 91.9% decrease compared to the fuzzy PID controller, and about 93.68% decrease compared to the PID and the shortest rising time about 37.5% decrease compared to the fuzzy immune PID, about 75% decrease compared to the fuzzy PID, and about 91.2% decrease compared to the PID and has the best anti-interference ability which can adjust the output to the target value rapidly and steadily. It is tested from the simulation results that the GODFIP controller has improved the control performance of the fuzzy immune PID controller and is obviously superior to the PID controller and the fuzzy PID controller, so the GODFIP controller can track the target value rapidly and steadily and can handle the uncertainty conditions of complex systems to some extent which is more suitable for such a complex system as grain drying. The big difference between this control method and the traditional control method is that it is not dependent on the transfer function of the controlled object. The proposed GODFIP controller can provide an effective reference for the actual control strategy of the grain drying process and may be applied to control the real IRC dryer in future works.



---

*Source: 1406292-2017-09-20.xml*