Feedback Control and Beam Diagnostic Algorithm for a Multiprocessor