You could pull the vacuum pipe off the egr and plug the end then see if the car is smoother, if it is then it's maybe the egr causing it. Anyway here's the info taken from the tdiclub faq
http://www.tdiclub.com/TDIFAQ/TDiFAQ-7.html#j
With the engine warmed up and running at idle in neutral with all major accessories such as air conditioning turned off, connect the scan tool cable and start the scan tool software. Select engine control module. "Login" using 12233 as the access code. Select "adaptation" and go to adaptation block 3. Give the accelerator pedal a quick "blip" to ensure that the EGR remains turned on for the next minute while you perform the following steps. Note that the display shows a default adaptation value of 32768 and shows approximately 250 +/- 20 mg/stroke of air intake volume. (If it does not show this, you are either on the wrong screen, or you have an older ECU that differs slightly - see next paragraph.) If all is well, enter 33768 as the new adaptation value, and select "test". Note that the displayed air intake volume changes, usually to about 370 mg/stroke. The specification limit is 370 mg/stroke, so if you want to remain within OEM
shop manual specifications for emission control reasons, you might have to enter a number slightly smaller than 33768. (If you don't care about road-legal NOx emission limits then leave it at 33768. [Depending on the usage cycle, NOx at this setting can be increased by as much as 40%]) If all is well and you have a seting that you are happy with which results in an intake air volume of 370 mg/stroke or just a hair less, enter "save". Now your intake manifold either will never clog, or will take so long that the engine will wear out first.