Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: jandrea95 on February 02, 2016, 12:28:39 PM

Title: @ TP
Post by: jandrea95 on February 02, 2016, 12:28:39 PM
Hey TP I just now saw you replied to me over @ candcnc and asked me to post this here.

IF you ask this over at the Mach3 support forum I can help you . IF I did it here TOm and I would probably tie up and argue and you would get no help. You should be able to do everything you need to do from the M3 macro to get to the pierce point.

http://www.machsupport.com/forum/index.php

(;-) TP


I sincerely appreciate your help! Let me know if you need more info.
Title: Re: @ TP
Post by: BR549 on February 02, 2016, 01:29:37 PM
Explain again what exactly do you need to do.
Title: Re: @ TP
Post by: jandrea95 on February 02, 2016, 01:36:23 PM
Bless you for such a quick reply! Haha.

Ok, basically I have an HVAC program called Vulcan that makes input of what I do very simple. It is what generates my g-code. That being said it does NOT include any sort of Z axis coding, only X and Y. When I run it around my table with the torch off there are no issues, it follows the pattern etc, but again, no up and down torch movement. There IS a call for M3, but it simple turns the torch on in mid air.

So, what I wanted to do is incorporate something in with my M3 macro that would perform a touch off before every call for the torch (I know seems silly but I use very thin metal and wanna be careful). On an M3 call I want my torch to do the following if possible:

- Come down to the metal surface (I have an ohmic sensor) and stop
- Come up slightly for a switch offset
- Go up to .08" (my pierce height)
- Ignite torch

- DTHC would then take over from here.

I guess I would need something with M5 to bring the torch back up so it doesnt drag material as well.
Title: Re: @ TP
Post by: BR549 on February 02, 2016, 05:06:36 PM
OK do you want to do teh TOM(top of material routine) with a G28.1 move or a G31 move ?? Your choice there.

Do you know how to work with Mach3 macros or need help there also??  Help is not a problem just need to know what you need.
Title: Re: @ TP
Post by: jandrea95 on February 02, 2016, 06:03:54 PM
I am a little ignorant as to the differences but I would prefer the one that doesnt "assume" a home if that makes any sense. For example with our thin sheet metal the "top of material" may vary a little bit over the length of a 10' sheet. I could certainly use some help with the macros and would be very appreciative.

Thanks much!
Title: Re: @ TP
Post by: BR549 on February 02, 2016, 06:58:43 PM
Do you work in Metric or Inches ??

Can you post your current M3 and M5 code ?
Title: Re: @ TP
Post by: jandrea95 on February 02, 2016, 07:22:03 PM
I am in inches. My current M3 code is the standard Do spin CW ()
Title: Re: @ TP
Post by: BR549 on February 02, 2016, 07:38:09 PM
OK your new M3 will look like this.  You could put DROs on teh screen to be able to set teh variables from teh screen


'M3 Macro
SwitchOffset = .110
PierceHeight = .080
PierceDwell = 1
SafeZ = .500
CutHeight = .060
'********************************
Code"Z" & SafeZ      'Goto a safe Z height
Code"G90"
Code"G31 Z-1 F30"  'Probe for the surface
While Ismoving()
Wend
Code"G91
Code"G0 Z" & SwitchOffset      ' Apply the switch offset
Code"G90"
Code"G92 Z0.000"   'Set Z to Zero at Material Surface
Code" G91"
Code"G0 Z"  & PierceHeight   ' Move to pierce height
Code"G90"
While Ismoving()
Wend
DoSpinCw()        'Torch on
Code" G04 P" & PierceDwell    ' Add pierce Dwell
Code"G0 Z" & CutHeight        ' Lower to cut height
End


AND teh M5 would look like this

DoSpinStop()
SafeZ = .500
Code"G91
Code"G0 Z" & SafeZ    ' Raise Z to safe Z height
Code"G90"
End


Title: Re: @ TP
Post by: jandrea95 on February 02, 2016, 07:40:08 PM
Amazing, ill try it first thing in the AM. Very very appreciative of your time.
Title: Re: @ TP
Post by: BR549 on February 03, 2016, 11:09:32 AM
One thing to double check is HOW you have teh Ohmic setup for this code to run correctly it must be setup as a Probe input not a Home input. You need to check your setup . IF it is useing teh Home input You need to tweeek the code to use G28.1 instead of teh G31.

(;-) TP
Title: Re: @ TP
Post by: jandrea95 on February 03, 2016, 11:12:11 AM
I kind of figured that out and have been playing with it haha. So do I simply replace 31 with 28.1? It is doing a little bit of strange things right now such as it begins to go down, but then stops ABOVE the metal and ignites the torch randomly. I am going to keep playing with it.

Also should I add sleep delays in the macro?

Thanks!
Title: Re: @ TP
Post by: BR549 on February 03, 2016, 07:12:15 PM
Post exactly what you have in the script and a play by play of exactly what it does .

First where do you have teh ohmic sensor signaling to the Home or Probe input. That will determine whether to use G28.1 or G31.

(;-) TP
Title: Re: @ TP
Post by: jandrea95 on February 04, 2016, 11:24:47 AM
I will go out at lunchtime and check the script but for now I can say the ohmic is basically connected as my Z "home switch". So for instance if I go into diagnostics and place a piece of metal against my torch tip my Z home lights up. I do have an ACTUAL switch as an emergency stop, but that doesnt really factor in to this I dont believe.

To clarify I want to physically find the metal surface each time an M3 is commanded. This is due to the fact some of my thin metal is very wavy and even though my table is level, my material is not. So I want to do the following:

Every time M3 is called:

