Excuse me for butting in, but there are some things to be aware of. Since the battery was disconnected, idle speed is going to be too low until "minimum throttle" is relearned. Until then, you may need to hold the accelerator pedal down 1/4" for the engine to start, and to not stall at stop signs. Erratic idle speed is typically the result of a vacuum leak. One clue to verify that is to watch the idle "steps" the Engine Computer has placed the idle speed motor too. That motor can be pulsed to one of 256 positions. For a properly-running engine, step 32 is typical. With one misfiring cylinder on a V-8 engine, around step 50 is common.
If you find the idle step is "0", minimum throttle has not been learned yet. To meet the conditions for the relearn to take place, drive at highway speed with the engine warmed up, then coast for at least seven seconds without touching the pedals.
Once you see the number of steps displayed, observe if they go up or down when engine speed changes. If the step number goes down when engine speed goes up, the computer is trying to lower the idle speed, but without success. That is where the vacuum leak becomes the best suspect. If the step number goes up when engine speed goes up, the computer is requesting that higher speed in response to something. The biggest contributor to the target idle speed is coolant temperature, so watch that to see if the sensor's voltage readings are erratic. Except for a rash of problems on early 1990's Fords, coolant temperature sensors have an extremely low failure rate because they have just one component inside. If you get inconsistent or wrong readings, wiring problems and corroded connector terminal problems are the better suspect.
Monday, April 10th, 2017 AT 10:37 AM