Grooved multi-pole magnetic gratings for high-resolution positioning systems