- Torch is lowered until the ohmic (Z home switch) senses metal.
- Auto zeros out as this is the 0 point.
- Comes up .003 inches as this is what it takes to slide a piece of paper under the tip.
- Auto zeros out again
- Comes up .08 inches (pierce height)
- Turns on torch (there is no pierce delay for my metal)
- Lowers to .002 inches (work height off metal surface)
- Then my DTHC will take over and x and y will do their thing.

Then for a torch off M5 command:

- Turn off torch
- Raise to 1 inch or so (so I dont snag going to my next piece).


Hopefully I am stating this clearly, I am fairly new to this, but I am sure you hear that a lot. I appreciate you being so patient with me.

Thanks,

Jason
Title: Re: @ TP
Post by: BR549 on February 04, 2016, 01:28:57 PM
AH ok that does make a difference try it this way.

'M3 Macro
SwitchOffset = .110
PierceHeight = .080
PierceDwell = 1
SafeZ = .500
CutHeight = .060
'********************************
Code" G90"
Code"G00 Z" & SafeZ      'Goto a safe Z height
Code"G28.1 Z.500 "  'Probe for the surface
While Ismoving()
Wend
Code"G91
Code"G0 Z" & SwitchOffset      ' Apply the switch offset
Code"G90"
Code"G92 Z0.000"   'Set Z to Zero at Material Surface
Code" G91"
Code"G0 Z"  & PierceHeight   ' Move to pierce height
Code"G90"
While Ismoving()
Wend
DoSpinCw()        'Torch on
Code" G04 P" & PierceDwell    ' Add pierce Dwell
Code"G0 Z" & CutHeight        ' Lower to cut height
End
Title: Re: @ TP
Post by: jandrea95 on February 04, 2016, 01:59:56 PM
It doesnt seem to be working. The torch comes up to 1" for some reason, and the torch fires 1" above the table? It isnt probing
Title: Re: @ TP
Post by: BR549 on February 04, 2016, 03:42:21 PM
That would indicate that your Home signal is already on when it goes to probe.

Change teh active hi/low state for teh Zhome signal
Title: Re: @ TP
Post by: jandrea95 on February 04, 2016, 04:33:10 PM
It isnt though, its very strange. However when I go into the VB script editor it all works fine. If I go line by line in your code it works. But ran live time in my M3 macro as part of my program it doesnt want to work proper.
Title: Re: @ TP
Post by: BR549 on February 04, 2016, 05:13:49 PM
OK try it this way.

'M3 Macro
SwitchOffset = 0
PierceHeight = .080
PierceDwell = 1
SafeZ = .500
CutHeight = .060
'********************************
Code" G90"
While Ismoving()
Wend
Code"G00 Z" & SafeZ      'Goto a safe Z height
While Ismoving()
Wend
Code"G28.1 Z.500 "  'Probe for the surface
While Ismoving()
Wend
Code"G91
While Ismoving()
Wend
Code"G0 Z" & SwitchOffset      ' Apply the switch offset
While Ismoving()
Wend
Code"G90"
While Ismoving()
Wend
Code"G92 Z0.000"   'Set Z to Zero at Material Surface
While Ismoving()
Wend
Code" G91"
While Ismoving()
Wend
Code"G0 Z"  & PierceHeight   ' Move to pierce height
While Ismoving()
Wend
Code"G90"
While Ismoving()
Wend
DoSpinCw()        'Torch on
Code" G04 P" & PierceDwell    ' Add pierce Dwell
Code"G0 Z" & CutHeight        ' Lower to cut height
End
Title: Re: @ TP
Post by: Overloaded on February 04, 2016, 05:21:23 PM
It doesnt seem to be working. The torch comes up to 1" for some reason, and the torch fires 1" above the table? It isnt probing

Is the Z homing direction configured backwards ?
Title: Re: @ TP
Post by: jandrea95 on February 05, 2016, 08:54:17 AM
Hey TP were getting very close but still not probing. Step by step in the VB editor it works FLAWLESS. Torch moves to .5, probes to surface, etc. However when ran live time it goes to safe Z .5, but then skips probe, resets to 0 per Z92 and then applies then goes UP to pierce height. Direction everything works, and ran step by step it works. But in live application it is like it is skipping the probe command.
Title: Re: @ TP
Post by: jandrea95 on February 05, 2016, 10:25:55 AM
Ok TP I believe your code is PERFECT. I did a step by step to see what was going on and see something that is indeed skipping the G28. It is an error, dont quote me on this but something to the effect of "G28 and G30 not allowed with cutter compensation". I indeed do have a G42 being generated by my code. So I gotta try and find a way around that. But the error indeed specifically stated the error was BLOCKING the G28.1 Z.5" command.
Title: Re: @ TP
Post by: BR549 on February 05, 2016, 10:35:16 AM
OK YES you do indeed have to come OUT of any offsetting to use G28.1.  But with plasma why would you be using offsets ? Just curious or did your old CAM does it.

You can program around that problem add this to the start of the script of the script.   Can you post a copy of the file. It may help IF I can see exactly what the Gcode looks like in actual useage.  IF we can get that cleared up it may be we can trim back some of the script to make it work better(faster).

Code"G49 G40 "   ' cancel offsets
While Ismoving()
Wend
Title: Re: @ TP
Post by: jandrea95 on February 05, 2016, 04:04:29 PM
TP I will get you some more info Monday. Just wanted to say I am hugely thankful for you. I got everything working great! Now I need to play with my DTHC settings till it works well. It does weird things but probably because im @ high speeds (350 ipm). For instance it will track UP with material, but when the material goes back down it just keeps a straight line and doesnt attempt to correct itself
Title: Re: @ TP
Post by: BR549 on February 05, 2016, 05:24:26 PM
That would be a setting in teh DTHC  tip saver is probably locking you out (;-) or teh Minmax setting in mach3  or (;-) the list goes on.

Holler if you need more help, you know where I can be found.

(;-) TP