Hello Guest it is March 30, 2023, 04:32:09 AM

### Author Topic: Question for Plasma guys on material sensing  (Read 10785 times)

0 Members and 1 Guest are viewing this topic.

#### TOTALLYRC

• 861
##### Re: Question for Plasma guys on material sensing
« Reply #10 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.
We never have the time or money to do it right the first time, but we somehow manage to do it twice and then spend the money to get it right.

#### Hood

• 25,835
• Carnoustie, Scotland
##### Re: Question for Plasma guys on material sensing
« Reply #11 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
Hopefully it will work tomorrow and I have not made any mistakes as my VB is, as you can see, basic but hopefully functional
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

#### TOTALLYRC

• 861
##### Re: Question for Plasma guys on material sensing
« Reply #12 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.
We never have the time or money to do it right the first time, but we somehow manage to do it twice and then spend the money to get it right.

#### Hood

• 25,835
• Carnoustie, Scotland
##### Re: Question for Plasma guys on material sensing
« Reply #13 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

#### Davek0974

• 2,606
##### Re: Question for Plasma guys on material sensing
« Reply #14 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.

#### Hood

• 25,835
• Carnoustie, Scotland
##### Re: Question for Plasma guys on material sensing
« Reply #15 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.

#### stirling

• 2,188
• UK
##### Re: Question for Plasma guys on material sensing
« Reply #16 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 HeightWhile IsMoving()WendCode"G90"                                       'Set back to absolute modeWhile IsMoving()Wend`
I'm wondering if the gcode buffer is getting corrupted

#### Hood

• 25,835
• Carnoustie, Scotland
##### Re: Question for Plasma guys on material sensing
« Reply #17 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.

#### stirling

• 2,188
• UK
##### Re: Question for Plasma guys on material sensing
« Reply #18 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.

#### Hood

• 25,835
• Carnoustie, Scotland
##### Re: Question for Plasma guys on material sensing
« Reply #19 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.