There is also a cam position sensor on your engine, when your car idles
if that sensor is bad or going bad it can also cause that as well. I
believe that is one of the more common problems on a BMW, that is, that
sensor going bad and needing replaced.