CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > G-Code Programing


G-Code Programing Discuss G-code programing and problems here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 06-25-2009, 05:56 AM
 
Join Date: Mar 2009
Location: Denmark
Posts: 11
NickDP is on a distinguished road
Spiral Milling

Hello fellow cnc-fans

I've had lots of time for spare at work lately, so i started playing around with macros again.

Now at school, i've been using G12/G13 for spiral milling, but on my fanuc o-m there is no such g-code, so i intented to program it.

But i found it that it aint realy an easy task, and now im afraid i need a bit of assistence.

I've only been working on it today, so its not much, but i think i've got the general understanding of it right.

Code:
T1 M6
G00 X0. Y0.
#110=0
#112=0
#11=1. (Little C)
#12=10. (MAX RADIUS)
#10=[#12/360] (BIG A)
#100=0. (Desired Radius)

IF[#110EQ0] THEN[#110=ROUND[[#11*COS[#10]]]]
IF[#112EQ0] THEN[#112=ROUND[[#11*SIN[#10]]]]

WHILE[#100LE#12] DO1
#120=#110
#130=#112
#110=[#120-#130]
#112=[#130+#120]
G01 G91 X#110 Y#112
#100=[#100+1]
END1
To give you the understanding of the program, #100 is just used to make it stop at some point, i havent started working on that yet.

Little C (#11) is taken from the the need of caluclations, as its called in my book , same goes with Big A/ Max Radius.

Anyway, thanks alot for looking by

Best regards
Nick. D. Pedersen.
__________________
Nick, The Newbie Programmer
Reply With Quote

  #2   Ban this user!
Old 07-01-2009, 04:57 PM
samu's Avatar  
Join Date: Feb 2007
Location: quebec
Posts: 216
samu is on a distinguished road

the simpliest way to aproximate a spiral is with a two center construction.Spiral radius is constant for 180 degree but each arc center have an offset from spiral center.Offset=[distance between spire/2].
from this concept i wrote the following macro. Very basic and untested but it could give you a starting point

format is:
G65 P9013 Axx Bxx Dxx Fxx Hxx Rxx

A=STEP OVER
B=TOOL DIAMETER
D=FINAL DIAMETER
F=X-Y FEED
H=Z FEED
R=RETRACT PLANE

O9013(SPIRAL MACRO)
#7=#7-#2 (FINAL DIAMETER-TOOL DIAMETER)
#100=FUP[#7/#1+0.5] (NUMBER OF HALF TURN NEEDED TO REACH FINAL DIAM)
#101=[#7/[0.5*#100-0.25]] (CORRECTED STEP OVER )
#102=1 (HALF TURN COUNTER)
#103=#101*[#102-0.5] (CURRENT DIAMETER)
G0 G90 X#24 Y#25 (RAPID TO CENTER)
Z#18 (RAPID TO RETRACT PLANE)
G91
G03 X#103 I[#103/2] F#9 (CUT THE FIRST ARC)
#102=#102+1 (INCREMENT COUNTER)
WHILE[#102 LE #100] DO1 (IF NEEDED HALF TURN NOT REACHED)
#103=#101*[#102-0.5] (CURRENT DIAMETER)
G03 X-#103 I[-#103/2]
#102=#102+1
IF[#102GT#100] GOTO10
#103=#101*[#102-0.5]
G03 X#103 I[#103/2] F#9
#102=#102+1
END1
G03 I-[#7/2] (ENTIRE CIRCLE AT FINAL DIAMETER)
GOTO20
N10 G03 I[#7/2] (ENTIRE CIRCLE AT FINAL DIAMETER)
N20 G0 G90 Z#18
M99

MY LOGIC TO CALCULATE THE END OF THE SPIRAL IS TO SLIGHTLY CHANGE THE PROGRAMMED STEP OVER TO OBTAIN A SPIRAL TANGEANT TO FINAL DIAMETER AT 0 OR 180 DEGREE

I JOINED A DRAWING OF THE TWO CENTER SPIRAL.
IF YOU HAVE ANY QUESTION OR NEED HELP TO IMPROVE THIS MACRO IT WILL BE A PLEASURE FOR ME TO HELP YOU.
Attached Thumbnails
Click image for larger version

Name:	spiral.jpg‎
Views:	111
Size:	88.5 KB
ID:	83698  

Last edited by samu; 07-02-2009 at 08:28 AM.
Reply With Quote

  #3   Ban this user!
Old 07-01-2009, 10:28 PM
 
Join Date: Mar 2009
Location: Denmark
Posts: 11
NickDP is on a distinguished road

Uh, that looks great, i'll try to have a look at it later on today.

Thanks alot for the reply

Best regards
__________________
Nick, The Newbie Programmer
Reply With Quote

  #4   Ban this user!
Old 07-06-2009, 11:49 AM
samu's Avatar  
Join Date: Feb 2007
Location: quebec
Posts: 216
samu is on a distinguished road

i took a look on the way you plane to program it. On the first look i was sure it dont give a spiral but a put equations on excel sheet and what a surprise, it was a spiral, but not with constant distance between spire, after only 45 moves, the spiral radius is about 3 000 000!!!

For what kind of application you want to use spiral milling?
If it is for circular pocketting, you definately need a constant distance between spire.

If i find some time, maybe in the middle of the week, i could test my previous macro. Let me know if you are interested.
Reply With Quote

  #5   Ban this user!
Old 07-06-2009, 12:14 PM
 
Join Date: Mar 2009
Location: Denmark
Posts: 11
NickDP is on a distinguished road

Yeah, the plan is to use it for pocketting.

But yes, the place i kinda got kicked down was with the constant distance between the spires :/

I sadly havent had a chance to look at your macro yet
__________________
Nick, The Newbie Programmer
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 09-27-2011, 09:47 PM
 
Join Date: Sep 2011
Location: USA
Posts: 56
texaspyro is on a distinguished road

Here is an updated version of the spiral macro. It fixes several issues.

The D param is the diameter (was the radius).

The B tool diameter is now actually the tool diameter. It was.... uhhh... something else.

The working variables are now local variables. Calling the macro will not affect any global variables.

The final full circle cut has been fixed to cut the full diameter (it was cutting only half the diameter).

Added a Z parameter for specifying the cut depth.

The H plunge feed rate parameter is now used.

Fixed the R retract plane move.

The subroutine exits with the tool at the initial X/Y center coords. Z is at the retract plane.

The code has been modified to offset the cutting start point based upon the number of half turns. Otherwise the circle will not be centered on the input coordinates.

The macro does does not alter the initial G90/G91 state.


G00 X0Y0Z0
G65 P9013 X2. Y3. Z-.25 A.15 B.50 D2.00 H5.0 F10.0 R0.50
M30

O9013 (SPIRAL MACRO)
(A=STEP OVER)
(B=TOOL DIAMETER)
(D=FINAL DIAMETER)
(F=X-Y FEED RATE)
(H=Z FEED RATE)
(R=RETRACT PLANE - ABSOLUTE COORDS)
(X,Y = CIRCLE CENTER - ABSOLUTE COORDS)
(Z=CUTTING PLANE - ABSOLUTE COORDS)
#7=#7/2.0 (CONVERT DIAMETER TO RADIUS)
#7=#7-#2/2.0 (FINAL RADIUS-TOOL RADIUS)
#30=FUP[#7/#1+0.5] (NUMBER OF HALF TURNS NEEDED TO REACH FINAL DIAM)
#28=[1-[[#30AND1]*2]]*[-1] (+1 IF ODD, -1 IF EVEN)
#31=[#7/[0.5*#30-0.25]] (CORRECTED STEP OVER)
#32=1 (HALF TURN COUNTER)
#33=#31*[#32-0.5] (CURRENT DIAMETER)
#29=#4003 (SAVE G90/G91 STATE)
G00 G90 Z#18 (RAPID TO RETRACT PLANE)
X[#24-#33/2.0*#28] Y#25 (RAPID TO CENTER WITH DIAMETER OFFSET IN X)
G01 Z#26 F#11 (FEED TO CUTTING DEPTH)
G91
G03 X#33 I[#33/2.0] F#9 (CUT THE FIRST ARC)
#32=#32+1.0 (INCREMENT COUNTER)
WHILE[#32 LE #30] DO1 (HERE WE GO ROUND AND ROUND...)
#33=#31*[#32-0.5] (CURRENT DIAMETER)
G03 X-#33 I[-#33/2]
#32=#32+1.0
IF[#32GT#30] GOTO10
#33=#31*[#32-0.5]
G03 X#33 I[#33/2.0]
#32=#32+1.0
END1
G03 I-[#7] (CUT ENTIRE CIRCLE AT FINAL DIAMETER)
GOTO20
N10 G03 I[#7] (CUT ENTIRE CIRCLE AT FINAL DIAMETER)
N20 G0 G90 Z#18 (RAPID TO RETRACT PLANE)
G0 X#24Y#25 (RAPID TO CENTER)
IF[#29NE91]GOTO40 (RESTORE G90 STATE)
G91
N40 (WE IS ALL DONE)
M99


Another improvement that could be made would be to modify the cutting of the final full diameter circle to only cut a half circle... the other half of the full circle was already cut. I'll leave this exercise to the reader...

Last edited by texaspyro; 09-27-2011 at 10:04 PM.
Reply With Quote

  #7   Ban this user!
Old 09-27-2011, 10:18 PM
 
Join Date: Aug 2005
Location: usa
Posts: 77
underdog is on a distinguished road

Are you sure you don't just want to check in the parameter book and see if your control is set to allow 3 axis simultaneous moves and then try adding a Z coordinate to the G02 move? (See the programming book for the format - it should be under helix)
Reply With Quote

  #8   Ban this user!
Old 09-27-2011, 10:30 PM
 
Join Date: Sep 2011
Location: USA
Posts: 56
texaspyro is on a distinguished road

This macro is for a circular pocketing type of operation where you are cleaning out the whole inner diameter of the circle and leaving a flat bottom. Helical G02 moves won't do that (but can be useful for ramping into the operation if you don't have the proper end-cutting bit).
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MACRO FOR HOLE SPIRAL MILLING ALEXCOMO Fanuc 32 06-23-2011 06:37 AM
Problem- Can I spiral in? mphjunky Haas Mills 15 05-16-2008 08:25 PM
spiral macro ? cyclestart G-Code Programing 4 03-23-2008 09:42 PM
Newbie- Drawing a spiral? m1911bldr BobCad-Cam 1 02-05-2008 12:51 PM
Spiral saw RPM nophead00 General Metalwork Discussion 2 04-22-2007 03:43 AM




All times are GMT -5. The time now is 12:18 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361