I have been able to get a repeating signal with a 2mm pitch refridgerator magnet material. The distances per pulse need to be calibrated but the initial results are promising. I believe I can get around 0.02mm resolution with the current setup. The sensor used is an ALS31313 which I am reading with both a teensy 3.2 and ESP32. I'm looking for some help figuring out how to digitally filter the signals and how I might optimize the code. The code should be pushed to github shortly. If you are interested please join the project.
Video of how the math works and a brief overview of the code can be found here: