Results 1 to 2 of 2

Thread: Usere Macro - Circle through 3 points

  1. #1
    Join Date
    Jan 2012
    Posts
    350
    Thanks
    0
    Thanked 74 Times in 65 Posts

    Default Usere Macro - Circle through 3 points

    Hi All,
    Following is my answer to a question asked in another Forum. I'm Posting it here for the benefit of those who frequent this Forum, and my be interested. This Macro program calculates the Centre X Y coordiantes, and the Radius of a circle, the circumference of which, passes through any three points.

    The program is started, and each time the Operator Message prompts "MAN TOUCH", select Hand Wheel to make the touch. Once the touch is made, select Auto Mode and press Cycle Start to record the current X Y coordinates. The process of "MAN TOUCH" prompt, manual touch with Hand Wheel, and coordinate recording by pressing Cycle Start will repeat until all three points have been recorded. If the control has the infrastructure for Auto contact with a Probe, the High Speed Skip G31 will be used if the control is by Fanuc, and no Manual intervention will be required. In this case, the probe could be roughly positioned in the centre of the circle/arc to be measured, and a diameter roughly equal to the proposed circle/arc to be measured passed as an argument by the Macro Call block.
    For example:
    G65 P9081 D100.0 S2 (D100.0 being the rough diameter of the feature to be measured)

    Post any questions you may have.

    Regards,

    Bill

    The following is a conversion of a routine I wrote for a CAM software package. Accordingly, I haven't tested it on a machine as a User Macro program. However, I don't think I've made any mistakes so it should be right to go. Test it in fresh air first. Post back with result.

    If you use it to set a Work Shift, you could pass the Work Shift number to set in the Macro Call block.
    For example:
    G65 P9081 S2
    Where S value
    1 = G54
    2 = G55
    3 = G56
    4 = G57
    5 = G58
    6 = G59

    Then in the macro
    #[5201+[20*[#19]]]=#15 (X WORK SHIFT)
    #[5202+[20*[#19]]]=#16 (Y WORK SHIFT)

    Obviously the above two Macro statement go at the bottom of the following program after all calculations have been completed.

    Regards,

    Bill

    %
    O9081(CIRCLE THROUGH 3 POINTS MACRO)
    #3006=1 (MAN TOUCH 1 - CYCLE START)
    #3006=0
    #1=#5021 (1ST X)
    #2=#5022 (1ST Y)
    #3006=1 (MAN TOUCH 2 - CYCLE START)
    #3006=0
    #3=#5021 (2ND X)
    #4=#5022 (2ND Y)
    #3006=1 (MAN TOUCH 3 - CYCLE START)
    #3006=0
    #5=#5021 (3RD X)
    #6=#5022 (3RD Y)

    (GET PERPENDICULAR BISECTOR OF #1, #2 and #3, #4)
    #7 = [#3 + #1] / 2
    #8 = [#4 + #2] / 2
    #9 = #3 - #1
    #10 = -[#4 - #2]

    (GET PERPENDICULAR BISECTOR OF #3, #4 and #5, #6)
    #11 = [#5 + #3] / 2
    #12 = [#6 + #4]/ 2
    #13 = #5 - #3
    #14 = -[#6 - #4]

    (SEE WHERE THE LINES INTERSECT)
    (X-CENTRE)
    #15 = [#8 * #10 * #14 + #11 * #10 * #13 - #7 * #9 * #14 - #12 * #10 * #14] / [#10 * #13 - #9 * #14]

    (Y-CENTRE)
    #16 = (#15 - #7) * #9 / #10 + #8

    (RADIUS)
    #17= SQRT[ [ [#1-#15]* [#1-#15] ]+[ [#2-#16]*[#2-#16] ]]
    .............
    Rest of program
    .............
    Do whatever you want with the Centre and Radius information.
    For example:
    1. Register as Work Shift Offset,
    2. Rapid or feed to X#15 Y#16
    3. Whatever

    M99
    %
    Last edited by angelw; 02-08-12 at 03:40 AM.

  2. The Following 2 Users Say Thank You to angelw For This Useful Post:

    MMMMM (02-09-12), Stevo (02-08-12)

  3. #2
    Join Date
    May 2008
    Location
    Great State of Wisconsin
    Posts
    1,211
    Thanks
    7
    Thanked 134 Times in 112 Posts

    Default Re: Usere Macro - Circle through 3 points

    Very cool Bill.....thanks for the program. I am looking forward to goofing around with it when I get some free time. Well I guess that means I will not goof around with it but I will definitely be adding it to my archives for a rainy day.

    Steve
    (The opinions in this post are my own and not those of machinetoolhelp.com and its management)

Similar Threads

  1. Understanding different reference points for tool changer position
    By cncguy in forum Programming / Applications
    Replies: 8
    Last Post: 07-20-13, 10:07 AM
  2. Sinumerik 810t reference points change
    By crash in forum Machine Repair & Troubleshooting
    Replies: 1
    Last Post: 04-12-13, 06:20 PM
  3. bad circle code puzzle
    By andyhol in forum Programming / Applications
    Replies: 13
    Last Post: 03-22-11, 03:28 AM
  4. Machining circle with four lines(PROJECTIONS) at 90 Degrees apart
    By shabibullah in forum Programming / Applications
    Replies: 5
    Last Post: 12-29-10, 03:22 PM
  5. Bolt circle program for Fanuc Oi-MC.
    By Heinz Putz in forum Programming / Applications
    Replies: 0
    Last Post: 07-17-09, 09:14 PM

Posting Permissions

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