It could be the TPS as JD says there is a sequence on how to check it if its in the right position, on the TDM there is a sequence but cant remember off hand but i have to line the Tacho needle up with the 4Krpm,Also if the speedo goes up to a cartain rev limit or down for cerain number of seconds that tells you where the fault is .If it hasnt got fuel injection you could still have a TPS my TDM is only carbs.
Best bet is to buy the Haynes manual for your bike it should tell you about it in there .