# Design and Testing of an Intelligent Control System for Maize Picking Harvest
## 2 Materials and Methods
### Software Algorithm
#### 2.2.3 Design of the Fuzzy PID Controller  
Fuzzy control is a time-varying control system [28] that has been successfully applied in several different disciplines, such as agriculture [29; 30; 31]. In the maize picking process, the rotational speed of the pulling rollers and the operating speed are time-variant; thus, fuzzy PID control is appropriate. The fuzzy PID control system for the rotational speed mainly includes a fuzzy controller and PID controller. The difference between the target and current values for the rotational speed of the pulling rollers (i.e., \(n_{e}=n_{1}-n_{2}\)) was taken as one input for the fuzzy inference unit. The deviation change rate \(n_{ec}\) was taken as another input. The proportional coefficient \(K_{p}\), integral coefficient \(K_{i}\), and differential coefficient \(K_{d}\) represent adjustments to the PID controller. The changes to these parameters (i.e., \(\Delta K_{p}\), \(\Delta K_{i}\), and \(\Delta K_{d}\)) were selected as the outputs. The final coefficients of the proportional, integral, and derivative terms of the PID controller were \(K_{p}=K_{p0}+\Delta K_{p}\), \(K_{i}=K_{i0}+\Delta K_{i}\), \(K_{d}=K_{d0}+\Delta K_{d}\). Where \(K_{p0}\), \(K_{i0}\) and \(K_{d0}\) denote the preset initial values of the ordinary PID controller parameters. According to expert experience and test data, it can be known that the rotational speed of pulling rollers varies in the range of [0, 1500] r/min, and the deviation of the normal working speed is within 50 r/min. When the rotational speed decline rate exceeds 30 (r/min)/s, it is considered that the pulling rollers have a tendency to block. Therefore, the basic domain of the rotational speed deviation is [\(-\)50, 50] r/min, and the lower limit of the rotational speed deviation change rate is set to \(-\)30 (r/min)/s, and its basic domain is [\(-\)30, 30] (r/min)/s. The output of the fuzzy control system is the correction value of the PID adjustment parameters, including \(\Delta K_{p}\), \(\Delta K_{i}\), and \(\Delta K_{d}\). The basic domain of \(\Delta K_{p}\) is  
Figure 5: Relationship between the main factors and the maize picking loss rate respectively: (**a**) Relationship between the rotational speed of the pulling rollers and maize picking loss rate (MPL); (**b**) Relationship between the operating speed and MPL; (**c**) Relationship between the header height and MPL. [\(-\)0.9, 0.9]. The basic domain of \(\Delta K_{i}\) is [\(-\)0.015, 0.015]. The basic domain of \(\Delta K_{d}\) is [\(-\)0.9, 0.9]. In order to ensure control accuracy, the basic domains of deviation, deviation change rate and the output variables (\(\Delta K_{p}\), \(\Delta K_{i}\), and \(\Delta K_{d}\)) are divided into 7 grades, and the quantization domains are all [\(-\)6, \(-\)4, \(-\)2, 0, 2, 4, 6], the corresponding fuzzy language variable set is [negative large, negative medium, negative small, zero, positive small, positive medium, positive large], denoted as {NL, NM, NS, ZE, PS, PM, PL}. The commonly used triangular membership function was selected as the membership function. The membership functions of input \(n_{e}\), \(n_{\alpha}\) and output \(\Delta K_{p}\), \(\Delta K_{i}\), and \(\Delta K_{d}\) are shown in the Figure 6.  
The investigation results combined with expert opinions were input into the fuzzy inference system to form a fuzzy rule base. Table 1 presents the overall form of the fuzzy rule base. For two-dimensional fuzzy controllers, Mamdani control rules are often used. The tuning requirements of \(\Delta K_{p}\), \(\Delta K_{i}\), and \(\Delta K_{d}\) under different deviations \(n_{e}\) and deviation change rate \(n_{ec}\) are as follows:  
1. When the deviation is small, \(K_{p}\) and \(K_{i}\) should be increased to make the system have better steady-state performance. Considering the anti-interference ability of the system and in order to avoid the output response from oscillating near the set value, \(K_{d}\) should be selected appropriately.