Abstract:170 GHz gyrotron utilized to heat the plasma in the thermonuclear fusion is a power source device and the most important component of the electron cyclotron resonance system. The problem of the overlarge power density in the collector will restrict the increase of the average output power and the pulse width. Therefore, a Transverse Magnetic Field Sweeping Solenoids(TMFSS) is designed. According to the simulation analysis of the electron distribution in the collector, the power density could be decreased significantly from 4.7 kW/cm2 to 0.29 kW/cm2 after applying the solenoids, which will effectively ensure the stable operation of the tube. The optimized design of the TMFSS will be used in the future gyrotrons assembly and hot testing.