Hi,
I just want to give you feedback on the actual project. I implemented the homing now with the arduino nano. It was a bit more complicated than orginally thought - as always reality is different from theory.
I came across the following issues I had to solve on the arduino:
1. The A/D conversion is one of the most expensive operations on the arduino and takes ~100 micro seconds. Not too much but I need to be sure that I don't miss any of the short and sharp index signals. The arduino nano comes only with 2 interupt lines. Without connecting all the input via OR to the interrupt I have to use a fast method for the A/D conversion to be on the save side. There are possibilities on the arduino to start the A/D conversion and run the code in parallel and get the A/D values when it is ready. If you want to know how take a look at the code I attached.
2. The poti signal is not very precise while the robot/poti is moving. During halt is differs just +/-1 from the 10digit conversion. But during move it differs ofter +/-5 (or even 10). The issue is that the index signals are every 9-10 values - around the same size. So there is no way around doing average calculation. The arduino code calculates the average of 10 A/D conversion omitting the largest and smallest value. This is precise enough to use the timing schema as it was lined out by Jerry.
The whole procedure works pretty well. There is one thing I could not solve/understand: When I power the arduino from the internal 5V power supply or from an external USB power supply there are sometimes problems with the arduino program. When I plug in the arduino into a laptop it works fine (indedpendent if it is another or the same laptop where I run the LinuxCNC) - very strange. I should be related to GND since the DB25 board is decoupled via opto coupler. No idea. So I plug in the USB cable when I running the homing.
I attached the code that is still in a beta version but for those who want to take a closer look it should give you an idea. It could be streamlined but for now it is doing the job.
You can take a look at my short youtube video on how it works: