. .

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    A tutorial to show the configuration of Mach3 (with standard screens) to find the center of a hole or pipe.
    the code is IN MILLIMETERS if you wish to use Imperial measurements you will have to edit the code accordingly.
    You must get this right or you could damage your machine or probe or worse!!
    I was not able to find a tutorial that started at the beginning for the novice, so why not have one here.
    This tutorial assumes you have fitted a probe on your system, and assigned it to an input, and that the large digitise led on the diagnostics tab in Mach3 lights when you activate it.
    Some of the buttons in Mach3, although shown on the screens do not do anything when pressed, this is because they have no code or script assigned to them.(Great idea that)
    In the few steps to follow, we will assign some code to a button for center finding, this procedure can be used with other buttons as well, as long as you can find the code for the button you wish to assign it too. The script/code we will be using is not mine, it has several authors as it has evolved over time and I’m sure it will evolve further in the future.
    Ok first things first.
    There may be a better way to do this but as nobody seems to have done it as a tutorial I’m having a go. if you have a better way then submit it as a tutorial of your own and by all means pop a link to it in this thread, after all the more views the better, but let’s not make this any more complicated than it needs to be. If you have clever dick comments then keep them to yourself as this is not a debate, or pm me :)
    Of course if you have constructive comments then please don’t be shy and at the end of this we should have a nice little tutorial for the site.. (That’s why we are members isn’t it)
    The Main screen in Mach3

    Click image for larger version. 

Name:	1.jpg 
Views:	1855 
Size:	229.4 KB 
ID:	9004


    Select the Offsets Tab indicated
    Click image for larger version. 

Name:	2.jpg 
Views:	2201 
Size:	228.4 KB 
ID:	9005

    This screen has a number of functions that can be performed using a probe/edge finder this tutorial will be using a touch probe, select the operator button in the file menu bar indicated below.

    Click image for larger version. 

Name:	3.jpg 
Views:	4976 
Size:	233.1 KB 
ID:	9006

    As we are assigning a function to a button select button script from the dropdown menu
    Click image for larger version. 

Name:	4.jpg 
Views:	5404 
Size:	234.8 KB 
ID:	9007

    This will cause all the buttons that can be assigned to flash, select the centering button indicated below.
    Click image for larger version. 

Name:	5.jpg 
Views:	2113 
Size:	229.0 KB 
ID:	9008

    A code box for the selected button will appear, Copy the code at the bottom of the post into this box.

    Click image for larger version. 

Name:	6.jpg 
Views:	2429 
Size:	225.0 KB 
ID:	9009
    And don’t forget to save it as indicated in the picture
    Click image for larger version. 

Name:	7.jpg 
Views:	3408 
Size:	258.6 KB 
ID:	9010

    And that’s it!!
    Assuming the probe is fitted and working, using jog, move the probe down (5mm or more will do) into the hole or pipe you wish to have the machine centered to. And hit the Red circled button..

    Click image for larger version. 

Name:	8.jpg 
Views:	2000 
Size:	236.2 KB 
ID:	9011


    The Code
    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 "F100" 'slow feed rate to 4 ipm 100mm

    Rem Probe Left

    XNew = Xcurrent - 75 'probe 3 inches to left 75mm
    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 + 75 'probe 3 inches to right 75mm
    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 + 75
    Code "G31 Y" &YNew
    While IsMoving()
    Wend
    YPos1 = GetVar(2001)

    Code "G0 Y" &YCurrent

    Rem Probe down

    YNew = YCurrent - 75
    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

    DoOEMButton ( 1008 )
    DoOEMButton ( 1009 )

    End If

    The Code

    Just copy this code into the box when prompted this version will zero the X,Y when Finished.

    I always run it twice

    this tutorial works on my machine...but use it at your own risk!!
    Rick
    Always bear in mind that your own resolution to succeed is more important than any other - Abe Lincoln

  2. The Following User Says Thank You to Ricardoco For This Useful Post:


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Tool Height Setting Probe - Mach3 - solution
    By HiltonSteve in forum Tool & Tooling Technology
    Replies: 18
    Last Post: 12-11-2013, 06:23 PM
  2. BobCad-Cam 3D tutorial
    By craigrobbo in forum Computer Software
    Replies: 0
    Last Post: 21-09-2012, 06:20 PM
  3. Spindle probes for centering
    By maritimesbob in forum Probing, Digitizing & Scaning
    Replies: 4
    Last Post: 02-09-2012, 11:22 PM
  4. Co axial centering indicator
    By Robin Hewitt in forum Tool & Tooling Technology
    Replies: 13
    Last Post: 03-02-2012, 07:49 PM
  5. Touch Probe
    By luke11cnc in forum Probing, Digitizing & Scaning
    Replies: 28
    Last Post: 31-01-2012, 01:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •