Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Hood on November 29, 2016, 05:16:19 PM

Title: Question for Plasma guys on material sensing
Post by: Hood on November 29, 2016, 05:16:19 PM
How do you plasma guys do material sensing, is it G31 G28 or some other way?
Do you have the routine in the M3 macro or do you have separate lines that your post processor spits out or some other method?

Reason I am asking is with mine I have been using a modified  M31 macro that comes with the CS Lab controllers but I am having endless problems with it. I was thinking of just modifying the M3 macro to do a G31, move to pierce height then  turn on the torch.

Hood
Title: Re: Question for Plasma guys on material sensing
Post by: TOTALLYRC on November 29, 2016, 07:42:50 PM
I am not sure what was under the covers of the one I worked on last weekend but is how it seamed to function. It would go down, probe the material height, then go up to the pierce height, pierce and go down at feedrate to cut height, then go on its merry way.

Mike
Title: Re: Question for Plasma guys on material sensing
Post by: RICH on November 29, 2016, 07:50:07 PM
FWIW,
Here is the macro that  a friend uses. I think it  is run every time the torch is moved to the next cutting operation.
Takes care of warpage on thin material.
Quote
I am a complete dumb dumb about plasma.

Oh, BTW, Lazycam can be used for plasma...."if" I remember correctly you use the  Mill modul for pathing, but use the Plasma to generate the code. He uses it all the time and works fine.

Call SetOEMDRO(802, 0) 'Set Z DRO = 0.00
 Code "G31 Z-8.0 F60" 'probe surface
While IsMoving()
Wend
Code "G4 P.5" 'wait
ZprobePos = GetVar(2002) 'get contact point
Code "G0 Z" &ZprobePos 'return to point to remove overshoot
While IsMoving()
Wend
Call SetOEMDRO(802, 0) 'Set Z DRO = 0.00
While IsMoving()
Wend
Code "G4 P.5" 'wait
Code "G0 Z.480 F30" 'remove floating head travel
While IsMoving()
Wend
Code "G4 P.0" 'wait
Call SetOEMDRO(802,.100) 'Set Z DRO = 0.00
While IsMoving()
Wend
ActivateSignal(Output2)



Again, FWIW,

RICH
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on November 30, 2016, 02:49:36 AM
Mike,
 yes they all tend to work that way, was more wondering the method used. I am using a modified CSMIO internal probing macro M31 but having issues. I was wondering if people are using the G31 or whether their height sensing was done by homing the Z.

Rich
 Using BobCAD for Mill, Lathe and now Plasma.

Thanks for the macro code, do you know if it is just a custom macro that he calls or is it part of the M3 macro? Any idea what Output 2 is for?
Title: Re: Question for Plasma guys on material sensing
Post by: TOTALLYRC on November 30, 2016, 05:52:53 AM
It must be using G31 because the switch is hooked up to the digitize input.
This was my first foray into Plasma so I am a little vague on how it works but we had to rewire the switch so that I know for sure.
Mike
Title: Re: Question for Plasma guys on material sensing
Post by: Davek0974 on November 30, 2016, 06:12:02 AM
G28.1 in a subroutine here.

Post just inserts the sub call, makes changing the routine easy as its only in one place :)
Title: Re: Question for Plasma guys on material sensing
Post by: RICH on November 30, 2016, 10:06:47 AM
Hood,
Will answer your question's later today.
 
Nice to see that there activity on plasma in here. I would venture to say "it's more of a lost child than the lathe". :D

Later,
RICH
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on November 30, 2016, 11:12:54 AM
Thanks  for the answers.
 As I was using the M31 macro which is a kind of internal CS-Lab macro I already had the switch set as a probe input.
 So I quickly wrote a custom macro (m124.m1s) which basically mimicked what I had in the M31 macro but instead used G31. It seems to be working fine so far, I have used it from MDI and also a button on my panel and easily over 100 times one after the other and it has worked perfectly where the M31 would definitely have failed after a lot less attempts. I have not tried from G Code yet but hopefully that is it working, fingers crossed ::)


Hood
Title: Re: Question for Plasma guys on material sensing
Post by: RICH on November 30, 2016, 03:09:31 PM
Hood,

The plasma machine that my friend uses is very basic and has no input control so he installed a relay to automate pulling the trigger.Handle is on a floating head.
The M3 macro turns the plasma machine on after probing / locates top of material then adjusts heigth, and provides a signal to activate a relay ( Output 2), sets some basic feed rates.

So typical cycle is:
- initial axis moves
- M3
  Probe and set tip to material
  Output 2 from Mach triggers a relay which closes the trigger circuit.
  run gcode
 - M5
   turn off pasma before retracting via M5 macro.

Repeat above cycle for each new pathing to be cut.


RICH

