Strange behaviour M61 Qn and cuttercompensation

More
04 Oct 2019 11:15 #147109 by MaHa
Because i need to do manualtoolchange sometimes at other position than at defined toolchange position, i use M61 Qn instead of M6. Works fine, mostly. Only this situation example:
Having a flute mill dia=12mm in spindle, next tool is dia=2mm, and cutter compensation will be applied. When reload file and M61 Qn is used for toolchange, it occurs an error in connection with G41/G42. Cuttercompensation does incorrectly recognise current tool in spindle, instead of changed tool. Is there a way to make M6 toolchange position variable, setable from Gcode, or get rid off this behaviour of M61 Qn / G41 G42?

Please Log in or Create an account to join the conversation.

More
04 Oct 2019 15:06 - 04 Oct 2019 15:09 #147117 by BigJohnT
You may want to read the M6 section of the documents for important information about what it does and does not do. While not stated in the documents I assume M61 works just like M6 with the exception of not moving anything.

JT
Last edit: 04 Oct 2019 15:09 by BigJohnT.

Please Log in or Create an account to join the conversation.

More
05 Oct 2019 05:24 #147156 by andypugh
Yes. I think that the point here is that both M6 and M61 require a G43 to apply the tool offsets and diameter.

Please Log in or Create an account to join the conversation.

More
05 Oct 2019 10:19 #147181 by MaHa
I use tooltable, and G43 is always applied. I made a short .ngc file to demonstrate, only need to load and reload. Tools T12 D=12 and T2 D=2 needed in tooltable.
Comment/uncomment in line 30/31. Open file or Ctrl-R produces the error, when M61 Q2 used.
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Oct 2019 06:00 - 08 Oct 2019 06:01 #147429 by andypugh
i wish there was a way to mark forum posts as "unread" or (better) for follow up.

Now I have read this, I can't unread it, but don't want to forget that I intend to look at it.

If nobody gets back to this within a few days please reply just to bump it back up the list, I think this sounds like it needs looking at.
Last edit: 08 Oct 2019 06:01 by andypugh.

Please Log in or Create an account to join the conversation.

More
28 Oct 2019 16:45 #148988 by MaHa
After this problem occurred again yesterday, i remember to bump it back up the list.

Please Log in or Create an account to join the conversation.

More
08 Dec 2019 01:31 #152310 by andypugh
Sorry for the extreme delay.

I have determined that the error is raised by this line here:
github.com/LinuxCNC/linuxcnc/blob/master...terp_convert.cc#L856

And that, with your test file tool_radius at that point is 6.00mm

So, this implies that M61 does not update
settings->cutter_comp_radius

That, in turn, is set by the G40 handler here:
github.com/LinuxCNC/linuxcnc/blob/master...erp_convert.cc#L1944
Checking that data, with an M6 the radius is set to 1, with an M61 it is set to 6.

So my theory is that M61 does not copy the diameter data from the tool "pocket" to "pocket 0" (which is the spindle)

Unfortunately I have a plane to catch in 6 hours. There is some chance that I might get back to this during the week I am away.
The following user(s) said Thank You: MaHa

Please Log in or Create an account to join the conversation.

More
10 Dec 2019 22:59 #152462 by MaHa
Thank you for investigating about this problem. Somehow i understand the description, but i am very far from being able to find a solution myself. As i completed this years work, I'm away for a while anyway.

Please Log in or Create an account to join the conversation.

More
12 Jan 2020 22:48 #154726 by MaHa
Now i circumvent this problem by Remap M6. The initial demand was, to be able to goto a freely selectable (manual)toolchange and probing position. I got this option, by removing toolchangeposition related entrys in the ini, adding variables for TCH and Z_OFFS, the standard toolchange and probing position. I have also the option in the .ngc file, to set this positions. If there is an entry in the .ngc, it overrides the .ini entry. At the same time, tool and z offset probing was improved. The first tool in the program sequence gets probed, then the toolsetter is placed on the workpiece, to get Z-offset, where a variable can be applied for minor corrections of the probing result. As we know, the toolpath doesn't match the preview anymore, after probing. So my probing routine has some funny testcounter, which allow to abort the program, ctrl-r, and when the program is started again, the 2 probing actions are skiped once, and the counter reset. A toolchange will reset this option also. This is only for the very beginning of a routine, with the first tool.
I did the testing in the simulation, also used the simulate_probe button, but still was tired of g38.n needing too much attention. A .ini entry 'SIM' with different values for the machine and simulation was made, to exclude certain programsequences in the simulation.

Please Log in or Create an account to join the conversation.

More
22 Mar 2020 15:34 #161115 by andypugh
I have looked at this some more, and I have noticed that if you ignore the warning, then the code runs properly.

It actually looks like the preview run-through is flagging an error, but there is no error at run-time.

You can see this in the simulator with your sample code (though the sim/axis-mm simulator needs the G53 move to be made a bit shorter)

M61Q2 = error box but runs OK
M6 T2 = all OK
M61 G12 = error box _and_ run-time message and program stop.

Running the tklinuxcnc simulator (no preview) has both versions of the code working. (but errors with M61Q12, as it should).

So this really does seem to be a problem with G-code preview rather than with the actual program execution.
The following user(s) said Thank You: MaHa

Please Log in or Create an account to join the conversation.

Time to create page: 0.229 seconds
Powered by Kunena Forum