CamBam

FeedBack => Bug Reports => Topic started by: R0bbie on June 05, 2017, 14:23:50 pm



Title: Different tool with same diameter problem
Post by: R0bbie on June 05, 2017, 14:23:50 pm
Hello all,

New member here.
I am amazed by the ability of my CNC router to find the spots where the screws are holding down the work piece on the spoil board, preferably when using carbide tooling :(

Today it happened again but I found it wasn't my fault (besides checking the code or doing an air cut).

I have found that when doing a tool change to a different tool number with the same diameter the Z axis plunges to the cutting height and then the X and Y move to the cutting position and finds of course the screw  :'(.

I am using Mach3 and have selected the correct post processor, attached you find a print-screen of the code, left with same tool diameter problem see arrow.

Am I doing something wrong or am I the first one to do a tool-change with the same diameter?

Regards,
Rob.


Title: Re: Different tool with same diameter problem
Post by: kvom on June 05, 2017, 14:53:04 pm
Post the CB file to get the help you need.


Title: Re: Different tool with same diameter problem
Post by: R0bbie on June 05, 2017, 15:03:42 pm
Thank you for your reply Kvom,

The file is nothing special, but it replicates the problem.
if you change the tool diameter of Profile2 to anything else the problem disappears.

Regards,

Rob.


Title: Re: Different tool with same diameter problem
Post by: lloydsp on June 05, 2017, 15:04:23 pm
Yeah, you must post your .cb file for us to help well.  However, I see nothing untoward there from one file to the other... BOTH do the plunge to Z0.

And no... you're not the first.  I frequently go from a 1/2" endmill to a 1/2" ball-nose.

LLoyd


Title: Re: Different tool with same diameter problem
Post by: R0bbie on June 05, 2017, 15:13:41 pm
Thanks for you reply Lloyd,

I can make a ball-nose from an endmill without a tool change ( if I only find the screw ;) )

Sorry, serious now, the difference if you compare the left code to the right is first the plunge to Z0 and then the Y move, on the right side there is first a X move and then the Z plunge.

Regards,
Rob.


Title: Re: Different tool with same diameter problem
Post by: lloydsp on June 05, 2017, 15:18:42 pm
Yeah, I just ran the file.

It's something about the Mach3 PP.

It produces what you saw, but my own PP (pretty-generic) produces more-correct code, like this:

%
O1
: TEST2
:
: CAMBAM
: TEST2 6/5/2017 10:20:10 AM
: T3 DIA 6.0
: T6 DIA 6.0
G21
G0 G17 G40 G80 G90
: T6 : 6.0
: TOOL/MILL,6.0,0.0,0.0,0
M9  ; COOLANT OFF
M5  ; SPINDLE OFF
M25
G28 ; GO TO MACHINE RETURN POSITION
T6 M6
G43 H6
: PROFILE1
M3 S18000
G4 P6.00
G0 X-3.0 Y0.0
G0 Z25.0
G0 Z1.0
G1 F300.0 Z-1.0
G1 F800.0 Y100.0
G2 X0.0 Y103.0 I3.0 J0.0
G1 X100.0
G2 X103.0 Y100.0 I0.0 J-3.0
G1 Y0.0
G2 X100.0 Y-3.0 I-3.0 J0.0
G1 X0.0
G2 X-3.0 Y0.0 I0.0 J3.0
G0 Z25.0
: PROFILE2
: T3 : 6.0
: TOOL/MILL,6.0,0.0,0.0,0
M9  ; COOLANT OFF
M5  ; SPINDLE OFF
M25
G28 ; GO TO MACHINE RETURN POSITION
T3 M6
G43 H3
M3 S18000
G4 P6.00
G0 X-3.0 Y0.0
G0 Z0.0
G1 F300.0 Z-1.0
G1 F800.0 Y100.0
G2 X0.0 Y103.0 I3.0 J0.0
G1 X100.0
G2 X103.0 Y100.0 I0.0 J-3.0
G1 Y0.0
G2 X100.0 Y-3.0 I-3.0 J0.0
G1 X0.0
G2 X-3.0 Y0.0 I0.0 J3.0
G0 Z25.0
M25 ; GO TO Z HOME
M09 ; COOLANT OFF
M5
G28
M2 ; END OF PROGRAM


