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 11-28-2005, 05:09 PM
 
Join Date: Nov 2005
Location: united kingdom
Posts: 6
demonwolf is on a distinguished road
Something wrong with my G02 command and cant see what it is...

Hi
Im trying to write G-code for a report due in this friday, In one section i have to write G-code to machine a piece thats shown in a drawing. The blank is 140mm in length and 120mm wide and the first operation is profiling a curved corner (i think its techincal name is a fillet?) in the top right hand corner with a radius of 25mm. I have to do this in 2 passes, first rough pass is 2mm away from the finish.
This is the part of my g-code i have problems with. Im using CNCsimulator to check my code.
%
N10 G80 G40
N20 G90 G70
N30 G00 G91
N40 G28 X0 Y0 Z0
N50 G92 X0 Y0 Z0
N60 T02 M06 G41
N70 M03 S1000
N80 G90 G43 H01 Z20 F0
N90 G00 X113 Y122
N100 G01 Z-30 F200
N110 G02 X142 Y93 R27
N120 G00 Z20
N130 G00 X115 Y120
N140 G01 Z-30 F100
N150 G02 X140 Y95 I0 J-25
N160 G01 Z20
N170 G40

I have huge problems on line 110 the rough pass doesnt work if i use I and J parameters of I0 J-27 (the rough pass has a curve of radius 27) says G:02 illegal endpoint. So i used R27 and it works but machines into the surface where i dont want it to. Ive checked my coordinates and they seem okay. The finish pass works just fine and is simulated okay. Can anyone see where im going wrong?
Reply With Quote

  #2  
Old 11-28-2005, 06:35 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,454
ger21 is on a distinguished road
Buy me a Beer?

Try this. If you use I0 J-27, the radius won't be 27 unless your endpoint was X140 Y95


N110 G02 X142 Y93 I2.0803 J-26.9197
__________________
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   Ban this user!
Old 11-28-2005, 06:53 PM
 
Join Date: Nov 2005
Location: united kingdom
Posts: 6
demonwolf is on a distinguished road

thanks gerry , i tried it but still get the illegal endpoint error command, possibly a bug in CNCsimulator?

Ive redone my code so i use ccw circular interpolation G03, i tried it with I and J commands and get that error but with R27 parameter it works fine and machines the piece like it should. Its also a little more elegant as i dont have to retract the drill after the rough pass.
Still would like to know why the I and J parameters dont work in the first G03 command yet work in the finish pass G02 command. Its really confusing me.

%
N10 G80 G40
N20 G90 G70
N30 G00 G91
N40 G28 X0 Y0 Z0
N50 G92 X0 Y0 Z0
N60 T02 M06 G42
N70 M03 S1000
N80 G90 G43 H01 Z20 F0
N90 G00 X142 Y93
N100 G01 Z-35 F200
N110 G03 X113 Y122 R27
N120 G41
N130 G01 X115 Y120 F100
N150 G02 X140 Y95 I0 J-25
N160 G01 Z20
N170 G40
Reply With Quote

  #4  
Old 11-28-2005, 07:37 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

Demon,
You may have to make compatible settings in your cnc simulator to match the type of arc centers you are using. There are arc centers using absolute coordinates or those using incremental coordinates. If your simulator settings are not compatible, the output will be rubbish.

I would forego the R values, because they don't tell you enough when you are trying to determine arc centers for partial arcs. Stick with I and J, because those are the coordinates of the arc center, either relative to the current position (incremental) or relative to the part zero (absolute).
__________________
First you get good, then you get fast. Then grouchiness sets in.

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

  #5  
Old 11-28-2005, 07:46 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,454
ger21 is on a distinguished road
Buy me a Beer?

Probably a CNC Simulator issue. I loaded your first code (with my fix) into Mach3 and it ran OK.
__________________
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

Sponsored Links
  #6   Ban this user!
Old 11-28-2005, 10:26 PM
 
Join Date: Sep 2004
Location: Canada
Posts: 204
ckirchen is on a distinguished road

For the finishing pass (at the top right corner going CW around the part), a 25mm fillet will start at X115 Y120 and end at X140 Y95. Adding 2mm for the roughing pass, it will start at X115 Y122 and end at X142 Y95.

You have it starting at X113 Y122 and ending at X142 Y93. The problem is that don't need to add offset to the bolded items because not all items change when you apply the offset.

The correct blocks would be:
N090 G01 X115 Y122
N110 G02 X142 Y95 I115 J95

Chris Kirchen
Reply With Quote

  #7   Ban this user!
