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 08-26-2008, 12:11 PM
Get lucky's Avatar  
Join Date: Jul 2008
Location: us
Posts: 109
Get lucky is on a distinguished road
MACRO ?

Not so sure that these statements are correct if somebody could look at them and let me know if they are correct and if it would work or if there is a better way to do this.

PECK DRILLING CYLCLE

N1000M01
T1000M8
G97S600M3
X0Z.1T1010
G65P9001R.1Z-.3Q.1F.005
(R =RETURN POINT#18)
(Z=DEPTH OF CUT#26)
(Q= PECK#17)
(F= FEED RATE#9)
G60G28U0W0T1000


%
O9001
#102=0
N1
G1Z-[#17+#102]F#9
G0Z#18
Z-[[#117+102]-.005]
#102=#102+#18
IF[#102GE[#26-#18]]GOTO10
M99P1
N10
G0Z-[[#100+102]-.005]
G1Z-#26
G0Z#18
M30
%
Reply With Quote

  #2   Ban this user!
Old 08-26-2008, 12:47 PM
jamesweed's Avatar  
Join Date: Jan 2007
Location: USA
Posts: 82
jamesweed is on a distinguished road

%
O9001
#102=0
N1
G1Z-[#17+#102]F#9
G0Z#18
Z-[[#117+#102]-.005]
#102=#102+#18
IF[#102GE[#26-#18]]GOTO10
M99P1
N10
G0Z-[[#100+#102]-.005]
G1Z-#26F?
G0Z#18
M30
%

Maybe the changes that are in bold?
Reply With Quote

  #3   Ban this user!
Old 08-27-2008, 07:10 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

I am not quite sure why you are doing so much code for just a peck drilling cycle. For starters in your sub after the N10 your using #100 I don't see that being set anywere. What is it? I also don't see your drill code G73,G83. I always use a variable to establish a clearance plane. Try this, using the same R,Z,Q,F as you were.

N1000M01
G97S600M3
T1010
#500=3.(clearance plane)
G65P9001R.1Z-.3Q.1F.005
G60G28U0W0T1000

O9001
G0G90X0Y0
Z#500
G73Z-#26R#18Q#17F#9M8
M99
%

I typically have mine set up to use all variables. It makes it more universial. But I am typically doing mine with multiple holes on a bolt circle and the macro loops. I just modified this one here to do one hole. Thats what I figured you were doing.

A=3.(CLEARANCE PLANE #1)
K=73.(G-CODE FOR DRILL CYCLE)(#6)
Q=.1(PICK SIZE FOR DRILL CYCLE)(#17)
W=.1(R-PLANE)(#23)
T=1515(TOOL NUMBER BEING USED)(#20)
Z=1.0(FINAL DEPTH OF HOLE)(#26)
X=2.5(X COORD. OF HOLE)(#24)
Y=1.5(Y COORD. OF HOLE)(#25)
F=5.0(FEED RATE)(#9)
M=8(COOLANT TYPE 8=FLOOD 18=SPINDLE 9=OFF)(#13)
S=500(SPINDLE SPEED)(#19)

N1000M1
G65P8000A3K73Q.1W.1T1515Z1.X2.5Y1.5F5.M8S500
M30

O8000(DRILL CYCLE)
T#20
G0G90X#24Y#25Z#1M3S#19
G#6Z-#26R#23Q#17F#9M#13
G60G28U0W0M9
M99
%

Stevo
Reply With Quote

  #4   Ban this user!
Old 08-27-2008, 09:12 AM
Get lucky's Avatar  
Join Date: Jul 2008
Location: us
Posts: 109
Get lucky is on a distinguished road

Stevo,

I was trying to make a drill cycle for a lath so it is only have one hole in the center of the part. The lath will not read the G81,G73 I tried it out this morning and that macro didn't work for crap. The other reason that I don't put all the information in this macro is the machinist that work for me really don't under stand how a letter transpose to a number with equation and I tried to explain it to them and they just don't under stand here is how I finaly got it to work.

peck drilling cycle

N1000M01
T1000M8
G97S600M3
X0Z.1T1010
G65P9001R.1Z-.3Q.1F.005
(R =RETURN POINT#18)
(Z=DEPTH OF CUT#26)
(Q= PECK#17)
(F= FEED RATE#9)
G28G28U0W0T1000
%
O9001
#102=0
#103=#26+#17
N122
#102=#102-#17
G1Z#102F#9
G0Z#18
Z[#102-.005]
IF[#102LE#103]GOTO123
GOTO122
N123
G0Z[#102-.005]
G1Z#26F#9
G0Z#18
M99

Kyle
Reply With Quote

  #5   Ban this user!
Old 08-27-2008, 09:34 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

My apologize. I did not see anything in your first post that said you were running this on a lathe. I should have asked. If that works for you then great.

If you want to help your operators understand the Alpha numeric word usage better I usually have lists made for each macro that I have. I have attached the spreadsheet that gives you the format that I use. You say they dont quite understand how it works, but with macros the operators don't have to understand how the letters transfer to variables and how the variables calculate in the macro. That is why most macros will be locked programs once proven out. If it is a proven program then there would be no reason to understand it and tweek it. The operators have a list that program 9001 is a peckdrilling cycle on the lathe and they have a list that says

Z= DEPTH OF CUT
Q= PECK/PICK SIZE
R= R-PLANE
F= FEED
S= SPEED
T= TOOL NUMBER USED
...
ect.

The list will never change and the macro will never change. As long as they understand how the line has to be set up G65P9001Z()Q()R()F()......ect. They should not be a problem.

Stevo
Attached Files
File Type: xls Monarch Macro's.xls‎ (31.5 KB, 91 views)
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 08-27-2008, 09:42 AM
 
Join Date: Apr 2006
Location: usa
Posts: 128
JWK42 is on a distinguished road
Better peck cycle

I found this on the web several years ago and it looks like something you could use on a lathe. It allows you to reduce the size of the peck with a limit of how small. You don't have to call it with a G65 block, just insert into your main program. I don't know the author so I can't give the proper credit





<-- Quote-->

I wrote this macro on a Citizen swiss machine; it allowed me to do a 'regressive'
peck cycle... each peck is slightly less than the previous one. This let me keep
the bore clear of chips, keep oil on the drill, and eliminated broken drills.
This will work for a 'long-hand' peck cycle without actually requiring 128K of
rapid/feed moves to be programmed. Just set the variables and go!

As I said, this was on a Citizen control, so I had to reverse the Z direction,
but it should work on any control that has a Fanuc 'look and feel'.

(Fadal users, I can convert it to use V/R variables if need be.)


Set the following values in your program before moving to the first hole.
Set #534 to 1.00 for a 'standard' peck cycle,
Otherwise, it will reduce the length of each peck by a percentage (in this case, 85%).
.. this is good for really deep holes, where chips, coolant, etc are a concern.
If you do use a regressive peck, make sure #533 is valid for the drill you are using.

( SET-CONDITIONS )
#531=4.361 ( DEPTH-TO-DRILL )
#532=0.160 ( FIRST-PECK-DEPTH )
#533=0.010 ( MIN-PECK-DEPTH )
#534=0.850 ( REGRESSION-PERCENT )
#535=0.1 ( Z-START-POSITION )
#536=0 ( RESERVED )
#537=0 ( RESERVED )


Then, move to the X/Y hole location, and give it a "M98 H310" on the next line.
Then, for each hole, do an X/Y move, then another "M98 H310"
Finally, at the end of your program, add this:


N310 ( REGRESSIVE-PECK-CYCLE )
#536=#535
#537=#532
N320 ( HERE-WE-GO! )
#536= [ #536 - #537 ]
IF[ #536 LE #531 ] GOTO330 ( DONE )
G1 Z#536 F.0016 ( DRILL-NEXT-DEPTH )
G0 Z#535 (RETRACT)
G0 Z[ #536 + .005 ] ( CLEAR )
#537= [ #537 * #534] ( REDUCE-PECK )
IF [#537 GE #533 ] GOTO325
#537 = #533 ( NOT-TOO-SMALL )
N325 GOTO320
N330 G1 Z#531
G0 Z#535
M99

Gives you a LOT of control, with no canned cycles, and very little extra code!

<-- Quote end -->
Reply With Quote

  #7   Ban this user!
Old 08-28-2008, 07:31 AM
 
Join Date: May 2007
Location: USA
Posts: 913
g-codeguy is on a distinguished road

JWK42, nice macro. Question tho. Shouldn't N310 be H310? Sorry for the dumb question, but I did stand next to a Swiss lathe one time.
Reply With Quote

  #8   Ban this user!
Old 08-28-2008, 09:37 AM
 
Join Date: Apr 2006
Location: usa
Posts: 128
JWK42 is on a distinguished road

I really don't know. I just cut and pasted exactly as I found it.
I have modified it to work on a Haas control.
Since Haas would use "M97 P310" to call this as a local sub program, I can imagine that Swiss would use an "H310" to do the same thing. Any Swiss users out there to help?

Edit

We use a right angle head to drill holes on our Haas EC 1600 and the drill cycles only work in "Z" axis so I agree, this is a very nice Macro.

Last edited by JWK42; 08-28-2008 at 09:42 AM. Reason: Added a comment
Reply With Quote

  #9   Ban this user!
Old 08-28-2008, 05:31 PM
 
Join Date: Jan 2005
Location: USA
Posts: 237
cogsman1 is on a distinguished road

On a Citizen machine, with a Mitsubishi control, you would have "Sub programs" that are internal to the main program. The way you run the sub program is with the statement "M98H###"
This means your example is correct. The M98H310 will hop to N310 and the
M99 will send it back just like an external sub program would do it.(Which also works) This just allows you to keep all you needed sub programs and the main program as one neat package.
On a Fanuc control and others you would use the "M99P310" to hop to N310 but to send it back you would have to use a "GOTO###" statement and have the "###" somewhere for it to find.
Reply With Quote

  #10   Ban this user!
Old 08-28-2008, 05:45 PM
 
Join Date: May 2007
Location: USA
Posts: 913
g-codeguy is on a distinguished road

I've never used the M99P310 type call, but will keep an eye open for future possibilities. Thanks.
Reply With Quote

Sponsored Links
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
need help with macro raj gill Commercial CNC Wood Routers 1 04-06-2009 07:43 AM
Need Help With O-M Macro AZDEN Fanuc 6 11-28-2007 07:57 AM
Convert Fanuc Macro to Fadal Macro bfoster59 Fadal 1 11-08-2007 11:41 PM
Macro help fpworks Fadal 3 02-07-2007 04:13 PM
One More Macro ? 16I Bluesman General CNC (Mill and Lathe) Control Software (NC) 4 02-07-2006 05:06 PM




All times are GMT -5. The time now is 12:04 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