cat had a similar issue with surging over idle speeds and it was due to the charging system overcharging. The higher voltages were affecting the sensors and other related components and causing the system to fluctuate trying to compensate for the voltage irregularities therefore creating the surge.
check the alternator output and make sure it is between 13.8v and 14.9v. Anything over that and there is an issue that needs to be addressed.
First check chassis grounding points and make sure they are good clean contact points. A volt drop test should be done between the battery and the ground point on the frame, any drop exceeding 0.5v indicates a problem and should be repaired.
Also check the ground to engine block in the same manner.
The overcharging will not necessarily trigger any codes so there may be none showing on the display and the MIL light may not light up either.
If no issues are found with grounds then replace the alternator.
good luck!
This is ONLY to be used to report flooding, spam, advertising and problematic (harassing, abusive or crude) posts.