I had this problem with my frst and spent over a hundred quid on a new idle valve thinking that it would sort it but i didnt. I just paid for a diagnostic in the end. Also i had the same thing on my focus a while back. It was the speed sensor both times.