How do I use a centering home-switch with GRBL?

I am using GRBL 1.1 to do some motion control for a prototype medical device at work. I am familiar with GCODE in general having built my own printer and milling CNC. I decided to install GRBL and drive it with my own custom interface (Labview) because I can prototype the motion sequences more easily before hard-coding them into dedicated firmware (that was the idea anyway)

Anyway, I have an atypical homing requirement: I have a rotary positioner that has a central safe position and no room for +/- limit switches. I put a photo detector in place that sees a disk on the motor shaft that is half black and half white. If it sees black it turns one way, otherwise the opposite. This keeps the motor moving along the shortest path to the center. This kind of homing location is intrinsically reliable but not useful for things like CNC or printing where an outer boundary must be defined.

While trying to build my own (slow) homing routine I needed the limit-switch positions but my mask is not working properly. I set $10=17 for only machine position and pin status, but it behaves like this:
8 times in a row it reports <Idle|MPos:0.000,0.000,0.000|FS:0,0>
The 9th time it reports <Idle|MPos:0.000,0.000,0.000|FS:0,0|WCO:0.000,0.000,0.000>
The 10th time it reports <Idle|MPos:0.000,0.000,0.000|FS:0,0|Ov:100,100,100>
Then the cycle repeats, regardless of the mask setting. Setting $10=31 will also insert Bf: values but still no limit values.

As Neil Armstrong said when he first stepped on the moon onto some chewing gum...'wtf?'

Here is the build info:
[VER:1.1h.20190830:]
[OPT:V,15,128]
thanks

Normally to work from a centre you would have regular home switches.
In almost all cases Z up is called first and then X and Y home.

Then define the max travel in each direction eg. 100mm x 100mm
Then you would write a simple centre routine as a mask or offset.

Some senders such as UGS and LaserGRBL allow all those to be defined quite easily.

We would also need to know if you are using lead screws or belts as there are or could be minor variations with either of those.
Along with the EXACT motor being used as the steps can vary between stepper motors.

3 decimal points might also be pushing GRBL to the limit and minor errors can creep in if all the $ parameters are not correct.

For most NEMA 17 frames you can buy encoders that mount on the back which turn them into closed loop so positions can be tracked and accounted for.
They don't cost much and I ordered some to play with.
Also don't forget the pull off distance needs to be taken into account when homing.

Pictures of your setup could be useful along with any code being used.
Struggling to see what you have in front of you from your description.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.