## 1 Introduction
The disturbance affects the resonant frequency change and mismatch impedances between the frequency source and output load (accelerator tube) during the LINAC operation. These effects lead to electron acceleration, which would not gain sufficient energy to travel through the end of the LINAC. Thus, the X-ray quantity used for the irradiation is either insufficient or too high to sterilize products. To achieve an appropriate frequency and proper characteristics regarding the modes of the magnetron during the LINAC operation, the measurement of the structural dimensions and shape of the magnetron and simulation method are applied to analyze the resonant frequency of the magnetron. This paper is organized in three main parts. First, the dimensional parameters and shape of the magnetron are measured by a coordinate measuring machine (CMM) with tolerance of 0.5 \(\upmu\)m. To analyze these parameters, the resonant frequency at a suitable operating point in the dominant mode is achieved by using equivalent resonant circuit analysis and 3D-drawing analysis, which are based on PIC simulation in the CST Particle Studio program. The PIC simulation allows the analysis to vary and adjust the virtual parameters and structural dimensions of the magnetron and observe dynamic changes in these parameters during the simulation. The last is the design of the LINAC control system to obtain stable operation of the magnetron in the dominant mode by controlling certain parameters, such as input anode voltage V and the magnetic field B. The control system is based on a fuzzy logic control (FLC) algorithm with the Takagi-Sugeno fuzzy rule used to represent local parameters in relation to a nonlinear system. The approach of the control system is to adequately match the LINAC's resonant frequency or any load with a magnetron frequency of 2.9982 GHz to maximize the power used for electric field gradient generation in the LINAC. This serves to maintain the emission of the high-energy X-ray beam at the desired absorbed dose rate during the irradiation of agricultural products. Here, the RFsource or the magnetron frequency is tracked and adjusted according to the time variation of the resonant frequency by controlling the shaft of a stepping motor that is coupled with the internal structure of the magnetron. Under these experimental conditions, both temperature and vacuum pressure are maintained in the range of 38 to 42 Celsius and 1 \(\times\) 10\({}^{-9}\) to 5 \(\times\) 10\({}^{-8}\) torr, respectively, to control for environmental disturbance. The structure of the paper is as follows: Section 2 describes the research methodology, consisting of three subsections. Firstly, an outline of the magnetron structure analysis is presented, which gives details of the measurement of the structural magnetron and parameter optimization. The second section presents the analysis of the magnetron frequency with the equivalent circuit and PIC simulation method. The third section presents the fuzzy logic control algorithm and system for the sterilization of agricultural products with an X-ray beam. Finally, the experimental results and the conclusions are presented in Sections 3 and 4, respectively.