MACROS & GCODE EXAMPLE
------------------------
M3 MACRO
------------
Present_Feed_Rate = GetOEMDRO(818)
DeactivateSignal(Output2)
Call SetOEMDRO(802, 0) 'Set Z DRO = 0.00
Code "G31 Z-8.0 F60.0" 'probe surface
While IsMoving()
Wend
Code "G4 P.5" 'wait
ZprobePos = GetVar(2002) 'get contact point
Code "G0 Z" &ZprobePos 'return to point to remove overshoot
While IsMoving()
Wend
Call SetOEMDRO(802, 0) 'Set Z DRO = 0.00
While IsMoving()
Wend
Code "G4 P.5" 'wait
Code "G0 Z.480" 'remove floating head travel
Code "F" & Prestent_Feed_Rate
While IsMoving()
Wend
Call SetOEMDRO(802,.100) 'Set Z DRO = 0.00
While IsMoving()
Wend
ActivateSignal(Output2)
'Pierce Delay
Code "G4 P1.0" 'wait for example 5 second delay
'put G4 P5.0 in GCodde after each M3 line or uncomment the G4 code line above.


M5 MACRO
---------
DeactivateSignal(Output2)


EXAMPLE OF some GCODE ( posted by LazyCam Plasma Module )
--------------------------------------------------------
N5 (File Name = 2 2"SQUAREs )
N10 (Default Plasma Post)
N15  G91.1
N20 G0  Z60.0000  (bad posting value / bug/ need to change Z value to suite)
N25 G0  X0.0000  Y0.0000
N30 G0  Z0.0000
N35 M3(PLasma On)
N40 G4 P0.3000 (vary P value to suite / or set dwell in M5 macro)
N45 G1  Y2.0000  F60.00
N50  X2.0000
N55  Y0.0000
N60  X0.0000
N65 G4P0.40
N70 M5 (Plasma Off)
N75 G0  Z60.0000 (bad posting value / bug/ need to change Z value to suite)
N80 G0  X3.0000  Y0.0000
N85 G0  Z0.0000
N90 M3(PLasma On)
N95 G4 P0.3000  (vary P value to suite / or set dwell in M5 macro)
N100 G1  X5.0000
N105  Y2.0000
N110  X3.0000
N115  Y0.0000
N120 G4P0.40
N125 M5 (Plasma Off)
N130 G0 Z60.0000 (bad posting value / bug/ need to change Z value to suite)
N135 M30
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on November 30, 2016, 03:21:04 PM
Thanks Rich,
 what I have seems to be working at the moment but always good to have info just in case :)

Here is what I have in a custom macro m124.m1s

PierceHeight = GetUserDRO (1555)
ZOffset = GetUserDRO(1556)
XOffset = GetUserDRO(1557)
YOffset = GetUserDRO(1558)
ProbeSpeed = GetUserDRO(1559)
ZHeight = GetOemDRO(85)
Sleep 50

If ZHeight > -30 Then
Code "G91G0Z-30"
End If


SetHeight = (ZOffset - PierceHeight ) * -1

Code "G91G0Z20"
Code"G91"
Code"G0X" & XOffset & "Y" & YOffset
While IsMoving()
Wend


SetOutBit(90,10)
sleep 100
Code "G31Z-100F" & ProbeSpeed
While IsMoving()
Wend
ResetOutBit(90,10) 

 

Code"G91"
Code"G0X" & XOffset*-1 & "Y" & YOffset*-1 & "Z"& SetHeight
While IsMoving()
Wend
Code "G92Z" & PierceHeight
Code"G90"
Title: Re: Question for Plasma guys on material sensing
Post by: TOTALLYRC on November 30, 2016, 04:30:35 PM
Hood,
Looks like you are making progress using the G31.

Rich,
I now have Plasma envy after working on a CNC plasma for the first time!!!!

Dave,
FYI IIRC G28.1 doesn't work in Mach4 if you ever decide to upgrade.
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on November 30, 2016, 05:46:32 PM
Just tidied up the macro a wee bit and added comments so I can follow in a years time :D
Hopefully it will work tomorrow and I have not made any mistakes as my VB is, as you can see, basic but hopefully functional :D
Have also altered my screenset to add a few dros such as Probe Speed.

PierceHeight = GetUserDRO (1555)  'Screen DRO to enter Pierce Height required
ZOffset = GetUserDRO(1556)        'Screen DRO to enter Z offset of switch from torch
XOffset = GetUserDRO(1557)        'Screen DRO to enter X offset of switch from torch
YOffset = GetUserDRO(1558)        'Screen DRO to enter y offset of switch from torch
ProbeSpeed = GetUserDRO(1559)     'Screen DRO to enter speed of G31 probe
ZHeight = GetOemDRO(85)           'Machine coordinates DRO for Z Axis
Sleep 50
SetHeight = (ZOffset - PierceHeight ) * -1    'Calculate distance required to move Z back for pierce height

