Aligning coordinate axis with part


Results 1 to 13 of 13

Thread: Aligning coordinate axis with part

  1. #1
    Registered
    Join Date
    Jul 2010
    Location
    Canada
    Posts
    152
    Downloads
    0
    Uploads
    0

    Default 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.

    Similar Threads:
    Last edited by outsider787; 02-28-2012 at 10:31 AM.


  2. #2
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    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
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  3. #3
    Registered
    Join Date
    Nov 2011
    Location
    Russia
    Posts
    14
    Downloads
    0
    Uploads
    0

    Default

    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
    Registered
    Join Date
    May 2012
    Location
    Canada
    Posts
    9
    Downloads
    0
    Uploads
    0

    Default 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
    Registered
    Join Date
    Nov 2011
    Location
    Russia
    Posts
    14
    Downloads
    0
    Uploads
    0

    Default

    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
    Registered
    Join Date
    May 2012
    Location
    Canada
    Posts
    9
    Downloads
    0
    Uploads
    0

    Default dooembutton

    it is work fine fantastic
    tanks for all



  7. #7
    Registered
    Join Date
    May 2012
    Location
    Canada
    Posts
    9
    Downloads
    0
    Uploads
    0

    Default 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 ?

    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
    Registered
    Join Date
    Nov 2011
    Location
    Russia
    Posts
    14
    Downloads
    0
    Uploads
    0

    Default

    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
    Registered
    Join Date
    May 2012
    Location
    Canada
    Posts
    9
    Downloads
    0
    Uploads
    0

    Default 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
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    dooembutton (1017) 'go to zero
    While IsMoving()
    Wend
    dooembutton (160) ' regen toolpath

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  11. #11
    Registered
    Join Date
    May 2012
    Location
    Canada
    Posts
    9
    Downloads
    0
    Uploads
    0

    Default coordinate axis with part

    tanks it seem to work



  12. #12
    Registered
    Join Date
    Dec 2013
    Posts
    2
    Downloads
    1
    Uploads
    0

    Default 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
    Member
    Join Date
    Jun 2013
    Posts
    29
    Downloads
    2
    Uploads
    0

    Default 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 ?

    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?



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Aligning coordinate axis with part

Aligning coordinate axis with part