Straight from the lovely world wide web.....
.....although this guy is talking about Mazda RX-7's, yours seems to have the same symptoms.
EGR VALVE
Difficulty? Medium
Total time: Couple hours.
Applications: 86-88 NA/Turbo, 89-91 NA/Turbo
DISCUSSION:
The purpose of the Exhaust Gas Re-circulation System is to help the engine reduce exhaust emissions. It does this by feeding a small amount of the exhaust gases back into the intake to be re-burned in the combustion process.
The system is controlled by two of the four solenoid valves found right above the spark plugs. These valves open and close, allowing intake manifold pressure to open and close the EGR valve.
The problem with the system is that the EGR valve eventually fails in one of two ways: 1) The rubber diaphragm used to open and close the valve dry rots and cracks. 2) The valve gets clogged from carbon build up.
This problem is pretty much guaranteed to happen to every RX-7 owner at one time or another. The symptoms of a bad EGR valve are:
* Rough idle
* A "miss" or slight "popping" in the exhaust at all RPM's
* Large amount of backfiring
* The car runs rich, and the spark plugs are black when you pull them out.
DIAGNOSIS:
To determine if your valve has failed, you need to perform a vacuum test on the valve:
The valve itself is located directly under the intake manifold. If you have a turbo car, you should have pretty easy access to the valve. If you have a non-turbo then your going to need some small hands. There is one vacuum hose that leads to the valve. Remove that line and attach a vacuum pump to the valve. Then warm up the car completely, and allow it to idle. Once the car is warm, apply pressure from the pump to the EGR valve. (about 200 mmHg / 7.87 inHg)
Once you apply pressure to the valve, the car should run very rough and want to stall. This means the valve is working properly. If it does not want to stall or the pump can not hold any pressure, then the rubber diaphragm has failed.
If you can get the pump to hold pressure but there is no change in the idle of the car, then the valve is probably stuck partially open and needs to be removed and cleaned.
REPAIR:
If your valve has failed, you can do two things: Buy a new valve for ~$300 from Mazda, or you can remove the valve and make a block off plate. The plate method works very well, but it will effect your emissions. So be careful if your in a smog testing area.
My solution to fix my leaky diaphragm was to remove the valve, Clean all the carbon out of it so the valve closed properly, and JB Weld the valve shut. I then placed a ball bearing in the vacuum hose that leads to the switching solenoid. The ball bearing was necessary because without it, you have a major intake leak coming from the cracks in the EGR diaphragm.
The hardest part about doing this was that I had to remove the intake manifold from the engine to get at the valve. Like I said earlier though, if you have a turbo model, you should be able to access valve without removing the intake.