Mach3 THC off-THC on g code?

Mach3 and Mach4 questions, tips and topics can be posted here
Post Reply
tm america
2.5 Star Member
2.5 Star Member
Posts: 150
Joined: Sat Feb 23, 2013 12:24 am

Mach3 THC off-THC on g code?

Post by tm america »

I have been looking everywhere for the answer to this question and coming up empty?Which g code is used to enable and disable the THC in mach3?I want to set it up so sheetcam writes the g code to turn the thc off and on when the cutting rules dictate..But i am not seeing anywhere in mach to set this up nor am i finding anything as far as documentation on the art soft website about it..I know it can and has been done..Is there are standard g code that is set for thc off?thc on? Or is there somewhere in mach to set it up? Thanks in advance ..
User avatar
acourtjester
6 Star Elite Contributing Member
6 Star Elite Contributing Member
Posts: 7770
Joined: Sat Jun 02, 2012 6:04 pm
Location: Pensacola, Fla

Re: Mach3 THC off-THC on g code?

Post by acourtjester »

I think the main stumbling point is finding a post processor that would do it for you you would need Les to write one for you and then use that to control a relay to shut off power or the arc ok signal. Timing may also be an issue as to how quickly it could be done.
DIY 4X4 Plasma/Router Table
Hypertherm PM65 Machine Torch
Drag Knife and Scribe
Miller Mig welder
13" metal lathe
Small Mill
Everlast PowerTig 255 EXT
User avatar
SeanP
4 Star Member
4 Star Member
Posts: 950
Joined: Thu Aug 01, 2013 11:50 am
Location: Co Kerry, Ireland

Re: Mach3 THC off-THC on g code?

Post by SeanP »

I am using S20 to turn on & S10 to turn off.
Clip_4.jpg
Clip_4.jpg (71.1 KiB) Viewed 4627 times
Powermax XP45
Home built table, Candcnc DTHC 2, Dragoncut 620-4
R-Tech 210 Tig, Jasic 250 mig
Sheetcam, Scanything, Coreldraw
Table build gallery
tcaudle
4 Star Elite Contributing Member
4 Star Elite Contributing Member
Posts: 1353
Joined: Tue Feb 28, 2012 6:47 pm

Re: Mach3 THC off-THC on g code?

Post by tcaudle »

tm america wrote:I have been looking everywhere for the answer to this question and coming up empty?Which g code is used to enable and disable the THC in mach3?I want to set it up so sheetcam writes the g code to turn the thc off and on when the cutting rules dictate..But i am not seeing anywhere in mach to set this up nor am i finding anything as far as documentation on the art soft website about it..I know it can and has been done..Is there are standard g code that is set for thc off?thc on? Or is there somewhere in mach to set it up? Thanks in advance ..
There is no G code to turn THC on or off
Mach has a THC on and THC off function . You have to write a macro that calls the function. If you have a button on your screen that does it you can simply write two macros to turn the THC ON or the THC off.

Here is one that looks at the THC LED to see if its on or off then clciks the button if it needs to
Macro M101.m1s

'turn off THC
If GetOEMLED(24) Then
Call DoOEMButton(123)
END if

M102.m1s

'turn on THC
If GetOEMLED(24) = False Then
Call DoOEMButton(123)
END i

So those work a treat as long as you don't call the macro during motion. The probelm is that macros in G code in MACH get parsed like any other command line and get executed so motion stops until the code is executed . There is no practical way to do a dynamic THC ON/OFF in g-code with conventional macros.

The 's" code works with the fact that S commands are executed in a line of motion so they do not cause a pause . Before you get excited to make an S code do anything but change the RPM value in MACH you have to have a custom plugin that can translate a value and call a function internally. Even then there will be some delay . If you have a THC (hardware) that can enable or disable the UP /DOWN signals (basicaly turning it off , you can use an output to hardware disable the THC signals but you have to use a method that does not depend on a true macro.

There is one set of macros (M10 & M11) that are NOT handled by MACH the same way and get processed outside motion. The only probelm is that all you can do with M10 and M11 is turn an output one or off (example M10P1 turns off output1). With some fancy redirect you can map an output to a function in MACH . The other way is to have it mapped to a real output and have that disable the THC hardware rather thantrying to turn off the THC logic in MACH
tm america
2.5 Star Member
2.5 Star Member
Posts: 150
Joined: Sat Feb 23, 2013 12:24 am

Re: Mach3 THC off-THC on g code?

Post by tm america »

