I've had them on and off for years too and it's very scary when it feels like your heart is going to gallup right out of your chest. Caffeine is usually the culprit for me. I've had stress bring them on, but they have also awakened me from a sound sleep and there's not much that is less stressful than sleep so for me detecting a pattern can be difficult. One thing I can certainly tie them to is caffeine.

One thing I've done with some success is that if a bout comes on I mentally change the conversation, example; I do something different that what I was currently doing. Something to keep my mind busy and I don't think about it as much.