Hello Guest it is March 29, 2024, 06:47:33 AM

Author Topic: G41 Offset being ignored  (Read 7998 times)

0 Members and 1 Guest are viewing this topic.

G41 Offset being ignored
« on: October 08, 2010, 09:10:19 PM »
The G Code in the attachment below ignores my G41 Offset Lines.

What am I doing wrong?

There is a reason I am using the subroutine.  I have 3 other similar programs with multiple identical holes and using subroutines is the most compact and efficient way.

If I can get this simple one hole version going, I can then fix all programs and learn by my mistakes.

Regards

Chrisjh

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G41 Offset being ignored
« Reply #1 on: October 08, 2010, 11:30:52 PM »
If I were doing this I would start in the center of the shape. Then apply the G41 as a leadin to the midpoint of the rh flat. Then move up and then throught the arc down the LH flate then arc then from the beginning of the next straight I would sink the Z to the next depth then continue looping until I reached the target Z depth. After the target depth is reached and when you have reached the end point cancel with G40 and do a leadout the same way you came in.

How you apply the step down depends on you. I would use a variable for z and then loop the shape in a SUB call and apply the step depth at the end of each loop until target depth was met.

Just a thought, (;-) TP

Just a thought, (;-) TP

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: G41 Offset being ignored
« Reply #2 on: October 09, 2010, 04:56:33 AM »
This would be my solution :-

The G52 is commented out for display purpose only, Mach3 shows it wrong and confuses people.

%
(0298-04_1Hole Pattern Step and Repeat using Sub Routine)
(This routine machines 1 x Ø12.8 Flat Sided Hole in one side of a plastic box)
(CJH 08Oct10)

O0000 (Main Program)

G00 G17 G21 G40 G49 G50 G64 G69 G80 G90 G94
M6 T6 (Ø3.175mm Slot Drill)
M3 S750
G04 P100
S1000
G04 P100
S1500
G04 P100
S2000
G04 P100
S2500
G04 P100
S2800
G04 P100
S3200
M8 (Coolant on)
G00 Z10. G43

(G52 X41.25 Y-11.) (1st Pattern)
M98 P0001 D6

M5 M9 (Spindle and Coolant Off)
G00 Z15
M30 (End and Rewind)

O0001 (Subroutine 1)
G00 X0 Y0
G01 Z-1. F200.
M98 P0002 F400.
G01 Z-2. F200.
M98 P0002 F400.
G01 Z-3. F200.
M98 P0002 F400.
G01 Z-4. F200.
M98 P0002 F400.
G00 Z10.
G52 X0 Y0
M99

O0002(Mill Ø12.8 Flat Sided Hole)
G01 G41 X1.808 Y-1.035
G03 X0. Y6.4 R3.938
X-5.712 Y2.887 R6.4
X-5.9 Y2.098 R1.75
G01 Y-2.098
G03 X-5.712 Y-2.887 R1.75
X5.712 R6.4
X5.9 Y-2.098 R1.75
G01 Y2.098
G03 X5.712 Y2.887 R1.75
X0. Y6.4 R6.4
X-1.808 Y-1.035 R3.938
G01 G40 X0. Y0.
G00 Z2.
M99
%

Graham
« Last Edit: October 09, 2010, 04:59:33 AM by Graham Waterworth »
Without engineers the world stops

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G41 Offset being ignored
« Reply #3 on: October 09, 2010, 02:14:56 PM »
There have been a few strange things reported with the G41 that work fine in G42 mode.



Just a thought, (;-) TP
Re: G41 Offset being ignored
« Reply #4 on: October 09, 2010, 08:25:52 PM »
Thanks Graeme,

Very efficient and compact code!!   However I still have a problem with wild arcs in both your and my programs.  See Attached Toolpath images.

The crazy thing is that I have a program that works using a "P" rather than a "D" offset.  See example of the Toolpath image and program attached.

I prefer not to use Tool Tables (and any data therein) for 2 reasons:
 
1.   I am a learner and my mill does not use a tool changer (yet) and I use gang tooling on my lathe, and

2.   I found that using tool table data on my lathe caused excursions beyond the limits of my cross slide travel so I settled on temporary G52 offsets for each tool in the gang. (Works great)

As a result, all of the data in my tool tables is set to 0.  I will use tool tables when I have access to a tool changer.

Whilst fiddling yesterday, I actually saw a correct Toolpath using a "P" offset on the simulation screen in my office.  So I closed the file and rushed out to my shed to test the code on the mill computer, only to see the wild arcs again.  I went back inside to recheck but the Toolpath had reverted to "wild arcs".  So I now suspect that Mach3 has some form of "intermittency".

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: G41 Offset being ignored
« Reply #5 on: October 10, 2010, 04:48:05 AM »
If you are using G52's in your code you can get strange results in the tool path display, test the code with G52 commented out and then if the code looks good then run it with the G52's included.

The problem is in the display not the cutting path this has been corrected in version 4.
Without engineers the world stops
Re: G41 Offset being ignored
« Reply #6 on: October 10, 2010, 07:07:19 AM »
Hi Graham,

I have been giving this problem some further thought.

I recently had a similar problem when I tried to use a G68 to rotate the toolpath so a job could fit in my vice jaw limits.  Long story short, but I rewrote the code with the dxf file rotated and, did not use any G68 rotation commands.  The result is shown in the successful toolpath in the previous post.

So I thought, "What if i get rid of subroutines?"

The result was a successful toolpath as shown in the image attached.  The program is useless for my purpose but proves the point.

So it appears that Mach3 does not like the combination of G41 Offsets with Subroutines or G68 rotational commands.

Fot the job in hand, I guess I have no choice but to abandon my attempts to use G41 offsets and go back to my old proven, long winded, methods of using toolpaths generated with Bobcad.  So a few more hours rewriting 4 new programs doing battle with Bobcad.

Regards

Chrisjh

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: G41 Offset being ignored
« Reply #7 on: October 10, 2010, 09:27:32 AM »
Hi Chris,

the tool path that you have shown is flawed, it will cut into the side of the hole on entry and exit, this is due to the fact that you are trying to apply the G41 comp into a sharp corner, this can be resolved in one of two ways you can fillet the corners with 3.2mm rads or you move the start point into the centre of one of the arcs or flats then all will work as it should.  G41 has problems but if you follow the rules it is fine and it will work with subs.

V4 uses tool compensation type C and solves all these problems but that is still some time away.

Graham
Without engineers the world stops

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: G41 Offset being ignored
« Reply #8 on: October 10, 2010, 01:41:17 PM »
Graham I have not been able to get a G41 to work with subs AND USING the G52 in a long time. Perhaps you could post a simple version as an example. SUBS worked fine but not the combination of sub and G52s.

I have been practicing hand coding to stay sharp with it.  Also the new Comp code does not use arcs  as a leadin leadout.  SO it is a little more tricky to hand code.

Thanks (;-) TP

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: G41 Offset being ignored
« Reply #9 on: October 10, 2010, 02:20:38 PM »
All I can say is the code below works on my mill and simulates OK on screen.

Graham
Without engineers the world stops