Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: moxy on April 25, 2020, 03:12:33 PM

Title: zero z axis in plasma
Post by: moxy on April 25, 2020, 03:12:33 PM
Hi All, I have just completed the hardware installation of a height checker and need some help with a subroutine to auto reset the z height during the execution of a plasma gcode. My sensor is a small pneumatic cylinder with a reed switch attached which I can adjust to a preset position. i have used the coolant function to deploy the probe which stops below the plasma nozzle so i can move the z axis down until the switch triggers, at this point I want to do aG92 to reset the z axis height and carry on with the job until the next move/cut. I have tried a subroutine which appears to work (does the motions etc) but does not reset the z height. See my sub below.

O1000
M7                   ( deploys the  probe )
G1 z3.000 Fxx  (slowly moves z down until switch triggers. Z going down moves probe up)
G92 Z*********x       (Resets the z height with the known value)
M9                   (stows the probe)
M99                 (return to the main gcode)

Any help will be very welcome!
Title: Re: zero z axis in plasma
Post by: Graham Waterworth on April 25, 2020, 06:18:55 PM
Why are you not using a G31, movement stops when it switches and you read #2002 which is the Z touch point.