It seems that many people have trouble with the way their 5.0 Mustang idles. Symptoms are usually a stumbling or rough idle which may be the result of modifications, or any number of other factors that may contribute to the problem. Clogged Emissions Gas Recirculation (EGR) Valves or Idle Air Bypass (IAB) solenoids are often to blame. A bad Throttle Position Sensor (TPS) will cause the engine to “hunt” for a proper idle setting. If you are experiencing idle problems first check the IAB. If it has large amounts of carbon deposits in it you may need to clean it using regular carburetor cleaner. You will have to remove it to do this, DO NOT clean it while it is on the car! If you have checked to make sure that your EGR, IAB, and TPS are clean and properly set and you are still experiencing problems try the following:
1. Clear the EEC-IV’s idle memory by disconnecting the battery for 20+ minutes.
2. Disconnect the Idle air bypass solonoid
3. Reconnect battery
4. Start engine and set idle speed to desired RPM with stop screw on throttle body (900 rpm works great with E303 or larger cam)
5. Turn off engine and reconnect the air bypass solenoid*Optional — set TPS to 0.90 - 0.95 volts (Do not exceed 1.0 volts MAKE SURE!) Use a digital volt meter!
6. Start engine and let it idle for 2 minutes with no accessories on.
7. Turn off engine for two minutes
8. Start engine again and run for 2 minutes with every accessory turned on.
9. Turn engine off again. Your computer should have now re-learned the new idle settings. This procedure assumes that you have a clean IAB valve. If it is carboned up then you may need to remove it and clean it with carburetor cleaner.
For people that dont know you have to take off the neg. battery cable first and always put it back on last when disconecting both battery cables.
(taken from a www.ModdedMustangs.com post by ICantDo55)