there is several sensors, crank, cam, throttle position, air flow meter, temperature. you need to thoroughly test their resistence & see if it meets spec. it could also be vaccuum leak, what is the compression test results? i just spent $800.00 on my 540i/a trying to find why it has a slight mis & runs rough up to 1300rpm's & smooths out around 2000rpm's. mech. is now telling me he thinks it is the torque convertor, but the dealer says the idle is almost perfect.
tim s.