A random energization of unloaded transformers may lead to tremendous inrush currents and over-voltages, which have undesirable effects including potential damage to transformers and misoperation of protection system. Controlled switching can eliminate inrush currents effectively. To achieve this, optimal switching phase should be calculated by measuring residual flux accurately. However, the over-voltage caused by chopping current of the vacuum switch affects the residual flux in core and the calculation becomes difficult. In this paper, changing of the residual flux under the influence of chopping current is investigated and improvements of the voltage integral method has been taken to calculate the residual flux accurately. Results of simulation in PSCAD and laboratory experiments verify the effectiveness of this method.