The energy-sweeping mode was recently used for measurement of the charge exchange flux energy distribution every 3-5ms via single-channel electrostatic neutral particle analyzer (NPA) in stellarator U-3M .The magnetic mass-separation (MS) part of NPA was omitted during these energy-sweeping measurements.The MS part is required for some experimental conditions in a case of presents of different masses in plasma and as the efficient suppressor of parasitic influence of plasma radiation on the NPA measurements (due to geometrical factor). The MS magnets of about 10 Henry are used in our NPA diagnostics. A variation of current troughs MS magnet from zero to 0.3 A is required for energy-sweeping mode application in the energy range of 0-2keV. The 3-5 ms duration of this variation is required for U-3M. The L/R time constant of the MS magnet is about 200 ms. Required variation speed can be achieved by application of rather high voltage to the MS magnet. The voltage applied to electrostatic part of NPA should be varied from zero to 500 V (measured energy is 4.5 times higher then applied voltage). The dependence of electrostatic voltage on MS current is nonlinear, and should correspond to the NPA calibration curve. The problem of simultaneous variation of the voltage at electrostatic part and current in MS magnet in accordance with NPA calibration is solved in our work. In some cases, in particular in high voltage and power applications  or in the high inductance case under consideration simple square wave pulses (without pulse width modulation) are used for the control. We use STM32F100 microprocessor as a control unit. Square wave 310 V pulses of variable duration are used for control of MS magnet current. The IGBT bridge is used as a power unit of MS magnet. One pair of the bridge is used at the current rise stage; another pair is applied reverse voltage for fast decay of the MS magnet current. The digital to analog convertor unit of STM32F100 microprocessor is used for the electrostatic voltage formation. Since parameters of MS magnet and electrostatic parts of NPA are fixed, no feedback is required in our system. The predefined set of durations for MS current control and waveform of electrostatic voltage are stored in the internal memory of the microprocessor. The direct memory access unit of the STM32F100 microprocessor is used for synchronized output of two control signals.
 Dreval M and Slavnyj A S 2011 Plasma Phys. Control. Fusion 53 065014
 Onchi T et al 2016 IEEE Transactions on Plasma Science, Vol. 44 No. 2, 195