An automatic anastigmatic electron gun, comprising a central controller, an electronic source power supply, a drive power supply and an electron gun body; an electron beam generator, an anastigmatic device and a focusing device are arranged in the electron gun body from top to bottom; and the anastigmatic device comprises anastigmatic windings with two phases, which form a structure with a plurality of pairs of axisymmetrical magnetic poles; an electron beam control voltage signal output end of the central controller is connected with a control input end of the electronic source power supply, and an output end of the electronic source power supply is connected with the electron beam generator; a first anastigmatic control voltage signal output end of the central controller is connected with a first control input end of the drive power supply, and a first output end of the drive power supply is connected with a first anastigmatic winding of the anastigmatic device; and a second anastigmatic control voltage signal output end of the central controller is connected with a second control input end of the drive power supply, and a second output end of the drive power supply is connected with a second anastigmatic winding of the anastigmatic device; characterized by further comprising a detection device and a signal processing circuit, the detection device is arranged in the electron gun body and located at an electron beam outlet end directly below the focusing device; the detection device comprises a framework and four detection windings; the framework has a ring structure of non-magnetic conductive insulation material; the four windings have the same number of turns and the same wire diameter, and are wound around the framework and evenly and symmetrically distributed; a first detection winding and a third detection winding are radially oppositely arranged on the framework, and the tail end of the first detection winding is connected with the head end of the third detection winding; and a second detection winding and a fourth detection winding are radially oppositely arranged on the framework, and the tail end of the second detection winding is connected with the head end of the fourth detection winding; the head end of the first detection winding of the detection device is connected with the head end of the second detection winding and then connected to a common input end of the signal processing circuit, the tail end of the third detection winding of the detection device is connected to a second input end of the signal processing circuit, and the tail end of the fourth detection winding of the detection device is connected to a first input end of the signal processing circuit; and the output end of the signal processing circuit is connected with the input end of the central controller. an electron beam generator, an anastigmatic device and a focusing device are arranged in the electron gun body from top to bottom; and the anastigmatic device comprises anastigmatic windings with two phases, which form a structure with a plurality of pairs of axisymmetrical magnetic poles; an electron beam control voltage signal output end of the central controller is connected with a control input end of the electronic source power supply, and an output end of the electronic source power supply is connected with the electron beam generator; a first anastigmatic control voltage signal output end of the central controller is connected with a first control input end of the drive power supply, and a first output end of the drive power supply is connected with a first anastigmatic winding of the anastigmatic device; and a second anastigmatic control voltage signal output end of the central controller is connected with a second control input end of the drive power supply, and a second output end of the drive power supply is connected with a second anastigmatic winding of the anastigmatic device; characterized by further comprising a detection device and a signal processing circuit, the detection device is arranged in the electron gun body and located at an electron beam outlet end directly below the focusing device; the detection device comprises a framework and four detection windings; the framework has a ring structure of non-magnetic conductive insulation material; the four windings have the same number of turns and the same wire diameter, and are wound around the framework and evenly and symmetrically distributed; a first detection winding and a third detection winding are radially oppositely arranged on the framework, and the tail end of the first detection winding is connected with the head end of the third detection winding; and a second detection winding and a fourth detection winding are radially oppositely arranged on the framework, and the tail end of the second detection winding is connected with the head end of the fourth detection winding; the head end of the first detection winding of the detection device is connected with the head end of the second detection winding and then connected to a common input end of the signal processing circuit, the tail end of the third detection winding of the detection device is connected to a second input end of the signal processing circuit, and the tail end of the fourth detection winding of the detection device is connected to a first input end of the signal processing circuit; and the output end of the signal processing circuit is connected with the input end of the central controller.