Automatic ion current control of a direct inlet system