Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: rrc1962 on February 12, 2011, 07:54:02 PM

Title: THC not working properly
Post by: rrc1962 on February 12, 2011, 07:54:02 PM
basically, Mach3 is acting like the THC function is turned off, but it's not.  All of the THC related LED's light as they should, such at ArcOK, THC Up and THC down, but Mach does not respond.  ArcOK is completely ignored and THC Up and Down is not working even though the LED's indicate that these functions are working.  The system operates as if it's running a router.

The only thing different is that the ArcOK, THC Up and THC Down pins are mapped to modbus inputs.  I know they are mapped correctly because the LED's light.

Has anyone had issues with the Mach3 THC mode not working at all even though it is on and LED's function properly?

Thanks
Title: Re: THC not working properly
Post by: stirling on February 13, 2011, 03:28:53 AM
Is this a licenced or demo Mach3?
Title: Re: THC not working properly
Post by: rrc1962 on February 13, 2011, 11:05:45 AM
Licensed.  The THC function has been working fine.  I just switched over to a different THC that uses the modbus instead of a second PP.
Title: Re: THC not working properly
Post by: stirling on February 13, 2011, 12:16:19 PM
AFAIK, the required THC functionality is coded "inside" the PP driver. That's one reason why THC doesn't work with the smoothstepper for example. I suspect, that as you're using the modbus for these signals and therefore not using the PP, then you're suffering from the same problem.

Ian
Title: Re: THC not working properly
Post by: rrc1962 on February 13, 2011, 01:56:30 PM
But I can control virtually every aspect of Mach over the Modbus.  Why would the THC function be coded differently than everything else?  You can even select THC inputs in a brain...but unfortunately, those don't seem to work either.  Can't even get the LED's to light that way.

Just doesn't make sense that when I map a jog input or trigger some event with a modbus input it works, but when I map a modbus input to any of the 3 THC functions, I get nothing...Well, nothing but the LED's.
Title: Re: THC not working properly
Post by: Hood on February 13, 2011, 02:20:04 PM
From my understanding THC and Probing are actually functions of the driver as they need the speed that only the driver can give in a PP connected system.


Hood

Oh also single point threading in Turn is also in the driver for a similar reason.
Title: Re: THC not working properly
Post by: rrc1962 on February 13, 2011, 02:35:48 PM
So there is no other way to drive THC functions other than a second PP?  And here I thought Art and Brian could walk on water. :(
Title: Re: THC not working properly
Post by: rrc1962 on February 13, 2011, 03:06:09 PM
Are the THC functions hard coded to the second PP or could an unused input on the primary PP be used?  The reason I ask is that if you use a stand alone THC that handles it's own motion control, the only input to Mach you would need is Arc OK, and it would be a shame to have to add a second PP just for that one input.  Any other communication, like the trigger to initiate torch reference, could be done through the modbus.
Title: Re: THC not working properly
Post by: Hood on February 13, 2011, 03:37:41 PM
I dont know much about THC but I would be very surprised if the input was hard coded as nothing else in MACH is ;)

Hood
Title: Re: THC not working properly
Post by: rrc1962 on February 13, 2011, 05:03:56 PM
I've got it switched back over to PP control but I've still got nothing.  THC in Mach is definitely on.  I've got PP2 enabled and pin 15 mapped to Arc OK.  When the arc is good, the ArcOK LED lights so I know the mapping is good.

If I ground pin 15, the ArcOK LED lights.  If I then turn on the THC function in Mach, Mach should wait for an ArcOK signal before moving.  Forget about even having a THC connected.  If the THC function is on, Mach should wait for the ArcOK signal before moving, correct?   I should be able to put pin 15 on a button and Mach should wait until the button is pressed before moving.

The only difference between the profile I'm using for testing this and the profile I used with a Sound Logic THC is that in my mew profile I have modbus enabled, but as I said, I'm now controlling the THC through PP2.

What else is there that could cause Mach to ignore the THC commands? 
Title: Re: THC not working properly
Post by: rrc1962 on February 13, 2011, 05:53:38 PM
I wrote this little bit of code in a button to determine if the THC mode was actually on...

If isActive(THCON) Then
   MsgBox("THC is ON")
Else
   MsgBox("THC is OFF")
End If

When I press this button, even with the THC LED on, it tells me that the THC is off.  I'm at a loss.  There has to be something telling Mach to ignore THC commands even though THC is on.
Title: Re: THC not working properly
Post by: rrc1962 on February 13, 2011, 06:21:18 PM
Problem solved..and everything works through the modbus.  More testing will tell whether the modbus is fast enough to keep up with the height changes, but for now it works.

In the M3 macro you have...

DoSpinCW()

I replaced that with...

SetModOutput( 2, 1 )

Evidently Mach3 does something in regards to enabling THC commands when it executes, DoSpinCW() because after changing it to this...

DoSpinCW()
SetModOutput( 2, 1 )

Everything works.  DoSpinCW() does whatever it does to enable THC and the torch is fired via the modbus.

Title: Re: THC not working properly
Post by: stirling on February 14, 2011, 04:54:20 AM
Good you've made some progress. Looks to me as if some of the modio is done in the PP driver as well then. The thing with DoSpinCW is weird though because I use activateSignal(OUTPUT1) instead in M3, not a doSpinCW in sight and THC works just fine and dandy.

I wrote this little bit of code in a button to determine if the THC mode was actually on...

If isActive(THCON) Then
   MsgBox("THC is ON")
Else
   MsgBox("THC is OFF")
End If

When I press this button, even with the THC LED on, it tells me that the THC is off.  I'm at a loss.  There has to be something telling Mach to ignore THC commands even though THC is on.

The reason this doesn't work as you might have expected is... (and you're going to love this after your walk on water comment earlier)  ;D

what you're testing here is whether ArcOK is on or off - not whether THC is on or off. THCON is actually the signal name for ArcOK. But then that's what it's called in ports n pins too so it shouldn't be that surprising perhaps.

Please get back with whether modbus is fast enough for THC UP/DOWN -  I'd be interested. Personally I think THC via PP is only just keeping up - but then if some of the modio is done in the PP driver, it may be no different - who knows.

Ian

Title: Re: THC not working properly
Post by: rrc1962 on February 14, 2011, 09:51:00 AM
I think it will be on par with the PP.  Of course, the best option is a stand alone THC with PID control of the Z axis drive.