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-20-2009, 11:35 AM
 
Join Date: Feb 2009
Location: U.S.A.
Posts: 19
psehorne is on a distinguished road
gcode problem with drilling operation

EMC2 does not like the following gcode (3 sequential drilling operations) generated by CamBam:

======== begin gcode =========
( Begin Drill Operation 1 )
S0
G81 X1.0 Y-1.297 R1.0 F4.0
G80

( Begin Drill Operation 2)
S0
G81 X0.0 Y1.297 Z-0.26
G80

( Begin Drill MOP 3 )
S0
G81 X-6.22 Y0.0 Z-0.26
G80

M5
M30
======== end of gcode =======

Notice that G81 for operation 1 has an R and no Z.
Operations 2 and 3 both have a Z and no R.

EMC2 complains unless both R and Z are included in all three lines.

Is this a problem with CamBam or with EMC2 (or with me)?

Thanks,
Paul
Reply With Quote

  #2   Ban this user!
Old 02-20-2009, 12:00 PM
chucker's Avatar  
Join Date: Nov 2007
Location: USA
Posts: 132
chucker is on a distinguished road

Try this
======== begin gcode =========
( Begin Drill Operation 1 )
S0
G81 X1.0 Y-1.297Z-0.26 R1.0 F4.0
X0.0 Y1.297
X-6.22 Y0.0
G80
G28G91Z0
M5
M30
======== end of gcode =======
Reply With Quote

  #3   Ban this user!
Old 02-20-2009, 12:17 PM
 
Join Date: Feb 2009
Location: U.S.A.
Posts: 19
psehorne is on a distinguished road

Originally Posted by chucker View Post
Try this
======== begin gcode =========
( Begin Drill Operation 1 )
... etc...
M5
M30
======== end of gcode =======
Oops! Sorry, I didn't make myself clear. I wasn't looking for replacement code. I have already hand edited the output of CamBam to satisfy EMC2. My question is "Has CamBam produced proper code and EMC2 should not complain or is CamBam producing invalid code?" so that I know where to go to for a fix.

Does every G81 require all four parameters (X, Y, Z, and R)? The docs I am reading on gcode are not clear on this.

Thanks,
Paul
Reply With Quote

  #4   Ban this user!
Old 02-20-2009, 01:39 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

yes that is why it is complaining. With the canned cycle call you have to tell it how deep to drill(Z) and the start point(R).

Now what Chucker is suggesting is the easiest way to write what you are trying to do. Seens how you are going to the same depth but just changing your X,Y locations you can just put your new X,Y locations after the canned cycle call and it will move to that location and do the same routine as in the G81 line. This is nice for if you have 15 holes at different locations you just put the new X,Y.

G81 X1.0 Y-1.297Z-0.26 R1.0 F4.0
X0.0 Y1.297
X-6.22 Y0.0
...
...
...-----------as many X,Y locations you want
G80
G28G91Z0
M5
M30

Stevo
Reply With Quote

  #5   Ban this user!
Old 02-20-2009, 05:58 PM
 
Join Date: Feb 2009
Location: U.S.A.
Posts: 19
psehorne is on a distinguished road

Originally Posted by stevo1 View Post
yes that is why it is complaining. With the canned cycle call you have to tell it how deep to drill(Z) and the start point(R).
CamBam support replied to me:
The canned cycles should 'reset' any modal parameters at the start of the block so they are always output in the first command of the block. This will be fixed in the next release.

There is a work around by altering the EMC post processor file to make R non-modal.
A description of this method can be found in this thread.

http://www.cambam.co.uk/forum/index.php?topic=404.0
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 02-23-2009, 06:44 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

I don't know much about CAM software but couldn't you just put an R in all the G81 lines?

I still think that the easiest way if you are drilling many holes that have the sam depth just different locations that you should not have to have the program keep calling the G81 line and canceling the canned cycle for everyhole. Call it one time then just put in new X,Y locations 1 after another.

What kind of control are you using to run this program? Your R should remain modal until you put a G80. Have you tried removing the G80's at the end of your lines like this. I would think this should take care of your problem.

( Begin Drill Operation 1 )
S0
G81 X1.0 Y-1.297 R1.0 F4.0

( Begin Drill Operation 2)
S0
G81 X0.0 Y1.297 Z-0.26

( Begin Drill MOP 3 )
S0
G81 X-6.22 Y0.0 Z-0.26
G80
M5
M30

If this works...now to what Chucker and I were saying you can remove your G81 and Z-.26 S0 out of the 2nd and 3rd hole. To have this.

S0
G81 X1.0 Y-1.297 R1.0 F4.0(Drill hole 1)
X0.0 Y1.297(Drill hole 2)
X-6.22 Y0.0(Drill hole 3)
G80
M5
M30

Stevo
Reply With Quote

  #7   Ban this user!
Old 02-23-2009, 10:16 AM
 
Join Date: Feb 2009
Location: U.S.A.
Posts: 19
psehorne is on a distinguished road

Originally Posted by stevo1 View Post
I don't know much about CAM software but couldn't you just put an R in all the G81 lines?
This works
S0
G81 X3.0 Y-1.34778 Z-0.26 R1.0
G81 X2.0 Y1.3477 Z-0.26 R1.0
G81 X-1.345 Y0.0 Z-0.26 R1.0
G81 X-4.22 Z-0.26 R1.0
G80

Thanks,
Paul
Reply With Quote

  #8   Ban this user!
Old 02-23-2009, 10:24 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

As it should work...glad you got it.

If you want as I stated before you can remove your G81,Z-.26, and R1. from your other lines. You can put as many X,Y locations as your heart desires...no need to keep calling the same codes. You can also not input a X or Y if you are using the same position as the position before.

S0
G81 X3.0 Y-1.34778 Z-0.26 R1.0
X2.0 Y1.3477
X-1.345 Y0.0
X-4.22
X,Y
X,Y
X,Y
G80

Stevo
Reply With Quote

  #9   Ban this user!
Old 02-23-2009, 10:43 AM
 
Join Date: Feb 2009
Location: U.S.A.
Posts: 19
psehorne is on a distinguished road

Originally Posted by stevo1 View Post
If you want as I stated before you can remove your G81,Z-.26, and R1. from your other lines. You can put as many X,Y locations as your heart desires...
Thanks, Stevo... I understand now.

Paul
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
Problem with pauses in drill operation LuckyStrike SprutCAM 3 01-15-2009 01:43 PM
Need gcode or dxf file for drilling UHU PCB visky UHU Servo Controllers 0 10-07-2008 02:45 PM
Drill operation problem nomodoh CamBam 1 07-27-2007 09:56 AM
Drilling operation - 1st hole always skipped? JMFabrications Mastercam 6 07-15-2007 06:02 PM
I have a problem with my gcode or my conversion to gcode , everything is tiny? NickLatech G-Code Programing 0 03-10-2005 12:46 PM




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