If ZHeight > -30 Then             'Check to see if Z Axis is less than 30mm from Z Max
Code "G91G0Z-30"                  'If it is then rapid to 30mm below Z Max
End If

Code "G91G0Z20"                               'Incrementally move Z to provide clearance for probe
While IsMoving()
Wend
Code"G91G0X" & XOffset & "Y" & YOffset        'Incrementally move X and Y to offset for probe distance from torch
While IsMoving()
Wend


SetOutBit(90,10)                              'Set output to air solenoid valve to extend probe
sleep 100
Code "G31Z-100F" & ProbeSpeed                 'Command probe routine at speed set by ProbeSpeed DRO
While IsMoving()
Wend           

ResetOutBit(90,10)                             'Reset output to air solenoid valve to retract probe

 
Code"G91G0X" & XOffset*-1 & "Y" & YOffset*-1 & "Z"& SetHeight 'Incremental move to set torch back to original position on X,Y and Pierce Height on Z
While IsMoving()
Wend
Code "G92Z" & PierceHeight                      'Set Z DRO to Pierce Height
Code"G90"                                       'Set back to absolute mode
       
Title: Re: Question for Plasma guys on material sensing
Post by: TOTALLYRC on November 30, 2016, 08:33:56 PM
Nice work Hood. I am not that good at VB either but the screen work is nice.
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 01, 2016, 05:34:14 AM
Well disaster, works every single time from MDI or button but fails every singe time from MDI.
Have to go get some welding done on a boat but will maybe get a chance to try separate macros for offsetting probe etc and have the G31 in the code.
Heres the failure video.
https://youtu.be/skNZ5zIKWJY
Title: Re: Question for Plasma guys on material sensing
Post by: Davek0974 on December 01, 2016, 05:45:04 AM
ePid fault - that is why i gave up on the G/M31 on my mill, could not get it to work at all.
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 01, 2016, 07:02:14 AM
Ah Ok Dave, didn't know, or if I did I forgot, that you had the epid with the probing (G31 and M31) Was thinking it was with tuning.

Will see what CS-Lab say but may try the homing way instead via a macro.

Title: Re: Question for Plasma guys on material sensing
Post by: stirling on December 01, 2016, 07:24:56 AM
Try putting a while isMoving loop after each of your last two code statements. i.e.

Code: [Select]
Code "G92Z" & PierceHeight                      'Set Z DRO to Pierce Height
While IsMoving()
Wend
Code"G90"                                       'Set back to absolute mode
While IsMoving()
Wend

I'm wondering if the gcode buffer is getting corrupted
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 01, 2016, 07:44:08 AM
Thanks Ian,
 just tried but still the same. It seems to be a CSMIO problem as it is stopping just after the probe is hit.
You get the message that Probing is started then CSMIO/IP Probe hit (ok) then immediately get the Driver has initialised message and the epid error.

Thanks anyway, was worth a try.


Title: Re: Question for Plasma guys on material sensing
Post by: stirling on December 01, 2016, 08:30:55 AM
Curious. I can't really see why if it works from the MDI, it doesn't when called from gcode.

Just took a look at the CSLabs site M31 macro: This comment makes me wonder:

Quote
Probing with M31 macro is done mainly by CSMIO/IP motion controller as an internal function. M31 macro can be freely extended and modified as you wish, what gives an user great opportunities.

Well G31 is always in the controller so I don't get why they've made the first point.

As far as the second point goes, I'm struggling to see what "great opportunities" their macro offers over putting G31 in your own macro.

All sounds a bit kludgy to me.

What happens if you just put a single simple G31 line in a macro? If that doesn't work I think I'd be asking CSLabs why not.
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 01, 2016, 10:15:17 AM
I always  wondered why myself.

Ok just  made 2 macros, first m124 with the first section of code that raises, offsets and fires probe.
Second has last part of code which retracts the probe then moves back etc.
I then altered the code to have

m124
g31z-100f500
m125

It ran the first part, did the G31 then failed after that.
I then put msgbox in after each operation in the m125 macro and it removes the probe solenoid signal then after I ok the message it fails with epid error.
The next line is

Code"G91G0X" & XOffset*-1 & "Y" & YOffset*-1 & "Z"& SetHeight

So that is where it is dying, not sure why, going to try with the Z move on another line and see if it is that that is the problem.

Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 01, 2016, 11:03:07 AM
Ok got the better of it I think, did as above but added G92Z0 after the G31 line in the G Code and it seemed to work.
So next I went back to the original G code with m124 only in it and went back to my original macro but I added
Code"92z0" after the G31 move in the code. It worked but went way too high on the Z for some reason.

So next I replaced the
Code"G92Z0" line with
SetOemDRO(802,0)
And it worked perfectly.