I already have the sheetcam post processor set up to do this i have this function set up on my controllers along with being able to control 8 more relays. Les was super helpful getting me set up with the basic post processor..I have added alot to it. but with mach and most of the mach controllers there is just a spindle relay?So doing it with a relay would require a different controller..The machine i am trying to add the feature to has a tb6560 controller.. Super basic no extras..So i am looking at the THC off-on button on the screen thinking it must be possible to disable it in mach which i guess should be able to be done in mach..But the documentation sucks for this..I guess i need to do more research on setting up macros in mach?
This is an old mach machine i built before i started using my new controllers ..Now that i have the machines doing so much with the new set up it is really hard for me to use a mach machine..Cant believe the difference having the path rules dialed in with the right machine vs old technoligy ..What a difference in cut quality..Old set up you either get good circles or speed.. with the new set up everything is laser quality and almost zero dross..
vmax549
3 Star Member
3 Star Member
Posts: 399
Joined: Wed Oct 14, 2009 10:22 pm

Re: Mach3 THC off-THC on g code?

Post by vmax549 »

You may want to try a { Brain } to watch the S value and set the thcon/off according to S value S1000 = THCon S2000 = THCoff

OR possibly a { macropump } section to watch it.

(;-) TP
desmond
1/2 Star Member
1/2 Star Member
Posts: 3
Joined: Thu Apr 20, 2017 6:36 am

Re: Mach3 THC off-THC on g code?

Post by desmond »

Hi all,

I am struggling to get the thc disabled and enabled for hole cutting.

My setting are as tcaudle mentioned in his post, for the m101 and m102 codes and are stored in the macros folder. What bugs me is that when entered into the dmi the led switches on and off (using thc 300 screenset) but on actual cutting, the torch still dives into the plate (cutting @ 40%).

Mach-3
Sheetcam with mp1000-thc post
Cnc controls and thc from Leeuwinga.

Can someone please assit me with this...
User avatar
acourtjester
6 Star Elite Contributing Member
6 Star Elite Contributing Member
Posts: 7770
Joined: Sat Jun 02, 2012 6:04 pm
Location: Pensacola, Fla

Re: Mach3 THC off-THC on g code?

Post by acourtjester »

If the torch is diving at the start of cutting (after pierce) you may look to see if you have a delay you can add to allow the arc voltage to stabilize.
This will hold off the THC for about 1.5 to 2 seconds.
DIY 4X4 Plasma/Router Table
Hypertherm PM65 Machine Torch
Drag Knife and Scribe
Miller Mig welder
13" metal lathe
Small Mill
Everlast PowerTig 255 EXT
desmond
1/2 Star Member
1/2 Star Member
Posts: 3
Joined: Thu Apr 20, 2017 6:36 am

Re: Mach3 THC off-THC on g code?

Post by desmond »

acourtjester wrote:If the torch is diving at the start of cutting (after pierce) you may look to see if you have a delay you can add to allow the arc voltage to stabilize.
This will hold off the THC for about 1.5 to 2 seconds.

Hi acourtjester,

Where will I be able to add/set that?

Thank you
tcaudle
4 Star Elite Contributing Member
4 Star Elite Contributing Member
Posts: 1353
Joined: Tue Feb 28, 2012 6:47 pm

Re: Mach3 THC off-THC on g code?

Post by tcaudle »

If you have no way to software control the THC ON/OFF then you cannot program in a delay unless your THC has that option. The Macro you talk about will not work because they create a motion pause as they execute so do not work embedded in a motion line. There are some ways to use M10 and M11 to do that but you have to have an input on the THC to disable / enable the THC function and assign the M10 off code to an ouput physically connected to that designated input.
User avatar
East German
4 Star Elite Contributing Member
4 Star Elite Contributing Member
Posts: 580
Joined: Sat Jan 05, 2013 8:21 am
Location: Stapelburg Germany

Re: Mach3 THC off-THC on g code?

Post by East German »

Hello


I make with relay works very well.

Peter
THC off.jpg
THC off.jpg (46.23 KiB) Viewed 3308 times
RelaisTHC.jpg
RelaisTHC.jpg (55.76 KiB) Viewed 3308 times
Sorry for my language! The last English class was in 1982.

Homemade CNC Plasma-Watertable
MyPlasmCNC
Hypertherm Powermax 85
Machine Torch
Hypertherm Powermax 1100
Machine Torch
Post Reply

Return to “Mach3 & Mach4 CNC”