585,922 active members*
3,651 visitors online*
Register for free
Login
Results 1 to 13 of 13
  1. #1

    Aligning coordinate axis with part

    Does any Mach3 (or other NC package) allow for the aligning of the computer part axis to the physical part?

    I'm not talking about just zeroing the axis. I'm talking about having the x axis (and y and z) line up with the part, so that when the NC software moves in the new X direction, it actually moves along the side of the part not just along the table axis.
    So in essence you'd be creating a virtual coordinate system to which mach3 would run.

    adrian.

  2. #2
    Join Date
    Mar 2003
    Posts
    35538
    You can rotate the coordinate system in Mach3 to match your part using G68 I think. But you'll need to figure out the angle to rotate to.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Nov 2011
    Posts
    14
    Here's how I do that.

    I have my own screenset with a lot of useful buttons/macros. You will also need to add new buttons to your screenset.

    Assume I have a clear zero mark on my physical part, and a line along desired X or Y.

    Step 1. I get the part zero by using a ring probe, a camera or just visually aligning any tool with a pointed tip. X and Y are zeroed.

    Step 2. I position a tool on the other end of the line (by the same means) but not alter X and Y.

    Step 3. Current coordinates are copied to the dedicated DROs - I have a button for that. The code below assumes they are #1002 and 1003.

    Step 4. A special button (I call it "Calc Angle") executes the following code.

    Code:
    dx = GetUserDRO( 1002 )
    dy = GetUserDRO( 1003 )
    Pi = atn( 1 ) * 4
    
    If Abs( dx ) > Abs( dy ) Then ' horizontal, near X axis
    	angle = atn( dy / dx )
    Else ' vertical, near Y axis
    	angle = atn( - dx / dy )
    End If
    
    angle = angle / Pi * 180
    
    ret = MachMsg("A = " & roun(angle) & "° - set?", "Axis Rotation", 4)
    
    If ret = 6 Then ' Yes
    	SetOEMDRO(118, angle) 'Code("G68X0Y0R" & angle)
    End If
    
    Message("A = " & roun(angle) & "°")
    If you answer Yes, the computed angle will be in effect for machining. Otherwise, it just displays the result.

    NOTE: if you have to interrupt the work and restart the system, the part offset are saved, but the axis rotation is reset. Hopefully the user DROs are preserved, and all you have to do is Step 4 above.

  4. #4
    Join Date
    May 2012
    Posts
    9

    Brownfox

    Hello it is very useful tool i take to use
    it is possible to insert in the code this function" regen tollpath" ?
    Tanks

  5. #5
    Join Date
    Nov 2011
    Posts
    14
    Quote Originally Posted by ringuets View Post
    it is possible to insert in the code this function" regen tollpath" ?
    No problem. Add
    Code:
    DoOEMButton(160)
    I would place it right after setting the DRO.
    This would be a good update.

  6. #6
    Join Date
    May 2012
    Posts
    9

    dooembutton

    it is work fine fantastic
    tanks for all

  7. #7
    Join Date
    May 2012
    Posts
    9

    Aligning coordinate axis with part

    hello i have insert two line in the code "dooembutton (1017) and dooembutton (160)" but the macro not execute the line "dooembutton (1017)"if i run the macro with vb script editor step by step all is OK i do not why? anybody have an answer ?:idea:

    dx = GetoemDRO( 800 )
    dy = GetoemDRO( 801 )
    Pi = atn( 1 ) * 4

    If Abs( dx ) > Abs( dy ) Then ' horizontal, near X axis
    angle = atn( dy / dx )
    Else ' vertical, near Y axis
    angle = atn( - dx / dy )
    End If

    angle = angle / Pi * 180

    ret = MachMsg("A = " & roun(angle) & "° - set?", "Axis Rotation", 4)

    If ret = 6 Then ' Yes
    SetOEMDRO(118, angle) 'Code("G68X0Y0R" & angle)
    dooembutton (1017) 'go to zero
    dooembutton (160) ' regen toolpath
    End If

    Message("A = " & roun(angle) & "°")

  8. #8
    Join Date
    Nov 2011
    Posts
    14
    I didn't check it in real environment, just guessing...
    Try to insert a small delay before and/or after "dooembutton (1017)". Actually setting DROs takes time - maybe within 0.5 s or so.

  9. #9
    Join Date
    May 2012
    Posts
    9

    coordinate axis with part

    i try to insert a delay with WScript.Sleep " " but an error message appear :error on line 18 object does support this property or method

  10. #10
    Join Date
    Mar 2003
    Posts
    35538
    dooembutton (1017) 'go to zero
    While IsMoving()
    Wend
    dooembutton (160) ' regen toolpath
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  11. #11
    Join Date
    May 2012
    Posts
    9

    coordinate axis with part

    tanks it seem to work :wave:

  12. #12
    Join Date
    Dec 2013
    Posts
    2

    Re: Aligning coordinate axis with part

    Thank you brownfox, I learned a lot from your sample. I'm going to update my screen with some DROs.

  13. #13
    Join Date
    Jun 2013
    Posts
    29

    Re: Aligning coordinate axis with part

    Quote Originally Posted by ringuets View Post
    hello i have insert two line in the code "dooembutton (1017) and dooembutton (160)" but the macro not execute the line "dooembutton (1017)"if i run the macro with vb script editor step by step all is OK i do not why? anybody have an answer ?:idea:

    dx = GetoemDRO( 800 )
    dy = GetoemDRO( 801 )
    Pi = atn( 1 ) * 4

    If Abs( dx ) > Abs( dy ) Then ' horizontal, near X axis
    angle = atn( dy / dx )
    Else ' vertical, near Y axis
    angle = atn( - dx / dy )
    End If

    angle = angle / Pi * 180

    ret = MachMsg("A = " & roun(angle) & "° - set?", "Axis Rotation", 4)

    If ret = 6 Then ' Yes
    SetOEMDRO(118, angle) 'Code("G68X0Y0R" & angle)
    dooembutton (1017) 'go to zero
    dooembutton (160) ' regen toolpath
    End If

    Message("A = " & roun(angle) & "°")
    Hello,
    I'm using this code for sheet alignment, it works great for aligning sheet, but when I'm cutting a part and I need to pause the cut and then when I want to re-cut the machine it leaves a stall position in the machine and does not cut the play as you should.

    What could be wrong, some configuration or some other problem?

Similar Threads

  1. Aligning axis encoder on '94 VF-1
    By GITRDUN in forum Haas Mills
    Replies: 7
    Last Post: 09-21-2019, 06:21 PM
  2. Routermaster needs aligning
    By sdgalloway in forum Commercial CNC Wood Routers
    Replies: 0
    Last Post: 02-11-2011, 01:18 AM
  3. Replies: 2
    Last Post: 02-12-2010, 06:31 PM
  4. 5 Axis Coordinate system
    By axis_control in forum Community Club House
    Replies: 8
    Last Post: 10-18-2009, 10:37 PM
  5. Replies: 0
    Last Post: 11-11-2008, 02:35 AM

Tags for this Thread

Posting Permissions

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