Toyota Repair: Idle issue., throttle position sensor, air flow meter


Question
I have a 1990 Toyota two- wheel drive extended cab pick-up with a 22-R-E and 5spd. It has a high, and surging at times, idle issue. When you stop at an intersection it surges up and down unless you take your foot off the brake pedal and maybe rev up for a second so the idle climbs even higher.  If I jumper it into test mode the idle will drop down a few hundred rpm but not where it should be. I don't have a tachometer, but I'd say when it's stationary (foot off brake pedal) and jumpered, or not, it's around 2000rpm. You can also feel it surging up and down when you let off the gas at most any speed. The only code it throws off in test mode is a 51 and you have to start it and rev it to get the 51 code. In test mode at idle it just flashes quickly like it is supposed to until you touch the accelerator and then it will flash the 51 code. Oh Toyota Master, can you help me?

Answer
Most idle problems are caused by a leak on the intake side of the EFI system, make sure there are no vacuum hoses or intake hoses that are either off or have cracks, a couple of other possibilities is the air flow meter or the throttle position sensor.