I'm going to break with the heard a little bit on this.
First some background (I'm no doctor, just to be clear):
Muscle cramps in the lower legs and feet are very common and in the absence of injury or underlying medical conditions usually caused by
a) overexertion / vigorous tensing of the muscles
b) circulation issues (cold or fins too tight)
c) dehydration
d) low levels of certain minerals in the blood, including calcium and magnesium, the levels of which can be lowered by hyperventilation.
So projected onto a foot cramp caused while diving then possible causes could be
a) overexertion or vigorous tensing. This could be question of relaxation but may also indicate that your fins are in fact TOO big and you're (consciously or not) tensing your feet to fill up the extra room
b) poor circulation caused by restrictions to the blood flow. This could indicate fins or boots that are too tight or a suit that is too tight. It might also be a function of aging.
c) dehydration. Over use of diurectics such as coffee/caffeine or alcohol and/or just not drinking enough.
d) reduction in calcium and magnesium levels in your blood by hyperventilation.
So it's hard to give accurate advice without seeing you because your problem could have several sources.
However, if you use the shotgun approach, you might be able to solve it.
a) get help with the proper fitting of your fins. Go for the goldilocks zone. Not too tight. Not too loose. Include a good look at the tightness of your suit (esp. the boots and behind your knees) as part of this process.
b) become conscious of any tension you're holding in your body. Breathe fairly deeply, fairly slowly and regularly as you go and every time you exhale let the muscle tension flow out. This is good advice that may very well improve your comfort anyway even if it doesn't solve your cramping issues.
c) drink lots of water or isotonic sport drink at least 1/2 hour before you go diving.
hope that gives you some ideas to go on.
R..