AMIGOf PI tuning, rationalized peak detection, finite state machine