PS to my earlier reply - this one is ON TOPIC.
I always add about 5% to the required wheel-emmitter count (or the equivalent stepper-pulse count) for a one-square move to avoid this problem, so that when a wall-discontinuity finally does appear, as it inevitably must, the counters can be updated without fear of losing a square. I have done this since 1981 with some occasionally successful results.
Regards from Alan D.
See you all on Saturday.