For what it's worth, I've had a similar situation with my 2006 R3 at around 34000 miles.
Rather than replace anything, I simply lubricated the idle position controller with WD40.
It's located just beneath the coolant tank, on the front of the primaries. Squirt some under the rubber dust boot and actuate the controller by turning the ginition on and off several times. Haven't had an issue since in the last 1000 miles
If that doesn't work, then I'd suugest replacing the TPS.