I made a note of the food I'd eaten each day and the following morning noted down any reaction.
Found out after this non scientific trial that the main foods that contributed to my cramp were:
Corn derivatives-sweet corn,corn on the cob, Modified food starch etc.
Pasta also gave a bad reaction so tried gluten free-seemed to work.
Use gluten free flour.
Milk chocolate.
As far as possible, I avoided potatoes.
This has worked really well for me and I rarely have cramp these days.
Also if I've had some of the foods above a swig of tonic water does seem to help.