Painful sex!

A couple things to preface this- 
I have been with my partner for almost a year now. And let's just say I'm a lucky girl. 
I have Skyla- the smaller IUD. It has been in for about 3 months now. 
I also have IBS And had intense constipation before we had sex. 
So to the situation- we were having sex and it started to hurt occasionally when he went deeper. Not in a "im sore from last time" way, or "we need some lube" kind of way, but in an intense and sharp pain way. It was only brief at first so I didn't want to say anything and we continued. I got on top and suddenly the pain was so extreme that I got the most painful cramp in my lower abdomin that I could barely move. I took Midol and put a heating pad on and somehow fell asleep. We tried again (my choice, I wanted to make sure it didn't hurt again and if something was more seriously wrong) and there were some pains but nothing extreme. 
My main worry was that my IUD misplaced but I checked and could feel the strings. Has anyone else experienced this? Could it have been the constipation? This was last Friday and we haven't since.