Development of a fast voltage control method for electrostatic accelerators