Predictive Filtering For Automatic Focus Pulling And Robot Control