This paper presents the parameter optimization of a twelve-hole-slot-type magnetron based on a reverse engineering technique to improve a 6-MeV linear accelerator (LINAC) operation for fruit sterilization. The magnetron structural dimensions are measured by a coordinate measuring machine (CMM) that has tolerance on a dimension of 0.5 µm to analyze the resonant frequency with a desired operating point of the magnetron in the dominant mode. There are two methods of analysis using a proper parameter for the magnetron operation. The first method is mathematical model analysis of an equivalent resonant parallel circuit. The other is 3D-model drawing of the magnetron based on particle-in-cell (PIC) using computer simulation technology microwave studio (CST). The results are demonstrated by the position of the resonant frequency of each mode of operation, and the radius and tuner slot distance of a cavity within the structures of the magnetron cause a resonant frequency change. The suitable parameters of the voltage and magnetic field supply are desired to control a resonant frequency at 2.9982 GHz by using the Takagi–Sugeno fuzzy logic control (FLC) algorithm to control a resonant frequency at 2.9982 GHz. The results of the FLC algorithm application show that the LINAC can produce X-rays with a constant dose rate for an hour with a disturbance in the range of 38 to 42 °C temperature and 1 × 10−9 to 5 × 10−8 torr vacuum pressure.