Hello Guest it is April 19, 2024, 12:37:13 PM

Author Topic: Probe wiring  (Read 16927 times)

0 Members and 1 Guest are viewing this topic.

Re: Probe wiring
« Reply #30 on: June 05, 2011, 06:38:42 PM »
It makes two short -Z moves, then rapids X about 2 inches, then continues at F4 in the same direction untill I touch the probe to stop it. Then repeats in -X, Y, and -Y. Then goes to center and displays diameter.
Here's the code:

  Rem VBScript To center probe outside diameter

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)
    OutsideDiameter = GetUserDRO(1152)

    Code "G4 P1" 'Pause 1 second to give time to position probe plate
    While IsMoving ()
    Wend
    Call SetDro (0,0.000)
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    Code "F4" 'slow feed rate to 4 ipm
    Code "G90 G0 X" &XNew + OutsideDiameter * .7
    Code "G91 G0 Z-.500"

Rem Probe Left

    XNew = Xcurrent - OutsideDiameter * .7
    Code "G31 X" &XNew
    While IsMoving() 'wait for the move to finish
    Wend
    XPos1 = GetVar(2000) 'get the probe touch location
    Code "G91 G0 Z.500"
    Code "G90 G0 X" &XCurrent 'rapid move back to start point
    Code "G91 G0 X" &XCurrent - OutsideDiameter * .7
    Code "G91 G0 Z-.500"

Rem Probe Right

    XNew = XCurrent + 3 'probe 3 inches to right
    Code "G31 X" &XNew
    While IsMoving()
    Wend
    XPos2 = GetVar(2000)
    Code "G91 G0 Z.500"
    XCenter = (XPos1 + XPos2) / 2 'center is midway between XPos1 and XPos2
    Code "G90 G0 X" &XCenter 'rapid move to the x center location
    While IsMoving ()
    Wend
    Call SetDro (0,0.000)
    Code "G4 P0.25"
    Code "G90 G0 Y" &YNew - OutsideDiameter * .7
    Code "G91 G0 Z-.500"

Rem Probe up

    YNew = YCurrent + 3
    Code "G31 Y" &YNew
    While IsMoving()
    Wend
    YPos1 = GetVar(2001)
    Code "G91 G0 Z.500"
    Code "G90 G0 Y" &YCurrent
    Code "G91 G0 Y" &YCurrent + OutsideDiameter * .7
    Code "G91 G0 Z-.500"

Rem Probe down

    YNew = YCurrent - 3
    Code "G31 Y" &YNew
    While IsMoving()
    Wend
    YPos2 = GetVar(2001)
    Code "G91 G0 Z.500"
    YCenter = (YPos1 + YPos2) / 2

Rem move To the center

    Code "G90 G0 Y" &YCenter
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    While IsMoving ()
    Wend
    Call SetUserDro (1152,YPos2 - YPos1 - .200)

    Code "G4 P0.25"

    Code "F" &FeedCurrent 'restore starting feed rate

End If 
Re: Probe wiring
« Reply #31 on: June 08, 2011, 01:50:07 PM »
I tried changing the G91's in the script to G90's, and now it works.
Thanks agin for everyones help.
My probe is alive!