Starting up 9 hours later it again idled at 1000-1500. I pulled the plug off the throttle position sensor and the revs shot up to about 3000. Put it back and it slowed down, then went up to 3000 again, and this time removing and replacing the plug made no difference. Jiggling the wires made no difference.
After a few miles it settled down again and was the same as it was this morning, ie jerky and idle slightly too high.
I've tested the TPS on an analogue meter and it seems perfect. What else could it be?