Machsupport Forum

General CNC Chat => Share Your GCode => Topic started by: Kenneth on May 21, 2015, 05:50:36 AM

Title: Probe Script
Post by: Kenneth on May 21, 2015, 05:50:36 AM
below is the code i use to probe IDs. i like to know how to
use feed move. i want to be able to change the feed at the top instead
throughout the script. is this possible ? i tried Ffeed, but it laughed at me.
Thanks for any help !

NegMove = -10
PosMove = 10
Feed = 6


'probing = XY ID
'probe dia. = tapered till tip - - tip .104"
NegMove = -10
PosMove = 10
Code "G91 G31 F6 X"&NegMove            'X axis
While IsMoving()
Wend
SetOEMDRO(800,0)
Code "G00 X.2"
While IsMoving()
Wend
Code "G31 F6 X"&PosMove
While IsMoving()
Wend
Xdro = GetOEMDRO(800)
SetOEMDRO(800,Xdro/2)
While IsMoving()
Wend
Code "G90 G00 X0"
While IsMoving()
Wend                                   
Code "G91 G31 F6 Y"&NegMove            'Y axis
While IsMoving()
Wend
SetOEMDRO(801,0)
Code "G00 Y.2"
While IsMoving()
Wend
Code "G31 F6 Y"&PosMove
While IsMoving()
Wend
Ydro = GetOEMDRO(801)
SetOEMDRO(801,Ydro/2)
Code "G90 G00 Y0"
End
 
Title: Re: Probe Script
Post by: dude1 on May 21, 2015, 06:09:24 AM
Code "F10"         'slow down feedrate to 10 ipm
Title: Re: Probe Script
Post by: Kenneth on May 21, 2015, 06:12:41 AM
Thanks daniell,
if i put that at the beginning, after it hit G00 the rest of the
script will be in G00 mode. and i'm already going 6imp.
Thanks again



those aren't feed moves, but axis moves
Title: Re: Probe Script
Post by: dude1 on May 21, 2015, 06:20:40 AM
Code "G4 P0.25"  'pause  might pay to add pause in to you know its working properly and to give time for the Estop to be hit before the next move
Title: Re: Probe Script
Post by: Kenneth on May 21, 2015, 06:24:59 AM
i'm trying to change the feed at the top.
like ;
Feed = 6
then ;
Code "g31 F[Feed] X"&PosMove

that way i can change the feed in one area. is this possible ?

or even have two feeds
Feed1 = 6
Feed2 = 10
Title: Re: Probe Script
Post by: dude1 on May 21, 2015, 06:31:42 AM
feed is Code "F"
Title: Re: Probe Script
Post by: dude1 on May 21, 2015, 06:34:26 AM
look how the Code"F' is done in this code

Rem   VBScript To probe In the z axis    

If GetOemLED(801) Then            'check if English Units
   If GetOemLED(16)<>0 Then 'Checks for machine coordinates
         code "(Please change to working coordinates)"
   Else

   
   If GetOemLed (825) <> 0 Then       'check to see if the probe is already grounded or faulty
      Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
   Else
      Code "G4 P1"         'pause 1 seconds to give time to position probe plate
      PlateOffset = GetUserDRO(1151)   'get plate offset DRO
      CurrentFeed = GetOemDRO(818)    'get the current feedrate to return to later
      Code "F10"         'slow down feedrate to 10 ipm

      Rem Probe In the z direction
         ZNew = GetDro(2) - 6         'probe move to current z - 6 inches
         Code "G31Z" &ZNew
         While IsMoving()      'wait for probe move to finish
         Wend
   
         ZNew = GetVar(2002)       'read the touch point
         Code "G0 Z" &ZNew +.1      'move back  +.1 to hit point incase there was overshoot +.1
         While IsMoving ()
         Wend
   
      Rem End add lines   
   
      Code "F2"         'slow down feedrate to 2 ipm
      ZNew = GetDro(2) - .25      'probe move to current z - .25 inches
      Code "G31Z" &ZNew
      While IsMoving()      'wait for probe move to finish
      Wend

      ZNew = GetVar(2002)       'read the touch point
      Code "G0 Z" &ZNew       'move back to hit point incase there was overshoot
      While IsMoving ()
      Wend

      If PlateOffset <> 0 Then
         Call SetDro (2, PlateOffset)   'set the Z axis DRO to  plate thickness
         Code "G4 P0.25"       'pause for Dro to update.
         'ZNew = PlateOffset + 3.6315   'calc retract
         'Code "G0 Z" &ZNew       'put the Z retract height you want here
         Code("G53G0Z-0.5")      'Z retract

         While IsMoving ()
         Wend
         Code "(Z axis is now zeroed in English Units)"    'puts this message in the status bar
      
      End If

      Code "F" &CurrentFeed       'returns to prior feed rate
   End If
   End If         
