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! > CAM Software > General CAM Discussion


General CAM Discussion Discuss CAD/CAM software and Design software methods here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-19-2005, 03:44 AM
MrBean's Avatar
Gold Member
 
Join Date: Oct 2003
Location: UK
Posts: 593
MrBean is on a distinguished road
Radius compensation in Mach2?

Does anyone know the syntax for using G41/G42.

I have some simple gcode that I'm running under Mach2, but I cant figure out how to use the G41/42 commands.

Any help is appreciated.

Regards Terry.....
Reply With Quote

  #2  
Old 03-19-2005, 06:02 AM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,453
ger21 is on a distinguished road
Buy me a Beer?

You need to have a lead in move, which is incredibly complicated to explain. Sometimes you need two. The lead in can be an arc or straight line. I recently read something on the Mach2 group about the lead in move being on the same line as G41/G42. But, I don't think it always has to be. Here code for a 2" circle (hole) using a 1/4" bit, with an arc for the lead in move. This displays correctly in Mach2's toolpath display, so I think it works. The center is at 0,0.

G0 Z0.1250
G0 X-0.1250 Y0.7500 Z0.1250
G42P0.125 (turn on offset right- P = tool radius)
G2 X0.0000 Y1.0000 Z0.0000 I0.1250 J0.0000 F20 (lead in move)
G2 X0.0000 Y1.0000 Z-0.1250 I0.0000 J-1.0000
G2 X0.0000 Y1.0000 Z-0.1250 I0.0000 J-1.0000
G0 X0.0000 Y1.0000 Z0.1250
G40 (turn off comp)

Instead of using P for the tool radius, you can also use D for the tool # in the tool table. G41D1 = Use Tool #1.

You should play around with some simple stuff until you get the hang of it. Here is code for a 2" square with a 1/4" bit.

G0 Z0.1250
G0 X4.0000 Y3.0000 Z0.1250
G1 X4.0000 Y3.0000 Z-0.1250 F10
G42P0.125 (turn on offset right- P = tool radius)
G1 X3.2500 Y3.0000 Z-0.1250 F20 (lead in move)
G1 X1.0000 Y3.0000 Z-0.1250
G1 X1.0000 Y1.0000 Z-0.1250
G1 X3.0000 Y1.0000 Z-0.1250
G1 X3.0000 Y3.1105 Z-0.1250 (I like to always start and end a little bit outside my part)
G40 (turn off comp)

Since I don't have my router finished, I haven't tested this. But I have done simulated runs in Mach2 which looked correct. I generated the code using my AutoCAD G-code macro.

Hope this helps.
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #3  
Old 03-19-2005, 06:26 AM
MrBean's Avatar
Gold Member
 
Join Date: Oct 2003
Location: UK
Posts: 593
MrBean is on a distinguished road

Many many thanks for that, ger21. Much appreciated.

I was trying to enter a diameter after the G41/42 I didn't realise you needed a P.
That sounds odd. I don't mean you need the toilet.


A reference text file would be handy for Gcode syntax's. Mach2 has a list of supported G/M codes, but no info on syntax, unless I missed something.

Thanks again.

Regards Terry.....
Reply With Quote

  #4  
Old 03-19-2005, 07:49 AM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,453
ger21 is on a distinguished road
Buy me a Beer?

The docs are kinda vague and imo quite confusing in regards to G41/G42.
When using the P with G41/G42, you need to enter the RADIUS, not diameter. Also, if you look carefully at the arc lead-in move, you'll see that it can't be drawn in a CAD program, because the start and end are different distances from the center of the arc. Even more confusing, eh? Lets see if I can explain it. I'll use metric, maybe that will make it a little clearer.

We'll do a clockwise leadin move, starting at 9:00. We'll use a 6mm tool, starting at 0,0. Move 1/2 the diameter to the left and position the tool.

G0 x-3 y0

The center is 0,0. Next line is your tool offset.

G42P3

Offset to the right 3mm radius tool. Now the tricky part. The next line has to finish at the offset position.

G2 X0 Y6 I3 J0


The arc starts with a 3mm radius, but ends with a 6mm radius. Make sense? The arc lead in move needs to be tangent to the next move, or you'll get gouging.
The next move can either be G1 X5(or whatever) Y6, Or a G2 to wherever you want.


Imo, you should only use arc leadin moves for the inside of cutouts, as it's far to complicated to hand code all the time.

Be aware that when doing cutouts, all inside corners need to have a radius at least as big as the tool radius, preferably a little bigger, or the tool will gouge the corner. Mach2 doesn't look ahead to see where it needs to go, so each line or arc needs to be tangent to the previous one or the tool will gouge the work. I'd draw some pictures, but I really don't have time right now. Hope this is helpful for you.
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro/Parametric Programming screensnot Fadal 4 03-28-2005 08:45 PM
Cutter compensation woes!! RBCMan G-Code Programing 7 02-16-2005 09:43 AM
Radius between tangents? smythe Rhino 3D 6 10-29-2004 03:14 PM
Windows XP or Windows 2000 better with Mach2 Beezer Mach Software (ArtSoft software) 2 10-18-2004 10:08 AM
G Code and Mach2 InventIt DIY-CNC Router Table Machines 8 03-13-2004 01:46 PM




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