Hello Guest it is March 28, 2024, 03:16:10 PM

Author Topic: G18 and G02 G03 problem  (Read 8197 times)

0 Members and 1 Guest are viewing this topic.

G18 and G02 G03 problem
« on: April 02, 2013, 01:59:09 PM »
This is my second G-code program ever, so please forgive me if I did something stupid :)

The part should be symmetrical, a slot with 2 opposing "fingers".   The bottom arc of the finger closer to the origin always goes clockwise (I think) whether I use G02 or G03....  Am I doing something wrong, or is this a Mach3 bug?   The problem arc is at the bottom of the program with a (******) comment above it.

I'm using IJ in incremental mode.

%
G20 (inches) G90 (absolute coords) G64 (best speed path)
M6 T3             (0.375 end mill)
G40
F15             (feed rate)
G00 Z0.1
G00 X 0.570 Y-0.190   
M98 P100 L3         (slot the stock)
(G00 Z2)         (retract for tool change)

M6 T6            (Enco 327-1933  1/2X3/64 NARROW USA STRTOOTH KEY CUT .047  )

G00 X 0.928 Y-0.260 (rough undercut)
G00 Z-0.156
G01 Y 0.760
G00 X 0.572
G01 Y-0.260

G00 X 0.928
G00 Z-0.129
G01 Y 0.760
G00 X 0.572
G01 Y-0.260

G00 X 0.938 Y-0.260 (finish undercut)
G00 Z-0.156
G01 Y 0.760
G00 X 0.562
G01 Y-0.260

G00 X 0.938
G00 Z-0.129
G01 Y 0.760
G00 X 0.562
G01 Y-0.260

G00 X 0.908 Y 0
M98 P200 L11    (round fingers on right side)
G91 G01 Y 0.025
G90
G00 x 0.592
M98 P300 L11    (round fingers on left side)

G00 X 0.750       (get in the middle to retract)
G00 Z0.1
M30    

(----------------------------------------------------------------)
O100                (Cut the slot)
G40
G91 G01 Z-.052   (conventional milling... maybe try climb)
G90
G01 Y 0.690
G01 X 0.930
G01 Y-0.190
G01 X 0.570
M99

(----------------------------------------------------------------)
O200               (undercut the finger right side)
G40 G90               
G91 G01 Y 0.025
G90
G18              (XZ plane)
G03 X 0.867 Z-0.088 K 0.041      (90 degree arc)
G01 Z -0.042               (Move up the width of the keyway cutter)
G03 X 0.908 Z-0.001 I 0.041      (90 degree arc)
G91 G01 Y 0.025
G90
G02 X 0.867 Z-0.042 K-0.041      (90 degree arc)
G01 Z -0.088               (Move up the width of the keyway cutter)
G02 X 0.908 Z-0.129 I 0.041      (90 degree arc)
G17            (XY plane)
M99

(----------------------------------------------------------------)
O300            (undercut the fingerleft side)
G40 G90               
G91 G01 Y -0.025
G90
G18              (XZ plane)
G02 X 0.633 Z-0.088 K 0.041      (90 degree arc)
G01 Z -0.042               (Move up the width of the keyway cutter)
G02 X 0.592 Z-0.001 I -0.041      (90 degree arc)
G91 G01 Y -0.025
G90
G03 X 0.633 Z-0.042 K-0.041      (90 degree arc)
G01 Z -0.088         (Move up the width of the keyway cutter)


(************** the following line always goes the wrong way whether I use G02 or G03)
G03 X 0.592 Z-0.129 I -0.041      (90 degree arc)


G17            (XY plane)
M99
            


%
Re: G18 and G02 G03 problem
« Reply #1 on: April 02, 2013, 10:00:36 PM »
Delete the problem line below and you will find you still have  a problem in the remaining code.
(************** the following line always goes the wrong way whether I use G02 or G03)
G03 X 0.592 Z-0.129 I -0.041      (90 degree arc)

Did you write this code by hand?


Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G18 and G02 G03 problem
« Reply #2 on: April 02, 2013, 10:46:01 PM »
G03 is the proper call in that piece of code . Mach3 does not always draw correctly in g18/19 mode (;-) But it is cutting the correct motion. WATCH the tool motion in the toolpathing  not the Predrawn motion.

(;-) TP
Re: G18 and G02 G03 problem
« Reply #3 on: April 03, 2013, 12:14:45 AM »
I wrote the code by hand... I haven't found a CAD/CAM solution that I can afford yet.

I can't delete that line because then the coords will be off for the following arcs and it will give an error. I guess I can try subbing in a straight move instead of an arc.   Would you give a hint as to where I goofed up?

BR549, that's kind of scarey that Mach3 can show one thing, but do another.  Are you saying if I run mach 3 in simulator mode, it will trace the correct path in the Toolpath window, or do I have to run it on my mill to see what it will actually do? (in air I guess so I don't break my tool)

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G18 and G02 G03 problem
« Reply #4 on: April 03, 2013, 09:33:43 AM »
YEP  either run it in air or go offline so the axis don't move and do a run and WATCH the tooltip on the screen. It will predraw it one way but actually move the tooltip the correct way.  That is how I knew which arc call to use to be correct. To be absolutly sure run the code in AIR and watch the tooltip to make sure.

(;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G18 and G02 G03 problem
« Reply #5 on: April 03, 2013, 09:42:15 AM »
For a free cad /cam try

Cad:  Draftsight

Cam :  Freemill
Re: G18 and G02 G03 problem
« Reply #6 on: April 03, 2013, 09:50:04 AM »
Not bad for the second G code ever by hand.  ;)

Look like you don't need a cam program. :)

That toolpath thing was trapping me also sometimes.  ;D

Alex
Re: G18 and G02 G03 problem
« Reply #7 on: April 03, 2013, 09:51:33 AM »
I just simulated it and L.I.B. the tool tip moved the right way even though it was pre-drawn incorrectly.

I'm rethinking whether my keyway cutter can do what I'm asking (don't think it will last very long cutting vertical arcs like I want), but that's not a g-code issue.

Thanks for the recommendation on software.  I will check them out, but I also need to get comfortable with g-code.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G18 and G02 G03 problem
« Reply #8 on: April 03, 2013, 11:18:13 AM »
The standard keyway cutter does not side cut well(;-)

Just a thought.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G18 and G02 G03 problem
« Reply #9 on: April 03, 2013, 03:51:47 PM »
You did a great job in programming that code. (;-)

(;-) TP