Else                                             'This portion of script is for Metric Native Units

   If GetOemLed (825) <> 0 Then       'check to see if the probe is already grounded or faulty
      Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
   Else
      Code "G4 P1"         'pause 1 seconds to give time to position probe plate
      PlateOffset = GetUserDRO(1151)   'get plate offset DRO
      CurrentFeed = GetOemDRO(818)    'get the current feedrate to return to later
      Code "F300"         'slow down feedrate to 300 mmpm

      Rem Probe In the z direction
         ZNew = GetDro(2) - 150      'probe move to current z - 150 mm
         Code "G31Z" &ZNew
         While IsMoving()      'wait for probe move to finish
         Wend
      
         ZNew = GetVar(2002)       'read the touch point
         Code "G0 Z" &ZNew + 3      'move back  + 3 mm to hit point incase there was overshoot + 3 mm
         While IsMoving ()
         Wend
   
      Rem End add lines   

      Code "F50"         'slow down feedrate to 50 mmpm
      ZNew = GetDro(2) - 6      'probe move to current z - 6 mm
      Code "G31Z" &ZNew
      While IsMoving()      'wait for probe move to finish
      Wend

      ZNew = GetVar(2002)       'read the touch point
      Code "G0 Z" &ZNew       'move back to hit point incase there was overshoot
      While IsMoving ()
      Wend

      If PlateOffset <> 0 Then
         Call SetDro (2, PlateOffset)   'set the Z axis DRO to  plate thickness
         Code "G4 P0.25"       'pause for Dro to update.
         'ZNew = PlateOffset + 50      'calc retract
         Code("G53G0Z-12")
         'Code "G0 Z" &ZNew       'put the Z retract height you want here
         While IsMoving ()
         Wend
         Code "(Z axis is now zeroed in Metric units)"    'puts this message in the status bar
      
   End If

      Code "F" &CurrentFeed       'returns to prior feed rate
      Code "F200"
      Sleep 100
   End If   
End If     
     
Title: Re: Probe Script
Post by: Kenneth on May 21, 2015, 06:40:55 AM
i understand. but to change your feed you'll have to go thru the script
and change each one. i understand that feed is modal and if i put
F6 at the top in would feed at 6 till it gets to G00 then ALL feeds will be G00
from there. "I" want to be able to change the feed in ONE place.
Is This Possible ?

Thanks
Title: Re: Probe Script
Post by: TPS on May 21, 2015, 06:45:28 AM
i'm trying to change the feed at the top.
like ;
Feed = 6
then ;
Code "g31 F[Feed] X"&PosMove

that way i can change the feed in one area. is this possible ?

or even have two feeds
Feed1 = 6
Feed2 = 10

Feed1 = 6
Feed2 = 10

Code "G31 F" & Feed1 & " X" & PosMove

Code "G31 F" & Feed2 & " Y" & PosMove

Title: Re: Probe Script
Post by: dude1 on May 21, 2015, 06:53:58 AM
do what TPS says
Title: Re: Probe Script
Post by: Kenneth on May 21, 2015, 06:57:15 AM
Thanks TPS.

but i tried the below and get script error.

Code "G31 F"&Feed & " X"&NegMove
Title: Re: Probe Script
Post by: TPS on May 21, 2015, 07:02:33 AM
your code:
Code "G31 F"&Feed & " X"&NegMove
my code:
Code "G31 F" & Feed & " X" & NegMove

i never figured out when you have to make spaces and when not, so i do them allways.
Title: Re: Probe Script
Post by: Kenneth on May 21, 2015, 07:13:09 AM
Thanks Daniell and TPS. this is what i got and works !
didn't know about spaces. Thanks TPS

'probing = XY ID
'probe dia. = tapered till tip - - tip .104"
NegMove = -10
PosMove = 10
Feed = 6
Code "G31 F" & Feed & " X" & NegMove           'X axis
While IsMoving()
Wend
SetOEMDRO(800,0)
Code "G00 X.2"
While IsMoving()
Wend
Code "G31 F" & Feed & " X" & PosMove
While IsMoving()
Wend
Xdro = GetOEMDRO(800)
SetOEMDRO(800,Xdro/2)
While IsMoving()
Wend
Code "G00 X0"
While IsMoving()
Wend                                    
Code "G31 F" & Feed & " Y" & NegMove          'Y axis
While IsMoving()
Wend
SetOEMDRO(801,0)
Code "G00 Y.2"
While IsMoving()
Wend
Code "G31 F" & Feed & " Y" & PosMove
While IsMoving()
Wend
Ydro = GetOEMDRO(801)
SetOEMDRO(801,Ydro/2)
Code "G00 Y0"
End