Has anyone had any success doing this? Do you have a sample code?
Thanks,
Don
Has anyone had any success doing this? Do you have a sample code?
Thanks,
Don
What exactly do you mean by spiral? Do you mean a simple tool path with z movement?
This is an example that will work.
G0G90G54X0Y0S2000M3T1
G43Z10H1
G1Z-5F100
Y2F200
G2Y-2I0J-2
Y4I0J3
Y-6I0J-5
Y8I0J7
Y-10I0J-9
Y12I0J11
Y-14I0J-13
Y16I0J15
Y-16I0J-16
Y16I0J16
G0G40Z100
Here are two Spiral samples:
%
N1O8000(SPIRAL MACRO)
N2G90G0X0Y0.115(MOVE TO THE BEGINING POSITION
N3#CLEAR
N4#'R1=THE STARTING RADIUS
N5#'R2=THE STARTING ANGLE
N6#'R3=THE INCREMENT BETWEEN EACH TURN
N7#'R4=THE NUMBER OF TURNS: EX. R4+2.5 = 2 1/2 TURNS
N8#'R5=CW OR CCW: R5+2. FOR CW, R5+3. FOR CCW
N9#'R6=THE SEGMENT LENGTH ALONG EACH RADIUS
N10#'R7=IN OR OUT: R7+0 OUTSIDE-IN, R7+1. INSIDE-OUT
N11#'R0=Z RISE EACH TURN (LEAD)
N12R1+1.85R2+0R3+0.0333R4+45.R5+2.R6+0.05R7+1.R0+0 .
N13#'
N14#'FIND WHAT PORTION OF SPIRAL TO END WITH
N15#V1=R4-(INT(R4))'FINAL PERCENTAGE OF SPIRAL
N16#V2 = INT(R4) 'NUMBER FOR NEXTROUND SUBROUTINE
N17#V3 = R1'STARTING RADIUS
N18#V8=R2
N19#R4=0
N20#IF V1=0 THEN V1=1
N21#IF V1>0 THEN V2=V2+1
N22#IF V2=0 THEN GOTO :NXTROUND 'IF V2 IS LESS THAN ONE TURN
N23#'
N24#'BRANCH TO CALCULATE ALL MOVES
N25#:CALMOVES
N26#V8 = R2
N27#IF V2 >0 THEN GOTO :NXTROUND
N28#GOTO :END
N29#'
N30#'
N31#'GETTING READY FOR LAST POSITION
N32#:LSTPOS
N33#V9=ABS(((V1*360)-360)-R2) 'LAST ANGLE
N34#IF R5=3 THEN V9=(((V1*360)-360)+R2)'LAST ANGLE
N35#IF V2>=1 THEN V9=R2
N36#IF V9>360 THEN V9=V9-360 'KEEP ANGLE BETWEEN 0 AND 360
N37#IF V9<0 THEN V9=V9+360 'KEEP ANGLE BETWEEN 0 AND 360
N38#R8=V4*(COS(V9)) 'LAST X
N39#R9=V4*(SIN(V9)) 'LAST Y
N40#R4=R4+V11' LAST Z
N41X+R8Y+R9Z+R4G1
N42#GOTO :CALMOVES
N43#'
N44#'
N45#'SET UP NEXT SPIRAL
N46#:NXTROUND
N47#V4 = V3 'SAVE LAST RADIUS
N48#V3 = V4 - R3 'SUBTRACT THE RADIAL INCREMENT FROM THE LAST RADIU
N49#IF R7=1 THEN V3=V4+R3
N50#V5=INT((3.14159*(V4*2))/R6) 'CAL. NUMBER OF POINTS
N51#V6 = 360 / V5 'ANGULAR INCREMENT
N52#V7 = R3 / V5 'RADIAL INCREMENT
N53#V11=R0/V5'Z RISE INCREMENT
N54#IF V2 = 1 THEN V5 = INT(V5 * V1)
N55#V5=V5-1
N56#V2 = V2 - 1 'COUNTER FOR NUMBER OF ROUNDS
N57#GOTO :MOVE
N58#'
N59#'
N60#'CALCULATE NEXT MOVE
N61#:MOVE
N62#IF R5 = 2 THEN V8 = V8 - V6 'V8 = NEXT CW ANGLE
N63#IF R5 = 3 THEN V8 = V8 + V6 'V8 = NEXT CCW ANGLE
N64#IF V8>360 THEN V8=V8-360 'KEEP ANGLE BETWEEN 0 AND 360
N65#IF V8<0 THEN V8=V8+360 'KEEP ANGLE BETWEEN 0 AND 360
N66#IF R7=0 THEN V4=V4-V7'SUBT RAD INCR FROM LST RAD FOR NXT RADIUS
N67#IF R7=1 THEN V4=V4+V7 'ADD RAD INCR TO LST RAD FOR NEXT RADIUS
N68#R8=V4*(COS(V8)) 'NEXT X
N69#R9=V4*(SIN(V8)) 'NEXT Y
N70#R4=R4+V11'NEXT Z
N71#V5 = V5 - 1 'COUNTER FOR NUMBER OF MOVES
N72X+R8Y+R9Z+R4G1
N73#IF V5 <= 0 THEN GOTO :LSTPOS
N74#GOTO :MOVE
N75#'
N76#'
N77#:END
N78M99
%
%
N1O5757(SPIRAL MACRO FROM USER MANUAL
N2#CLEAR
N3G0G90G80G40G49
N4S1800M3M8
N5G0G90X0Y0
N6H1Z0.1
N7G1Z-0.25F400.
N8#V7=0
N9#:LOOP
N10#V7=V7+1
N11#IF V7>=360 THEN V7=0
N12#V1=V1+.00077
N13#V2=SIN(V7)*V1
N14#V3=COS(V7)*V1
N15#R9=V2
N16#R8=V3
N17#R7=V1
N18G2X+R9Y+R8F400.R+R7
N19#IF V1 <10. THEN GOTO :LOOP'STOP WHEN REACHING 10. INCHES
N20G0Z0.1M5M9
N21G28
N22M2
%
Have fun!!!
Neal :=))
"In mathematics, a spiral is a curve which emanates from a central point, getting progressively farther away as it revolves around the point. ...".
quote from google.
so these radii do not form a spiral.
The two programs that I posted create a two dimensional spiral in the XY plane (G17). The longest one is the most useful in that you set the parameters and the macros do the calculation on the fly.
Neal
why would you use the spiral instead of using L9801 which uses only one line of code.
"why would you use the spiral instead of using L9801 which uses only one line of code."
The L9801 fixed subroutine will create concentric circles with a Y step over between them. It will not create a spiral.
Neal
lacing arcs together is not a spiral either.
LOL, good grief, I just want to know the code to cut a spiral. I'm not looking for an intellectual debate about the origin of a spiral or the true existance of a spiral; or even if a tree falls in the forest and no one is around, does it make a sound?
Your probably right, lacing arcs together is not equal to a spiral, but
IT IS THE ONLY THING THE D**N MACHINE UNDERSTANDS!!:withstupi
Thanks for the help,
Don
then why the spiral toolpath?
very interesting!, i have never used a spiral. is this hard material?
Any material; it is just so the tool load is the same all the time. My CAM software will generate a spiral but it wants to code it as line segments which leads to a huge file. I was hoping I could get it to code with a G2/G3. It looks like I can do it but it is going to take some trouble shooting.
Thanks,
Don
Digging up old threads here, but I came back to this today to see if I can finally solve this post processor output. Below is what I am getting but the machine chokes on it (Line 27). What am I missing?
The manual only shows one example spiral starting at X0 Y0, but what if your not at X0 Y0, then what?
I'm looking at Neal's long example below and it makes my head swim.
Thanks,
Don
%
N1O100(Small Objects - Inches.3dm)
N2G70
N3G17G40G80G90G0E01
N4(Hole Pocketing)
N5T16M6(Diameter = 0.5 Length = 4)
N6G0X0.125Y0.S4583M3
N7G43Z0.25H16
N8/M08
N9G00
N10G01Z0.025F17.
N11G17
N12G03Z-0.044I-0.125J0.R0.125K0.069F68.
N13Z-0.113I-0.125J0.R0.125K0.069
N14Z-0.181I-0.125J0.R0.125K0.069
N15Z-0.25I-0.125J0.R0.125K0.069
N16#CLEAR
N17#V7=0
N18#:LOOP
N19#V7=V7+1
N20#IF V7>=360 THEN V7=0
N21#V1=V1+.00077
N22#V2=SIN (V7)*V1
N23#V3=COS(V7)*V1
N24#R9=V2
N25#R8=V3
N26#R7=V1
N27G03 X+R9 Y+R8 R+R7
N28#IF V1<(0.75*2) THEN GOTO :LOOP
N29X-0.75Y0.001I-0.75J0.001R0.75
N30X0.75Y-0.001I0.75J-0.001R0.75
N31G01X0.125Y0.
N32X0.
N33G00Z0.25
N34G80M09
N35G53Z0H0
N36G53X0Y10.
N37G40X0Y10.Z0E0H0
N38T16M6(Diameter = 0.5 Length = 4)
N39M30
%
....deleted my post....don't think my thought is the problem....at least not yet. I'm thinking it don't like that R word..
Refer back to my previous post. I give you the code to create a spiral. If you need a 3D spiral let me know as I have that as well.
If you need to manipulate the spiral I can also guide you thru modifying the macro.
Neal
[email protected]
Hey Neal,
Yeah I was looking through your long example trying to decide if my post processor would spit out the applicable numbers or not.
I can get:
Spiral Start Radius
Spiral Angle
Spiral Number of Revolutions
Spiral CW/CCW
Also:
Spiral End Radius
Spiral Lead
Spiral Total Length
I can't get:
The Increment Between Each Turn
The Segment Length Along Each Radius
Maybe I can do this all mathematically with what I do have, but I'm not sure.
On the example I posted do you see what would keep it from running?
This is my hacked up version of the manuals example, I took out the things I thought I didn't need, maybe I took out too much.
Thanks,
Don