## 2 Materials and Methods
### Modeling
#### 2.1.2 Mathematical Modeling  
Based on the series capacitance calculation method, Equations (10) and (11) were obtained for calculating the corn capacitance and the capacitance of the cavity outer wall, respectively:  
\[C_{m}=\frac{\varepsilon_{0}\varepsilon_{m}S}{y_{m}}, \tag{10}\]  
\[C_{c}=\frac{\varepsilon_{0}\varepsilon_{c}S}{y_{c}}, \tag{11}\]  
where \(C_{m}\) and \(C_{c}\) are the capacitance of the corn and outer wall, respectively; \(\varepsilon_{m}\) and \(\varepsilon_{c}\) are the dielectric constant of the corn and outer wall, respectively; and \(y_{m}\) and \(y_{c}\) are the thickness of corn and outer wall, respectively. Therefore, the total capacitance to be measured is the sum of the series capacitance, which can be calculated using Equation (12):  
\[C_{tot}=\frac{\varepsilon_{0}\varepsilon_{m}\varepsilon_{c}S}{2\varepsilon_{ m}y_{c}+\varepsilon_{c}y_{m}}, \tag{12}\]  
where \(C_{tot}\) is the total capacitance value of the series capacitance to be measured. Equation (12) shows that the measured capacitance is only related to the relative dielectric constant, which corresponds to the moisture content one-by-one under the determined electric field frequency, corn porosity, and temperature. Thus, Equation (13) can be obtained:  
\[C_{tot}=f(M), \tag{13}\]  
where \(M\) is the moisture content of the corn to be measured, in wet basis. Equation (14) can be obtained by differentiating Equation (13):  
\[\frac{dC_{tot}}{dM}=\frac{\varepsilon_{0}\varepsilon_{c}^{2}Sy_{m}}{(2 \varepsilon_{m}y_{c}+\varepsilon_{c}y_{m})^{2}}\cdot\frac{d\varepsilon_{m}}{dM} \tag{14}\]  
A relationship exists between the resolution of the capacitance measurement circuit and the resolution of the moisture sensor, as shown in Equation (15):  
\[\frac{R_{c}}{R_{m}}=\frac{dC}{d\varepsilon_{m}}\cdot\frac{d\varepsilon_{m}}{ dM}=\frac{dC}{dM}, \tag{15}\]  
where \(R_{C}\) and \(R_{m}\) are the resolution of the capacitance measurement circuit and moisture sensor, respectively. Assuming the change rate of the corn dielectric constant with moisture content was \(K\), the full-range resolution of the moisture sensor, as shown in Equation (16), can be obtained from Equation (14):  
\[R_{m}=\frac{R_{c}}{K}\cdot\frac{(2\varepsilon_{m}y_{c}+\varepsilon_{c}y_{m})^{2} }{\varepsilon_{0}\varepsilon_{c}^{2}Sy_{m}} \tag{16}\]  
From Equation (16), when the corn dielectric constant changes little with the moisture content, the resolution of moisture sensor decreases with decreasing moisture content. Therefore, in the process of designing a sensor, it is necessary to ensure that the measurement near the safe moisture content meets the minimum resolution requirements. On the other side, due to the internal friction of corn, the corn gradually forms a cone in the process of flowing into measurement cavity. Thus, the chamber will not be filled with corn with an unreasonable sensor structure design, as shown in Figure 2a. However, the level sensor still judges that the chamber is full of corn at this time, which causes measurement error. Increasing the height of the cavity can cover the measurement area with corn. When the grain filling method is determined, grain with same moisture content has the same repose angle. Therefore, when the material's falling point is at the top of measurement cavity, as shown in Figure 2b, the required increase in height has the largest value, which should satisfy Equation (17):  
\[\Delta z\geq\Delta z_{\text{max}}=\sqrt{x_{m}^{2}+y_{m}^{2}}\cdot\tan(\alpha_ {\text{max}}), \tag{17}\]  
where \(\Delta z\) is the required increase in height, \(x_{m}\) is the width of parallel plate, and \(\alpha\) is the repose angle. Based on the mathematical relationship, when \(x_{m}\) is equal to \(y_{m}\), the minimum value of \(\Delta z\) is obtained, and the structure of the designed sensor is the most compact.