Cut two flanges out as a test, each flange had 6 x G31 moves in it and worked flawlessly. Why the G92 worked in code but not macro I have no idea but it is working so I am happy as that seems to be it more or less working as intended now.

Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 01, 2016, 11:41:44 AM
Just tried again to make sure :
1/4"Alu, bit slow but still worked great :)

https://www.youtube.com/watch?v=PJM1_TqGLPQ&feature=youtu.be
Title: Re: Question for Plasma guys on material sensing
Post by: stirling on December 01, 2016, 11:44:39 AM
good stuff
Title: Re: Question for Plasma guys on material sensing
Post by: Davek0974 on December 01, 2016, 02:13:10 PM
Looking good :)
Title: Re: Question for Plasma guys on material sensing
Post by: Chaoticone on December 01, 2016, 02:19:02 PM
Little circles, big circles and everything. Nice Hood!
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 01, 2016, 05:07:15 PM
Looking good :)

Well hopefully that is all the issues solved, might even try the wee computer again seeing as it fits nicely inside the cabinet.

Little circles, big circles and everything. Nice Hood!

Aye and lots of smoke circles too, need to get the fans sorted and dispense with the filter mask.

Title: Re: Question for Plasma guys on material sensing
Post by: TOTALLYRC on December 01, 2016, 05:18:30 PM
Plasma envy strikes again!!!

Nice work Hood. Glad to see you cleared the hurdles and made it to the finish line.


Mike
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 02, 2016, 05:18:50 PM
Well still working so I am calling it a sorted ::)
Making a base for a seat on a boat today, 3 retangles 400mm x 300mm and two right angle triangles 200 x 400. Shoved a half sheet of 5mm Alu on the Plasma, used Terry shape wizard (modified to suit my machine) had the rectangles and triangles cut out in less time than it would have taken me to measure and mark let alone cut with the saw :D

Ordered a fan today so hopefully I will be fume free next week.

Title: Re: Question for Plasma guys on material sensing
Post by: Chaoticone on December 02, 2016, 05:41:08 PM
Nice Hood! I know that is gonna help you out so much, so glad to see that.  :)

Quote
Ordered a fan today so hopefully I will be fume free next week.

I hope so too Hood.

Title: Re: Question for Plasma guys on material sensing
Post by: Davek0974 on December 03, 2016, 03:22:47 AM
Its probably the no1 accessory to have in a fab-shop, makes so many things possible that were either a PITA or just not do-able before.

Glad its working well now, must get that extract working though ;)
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 06, 2016, 03:20:24 PM
Just an update on this, Wojtek got back to me regarding the M124 macro, it seems Mach has issues with coordinates synchronization during G31. in versions after  044 and hence the epid error. Why it only affects it when run from G Code I have no idea but I installed 044 today and removed the write to Z dro line I had put in to get it working and it was fine.
 It  may have also cleared up an issue I had that if the computer was sitting idle for a long time it would kind of half lock up, for example I could jog etc but MDI would not do anything. Strange thing is I have 062  (which is what I was using) on all my other machines, one of which uses the IP/A, and I have no such issues. Will have to wait a while though to be sure it has cleared up that issue.

 Regarding the original M31 problem which lead to me to find this one, they are still looking into it and will let me know if they find the problem.



Title: Re: Question for Plasma guys on material sensing
Post by: Chaoticone on December 06, 2016, 03:24:09 PM
Thanks for the update Hood.

Did you get your fan yet?
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 06, 2016, 03:26:05 PM
Not yet, still waiting for the call to say it is in.
Title: Re: Question for Plasma guys on material sensing
Post by: Davek0974 on December 06, 2016, 03:34:01 PM
Interesting, that may explain whether told me to always install version 022, I did query this on the forum and it was decided that it was too old for consideration, maybe 044 is a better bet?
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 06, 2016, 04:18:10 PM
Interesting, that may explain whether told me to always install version 022, I did query this on the forum and it was decided that it was too old for consideration, maybe 044 is a better bet?

That is indeed interesting Dave. Ver 022 was the version I used on the wee lathe that improved the pullout at the end of the threading when using the IP/S, any version after that and the pullout was a lot slower. Problem with that version was Spindle Override did not work for me, also there were a few additions to things in Lathe after that version such as tool number DRO and description  to display correctly, and that is why I needed to use newer versions for the lathe.

Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 10, 2016, 03:29:54 PM
Ok freezing problem after sitting a long time idle was not solved by the older version as it happened again yesterday. It is a strange on as the machine will still jog via MPG but it won't respond to a button that has G Code in it X0Y0 button) but forgot to try out with some actual code. Hopefully I will remember next time it happens.
Title: Re: Question for Plasma guys on material sensing
Post by: Hood on December 11, 2016, 01:56:48 PM
Couldn't be bothered climbing up onto the plasma to see what the label said but  did the calcs and looks like it is 10.25:1 reduction box.
Now spot on :)