Usually this is caused by a sludged throttle body.Ford has a technical service bulletin out for this that requires reprograming the PCM. However sometimes cleaning the throttle body can correct it.
Here is a copy of the TSB
This article supersedes TSB(s) 08-5-13, 07-23-12 and 06-25-8 to update the Service Procedure.
Some 2004-2006 4.6L and 5.4L F-150 (excluding F-150 Heritage), 2006 5.4L Mark LT, 2005-2006 6.8L E-350 / E-450, 2005-2006 6.8L F-Super Duty (F-250 to F-550), 2006 6.8L F-53 Motorhome Chassis, 2006-2007 4.0L Explorer 4 dr, 2007 4.0L Explorer Sport Trac, 2006-2007 4.0L Mountaineer, 2006 4.0L Mustang, 2006 - 2007 4.6L 3V Explorer / Explorer Sport Trac / Mountaineer, 2006 4.6L 3V Mustang, and 2005-2007 Crown Vic / Grand Marquis / Towncar vehicles may exhibit one or more of the following symptoms: drive-away hesitation, loss of RPM on deceleration, difficulty starting, and/or idle RPM less than desired. Malfunction indicator lamp (MIL) may be illuminated with diagnostic trouble codes (DTCs) P0506 and/or P0505. These conditions may appear after battery disconnect, dead battery condition, or keep alive memory (KAM) reset. The symptoms may be due to engine deposits in the throttle leading to airflow less than desired.
Follow the Service Procedure steps to correct the condition.
Ok so that makes sense, we just changed the battery last wednesday. It sounds complicated not something we would be able to do ourselves right?
It appears that my answers did not go thru so I switched out of the chat mode.
You can try cleaning your throttle body first.This sometimes corrects it. If you had a scan tool that could look at data you would know for sure if the ETC_trim was above or below 3.5 degrees.
To reprogram the PCM though you would have to have that done at your dealer
You can look at the plates in the throttle body good and see if there is alot of build up that keeps the throttle plate from closing and take s tooth brush and cleaner and scrub it out good
the build up will usually be around the outside of the plate in the throttle body opening
Oh and it is easier to do if you remove the throttle body
Remove the parts in the order indicated in the following illustration and table