02 Dakota idles rough with the AC on

2002 Dodge Dakota 3.9, 5 speed. Whenever I have the AC on, the pickup just runs really rough. Engine runs good otherwise, no misfires or anything. Recently I’ve also begun to hear a feint clattering sound when the AC is turned on. Thanks in advance.

The Idle Air Control valve is suppose to bump the idle speed up when the AC is turned on so the engine doesn’t idle rough.

https://www.rockauto.com/en/catalog/dodge,2002,dakota,3.9l+v6,1384590,fuel+&+air,idle+air+control+(iac)+valve,6072

The IAC valve may be dirty or is defective,

Tester