Old 11-29-2005, 08:09 AM
 
Join Date: Nov 2005
Location: united kingdom
Posts: 6
demonwolf is on a distinguished road

Thanks for the replies by everyone,

HuFlungDung I see what you mean about using either absolute or incremental dimensions for the circular interpolation commands. Ive been taught that I and J parameters are always incremental from the start position to the center of the arc. This was also specified in the haas workbook and I also tried using absolute dimensions for I and J of I115 J95 (centre of the arc) and they were illegal parameters.
Ive kept tampering with both of my programs. One which only uses G02 commands for both rough and finish passes and the other which does the rough pass with G03 and smooth with G02.

With the G02 only program I found out my issue. First of all as ckirchen pointed out my start and end points were wrong and Ive corrected that, thanks ckirchen such stupid mistake to make. With that correction my values of I0 J-27 were now sccepted, but I still had the tool machining into the workpiece before lifting off the surface. I studied the tool position at each line


N110 G02 X142 Y95 I0 J-27
N120 G01 Z20
N125 G00 X115 Y120

The above code machined the rough fillet but then cut into my workpiece across upto X115 before lifting off the surface and going to X115 Y120. Even though Ive specified the tool to be lifted before traversing to X115 Y120.
I think its a CNCSimulator bug, by adding the following commands:

N110 G02 X142 Y95 I0 J-27
N120 G01 Z20
N122 G40
N123 G41
N125 G00 X115 Y120

The tool now lifts above the surface before going to X115 Y120.
A strange bug but ive explained it to myself now and im happy.
Thanks again for all the help much appreciated. The above code works
Reply With Quote

  #8  
Old 11-29-2005, 08:35 AM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,454
ger21 is on a distinguished road
Buy me a Beer?

Be careful using G41/G42. Different controls have different requirements. Usually you have to specify a tool, or tool size, and you may need a leadin move as well. That's probably why you're getting the gouging problems.
__________________
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

  #9   Ban this user!
Old 11-29-2005, 08:59 AM
 
Join Date: Nov 2005
Location: united kingdom
Posts: 6
demonwolf is on a distinguished road

Im not sure I completely understand about leadin. And if tool compensations have been previously specified with G43 H01 commands, is it safe to use G41 G42?

Now with the problems gone in CNC simulator Ive decided to use the G03 listing to use in my report.
The first part is given below.

%

N10 G40
N20 G90 G71
N30 G94 G97
N40 T02 M06
N50 M03 S1000
N60 G43 H01 Z20 F0 G42
N70 G00 X142 Y95
N80 G01 Z-35 F200
N90 G03 X115 Y122 I-27 J0
N100 G41
N110 G01 X115 Y120 F100
N120 G02 X140 Y95 I0 J-25
N130 G01 Z20
N140 G40
Reply With Quote

  #10  
Old 11-29-2005, 10:05 AM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,454
ger21 is on a distinguished road
Buy me a Beer?

G43 is length compensation. G41/G42 are radius compensation. How they work together would depend on the control.
__________________
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

Sponsored Links
  #11   Ban this user!
Old 12-01-2005, 08:08 PM
 
Join Date: Feb 2005
Location: usa
Posts: 376
little bubba is on a distinguished road

I was reading this thread yesterday and was a little confused, now I'm even more confused. I think the problem lies with the OPs misunderstanding of radius/diameter cutter comp. I have never anywhere seen a G41 or G42 on a line by itself. Calling G41 or G42 on a Z move just seems like it would/could get you in trouble, it can be done, but is probably bad practice for a programming class.

A g41,g42 leadin... with no cutter comp, you need to bring your tool to where you need it on centerline.

GO X0 Y0
G0 H1 Z10.
G1 Z -100 F50
G1 G41 D1 X(A)Y(B)
rest of your profile

where A and B (the whole A squared +B squared = C squared thing) is greater than or equal to your cutter comp radius. Now before you retract, same thing calling a G40, you need to move greater than your cutter comp on a G40 line. It can be done on a Z move, but bad things can happen, unless your dead sure on whats going on.

BTW I didn't see a G17 in your program, a big bunch of other Gs but no G17 , ask your teacher what will happen if you call a G18 or 19 up top and then call up cutter comp.

What you really need to do is get on a real machine, see what actually happens, break some tools, scrap some parts and then I guarantee you will learn a lot faster.
Reply With Quote

  #12   Ban this user!
Old 10-27-2006, 06:15 AM
 
Join Date: Oct 2006
Location: USA
Posts: 16
nstaley is on a distinguished road

you did not define I and J for line 110
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





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