Hello Guest it is January 16, 2022, 11:44:35 PM

Author Topic: Mach3 input triggered jump next line of g coce  (Read 603 times)

0 Members and 1 Guest are viewing this topic.

Mach3 input triggered jump next line of g coce
« on: September 08, 2018, 02:54:32 AM »
Greetings to everyone!

Is it possible use physical limit switch to stop axis movement and after input triggered g code jumps to next line?
I have steelsheet nesting machine under construction.servomotor powered axis move steel sheet in horizontal line and vertical z axis hydraulic cylinder press punch tool to do made holes for steel sheet.
I turn z axis step/dir signal to +-10V signal using external card and this give command hydraulic propotional servo valve.
I think so this case z axis not move linear,depending hole diameter and material hardness/tights it need different  hydraulic pressure/time to punch hole in sheet.
In my mind this z axis movement not need be so accurary to use anykind position encoder,some types limit switch would be practical to control hydraulic cylinder movement.
Is any way to get program jumps next line of g code after input triggering...
Re: Mach3 input triggered jump next line of g coce
« Reply #1 on: September 08, 2018, 10:06:28 PM »
I would think that possible in Mach3.

I have started using Mach4 and I know I could program Mach4 to do that, and I presume it could be done in Mach3 as well but I'm no expert in VB
so I cannot help you with it. If you wanted to try Mach4 I would help with a Lua macro which would do as you require.

Ignoring the differences between Mach3 and Mach4 the general idea is:
1) The motion of the Z axis is controlled by a macro, say m111
2) When m111 is called from the Gcode job:
     2a)The Z axis (hydraulic cylinder) is directed to move downwards to punch the material
     2b) The Z axis completes its move as detected by the lower limit switch. Note that depending on the material will vary in time. That's OK because Mach is going to
           wait until the limit switch activates
     2c) The Z axis is directed to move upwards, ie retract
     2d) The Z axis completes the retraction as signaled by the upper limit switch, Mach waits until the upper limit is activated
     2e) The macro m111 is complete and control reverts back to the main Gcode calling program
3) The Gcode job progresses, calling m111 at each instance the Z axis is required to punch a hole.


My wife left with my best friend...
     and I miss him!