2009 Ford Ranger 4.0 misfire at idle

I have a problem with a 2009 Ford Ranger with a 4.0 V6 that no one can seem to figure out. It occasionally goes into fits & misfires on cylinder 2 at idle. This is a sporadic problem, it does not do it all the time. Code stored is always P0302 (misfire at cylinder 2). Occasionally it will also store a code P0000 (random misfire at startup) in addition to the P0302. The engine runs great at all throttle settings other than idle & even when this condition occurs it will run fine as soon as I step on the throttle pedal. The problem only occurs when the vehicle is partially warmed up. It is OK (but not perfect) when very cold & the problem goes away & the engine idles just fine after driving down the highway 10 or 20 miles & fully warming up. If I just putter around town it will sometimes do it all day, other times the misfire will go away completely after shutting the engine off for a few minutes & then restarting (this is after the engine is fully warmed up). Strangely, running the air conditioner seems to reduce the roughness of the misfire or cause the problem to cease. The truck has 180,000 miles on it & was previously used by a friend of mine who was a rural mail carrier so the engine has a lot of hours idling in addition to the total miles. It does not use or leak any oil or smoke & runs great except for when it is misfiring on cylinder 2 at idle. It does not use any coolant so it cannot be leaking coolant into that cylinder under certain conditions. The truck was always serviced at a Ford dealership & received impeccable maintenance as this was used as a mail truck. After I clear the computer by disconnecting the battery & leaving it over night, the truck will run fine for a while but eventually the misfire at idle returns & always is on cylinder 2. Sometimes it takes a month for the problem to return, sometimes just a few days. Spark plugs & wires have been replaced. Using a spark tester I have verified that the coil is firing when the misfire condition occurs. I have not checked fuel pressure but did replace the fuel filter. I cannot find any vacuum leaks & the engine normally pulls 20 inches of vacuum at idle when it is idling correctly & around 17 when it is misfiring. I replaced the intake manifold O rings & fuel injector O rings just in case, as it was easy, & I wanted to move the number 2 fuel injector to another cylinder to see if the problem followed to that cylinder. After switching the number 2 & number 6 injectors the fault code still identifies a cylinder number 2 misfire (P0302) which rules out a bad injector. I checked the IAC valve & it is clean & I do not think the misfiring cylinder would always be the same if the IAC valve was the problem. I have not replaced the coolant temperature sensor as I do not think it could cause the same cylinder to always be the culprit either. There are no leaks in the hose between the MAF sensor & the throttle body & the hose is clean. The throttle body is free of carbon. The compression in all cylinders is fine (& even). I do not want to pay a mechanic a ton of money to start throwing parts at this thing & maybe get lucky & fix it. I am thinking that the ECU could be the problem (especially because the problem goes away for a while after flashing the ECU) but do not want to spend the money on a new ECU & then find out the problem is still present. Other than the ECU, I have addressed all the systems & components that are specific to cylinder number 2 that I can think of, & most that are not specific to cylinder 2 but specific to idle quality. However, I have not been able to fix the problem. Any help would be greatly appreciated.

Fords seem to have more ignition coil problems than other brands. That’s what I’d suspect before going on to other possibilities. If it’s possible to swap the coils around, see if the problem follows the swap or not. Or just purchase a new coil pack for that cylinder.

This has a single coil pack, & I have verified that the coil is firing all cylinders at the time that the misfire is occurring.

Replace the spark plug and gap it a little wide and see if that produces any change…If not, then gap it a little on the tight side…