Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: pacguy on June 27, 2020, 10:00:13 AM

Title: Using mach 3 to control a laser and need to disable it whentraveling
Post by: pacguy on June 27, 2020, 10:00:13 AM
Hi all,

I've been using mach 3 for the last year to run my laser and the only issue I have is that the laser runs continuously while traveling. I use it to create stencils for my work and it occasionally wrecks some of the more detailed parts. I use the m7/coolant option to toggle the laser and am wondering if it is possible to configure mach 3 to disable/enable the coolant when Z is at a specific value. I've seen a few things on using the VB script editor but I'm not sure if that is the correct option.

My settings on ports & pins are output #3, port 3, pin 1 and the coolant is set for #3 on the spindle tab. I would like to toggle it so that coolant is on when Z is at or below -0.01 and off when it is at or above 0.00.

Any help would be greatly appreciated.

Title: Re: Using mach 3 to control a laser and need to disable it whentraveling
Post by: TPS on June 28, 2020, 06:41:00 AM
you can do this with a few lines in macropump macro. make sure it is enabled in General config, and you remove Output3
in spindle tab.

Code: [Select]
'turn output ON
If GetDro(2) < -0.01 Then
ActivateSignal(OUTPUT3)
End If

'turn output OFF
If GetDro(2) >= 0.0 Then
DeactivateSignal(OUTPUT3)
End If
Title: Re: Using mach 3 to control a laser and need to disable it whentraveling
Post by: Tweakie.CNC on June 28, 2020, 06:58:48 AM
Hi Pacguy,

You should also consider using the commands M11Px / M10Px (where x is the Output# configured as the laser trigger) which were specially introduced into Mach3 for laser control. These commands are motion linked to prevent unwanted laser burns (at the start and finish of laser lines) as are created by the delays introduced from the standard M3 / M4 / M5 / M7 / M8 / M9  commands.

Tweakie.
Title: Re: Using mach 3 to control a laser and need to disable it whentraveling
Post by: pacguy on July 11, 2020, 12:14:13 PM
Thanks TPS, that did the trick. I've been using it for a week now with no issues.  :D

you can do this with a few lines in macropump macro. make sure it is enabled in General config, and you remove Output3
in spindle tab.

Code: [Select]
'turn output ON
If GetDro(2) < -0.01 Then
ActivateSignal(OUTPUT3)
End If

'turn output OFF
If GetDro(2) >= 0.0 Then
DeactivateSignal(OUTPUT3)
End If