A muscle cramp is controlled by engaging the antagonist. The inhibitory neurologic feedback signal from a steadyly engaged antagonist will interrupt the cramping.
A calf cramp such as in the Gastronemicus can be reduced and controlled by the steady firing of the Tibialis Anterior by pulling the top of the foot towards the head.
This principle works on a cramp in any muscle . The key is to know which muscle is cramping, so that the appropriate antagonist can be activated as soon as possible. It is easier to head off a cramp that is just beginning, than wrestle down a full blown charlie horse. The most common cause of cramping is either the lack of or an imbalance in the electrolyte balance in the body. Sweating sheds electrolytic minerals that need to be replaced. A simple rule of thumb for everyday mineral balance is to eat a banana per day.