Engine runs rough after restarting while still warm

After stopping to run an errand, the engine runs very rough when I restart it. It seems as if something is clogging the fuel system, which then gets blown out in 5-10 minutes. “Check engine” light flashes, then comes on solid. No problem if the “off” interval is only a few minutes or is at least an hour. Diagnostic code indicates “engine misfire” (duh!). Dealer has suggested “changing wires,” “changing coil,” and “putting in a tank of premium,” none of which sounds like the right fix for a problem that only occurs in certain conditions. My guess is a sensor not tracking the change in temperature properly, but don’t want to just start changing sensors without some idea that it’s the right thing to do, and would like to go after the most likely sensor first. Ideas?

Car in question is a 2000 Miata.

My experience is with old Bosch fuelinjection,but it sounds like a leaking injector.I have one on my car and it floods the one cylinder and takes time to repressurize the line.I cure it by holding the revs at 1500 to 2000 untill the problem goes away…Looking at the spark plugs will tell if a leaking injector is at fault. A leaking head gasket could also cause the miss on hot startup.loosen coolant cap before hot turn off.If this ends the problem,it’s a head gasket or cracked head.Maybe these checks will help solve the problem.

Engine misfire, that the only code?

Frankly it could be any of a dozen things. However temperature related sounds like a good idea. But which or what?. The ECU coudl be overheating OR the Electronic ignition module or some sensor reacting badly to being “soaked” when the engine is stopped with no air running over it.

You might try a few items. some time, say on returning home, open the hood to let the heat out faster and see what happens, does the time period change or the problem not happen?
On another occasion, while it is running rough, spray the ignition module with “dry ice”, or stuff you get in cans at Radio Shack to freeze electronic components in PC and the like to tell if they fail when hot & recover when cold.
Engine timing pickup sensors can go haywire, these are usually locate on the cam or the flywheel, give them a spray also.
if possible check your fuel pressure during this period, your fuel rail may have a pressure testing port on it. If your pump were acting up the pressure woudl be low. OTOH, ir the regulator were acting up, you might have pressure that is too hign. normal is usually about 45~50psi.

I don’t know what type of MAF sensor you have in this item, do you?. MAP use a pressure sensor which may act up.

Is any of this misfortune in any way related to the use of the AC? ie you use the AC and you have this problem, you do not and no problems.

and when this misfiring is gong on, does it feel or smell like it were running way too rich or normal, just missing.
also, does this engine have a distributor or multiple coils. If it has a distributor, how old/new are the cap and rotor?

also how is your battery, JIC it is on the hairy edge. Is it in the engine compartment?. It may be getting soaked during the period after stopping, loosing voltage, thus your fuel pump, injectors etc are incapable of running properly till it recharges.

What happens if you simple heat up the car a little and stop it for that critical period, same response or do you need to get the engine really hot first?.

I can respond to the last 4 possibilities you raised:

Not AC related. Problem occurred all winter, and I experimented with having AC on – no difference.

The sensation when the misfiring occurs is that not enough fuel is getting through. No smell. It is loud, though, until the problem resolves itself. Now that I think of it, could this be an exhaust problem? As far as I know, there is a single coil and a distributor; the cap and rotor are 3-4 years old, but if either of them were causing the problem, I would expect it to occur in more situations, expecially when the air is humid.

Battery is not in engine compartment. It is on the old side, but Miata batteries typically last 10+ years, so I’d be surprised if battery were the problem. I just had the car being idle while I was away for 2 weeks – you’d expect voltage to be lower in this situation than when stopping after the car had been running for a while – and it started right up.

The problem occurs regardless of whether the car is heated up a little or is really hot.

I have the same car with the same issue. Try cleaning the IAC and EGR valves and then start with the coolant temp sensor. That’s the rout I’m taking. Already changed the coil, wires and plugs.