Title: Re: Different tool with same diameter problem
Post by: R0bbie on June 05, 2017, 15:24:33 pm
Thanks for your reply Lloyd,

So should I change post processor or can I modify the Mach3 pp to correct the problem?


Regards,

Rob.


Title: Re: Different tool with same diameter problem
Post by: lloydsp on June 05, 2017, 15:29:01 pm
Note that my PP inserts a G28 (return to machine home) before each toolchange.  

Your machine thinks the tool is still AT X-3Y0 after the second tool's changeout, so it doesn't move the gantry before plunging.

Somehow, you must make Mach3 think the tool is NOT at X-3Y0.  One way (which wastes a bit of code space) is just to make the G0 command ALWAYS non-modal. (change this:{$g0} {$_f} {$_x} {$_y} {$_z} {$_a} {$_b} {$_c} to this: {$g0} {$_f} {$x} {$y} {$z} {$_a} {$_b} {$_c}

The reason it doesn't happen when the tools are different sized, is the tools have different starting positions for their profiles.

With the above change to the Mach3 PP, you get this:
T6 M6
( Profile1 )
G17
M3 M7 S18000
G0 X-3.0 Y0.0 Z25.0
G0 X-3.0 Y0.0 Z1.0
G1 F300.0 Z-1.0
G1 F800.0 Y100.0
G2 X0.0 Y103.0 I3.0 J0.0
G1 X100.0
G2 X103.0 Y100.0 I0.0 J-3.0
G1 Y0.0
G2 X100.0 Y-3.0 I-3.0 J0.0
G1 X0.0
G2 X-3.0 Y0.0 I0.0 J3.0
( Profile2 )
G0 X-3.0 Y0.0 Z25.0
( T3 : 6.0 )
T3 M6
M3 M7 S18000
G0 X-3.0 Y0.0 Z0.0
G1 F300.0 Z-1.0
G1 F800.0 Y100.0
G2 X0.0 Y103.0 I3.0 J0.0
G1 X100.0
G2 X103.0 Y100.0 I0.0 J-3.0


Title: Re: Different tool with same diameter problem
Post by: lloydsp on June 05, 2017, 15:39:06 pm
BTW, David will probably move this thread to general usage or post-processors.  It's certainly NOT a bug.

Lloyd


Title: Re: Different tool with same diameter problem
Post by: R0bbie on June 05, 2017, 15:46:42 pm
Thank you very much Lloyd!!

I don't have a clue what it all meant but I changed what you told me and the code look good now!

Thank you for your fast reply, explanation and solution!

Regards,

Rob.


Title: Re: Different tool with same diameter problem
Post by: lloydsp on June 05, 2017, 15:58:14 pm
Rob,
The explanation is simple.  There are two types of motion commands one may use.  A command may be 'modal'.  In that case, if nothing has changed from where the machine believes it is, then the command is simply not issued.

It can be made 'non-modal', also.  In that case, it's always issued, whether your machine thought there was a change of position or not.

Cambam uses the underscore in front of an axis value to make that axis modal.  So if your PP contained a $_x, the X value would only be issued when the pp believes there was a change from the position.  Make it $x instead, and the PP will ALWAYS issue the axis value, regardless.

LLoyd


Title: Re: Different tool with same diameter problem
Post by: Dragonfly on June 05, 2017, 16:08:31 pm
Mach3 tool change is entirely Mach3 responsibility and coded in it. CamBam has nothing to do with it and it is not related to tool diameter either.
Mach3 original tool change can be modified by a customized macro.  I use the original sequence for manual tool change and after change and zeroing Z lift the tool high manually and move it back in the vicinity of the spot where it stopped for the change.
I repeat - this is not a CamBam issue.


Title: Re: Different tool with same diameter problem
Post by: R0bbie on June 05, 2017, 16:51:18 pm
Thank you both again for your explanation,

I went back to the original part I was machining and nothing has changed, I noticed that the code was G1 instead of G0.
So I changed the X Y Z settings for G1 also to "non modal" as Lloyd explained.

The problem now is that all axis start moving towards to the cutting position at plunge feed rate (slow!) and the Z is heading for cut depth.
I would rather like all axes to move G0 to cutting position respecting Clearance Plane.

@ Dragonfly, I am using Cambam for a while now and am very happy with it.
I am still using the evaluation version and will buy it when my trials expire.
Please don't get me wrong, there is no reason to think that I am pointing fingers at Cambam, I am having a problem I don't understand.

Best regards,
Rob.



Title: Re: Different tool with same diameter problem
Post by: lloydsp on June 05, 2017, 16:56:07 pm
There are a number of things that can be done to modify the PP.

But before doing that, it would be useful for some other Mach3 users to pipe up about how their systems handle such situations.  As I noted earlier, my G28 conclusively convinces the PP that the spindle is no longer in whatever position it needs to go, so I don't see that issue, ever.

Lloyd


Title: Re: Different tool with same diameter problem
Post by: R0bbie on June 05, 2017, 17:33:14 pm
Thanks again Lloyd,

Everything I have done with Cambam worked fine until this problem I found.
I think the best I can do is revert the settings back to original and remember this "understandable" flaw.
If I put a useless Mop in between or change the tool diameter just 0.01mm the problem will be cured.

Kind regards,

Rob.


Title: Re: Different tool with same diameter problem
Post by: kvom on June 05, 2017, 17:41:49 pm
One kluge that will work around this issue is to make the tool diameter on the roughing cut something like 6.001mm.  Then CB thinks the tool needs to move after the tool change.


Title: Re: Different tool with same diameter problem
Post by: R0bbie on June 05, 2017, 18:18:31 pm
Hi Kvom,
I Don't know the word Kluge, Looked it up on Google and it describes it perfectly, in my words a dirty workaround which does the job.
as I wrote in my previous post make the tool 0,01mm larger and setting roughing clearance to -0,005mm solves the issue.

Regards,
Rob.


Title: Re: Different tool with same diameter problem
Post by: dh42 on June 05, 2017, 20:08:47 pm
BTW, David will probably move this thread to general usage or post-processors.  It's certainly NOT a bug.

Lloyd

Hello

Hum, that looks like a bug .. IMHO

Lloyd trick solve the pb for the X move, but the Z move is wrong ; it go to Z0.1 instead Z1.1

( Profile2 )
G0 Z25.0
( T10 : 6.0 )
T10 M6
M3 S18000
G0 X-3.0 Y0.0 Z0.1
G1 F300.0 Z0.0
G1 F800.0 Y100.0

the right code
( Profile2 )
G0 Z25.0
( T10 : 6.0 )
T10 M6
M3 S18000
G0 X-3.0
G0 Z1.1
G1 F300.0 Z0.0
G1 F800.0 Y100.0

As say Rob, changing the Ø to a small amount, and the G0 X.. is coming back

++
David

Edit: The pb is the same with the 'default' post processor


Title: Re: Different tool with same diameter problem
Post by: lloydsp on June 05, 2017, 20:41:50 pm
Well, David,

I'm not sure what's going on, but I just RAN a job on my machine with two different tool numbers for the same-sized cutter (same cutter, in fact).  In my case, I changed tool numbers in order that I might move some clamps after the first operation.

Mine did nothing LIKE what you are seeing there.  Mine handled each pocket as if it were a separate job.  All the correct feeds, plunges, everything.

The only thing I can see there is that both the rough and finish operations start and end at the same point, so that's 'fooling the pp' somehow.  FWIW, my two pockets overlap, but are different sizes.

I'm sure - therein - lies the issue we'll eventually find.

I thought, when I ran his job with my pp, that it worked properly.  I'll have to go look again.

LLoyd


Title: Re: Different tool with same diameter problem
Post by: dh42 on June 05, 2017, 21:37:38 pm
I think you find the pb

If I just change the start point for the second mop, the right X and Z move are coming back in the Gcode.

++
david


Title: Re: Different tool with same diameter problem
Post by: lloydsp on June 05, 2017, 21:53:02 pm
Hooray!  Good check, David!

Lloyd


Title: Re: Different tool with same diameter problem
Post by: Dragonfly on June 06, 2017, 08:19:50 am
Didn't want to interrupt the discussion until a solution is found but I must admit I read the OP diagonally and didn't get the essence of the problem right.
While I don't see this as a typical bug it is an odd case of coincidence where the logic of G-code generation is right but the actual result is unpredictable. Maybe it's better to hard code the move at safe Z after tool change even if the next MOP starts at the same position. Wouldn't cost any significant time but will be on the safe side.
Writing this I am not sure whether it is done in the PP or is coded in the main program.