ATC Project - Debug phase
03 Jul 2022 10:04 #246490
by andypugh
I don't actually know (I have only touched toolchangers a couple of times, both on lathes, and in both cases I was just trying to get it working)
If you have the time to figure out how the different versions differ during the toolchange process that would be useful information.
Partly it's probably historical, with different solutions being invented by different people at different times.
Replied by andypugh on topic ATC Project - (Remap Phase)
Why does stdglue use what appears to be local parameters, and how/where do those local parameters connect to the global parameters?[/i][/i]
I don't actually know (I have only touched toolchangers a couple of times, both on lathes, and in both cases I was just trying to get it working)
If you have the time to figure out how the different versions differ during the toolchange process that would be useful information.
Partly it's probably historical, with different solutions being invented by different people at different times.
Please Log in or Create an account to join the conversation.
03 Jul 2022 17:25 #246518
by spumco
Replied by spumco on topic ATC Project - (Remap Phase)
So I had a look at various stdglue.py files, and there doesn't appear to be any significant difference between py2 and py3. The py3 were updated with py3-compatible dialect, but the fundamental stuff didn't change.
I fiddled with some of the ngc files, and can see that the main toolchange.ngc is running, as the error I'm getting about named parameters is a third of the way through the file. I think this means that LCNC is at least starting to process toplevel, remap, and stdglue.
I think I'm going to follow my own advice in the recent rack ATC thread and try to get the ATC working outside of Probe Basic first. I just don't have the experience or knowledge to sort out so many new-to-me concepts and details in one bite.
So... next question to help me diagnose and monitor everything: how do I see the value of parameters? I can open linuxcnc.var and read the numbers, but I'm not clear on how to view the value of named or named global parameters when LCNC is running.
Is there an MDI command that will display the variable? Or do I need to open a second terminal and type something out?
I fiddled with some of the ngc files, and can see that the main toolchange.ngc is running, as the error I'm getting about named parameters is a third of the way through the file. I think this means that LCNC is at least starting to process toplevel, remap, and stdglue.
I think I'm going to follow my own advice in the recent rack ATC thread and try to get the ATC working outside of Probe Basic first. I just don't have the experience or knowledge to sort out so many new-to-me concepts and details in one bite.
So... next question to help me diagnose and monitor everything: how do I see the value of parameters? I can open linuxcnc.var and read the numbers, but I'm not clear on how to view the value of named or named global parameters when LCNC is running.
Is there an MDI command that will display the variable? Or do I need to open a second terminal and type something out?
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 18563
- Thank you received: 6219
03 Jul 2022 17:29 #246520
by tommylight
Replied by tommylight on topic ATC Project - (Remap Phase)
Use the included "show hal configuration", on the left side navigate to parameters and on the right side choose the "show" tab.
Axis has it in the "machine" menu, not sure where it is located on the other GUI's.
Axis has it in the "machine" menu, not sure where it is located on the other GUI's.
Please Log in or Create an account to join the conversation.
03 Jul 2022 17:48 #246522
by spumco
Replied by spumco on topic ATC Project - (Remap Phase)
Tommy - I think those are for hal component parameters. I'm looking for system parameters used in g-code.
Like #<_selected_pocket> or #<local_named_paramter>
Like #<_selected_pocket> or #<local_named_paramter>
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 18563
- Thank you received: 6219
03 Jul 2022 18:21 #246523
by tommylight
Replied by tommylight on topic ATC Project - (Remap Phase)
Sorry.
The following user(s) said Thank You: spumco
Please Log in or Create an account to join the conversation.
03 Jul 2022 19:37 #246530
by andypugh
It known as a "magic comment" and works in both MDI and code.
Replied by andypugh on topic ATC Project - (Remap Phase)
Yes, you can do it in MDIIs there an MDI command that will display the variable? Or do I need to open a second terminal and type something out?
(DEBUG, The value of parameter _z is #<_z>)
It known as a "magic comment" and works in both MDI and code.
The following user(s) said Thank You: spumco
Please Log in or Create an account to join the conversation.
04 Jul 2022 02:45 #246556
by spumco
Replied by spumco on topic ATC Project - (Remap Phase)
That Magic Comment was pure magic. Thanks Andy.
Ok, so I can now read the global named parameter values. More importantly, they change when I load a tool in the spindle with the on-screen button. Load tool #2, and #<_tool_in_spindle> = 2. So far, so good.
Problem the next is if I change to a local named parameter, #<tool_in_spindle. Maybe I'm misunderstanding, but this should be what stdglue & remap passes from the global to local named parameter(s). In the sample toolchange.ngc file, there's the following:
;assign the variables passed by M6 to some parameters
#100 = #<selected_tool>
#110 = #<tool_in_spindle>
#120 = #<selected_pocket>
Those local named parameters aren't defined anywhere else, so they must (?) be coming from stdglue. Right?
If that's the case then stdglue isn't actually working, which is why I keep getting the Named parameter #<selected_pocket> not defined error when I try to unload the spindle to the ATC. That particular ngc file simply calls T0 M6, which in turn references the toolchange.ngc file.
And if I set tool #4 to pocket #4 then load it in the spindle (via gui button), #<_selected_pocket> changes to 4. So LCNC is working, and the global parameters are updating.
But stdglue/remap isn't passing the global parameters to the local named parameters in the various ngc files.
INI file path error? Thought I had that fixed, but maybe it needs a relative vs. absolute path to the python folder?
[PYTHON]
# ***leave the following commented out unless you are using the ATC macros***
TOPLEVEL = /home/mill/linuxcnc/configs/HAL_rev32_ATC/python/toplevel.py
PATH_APPEND = /home/mill/linuxcnc/configs/HAL_rev32_ATC/python/
LOG_LEVEL = 8
Ok, so I can now read the global named parameter values. More importantly, they change when I load a tool in the spindle with the on-screen button. Load tool #2, and #<_tool_in_spindle> = 2. So far, so good.
Problem the next is if I change to a local named parameter, #<tool_in_spindle. Maybe I'm misunderstanding, but this should be what stdglue & remap passes from the global to local named parameter(s). In the sample toolchange.ngc file, there's the following:
;assign the variables passed by M6 to some parameters
#100 = #<selected_tool>
#110 = #<tool_in_spindle>
#120 = #<selected_pocket>
Those local named parameters aren't defined anywhere else, so they must (?) be coming from stdglue. Right?
If that's the case then stdglue isn't actually working, which is why I keep getting the Named parameter #<selected_pocket> not defined error when I try to unload the spindle to the ATC. That particular ngc file simply calls T0 M6, which in turn references the toolchange.ngc file.
And if I set tool #4 to pocket #4 then load it in the spindle (via gui button), #<_selected_pocket> changes to 4. So LCNC is working, and the global parameters are updating.
But stdglue/remap isn't passing the global parameters to the local named parameters in the various ngc files.
INI file path error? Thought I had that fixed, but maybe it needs a relative vs. absolute path to the python folder?
[PYTHON]
# ***leave the following commented out unless you are using the ATC macros***
TOPLEVEL = /home/mill/linuxcnc/configs/HAL_rev32_ATC/python/toplevel.py
PATH_APPEND = /home/mill/linuxcnc/configs/HAL_rev32_ATC/python/
LOG_LEVEL = 8
Please Log in or Create an account to join the conversation.
04 Jul 2022 09:41 - 04 Jul 2022 09:46 #246564
by andypugh
Replied by andypugh on topic ATC Project - (Remap Phase)
Does your [RS274_NGC]REMAP line reference routines from stdglue (for example change_prolog)?
(I looked back a couple of pages, but didn't see it)
You need toplevel.py file containing "import remap", and a remap.py that contains "from stdglue import *" too.
(I looked back a couple of pages, but didn't see it)
You need toplevel.py file containing "import remap", and a remap.py that contains "from stdglue import *" too.
Last edit: 04 Jul 2022 09:46 by andypugh.
Please Log in or Create an account to join the conversation.
04 Jul 2022 16:04 #246583
by spumco
Replied by spumco on topic ATC Project - (Remap Phase)
I think it does, but I've attached it here in case I've overlooked something.
python folder contains:
toplevel.py (one line = import remap)
remap.py (one line = from stdglue import *)
stdglue.py (previolusly attached)
python folder contains:
toplevel.py (one line = import remap)
remap.py (one line = from stdglue import *)
stdglue.py (previolusly attached)
Please Log in or Create an account to join the conversation.
04 Jul 2022 17:20 #246588
by andypugh
Replied by andypugh on topic ATC Project - (Remap Phase)
Yes, it looks to be there.
Maybe put some "print("hello") lines in the prolog just to be sure the file is running, and that the file you think is running is running.
Maybe put some "print("hello") lines in the prolog just to be sure the file is running, and that the file you think is running is running.
The following user(s) said Thank You: spumco
Please Log in or Create an account to join the conversation.
Time to create page: 0.352 seconds