Machine Log

More
01 Sep 2021 01:45 #219301 by snowgoer540
Machine Log was created by snowgoer540
We've spent a lot of time looking at error messages for QtPlasmaC trying to refine them, translate them, etc.

One that always shows up in the machine log at startup is "Tue31 21:31 Tool 0: No Tool". It does not throw the error pop-up, but in QtPlasmaC all errors/warnings are visible in the Statistics tab under the Machine Log section, and also make it to the machine log files.

As this particular error/warning has no meaning in QtPlasmaC, I am wondering what the easiest way to suppress it might be, as where exactly it comes from?

Thanks for the help!
-Greg

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

More
01 Sep 2021 06:22 #219311 by phillc54
Replied by phillc54 on topic Machine Log
I am probably talking out of my hat but it seems to me that there is a conflict between self.stat.tool_table and self.get_current_tool() when looking at hal_glib.py. From what I gather self.stat.tool_table[0][0] should be the current tool. On loading LinxCNC self.stat.tool_table[0][0] stays at -1 but self.get_current_tool() returns 0. If I do a MDI T0 M6 then self.stat.tool_table[0][0] shows 0 as does self.get_current_tool().

I used this code after L373 which is:  self.old  = self.stat.tool_table[0] to show the above.
        t = ''
        for l in range(len(self.stat.tool_table)):
            t += ' ' + str(self.stat.tool_table[l][0])
        print("stat.tool_table:{}    current_tool:{}".format(t, self.get_current_tool()))
 
The following user(s) said Thank You: snowgoer540

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

More
01 Sep 2021 10:30 #219321 by snowgoer540
Replied by snowgoer540 on topic Machine Log
So, is it as easy as adding an:
ACTION.CALL_MDI('T0 M6')

In the correct place during the initialization process?

I haven't spent much time on it this morning as work beckons so I apologize if that feels kind of work-around and not really a solution.
The following user(s) said Thank You: tommylight

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

More
01 Sep 2021 14:29 #219341 by snowgoer540
Replied by snowgoer540 on topic Machine Log
MDI commands wont work before out of estop.  Duh.

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

More
01 Sep 2021 19:09 #219358 by snowgoer540
Replied by snowgoer540 on topic Machine Log
According to this doc linuxcnc.org/docs/html/gcode/other-code.html under Section 3, it says:

When LinuxCNC is configured for a nonrandom toolchanger (see the entry for RANDOM_TOOLCHANGER in the EMCIO Section), T0 gets special handling: no tool will be selected. This is useful if you want the spindle to be empty after a tool change.


And goes on to say:

When LinuxCNC is configured for a random toolchanger (see the entry for RANDOM_TOOLCHANGER in the EMCIO Section), T0 does not get any special treatment: T0 is a valid tool like any other. It is customary to use T0 on a random toolchanger machine to track an empty pocket, so that it behaves like a nonrandom toolchanger machine and unloads the spindle.


So, for fun, I added "RANDOM_TOOLCHANGER = 1" under the [EMCIO] section. When I started QtPlasmaC the first time with Phill's suggested code in hal_glib.py, both the stat.tool_table and current_tool were -1.

So, I did an M6 T0 and restarted. Now every time I start it says "Tool 0: torch", and both values from above are 0 in the terminal.

Similarly, if I do a M6 T1, every time I start it says "Tool 1: scribe"

While I think this feels like a step in the right direction, I am not sure this is the solution. I don't think we want QtPlasmaC to default to the last used tool used on startup. I think we want it to default to the first tool in the tool table (T0 in our case).

I think the best solution is to figure out a way to make it so that QtPlasmaC (LCNC in this case) does not assume an empty spindle on startup. It needs to default to 0 instead of -1 I think. So M6 T0, but at startup lol. Basically what Phill's saying.

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

More
02 Sep 2021 00:07 #219376 by phillc54
Replied by phillc54 on topic Machine Log
Following the yellow brick road shows that the log is updated for tools at line 485 of screen_options.py. If I make that dependent on the machine power status then it doesn't log the initial tool state. It is probably only a kludge though.
 
 
Attachments:

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

More
02 Sep 2021 00:14 - 02 Sep 2021 00:14 #219378 by snowgoer540
Replied by snowgoer540 on topic Machine Log
I see now why I couldn’t find “No Tool” in any message on the linuxcnc repository :laugh:

I guess I’m confused as to why if QtPlasmaC defaults to tool 0, it doesn’t report tool 0 as the torch? Why does it default to tool -1?  Or better how can we get it to default to tool 0 instead of -1 instead?

I’m guessing it just is how linuxcnc works, but I think I’m also missing where the tool gets set to 0 then…
Last edit: 02 Sep 2021 00:14 by snowgoer540.

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

More
02 Sep 2021 00:21 #219380 by phillc54
Replied by phillc54 on topic Machine Log
QtPlasmac doesn't set or read the tools, that is done in LCNC.
Tool 0 is the reported tool if you check STATUS.get_current_tool(). There is a difference with that and what linuxcnc.stat() reports as shown in this previous post:
forum.linuxcnc.org/qtvcp/43487-machine-log#219311

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

More
02 Sep 2021 00:56 #219385 by snowgoer540
Replied by snowgoer540 on topic Machine Log
I follow the difference I guess I was confused on what came first the chicken or the egg :laugh:  Perhaps a better wording then is why the difference and how do we rectify it?  Other than the random tool changer option ¯\_(ツ)_/¯ 

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

More
02 Sep 2021 02:23 #219388 by cmorley
Replied by cmorley on topic Machine Log

Following the yellow brick road shows that the log is updated for tools at line 485 of screen_options.py. If I make that dependent on the machine power status then it doesn't log the initial tool state. It is probably only a kludge though.
 

 

That seems a pretty reasonable way to go.
You can also add a tool -1 to the tool file and get another answer.

Though the default 'no tool' comes from qt_tstat.py when one asks for info on a tool not in the toolfile.
I defaults to all tool 0, all data zero and the comment 'No Tool' I guess it should default to current tool - then it would be -1 on start up.

It's strange that no one has officially made linuxcnc remember the last tool it used before shutdown.
I would have thought it reasonably simple for a dev who knows the code.
I never did understand the T0-can-mean-different-things problem either. - it messes up lathes too (T0 is a valid number usually)

Chris

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

Moderators: cmorley
Time to create page: 0.185 seconds
Powered by Kunena Forum