Hi,
I would be happy enough to use an optical switch for a Limit switch but would not use one for a Home switch.
Of course an optical switch used for any purpose is subject to chips or coolant getting in there and obstructing the phototransistor.
I would presume that anyone using such a device has already thought that through and judged it not limiting.
Limit switches are obviously mounted at the end of travel and a little inaccuracy, say 0.5mm either way in it's detection point
would be fine, and therefore I would regard opto-siwtches as perfectly adequate, with the proviso above.
A Home switch is all about repeatability and for that purpose I would not use an opto-switch.
As you know Mach when homing travels toward a Home switch and on detection of a switch activation, decelerates to a stop, and then
backs up until the switch de-activates whereon it References the axis. The repeatability then depends very much on the hysteresis of the switch,
that is to say the difference (in distance) between when the switch activates and when it backs up and de-activates.
An opto-switch activates as the interrupt blade advances and partially obscures the light beam entering the phototransistor. Let's assume the
activation occurs at 50% obscuration. Now when the axis reverses when does the switch de-activate...at the same 50%, or more, or less?.
The specifications of opto-switches do not include any hysteresis measurement.
I like Omron (or equivalent from other manufacturers) roller plunger snap action microswitches. They have a well-defined and thereby repeatable switch
activation point and more importantly a defined and repeatable de-activation point and the associated hysteresis, 0.05mm. I have used these as Home switches
on my first mini-mill and more recently both as Limit and Home switches on my new mill. I regularly get better than 0.02mm repeatability
withoutrecourse to Index Homing.
https://nz.element14.com/omron-industrial-automation/z-15gq22-b/micro-sw-roller-plunger-spdt-15a/dp/1500340?st=snap%20action%20microswitchCraig