Hello Guest it is March 28, 2024, 09:13:48 AM

Author Topic: Setting cutter radius with G10?  (Read 19426 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Setting cutter radius with G10?
« Reply #10 on: November 11, 2011, 09:39:10 AM »
G10 L1 P~ X~ Z~ A~, where the P number must evaluate to an integer in the range 0 to
255 - the tool number - Offsets of the tool specified by the P number are reset to the given.
The A number will reset the tool tip radius. Only those values for which an axis word is
included on the line will be reset. The Tool diameter cannot be set in this way.


First the axis involved ARE lathe axis  XZ  NOW read the last line of the paragragh above(;-)

"The Tool diameter cannot be set in this way."

 A is the tip radius on a lathe tool bit.

Use of the G10 is a standard way of setting the fixture offsets Via Gcode only you use G10 L2.

IF you want to be able to set tool table Values you need to use a Mcode and use parmeters to set the values

M1999 P1 Q2.000 R.250

That could be used to set the Tooltable values to Tool#1  Tlength 2.000 and radius .250



(;-) TP
« Last Edit: November 11, 2011, 09:41:54 AM by BR549 »

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
re G41/G42 and G10
« Reply #11 on: November 11, 2011, 03:56:31 PM »
Hi all

Thanks for words of wisdom. Appreciated.

It does seem that the text in M3M is a trifle obscure at this stage. It may well be that it needs a little editing to clarify what applies to a mill and what applies to a lathe. I guess I was hoping for a little too much :-)

Yes, if I could find a copy of one of Smid's book I would read it with great enthusiasm. Can't find any around here though.

It just seems to me that if LazyCam and CamBam can do it (for example), then it should be possible for Mach3 to do it. Mind you, some CAD programs attempt it and get bits of it wrong. I have to manually correct embedded arcs for instance in one of my most commonly used CAD programs. So maybe it wouold be hazardous to include in Mach3 it at this stage! And, it is possible to describe outlines which cannot be handled with a cutter of X mm diameter - so what then?

OK, back to the shop.
Cheers

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Setting cutter radius with G10?
« Reply #12 on: November 11, 2011, 05:04:09 PM »
I don't have a clue as to what you are trying to saying(;-)  MACH3 is a machine controller, it is not CAD or CAM. It can ONLY do what it is told to do via the Gcode program.

What is it you think Mach3 should do that it already doesn't do?

"It just seems to me that if LazyCam and CamBam can do it (for example), then it should be possible for Mach3 to do it. Mind you, some CAD programs attempt it and get bits of it wrong. I have to manually correct embedded arcs for instance in one of my most commonly used CAD programs. So maybe it wouold be hazardous to include in Mach3 it at this stage! And, it is possible to describe outlines which cannot be handled with a cutter of X mm diameter - so what then?"

(;-) TP

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Setting cutter radius with G10?
« Reply #13 on: November 11, 2011, 05:34:18 PM »
I don't have a clue as to what you are trying to saying(;-)  MACH3 is a machine controller, it is not CAD or CAM. It can ONLY do what it is told to do via the Gcode program.
What is it you think Mach3 should do that it already doesn't do?

OK, understood. Let me explain.
If I define a tool diameter for milling I can get Mach3 to compensate for that tool diameter when machining a simple square. For a SIMPLE convex object in fact. Example follows.

Let's assume a 50 mm square and an unknown diameter cutter for instance (yeah, metric, but that's where I am). First, I program the control point to go around the actual square (non-minimal coding for clarity):
g1 x0 y0
g1 x50 y0
g1 x50 y50
g1 x0 y50
g1 x0 y0

Now, with any realistic physical cutter this code by itself will produce a square which is undersize. However, if I open up the tool table and put, say, 10 mm into tool 1 diameter, and load a 10 mm cutter, and prefix that code with

G0 x-20 y-20      % move to outside the square to allow a lead in - essential for g41 to work
G41 D1              % turn on cutter compensation

and then run that code, I will get a square cut exactly to size. Now let's assume i break that cutter, and only have an 8 mm cutter left over. I load it, change the Tool 1 diameter in the tool table to 8 mm and rerun the code. Behold: another perfect 50 m square.

What this means is that Mach3 can right now compensate for tool diameter when machining a simple convex outline. But it can't handle a complex and sometimes concave shape. OK. But many CAD/CAM programs can handle complex outlines and generate correct tool paths. What that says to me is that the code in Mach3 which handles cutter diameter compensation is but a limited and incomplete copy of the CAD/CAM programs. LazyCAM can handle this in most cases.

Where this becomes a serious problem is when the shape I am cutting slowly gets more complex, and the program gets more complex with subroutines. I can rely on Mach3 to correctlly handle simple shapes in a 'flat' program, but at some degree of shape or program complexity it will fail, and I don't know when that will be! That uncertainty is dangerous.

What should Mach3 do?
Well, we have several possibilities here.
1) Attempt NO cutter diameter compensation at all (rather than an unreliable version)
2) Upgrade the cutter compensation code to handle ALL cases (this is possible but may be difficult)
3) Do the best it can but alert the user at load time when the shape is too complex for it to handle correctly.
4) Ban the use of subroutines when G41 is active

