585,925 active members*
3,501 visitors online*
Register for free
Login
Results 1 to 3 of 3
  1. #1

    Spiral circle

    Hi,
    I need a program to do a spiral circle using four variables:

    X,Y "center of circle"
    Circle radius (in my prog=RDS
    Step (space between lines)

    I did it in a primitive way, but I know it can be done in a more professional way (mybe using sin and cosin)

    my program:

    __________________________________________________ ____________________

    N20 XX=300 YY=300 DIM=225 RDS=DIM/2
    N30 PAN=2 ST1="C1_2" ST2="NULL" ST3="NULL" L=PCUA
    N40 TDM=12.7 DD=TDM/2 ;TDM=tool diameter
    N50 X=XX Y=YY+RDS Z=PRK TP=2 PRF=12 F=6 VF=4 AX=X,Y,Z G41 PFLO=0 L=PON TRZ=0
    N60 G3 X=XX Y=YY-RDS I=XX J=YY
    :FOR B=1 TO RDS/DD
    N70 G3 X=XX Y=YY+RDS-(DD*B) I=XX J=YY-(DD/2)
    N80 B=B+1
    N90 G3 X=XX Y=YY-RDS+(DD*B) I=XX J=YY+(DD/2)
    :ENDFOR
    N100 G1 XI-0.01 Z=PRK
    N110 L=PSU
    N120 L=POFF
    %

    __________________________________________________ ____________________

    Note:
    I know that the external circuit is incomplete, I can fix it later

    Thank you in advance

  2. #2
    Join Date
    Jun 2015
    Posts
    4154

    Re: Spiral circle

    hi, declare a step radial step, like 10mm for example : thus, the radius goes like this :

    angle radius
    0 0
    90 2.5
    180 5
    270 7.5
    360 10

    360+0 10+0
    360+90 10+2.5
    360+180 10+5
    360+270 10+7.5
    360+360 10+10


    actual_radius = step * ( how_many_full_circles + actual_angle / 360 )
    ... 0 <= actual_angle <= 360*

    create a code & loop it; discretization is a bit tricky, because it is not direct proportional with the angle, but more with the radius ( i have to do the math to check this dependency )

    using a variable parameter to achieve a constant discretization is another thing, that may be hard to implement within a cnc soubroutine; i can develop this if you wish / that's all
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  3. #3

    Re: Spiral circle

    I'll try it, thanks

Similar Threads

  1. A circle, a simple circle. How hard can it be?
    By camasaki in forum Hobby Discussion
    Replies: 11
    Last Post: 07-18-2019, 09:21 AM
  2. Draw line tangent from small circle to large circle
    By WEDDLETON in forum ViaCad / Shark
    Replies: 2
    Last Post: 07-30-2014, 05:53 AM
  3. Replies: 16
    Last Post: 02-05-2014, 08:21 PM
  4. write gcode for circle with 4 small circle inside it
    By Farzaneh_2010 in forum G-Code Programing
    Replies: 3
    Last Post: 12-13-2010, 05:24 PM

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
  •