# Design and Test of Real-Time Detection System for Cleaning Loss of Rapeseed Harvester
## 2 Materials and Methods
### Signal Processing Circuit Design
#### 2.3.3 In-Phase Integral Circuit  
An integral circuit is a circuit based on a capacitor. It integrates the input voltage signal through the property of the integrator and outputs the integration result. The integration circuit is composed of an operational amplifier and capacitor and usually adopts negative feedback to achieve stable integration operation. In an integration circuit, the input of an operational amplifier is connected directly to a resistor, while the output is connected to the input via a capacitor. When the input voltage changes, through the negative feedback mechanism, the change in the output voltage of the operational amplifier will be transmitted to the input end through the capacitor, so as to realize the integration operation of the input voltage. Among these values, the capacitance value of the capacitor and the resistance value of the resistor determine the integration time constant of the integration circuit, that is, the integration time length of the input signal integral circuit.  
The integral circuit of this signal processing circuit is an in-phase integral circuit. The output voltage signal of the envelope detection circuit in the previous step is integrated in the same phase, the waveform area of the envelope detection circuit is obtained, that is, the energy contained in the waveform is calculated, and the integration signal waveform is finally obtained. The purpose of designing the in-phase integral circuit was to find out the energy distinction between rapeseed kernels and impurities. The design diagram of the in-phase integral circuit is shown in Figure 6.  
LMV321 TP-TR (the manufacturer of LMV321 TP-TR is 3 PEAK) and R14, R16, C20 and C23 constitute the in-phase integral circuit, so that R14 = R16 = R and C20 = C23 = C; the purpose is to ensure the balance of the circuit. The input and output voltage relationship is shown in (3):  
\[\mathrm{U}_{o}=\frac{1}{\mathrm{RC}}\mathrm{\int U_{i}(t)dt} \tag{3}\]  
Figure 5: Envelope detection circuit.  
After the original signal is processed by the amplifier circuit and the envelope detection circuit, it enters the integration circuit and integrates the waveform generated by the envelope detection circuit. The highest voltage value of the integration signal waveform output by the designed in-phase integral circuit is the area value after integrating the envelope detection waveform. At the same time, the two resistance values R14 and R16 or two capacitance values C20 and C23 are adjusted by the parameter. The larger the resistance value and capacitance value, the slower the integration speed; that is, the time of the peak of the integration waveform becomes late, so that the effective area obtained through the integration can be increased. Because the peak time of the integration waveform is too late to overlap with the second integration waveform, it is easy to cause the loss detection system to miss and misjudge the loss of kernels. Therefore, the peak time of the integration is made appropriate by constantly adjusting the R and C parameters. The designed in-phase integral circuit can recognize the rapeseed kernel signal quickly and continuously, and the integration time is short and the speed is fast, which means it can adapt to continuous working conditions.