A simple beam-energy homogenizer and automatic measurement of excitation functions