Author Topic: Mach Built In Find Hole Centre Probe Routine  (Read 12817 times)

0 Members and 1 Guest are viewing this topic.

Offline M250cnc

  • Active Member
  • Posts: 591
    • View Profile
Mach Built In Find Hole Centre Probe Routine
« on: August 19, 2008, 11:48:53 AM »
Is it possible to edit the routine. If yes please mention how. ;D

I am using version 2.63 and what i do not like is it uses the current feedrate.

I want to SET a feedrate of MY chosing.

All help appreciated.

Phil_H
The Good Thing About Mach3, Is It's very Configurable

The Bad Thing About Mach3, Is It's Too Configurable

Offline budman68

  • Master of the Custodial Arts, or better known as:
  • Global Moderator
  • *
  • Posts: 2,360
    • View Profile
Re: Mach Built In Find Hole Centre Probe Routine
« Reply #1 on: August 19, 2008, 01:15:47 PM »
Ok, I'm sure Greg (greolt) or "poppabear" will be along to help with this shortly, but here's my code (which is like Gregs):

Rem   VBScript To center probe inside a pipe

If GetOemLed (825) <> 0 Then       'Check to see if the probe is already grounded or faulty
   Code "(Probe plate is grounded, check connection and try again)"
Else
   FeedCurrent = GetOemDRO(818)    'Get the current settings
   XCurrent = GetDro(0)
   YCurrent = GetDro(1)

   Code "G4 P1"         'Pause 1 second to give time to position probe plate
   Code "F4"         'slow feed rate to 4 ipm

Rem   Probe Left
   
   XNew = Xcurrent - 3      'probe 3 inches to left
   Code "G31 X" &XNew
   While IsMoving()      'wait for the move to finish
   Wend
   XPos1 = GetVar(2000)      'get the probe touch location

   Code "G0 X" &XCurrent      'rapid move back to start point

Rem   Probe Right
   
   XNew = XCurrent + 3      'probe 3 inches to right
   Code "G31 X" &XNew
   While IsMoving()
   Wend
   XPos2 = GetVar(2000)

   XCenter = (XPos1 + XPos2) / 2   'center is midway between XPos1 and XPos2
   Code "G0 X" &XCenter      'rapid move to the x center location

Rem   Probe up

   YNew = YCurrent + 3
   Code "G31 Y" &YNew
   While IsMoving()
   Wend
   YPos1 = GetVar(2001)

   Code "G0 Y" &YCurrent

Rem   Probe down
   
   YNew = YCurrent - 3
   Code "G31 Y" &YNew
   While IsMoving()
   Wend
   YPos2 = GetVar(2001)

   YCenter = (YPos1 + YPos2) / 2

Rem   move To the center
   
   Code "G0 Y" &YCenter
   While IsMoving ()
   Wend

   Code "F" &FeedCurrent        'restore starting feed rate
End If
 



Now notice where it says "Code "F4"   'slow feed rate to 4 ipm" ?

I believe that's where you change your feed rate but obviously try it first!

Dave

P.S. just a warning, going too fast can screw up the "touch" accuracy if I'm not mistaken! Proceed with caution!
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline M250cnc

  • Active Member
  • Posts: 591
    • View Profile
Re: Mach Built In Find Hole Centre Probe Routine
« Reply #2 on: August 19, 2008, 03:14:58 PM »
Thanks for that Dave.

It was the built in probe routine that i was after changing but i will try that one.

I agree about speed being important if i go too slow i get an error, and if i go too fast i **** myself  ;D  hence my desire to hard code it.

Then i will not have to go thought it again if i have the speed incorrect.

As your using IPM's you must be the other side of the pond although brought up on imperial i prefer M & M's

I actually find 200 MM PM is best "8 IPM"

Phil_H
The Good Thing About Mach3, Is It's very Configurable

The Bad Thing About Mach3, Is It's Too Configurable

Offline budman68

  • Master of the Custodial Arts, or better known as:
  • Global Moderator
  • *
  • Posts: 2,360
    • View Profile
Re: Mach Built In Find Hole Centre Probe Routine
« Reply #3 on: August 19, 2008, 03:54:23 PM »
Indeed I am Phil but I still love M&M's ...... especially the green ones  :D
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline Greolt

  • Active Member
  • Posts: 956
    • View Profile
Re: Mach Built In Find Hole Centre Probe Routine
« Reply #4 on: August 19, 2008, 09:35:38 PM »
Ok, I'm sure Greg (greolt) or "poppabear" will be along to help with this shortly, but here's my code (which is like Gregs):


Woah!!!!  I don't think my name should be mentioned in the same breath as Poppabear's   ;D ;D

I have to ask him the most basic questions.  ;D ;D  And I have never seen that code before.  Never even tried centring routines before.  ;D

Phill  what code are you asking about?  Can you open it in an editor?  Look for an F command and change it to what you want.

If it has none then G31 will use the last used feedrate.  But adding a line should be no problem.

Also see the following two line in Budman's code,

FeedCurrent = GetOemDRO(818) 'Get the current settings
    This one near the sart

Code "F" &FeedCurrent  'restore starting feed rate
     This one near the end

They restore the feedrate to what it was before running the routine.

Greg


Offline M250cnc

  • Active Member
  • Posts: 591
    • View Profile
Re: Mach Built In Find Hole Centre Probe Routine
« Reply #5 on: August 20, 2008, 01:43:21 AM »
Quote
Indeed I am Phil but I still love M&M's ...... especially the green ones  Cheesy

I love em all.  ;D

Quote
Phill  what code are you asking about?  Can you open it in an editor?  Look for an F command and change it to what you want.





As i say its the one that's inbuilt but having tried the one posted by Dave AKA budman68 i think that one is better as you don't have to unload your gcode to run it.

I applied the code to the centre button on the offsets page.

I did try with no success to change the X & Y DRO's to zero at the end of the routine.  :-[

Phil_H
The Good Thing About Mach3, Is It's very Configurable

The Bad Thing About Mach3, Is It's Too Configurable

Offline Greolt

  • Active Member
  • Posts: 956
    • View Profile
Re: Mach Built In Find Hole Centre Probe Routine
« Reply #6 on: August 20, 2008, 02:34:31 AM »
Phill

Budmans script does not zero X and Y at the end. It leaves that up to the operator.

If you want it to do so then just add these couple of lines to the last bit.

Rem   move To the center
   
   Code "G0 Y" &YCenter
   While IsMoving ()
   Wend

   Code "F" &FeedCurrent        'restore starting feed rate


   DoOEMButton ( 1008 )
   DoOEMButton ( 1009 )

End If


Greg
 

Offline M250cnc

  • Active Member
  • Posts: 591
    • View Profile
Re: Mach Built In Find Hole Centre Probe Routine
« Reply #7 on: August 20, 2008, 04:07:29 AM »
Thanks Greg

Phil_H
The Good Thing About Mach3, Is It's very Configurable

The Bad Thing About Mach3, Is It's Too Configurable

Offline budman68

  • Master of the Custodial Arts, or better known as:
  • Global Moderator
  • *
  • Posts: 2,360
    • View Profile
Re: Mach Built In Find Hole Centre Probe Routine
« Reply #8 on: August 20, 2008, 08:26:35 AM »
So Sorry, Greg, you are correct,  that was "erniebro"s code over at the CNC Zone.  :P
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)