![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
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? |
|
#2
| ||||
| ||||
| 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) |
|
#3
| |||
| |||
| 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 |
|
#4
| ||||
| ||||
| 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) |
|
#5
| ||||
| ||||
| 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) |
| Sponsored Links |
|
#6
| |||
| |||
| 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 |
|
#7
| |||
| |||
| 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 |
|
#8
| ||||
| ||||
| 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) |
|
#9
| |||
| |||
| 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 |
|
#10
| ||||
| ||||
| 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) |
| Sponsored Links |
|
#11
| |||
| |||
| 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. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |