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 02-26-2007, 09:17 PM
 
Join Date: Nov 2005
Location: Only the USA
Posts: 213
theemudracer is on a distinguished road
Macro variable example I programmed today.

I am still in the learning stages of this. I am interested in your opinions and suggestions.

let me explain a little before you look my prg's over.

It is for a Lathe with a subspindle. There are 3 different part prg's below that use the same sub program O9983.

The parts are 1.25 o.d. with a .750 I.D. hole (that I drill from solid stock) with varying lenghts and tolerance on the I.D. .

I am using a parts ejecter inside the subspindle that has a limited stroke of .875 . That is the reason that I had to set the G55 Z value depending on the part length Using the #500 variable.

Let me know what you guys think of it and suggestions please.

thanks
Jon




O0026(602-80026 PART EJECTTER)
(JT 2/23/07)
(ZINC PLATE)
#500=[3.125+.145] (part length plus part off blade width(.125) + .02 for clean up on sub spindle)
#501=1.25 (O.D. of part)
#502=[501+.1]
#503=-[23.4684-#500+.875]
#504=-[23.4684+[#503-.155]]
#505=.0085(X OFFSET FOR DRILL)
G10L2P01X0.Z-23.4684
G10L2P02X0.Z#504
G10P10011X3.0038Z2.3897R.0156Q2
G10P10021X3.3968Z-8.905R.0156Q1
G11
/2M00(RELOAD NEW BAR)

M98P9983(SUBCALL 4 80026 & LIKE PARTS)
M99

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
O3031(082-63031 PARTS EJECTER)
(JT 2/23/07)
(ZINC PLATE)
#500=[2.5+.145]
#501=1.25
#502=[501+.1]
#503=-[23.4684-#500+.875]
#504=-[23.4684+[#503-.155]]
#505=.01(X OFFSET FOR DRILL)
G10L2P01X0.Z-23.4684
G10L2P02X0.Z#504
G10P10011X3.0038Z2.3897R.0156Q2
G10P10021X3.3968Z-8.905R.0156Q1
G11
/2M00(RELOAD NEW BAR)

M98P9983(SUBCALL 4 80026& LIKE PARTS)
M99

____________________________________________________________________________________________


O1086(704-21086 PARTS EJECTER)
(JT 2/26/07)
(ZINC PLATE)
#500=[2.63+.145]
#501=1.25
#502=[501+.1]
#503=-[23.4684-#500+.875]
#504=-[23.4684+[#503-.155]]
#505=.016(X OFFSET FOR DRILL)
G10L2P01X0.Z-23.4684
G10L2P02X0.Z#504
G10P10011X3.0038Z2.3897R.0156Q2
G10P10021X3.3968Z-8.905R.0156Q1
G11
/2M00(RELOAD NEW BAR)

M98P9983(SUBCALL 4 80026& LIKE PARTS)
M99

______________________________________________________________________________________



O9983(SUBCALL 4 80026 & LIKE PARTS)
(JT 2/26/07)
N10(CNMG 432)
M32
M118
G28U0
G28B0
G99
G40
G54M54

(CHAMFER)
G50S2500
T1010
G0G96S1000M3
Z-.1M8
X1.35
G41G1X1.25Z-.0625F.01
G2X1.125Z.0R.0625
G1X-.04
G0W.05
G28U0
G97M01


G54G98
T0199(.750 CORO DRILL)
M3S2595
G0Z.1M8
X#505M8
G1Z-#500F12.975
M05
G0X.0
Z2.
M09
M05
M01
G28U0


T1111
G40
G99
G96M3S1000
G54G0Z.1
G0X.74
G1Z-.07F.01
G42G01X.75F.004
G03X.875Z.0R.0625
G1Z.1F.01
G0Z.5
G40
G28U0
M05
M9


(Feed out)
T1213
M5
G54G0G98Z.05X0
M69(MAIN CHUCK UNCLAMP)
G1Z#500F500.
M68(MAIN CHUCK CLAMP)
G4P0500
G99
G0W.1
G28U0
N40

M01
(TRANSFER)
(SUB FORWARD)
T1299(.125 PART OFF)
G54
M118(SUB CLAMP)
G50S1000
G0G97S500M113(SUB SPINDLE ON)
G0G97S500M3 (MAIN SPINDLE ON)
M160(SPINDLE SYNC ON)
M119(SUB SPINDLE UNCLAMP)
G0B#503
M118(SUB CHUCK CLAMP)
G04P0500
G50S3500
G99G54G96S395
G0Z.02M8
X1.35
G1X.7F.006
M09
G0G28B0
G0W.25
G0G28U0.M9
M5
M161(SPINDLE SYNC OFF)
M01
G99
G97

T1020(CHAMFER)
G50S2500
G96S800M113
G55M55G0Z.1X1.35
G42G1X1.25Z.0625F.01M8
G3X1.125Z.0R.0625
G1X.65
G0G40Z-.25
G28U0
G97


T1121 (RADIUS ON I.D. ON SUBSPINDLE)
M55
G99
G40
G55
G96M113S1000
G0Z-.1
X.74
G1Z.07F.01
G41G1X.75F.004
G2X.875Z.0R.0625
G1Z-.1F.01
G0Z-.5
G40
G28U0.
M115

M09
G30B0.
M73
M119
M74
M01
M05
M12
M99


--------------------------------------------------------------------------------

Last edited by theemudracer; 02-27-2007 at 03:35 PM.
Reply With Quote

  #2   Ban this user!
Old 03-07-2007, 08:50 PM
gar gar is offline
 
Join Date: Mar 2005
Location: USA
Posts: 1,498
gar is on a distinguished road

070307-2120 EST USA

theemudracer:

I have only glanced at your code, but I might do this:

Program 1

#510 = 3.125 (length)
#505 = 0.0085 (X OFFSET FOR DRILL)

M98 P9900

M30


Program 2

#510 = 2.500
#505 = 0.010 (X OFFSET FOR DRILL)

M98 P9900

M30


Program 3

#510 = 2.630
#505 = 0.016 (X OFFSET FOR DRILL)

M98 P9900

M30



O9900
O0026(602-80026 PART EJECTTER)
(JT 2/23/07)
(ZINC PLATE)
#500=[#510+.145] (part length plus part off blade width(.125) + .02 for clean up on sub spindle)
#501=1.25 (O.D. of part)
#502=[501+.1]
#503=-[23.4684-#500+.875]
#504=-[23.4684+[#503-.155]]
G10L2P01X0.Z-23.4684
G10L2P02X0.Z#504
G10P10011X3.0038Z2.3897R.0156Q2
G10P10021X3.3968Z-8.905R.0156Q1
G11
/2M00(RELOAD NEW BAR)

M98P9983(SUBCALL 4 80026 & LIKE PARTS)
M99


This makes the main calling programs simpler, and easier to see what the real variables are.

Then you may also be able to use

G65 P9900 Z3.125 X0.0085
or
G65 P9900 Z2.500 X0.0100
or
G65 P6600 Z2.630 X0.0160

instead of the #-variables. Where Z value is length and X is drill offset. Other address letters can be used. See HAAS manual under MACROS.

.
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
Programmed RS-232 output ghyman G-Code Programing 13 07-11-2008 03:53 AM
Macro variable for current tool diam ? Shizzlemah Fadal 3 10-30-2006 08:47 AM
need help today thesaent14 DIY-CNC Router Table Machines 11 07-01-2006 10:32 AM
Need PIC programmed randyf1965 CNC Wood Router Project Log 0 03-26-2005 05:56 PM




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