Engine speed is primarily determined by the amount of air that is allowed to enter the cylinders.
Normally air enters the cylinders only through the four paths through the throttle body (ISC, FIAV, BISS and throttle plate), but there are also various ways that air can leak in. Resolving idle surge means identifying and correcting the cause of too much air being admitted into the intake manifold.
Check for leaks at
The simplest path through the throttle body is the Basic Idle Speed Screw (BISS). This screw controls an otherwise fixed air bleed that allows air to bypass the throttle plate. Screwing the BISS in reduces the amount of air that reaches the intake manifold, screwing the BISS out increases the flow. If the only problem is that the BISS needs to be adjusted, simply adjust the BISS until the ISCPosition value logged in DSMLink/ECMLink hovers around 30 at normal warm-engine idle in neutral. This produces better results than following the service-manual procedure.
You may find that screwing the BISS all the way in doesn't bring the idle speed down to idle speed configured in DSMLink/ECMLink. That means that some other path is allowing too much air to pass. First make sure that there is no leakage into the BISS hole by covering the hole with your finger. If the engine speed drops when you cover the hole, replace the BISS O-ring.
Next, investigate possible problems with the Idle Speed Control (ISC) servo. Open the ECU and inspect for burned ISC driver chips. If you find any, contact ECMTuning regarding repair of the ECU. If there are burned drivers, it's quite possible that the damage was caused by ISC itself having a shorted coil. Make sure you are using the correct O-ring to seal the ISC to the throttle body. An O-ring that's too thin might not seal, too thick and it might not allow the ISC to fully close the airway.
Test the coils in the ISC. (Note that the newer, more reliable, all-black ISCs normally measure about 39 ohms.) Inspect the tip of the ISC for any physical damage.
Test for proper operation of the ISC: Turn off the ignition and reset the ECU by removing battery backup power for at least 10 seconds, then restoring battery backup. Then, with the ISC unbolted from the throttle body but plugged in to the wiring harness, turn on the ignition and observe the movement of the ISC. The ISC should fully extend, then retract slightly. If the ISC just quivers a bit but doesn't really move, suspect a problem with the ISC, the driver circuits in the ECU, or the wiring. If the ISC fully retracts instead of fully extending, there is a wiring problem, perhaps a mismatch between '90 and '91+ engine harness and ISC. Using a '90 harness with a '91+ ISC, or vice versa, will cause the ISC to operate backwards.
Strange behavior can result from a bad Fast-Idle Air Valve. This is a coolant-temperature controlled air valve that provides some of the additional air needed for fast idle during engine warm-up. This valve is integral to the throttle body, so test by substitution or by blocking the FIAV passage with a block-off plate.
With all other possibilities eliminated, the remaining item to check is the throttle plate. A too-tight throttle cable can pull the thottle open, more so as the throttle-cable housing heats up, so make sure that the throttle cable has sufficient slack to allow the throttle to close to the stop even when the engine is hot. Check that the throttle is against the stop by manually rotating the throttle shaft closed. Make sure that nothing is binding the throttle shaft such as bad bearings or a badly adjusted throttle-position sensor.
In order for the ECU to attempt to control idle speed at all requires that the ECU know that the throttle is closed. The ECU knows this by the state of the idle switch, so make sure that the idle switch is working by logging IdleSw in DSMLink/ECMLink or use DSMLink/ECMLink to simulate the operation of the idle switch. Idle surge results from the ECU being forced to limit idle speed by shutting off the injectors until the engine speed drops low enough. When the ECU re-enables the injectors, the engine speed jumps back up.
Ignition timing also has some effect on idle speed. In fact, the ECU normally varies ignition timing at idle to provide fine control over the idle speed. Make sure that base ignition timing is set properly.
If you are running a configured idle speed that's higher than stock, it's possible to observe a slight oscillation in idle speed even when everything else is working properly. This is because, by default, the timing tables in the ECU significantly advance ignition timing as the engine speed rises above 750 rpm, and engine speed tends to increase as ignition timing is advanced. You'll want to reduce this positive feedback by retarding the ignition timing at idle and slightly above idle. It also helps by giving the ECU's fine idle control mechanism more authority.
Also, as your idle speed setting is increased, the intended idle speed begins to get pretty close to the rpm at which the ECU cuts fuel when the idle switch is active. A good rule of thumb is to set the Coasting FC Offset to your rpm setting minus 900. For example, if your intended idle speed is 1100 rpm, set the Coasting FC Offset to 200 to raise the fuel-cut threshold by 200 rpm. Doing so also helps ensure that the idle switch will deactivate before the engine speed increases to the coasting fuel-cut threshold during no-load throttle application.