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! > MetalWorking Machines > Haas Mills


Haas Mills Discuss Haas machinery here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 12-16-2010, 06:55 PM
cmo cmo is offline
 
Join Date: Aug 2009
Location: US
Posts: 21
cmo is on a distinguished road
THREAD MILLING MACRO

%
G65 P9012 X10. Y10. Z0. D.5 T10. A54. B1. C1. E2. F1. H1. I14. J6.
%
%
O09012 (THREAD MILLING MACRO REV.4)
(INPUT TESTING)
IF [ [ #24 GE - 25. ] AND [ #24 LE 25. ] ] GOTO100
#3000= 1 (X INPUT MISSING OR OUT OF RANGE)
N100 IF [ [ #25 GE - 12. ] AND [ #25 LE 12. ] ] GOTO110
#3000= 2 (Y INPUT MISSING OR OUT OF RANGE)
N110 IF [ [ #26 NE - 16. ] AND [ #26 LE 16. ] ] GOTO120
#3000= 3 (TOP OF THREAD MISSING OR OUT OF RANGE)
N120 IF [ [ #9 GT 0.5 ] AND [ #9 LT 4. ] ] GOTO130
#3000= 4 (THREAD OD MISSING OR OUT OF RANGE)
N130 IF [ #8 EQ 1. ] GOTO150
N140 IF [ #7 LE #9 * 0.8 ] GOTO150
#3000= 5 (TOOL SIZE OUT OF RANGE)
N150 IF [ #20 EQ FIX[ #20 ] ] GOTO160
#3000= 6 (TOOL NUMBER MUST BE A WHOLE NUMBER)
N160 IF [ #11 GT 0 ] GOTO1000
#3000= 7 (VALUE IS OUT OF RANGE)
N1000 (CALCULATIONS)
IF [ #2 EQ 1. ] THEN #2= 400. (STEEL)
IF [ #2 EQ 2. ] THEN #2= 600. (ALUMINUM)
#100= [ #2 * 3.82 ] / #7 (RPM)
#101= [ #100 * 0.004 ] (FEED RATE)
#102= -1. * [ #11 ]
#103= 0.1 (CUTTER COMP)
#104= -0.1 (CUTTER COMP)
#105= [ #9 - #7 ] + #24 (CUT DIA)
#107= -1. * #105 (CUT RAD)
#106= [ [ #9 / #7 ] / 2 ] (RAMP RAD)
#108= #106 + #106
#109= 0.25 * [ 1 / #4 ]
#110= -1. * [ #109 ]
#111= [ 1 / #114 ]
#112= [ 90 / 360 ] * #111
#113= -1. * [ #112 ]
#114= 0.1 (CUTTER COMP)
#115= -1. * [ #109 ]
#117= 0.5 * [ #9 + #7 ]
#118= -1. * [ #117 ]
#119= [ 0.6495 / 4 ]
#120= -1. * [ #110 ]
#122= [ 1 / #4 ]
#124= -1. * [ #123 - 1. ]
#125= [ #4 * #11 ]
#126= FIX[ #125 ]
#127= -1. * [ #126 ]
#150= #4 - #5 (TPI-ZDEPTH)
#128= [ 1 / #4 ] * [ #5 - 1. ] (ZMOVE)
IF [ [ #3 EQ 2. ] AND [ #8 EQ 1. ] ] GOTO2010
IF [ [ #3 EQ 2. ] AND [ #8 EQ 2. ] ] GOTO2020
IF [ [ #3 EQ 1. ] AND [ #8 EQ 1. ] ] GOTO2030
N2000 (MACHINING ID THREAD RIGHT HAND)
WHILE [ #150 GT 0 ] DO1
T#20 M06
S#100 M03
G00 G90 G#1 X#24 Y#25 M08 (HOLE LOCATION)
G43 H#20 Z [ #26 + 0.1 ] (MOVE TO .1" ABOVE PART ZERO)
G01 Z#102 F100. (FEED DOWN TO BOTTOM OF HOLE)
G41 X [ #24 + 0.1 ] D#20 F#101 (ACTIVATE CUTTER COMPENSATION)
G03 X#105 Z#109 R#106 (HELIX ON)
G03 I#107 Z#122 (HELIX THREAD)
G03 X [ #24 + 0.1 ] Z#109 R#106 (HELIX OFF)
G01 G40 X#24
#102= #102 + #128 (Z MOVE)
#150= #150 - 1.
END1
G91 G28 Z0
M99



WHAT IS WRONG??
Reply With Quote

  #2   Ban this user!
Old 12-16-2010, 09:36 PM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,313
dcoupar is on a distinguished road

Probably the font.

Whaddya mean "WHAT IS WRONG??"?

I'll tell ya what's wrong, you forgot to tell us what it does that it shouldn't or what it doesn't do that it should!!! Do you get an alarm? Does the coolant foam up? Does the main circuit breaker trip??? What happens when you try to run the macro???

Splain, Lucy!!! Sheesh.
Reply With Quote

  #3   Ban this user!
Old 12-16-2010, 09:47 PM
cmo cmo is offline
 
Join Date: Aug 2009
Location: US
Posts: 21
cmo is on a distinguished road

this is a project for my class but i figured it out!! thanks anyways
Reply With Quote

  #4   Ban this user!
Old 12-17-2010, 06:45 AM
machinistDroid's Avatar  
Join Date: Jun 2010
Location: USA
Posts: 4
machinistDroid is on a distinguished road
the loop

The pitch minus the depth is probably not a good conditional statement in this case.
#150=#4-#5
if your pitch is 13(#4) and your depth in 1.(#5) then everything will loop, toolchange and all, at least 12 times. #150=#150-1
Reply With Quote

  #5   Ban this user!
Old 12-17-2010, 09:52 AM
KenFoulks's Avatar  
Join Date: Aug 2010
Location: USA
Posts: 511
KenFoulks is on a distinguished road

Originally Posted by cmo View Post
this is a project for my class but i figured it out!! thanks anyways
Why don't you post the working version and explain what it does?
__________________
Thanks,
Ken Foulks
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 12-17-2010, 01:50 PM
 
Join Date: Jan 2007
Location: USA
Posts: 1,299
Delw is on a distinguished road

Originally Posted by KenFoulks View Post
Why don't you post the working version and explain what it does?
+1
sure would be nice, as it might be useful to others.
Reply With Quote

  #7   Ban this user!
Old 12-17-2010, 09:46 PM
machinistDroid's Avatar  
Join Date: Jun 2010
Location: USA
Posts: 4
machinistDroid is on a distinguished road

Follow the code. He's trying to write a thread milling macro that accepts a dia., pitch, and depth as variables. That is why I preach documentation... to help follow your own logic, if nothing else, when proofing it out.

He also needs to just loop the tool movement after the initial positioning. But I'm sure he found that out by now.
I love macros.

CNC macros
Reply With Quote

  #8   Ban this user!
Old 12-18-2010, 09:49 PM
 
Join Date: Nov 2006
Location: US
Age: 26
Posts: 181
Ydna is on a distinguished road

I wrote a much simpler one-pass macro that will can be called multiple times to yield the correct number of passes. But it steps out in diameter so the tool load isn't ideal.

%
O0101 (THREADMILL MAIN)
T1 M06 (T1 = THREADMILL CUTTER)
G00 G90 G58 X0. Y0.
S1000 M03
G00 G90 G43 H01 Z0.5 M08
G65 P300 D1.98 C0.5 E0.05 Z-1.0 F20. M0. (CALL THREADMILL)
G65 P300 D1.99 C0.5 E0.05 Z-1.0 F20. M0. (CALL THREADMILL)
G65 P300 D2.00 C0.5 E0.05 Z-1.0 F20. M0. (CALL THREADMILL)
G00 G90 G49 Z0. M09
M01
M30
(----------------------------------------)
O300 (THREADMILL ALIASED SUBROUTINE)
(INSIDE THREAD - RIGHT HAND)
(C=#3 - cutter dia)
(D=#7 - pass dia)
(E=#8 - lead of thread)
(F=#9 - feed at edge of cutter)
(Z=#26 - bottom z depth - thread start)
(M=#13 - top Z - threadmill end)
(#32 = threadmill pass radius - tool center)
(#27 = feedrate adjusted for tool center programming)
#30= 0 (30 = num of thread passes cut thus far)
#14= #26 (14 = current Z height)
G103 P1 (halt look ahead)
(BLANK LINE)
IF [ #13 EQ #0 ] THEN #13= 1 (must cut at least one thread)
G01 Z[#26] F20. (feed down to bottom of hole)
#32=[#7-#3]/2 (calculate path radius)
#27=[#9*[#32/[#7/2]]] (calculate adjusted feedrate)
G03 X#32 I[#32/2] J0 F#27 (arc into 3o'clock position)
(while-do loop start)
WHILE [#14 LT #13] DO1 (while current Z LT top Z...)
G03 I[-#32] J0 Z[#26+[#8*#30]]
#30= #30 + 1
#14= #26 + [ #8 * #30 ] (calculate current z height)
END1
(while-do loop end)
G03 X0 I[-#32/2] J0 (arc out to center position)
G103
M99
%


I'm working on making it calculate a "surface area cut" so the macro will automatically step out in diameter and up in Z, like a G76 threading cycle on a lathe. Is that what's happening in your much lengthier code?
Reply With Quote

Reply

Tags
macro threadmilling




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
Fanuc pocket milling macro tturnbull50 G-Code Programing 4 08-30-2010 02:48 AM
Sprocket milling macro ??? theemudracer G-Code Programing 20 11-08-2007 06:17 PM
Continuous thread G32 macro dcrace G-Code Programing 3 05-29-2007 02:23 PM
Milling Macro sencinia General Metalwork Discussion 2 04-04-2007 08:20 AM
Macro for milling round bar sencinia General Metalwork Discussion 0 03-31-2007 10:58 AM




All times are GMT -5. The time now is 02:10 PM.





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