[en] A beam of bunches of charged particles is controlled by generating a signal in response to the passage of a bunch and adding to that signal a phase-flipped reference signal. The sum is amplified, detected, and applied to a synchronous detector to obtain a comparison of the phase of the reference signal with the phase of the signal responsive to the bunch. The comparison provides an error signal to control bunching