586,593 active members*
2,949 visitors online*
Register for free
Login
Results 1 to 15 of 15
  1. #1
    Join Date
    Jul 2009
    Posts
    419

    How to program points on a circle by degrees

    I'd like to program a circle made of holes, with a radius and holes every 30 degrees.

    Can I program that in a simple way?
    I've looked at the manual pages on linuxcnc.org but if the info is there I do not understand it...
    Sven
    http://www.puresven.com/?q=building-cnc-router

  2. #2
    Join Date
    Feb 2007
    Posts
    664
    trig it out

  3. #3
    Join Date
    Jul 2009
    Posts
    419
    Thanks, but that is not programming in a simple way.
    Sven
    http://www.puresven.com/?q=building-cnc-router

  4. #4
    Join Date
    Apr 2012
    Posts
    79

    Degree Motion

    Hi

    I have tried it briefly and you need to program a rapid move to the pitch radius and then use the ^sign to get the angle correct.

    G0g54x20y0
    g0g43z1h01
    g81z-20q2r1
    ^10
    ^20
    ^30

    etc etc

    Hope this helps

  5. #5
    Join Date
    Feb 2007
    Posts
    664
    then do a Google search for bolt hole circles , there's some free stuff out there


    using trig is not that hard ,

    point X = center of circle X + ( radius * sin( angle ) )

    point Y = center of circle Y + ( radius * cos( angle ) )

  6. #6
    Join Date
    May 2004
    Posts
    4519
    Quote Originally Posted by CaptainVee View Post
    Thanks, but that is not programming in a simple way.
    If you can't do the trigonometry to calculate a simple circular hole pattern, how are you going to program things like the tangent point of a line meeting an arc at any point other than on an arc quadrant?

  7. #7
    Join Date
    Aug 2005
    Posts
    157

  8. #8
    Join Date
    Dec 2007
    Posts
    52

    Bolt circle array

    You might want to have a look at one of the sample scripts made for Linuxcnc. Check this one out and see if it fills your needs.
    LinuxCNC Documentation Wiki: Simple LinuxCNC G-Code Generators

    OOPS, just noticed someone beat me to it.

  9. #9
    Join Date
    Feb 2007
    Posts
    664
    Quote Originally Posted by txcncman View Post
    If you can't do the trigonometry to calculate a simple circular hole pattern, how are you going to program things like the tangent point of a line meeting an arc at any point other than on an arc quadrant?
    this is a good example of the difference between a machinist and a machine operator

  10. #10
    Join Date
    Nov 2012
    Posts
    96
    In CAD it is easy to use polar arrays or snap.

  11. #11
    Join Date
    May 2004
    Posts
    4519
    Quote Originally Posted by Winks View Post
    In CAD it is easy to use polar arrays or snap.
    I think what he is wanting is either a macro function or a rotate coordinate system function. I do not know if LinuxCNC handles either.

  12. #12
    Join Date
    May 2007
    Posts
    5
    I wrote a universal G code program to do chain drilling in a circle. You enter the various parameters as needed and the program will calculate the no of holes needed and hole spacing to do this. Maybe you can adaptn this technique to your application. Here is the program:


    (Touchoff X, Y, at center of circle. Z at surface)



    # = 3.141592659265359
    #1 = 10 (Outside diameter of circle)
    #2 = .125 (Drill diameter)
    #3 = .8 (Thickness of material)
    #4 = 15 (Feed rate)
    #5 = .04 (Clearance to move x & Y to next hole)

    #10 = [[#1 - #2]/2] (Radius of drill circle)
    #11 = [FIX[[2*#*#10]/[#2 + .001]]] (Integer no of holes)
    #12 = [360/#11] (Angle between holes)

    #13 = 0 (Hole counter)
    #14 = 0 (Current angle)

    G17 G20 G40 G49 G54 G64 G80 G90 G94 (boiler plate)
    F #4
    S 1000 M3 (start spindle)

    G0 Z #5
    #20=0

    G61
    o200 While [#20 LT 100]

    o100 While [#13 LT #11]
    #15 = [#10*Cos[#14]] (X hole location)
    #16 = [#10*Sin[#14]] (Y hole location)

    G81 X #15 Y#16 Z[0-#3-.3*#2] R #5

    G0 Z #5 (may not be needed)
    #14 = [#14 + #12] (Next hole angle)
    #13 = [#13 + 1] (Increment hole counter)
    o100 Endwhile
    #13=0
    #14=0
    #20=[#20+1]
    o200 Endwhile

    M5 (spindle off)
    M2

    jensor

  13. #13
    Join Date
    Jul 2009
    Posts
    419
    Cool, that looks like what I need!
    I'll give it a spin after moving house.
    Sven
    http://www.puresven.com/?q=building-cnc-router

  14. #14
    Join Date
    May 2007
    Posts
    5
    I just realized the above program had been modified from the original in order to run software tests wherein it repeats the circles 100 times. To correct remove the following statements:
    #20=0
    o200 While [#20 LT 100]
    #20=[#20+1]
    o200 Endwhile
    jensor

  15. #15
    Join Date
    Dec 2006
    Posts
    67
    4 months later, but for thread historical purposes
    G Code Overview: Polar Coordinates
    in order to learn... not save money.

Similar Threads

  1. Replies: 0
    Last Post: 07-01-2012, 01:35 PM
  2. Circle program
    By jazzy11 in forum Fanuc
    Replies: 9
    Last Post: 05-24-2012, 11:25 PM
  3. Determine pivot points from program
    By qrt69 in forum Okuma
    Replies: 4
    Last Post: 03-24-2012, 12:37 AM
  4. Points on a circle (Biesseworks question)
    By cbkrahn in forum CNC Machining Centers
    Replies: 8
    Last Post: 02-08-2012, 11:56 AM
  5. 2 degrees of a learning Circle
    By Smitty911 in forum Dolphin CAD/CAM
    Replies: 4
    Last Post: 02-13-2008, 01:02 AM

Posting Permissions

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