Z axis floating head touch sensor G code nightmare

Hi guys,

I have a legacy Crossfire unit that had no Z. I added a Z setup with limit switch for my touch sensor. I have it wired to Z home in Mach3.

I have tried multiple different post processors in Sheetcam for my setup, but none have made it work correctly.

My problem is the touch off line in the g code for moving down and touching off to the limit switch on my floating head.

At first I tried Langmuir’s post processor which uses G38. Mach stops when reaching that line and gives an error, something along the lines that it doesn’t know what G38 is.

I then tried another post processor that used G28.1.

G28.1 worked (kind of). It would touch off on the material, trip the limit switch as designed, then raise up, and then move to touch down AGAIN on the limit switch a second time (only this time way slower). I read this was as designed to touch off twice to get more accuracy on the switch. It is usable but just way too slow, makes cuts take so much longer.

Then, I tried G28. I had it semi-working for a short period of time on a cardboard box that was taller (around 2" tall). I was fine tuning the switch offset in the post processor. I removed the cardboard box and then put in a piece of aluminum so I could see exactly what the cut height was, only this time, it didn’t work as intended.

I set the torch roughly on top of the aluminum, set x,y,z to zero in Mach. Then start, the torch would go down about an inch or 2, then raise up (no limit switch triggered, almost like G28 was ignored), then it would start with it’s cutting process, activating the torch relay, and moving to cut the part.

I’m having such a hell of a time with this touch off it is getting real annoying.

Any help would be appreciated.

This is @TomWS 's wheelhouse.

1 Like

I’ll have to look at my code tomorrow. I’ll post the code tomorrow. I work with too many CNC systems (>0) to remember the details for Mach3

I will say, he who embarks on a DIY CNC system has only one person to blame for problems.

4 Likes

Thanks guys.

@TomWS do you know if there is a setting somewhere to make it so 28.1 only touches off once instead of twice?

Here is my older Mach 3 Z Probe Code annotated (this has been replaced with an Ohmic sensor setup but that is beyond the scope of this discussion):

N0100 G00 X2.6306 Y0.8713                  (Move to Pierce Position)
N0130 G31 Z-2 F40.0                        (Lower Z until IHS switch tripped)
N0140 G92 Z-0.11                           (Set Z to IHS switch backlash value)
N0150 G01 Z0.1500                          (Move to Pierce Height)
N0160 M03                                  (turn on torch)
N0170 G04 P250                             (Pierce Delay)

Thanks Tom. For G31 to function, what kind of input does the limit switch need to be set as? I’m guessing it’s not a “z home” type switch but just a regular input? Or how do we set up the switch in Mach?

Research the Mach3 documentation on configuration, It describes it all.