Possibility 1) is going backwards.
Possibility 2) is possible (eg lazyCAM) but requires a lot of programming to bring it up to CAD/CAM SW performance. $$ implications.
Possibility 3) sounds very nice but I am not sure whether it is either theoretically possible or reliable enough. There are huge complexities.
Possibility 4) might work (I am not sure), but it would be extremely inhibiting and a serious backwards step. I write very parametric programs using lots of subroutines.

Cheers



« Last Edit: November 11, 2011, 05:45:26 PM by rcaffin »

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Setting cutter radius with G10?
« Reply #14 on: November 11, 2011, 05:44:23 PM »
(;-) Mach can follow ANY contour inside or outside with tool comp as long as the radius of the cutter is smaller than the smallest radius it has to follow. IF you use a cutter that is LARGER than the smallest arc then MACH will error out and NOT run the code AS IT SHOULD.

IF it ran the bad tool/code combination it would GOUGE the part and the results would be an incorrectly made part. AKA JUNK.

Now that does require you to be able to program it correctly.

(;-) TP

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Setting cutter radius with G10?
« Reply #15 on: November 11, 2011, 06:06:21 PM »
(;-) Mach can follow ANY contour inside or outside with tool comp as long as the radius of the cutter is smaller than the smallest radius it has to follow. IF you use a cutter that is LARGER than the smallest arc then MACH will error out and NOT run the code AS IT SHOULD.
IF it ran the bad tool/code combination it would GOUGE the part and the results would be an incorrectly made part. AKA JUNK.
Now that does require you to be able to program it correctly.
Actually, not quite correct, on either point, and I now suspect that the problem lies not with the complexity of the shape but with the use of subroutines. As Ger21 said "From what I understand, G41/G42 doesn't work well with subs." That is a SW fault, pure and simple.

But I had better explain about the 'problem' of convex corners. Suppose the part I am making does have a convex corner. I do not want that corner to be a sharp point: that would produce stress concentrations leading to part failure under load. That's bad design. Instead, I want to filet the internal corner. Suppose I decide to use a 4 mm radius filet. I can get Mach3 to produce that filet by using an 8 mm cutter (radius=4 mm) and programming the outline without the filets. Yes, I tell Mach3 to go to the corner, but it does not: it stops short so there is no gouging and heads off on the next segment. It correctly creates a 4 mm radius filet just like that. I think that is wonderful. And Mach3 does not error out: It accepts the instructions and correctly executes them. No junk at all.

But I tend to program with subroutines for a number of reasons. Laying out several identical parts on one sheet, with some of them rotated to fit in optimally, is one reason. When I start to use subs, G41 fails. I would show pictures of the tool paths if this forum could handle images ... Is this a valid form of programming? Well, I think so, and I have been writing software at all levels for the last 50 years.

Cheers


Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Setting cutter radius with G10?
« Reply #16 on: November 11, 2011, 06:23:25 PM »
(;-) Mach can follow ANY contour inside or outside with tool comp as long as the radius of the cutter is smaller than the smallest radius it has to follow.


Not this code:

G20 G40 G90
G91.1
S10000 M3
G0 Z0.25
G0 X18.0538 Y9.7864 Z0.25
G1 X18.0538 Y9.7864 Z0.0 F50
G42P0.125
G1 X18.3056 Y9.0 Z-0.1 F1
G1 X18.3056 Y6.9396 Z-0.1
G2 X18.1732 Y5.4917 Z-0.1 I-0.75 J-0.6614
G2 X17.5412 Y4.5622 Z-0.1 I-2.1176 J0.7604
G2 X17.3762 Y4.5 Z-0.1 I-0.1651 J0.1878
G1 X17.3762 Y3.75 Z-0.1
G3 X18.0364 Y3.9990 Z-0.1 I0.0 J1.0
G3 X19.0556 Y6.2520 Z-0.1 I-1.9809 J2.2530
G1 X19.0556 Y11.7480 Z-0.1
G3 X18.0364 Y14.10 Z-0.1 I-3.0 J0.0
G3 X17.3762 Y14.25 Z-0.1 I-0.6603 J-0.7510
G1 X17.3762 Y13.5 Z-0.1
G2 X17.5412 Y13.4378 Z-0.1 I0.0 J-0.25
G2 X18.1732 Y12.5083 Z-0.1 I-1.4856 J-1.6898
G2 X18.3056 Y11.0604 Z-0.1 I-0.6176 J-0.7865
G1 X18.3056 Y8.7147 Z-0.1
G40
G1 X18.0556 Y8.4647 Z0.0
G0 X18.0556 Y8.4647 Z0.25
M5
M30


It works for 99% of what I do, but it does have issues.

But there's nothing that can be done. Fixing bugs adds more, and delays the next version, which actually has comp that works in all situations.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Setting cutter radius with G10?
« Reply #17 on: November 11, 2011, 06:28:21 PM »
Hi Ger

ERRRKKK!
I just pasted that in to see what it looked like. OUCH! Really wierd the way it took off at the top. Yeah, problems!

Ah well, when do we get the next release?

Cheers

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Setting cutter radius with G10?
« Reply #18 on: November 11, 2011, 06:30:19 PM »
When Brian stops fixing bugs in the current version.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Setting cutter radius with G10?
« Reply #19 on: November 11, 2011, 06:34:21 PM »
Hi Ger

Do I interpret what you wrote as meaning that the subroutine problem has been fully fixed in V4?

Cheers