Ok I think I have another idea that should work for all situations, but it may not be the best or cleanest way to do it. and I don't quite have all the pieces of the puzzle. (hopefully if someone has a better idea they'll chime in.)
There are 3 key steps to making this work, 1st getting the absolute distance traveled, 2nd remembering the distanced traveled between Linuxcnc sessions and restarts, and 3rd triggering your warning, or lube cycle at the required maintenance interval.
Here is a rough sketch of the hal work to implement the 1st step for one axis.
1st step, using the
abs
component connect the axis.N.joint-vel-cmd pin to the input of an
integ
component. The output of the integ component would be the total distance traveled since starting the machine (or since the last reset of it)
I'm not sure about how to implement the 2nd step.
The 3rd step seems simple enough, so I won't go into it now