Cramps/Pain

Lately when I've been masturbating, I get bad back cramps and occasionally pain in my pelvic area. Anyone know what could be up? I met with my doctor and she said it doesn't look or sound like anything is going on, but it keeps happening