ATC Project - Debug phase

More
13 Jul 2022 12:12 #247230 by tommylight
Hal files should be loaded from the ini file.
The following user(s) said Thank You: spumco

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

More
13 Jul 2022 21:44 #247256 by spumco
I tried adding the atc_motion.hal file using both POSTGUI_HALFILE and HALFILE in INI.

Postgui resulted in no errors, but no pins available.

HALFILE = atc_motion.hal resulted in startup error.  The first atc_widget.something line was identified as missing.

I've already got TWOPASS on.

The DEBUG,EVAL... actually works, sort-of.  The atc.py seems to permit three types of interaction with the custom qtpyvcp widget:

def load_tools
def store_tools
def atc_message
def rotate

I don't understand what the first two do.

If I MDI
(DEBUG, EVAL[vcp.getWidget{"dynatc"}.rotate{1, "ccw"}])

the ATC widget will move one pocket CCW regardless of any other tool/pocket status.  I think I might be able to use that to move the widget to represent what's actually going on, but it'd take a three-way coordination of parameter values:
  1. LCNC iocontrol (tool & pocket numbers)
  2. remapped g-code for actual carousel movement
  3. atc widget
I don't know how long it'd take me to work that one out, and I'm beginning to lose patience.  I'm not a 'computer' person.

On top of that, digging through multiple github open/closed issues it looks like there's still problems with tool number vs. pocket number for non-random toolchangers.  There doesn't appear to be an elegant solution for mill-type setups - non-random with tools not matching pocket numbers.

I suspect that's why most of the non-lathe toolchanger examples I've found all seem to bypass the pocket number problem and create an array of user parameters in the .var file to keep track of things.

I could probably punt and treat this ATC like a lathe.  Tool = pocket, ignore the ATC widget; only have 18 'installable' tools in the tool table.  Tools over #18 are pocket "-1", and I edit the tool numbers when I want to load a new tool.  Seems like a kludge, but that would get this thing functional(ish).

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

More
16 Jul 2022 14:08 #247464 by spumco
Replied by spumco on topic ATC Project - (update)
For those possibly still following the saga:

I can't figure out how to get carousel, PB widget, and LCNC/remap to play together.  I just don't have enough experience or brainpower.

Since I've still got the excellent, but insanely complicated, example from the ATC-as-axis, dual-carousel ZX45 I'm going to try to modify that config. 

It's known to work, so rather than breaking new ground with carousel.comp + PB, I 'just' have to unravel the dual-ATC portion of the scheme.

This will likely take some time as there are so many parameter calcs & formula to determine which (left/right) carousel to engage I get lost trying to follow the logic.

Here goes nothing...

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

More
16 Jul 2022 16:05 #247472 by tommylight
Replied by tommylight on topic ATC Project - (update)
I am still following from the benches! :)
The following user(s) said Thank You: spumco

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

More
21 Jul 2022 04:10 #247905 by spumco
OMG, I think I'm about there...

Over in the QtPyVCP sub-forum Lcvette has helped unravel the PB macros quite a bit so I've now got a sort-of working setup.

Physical ATC is controlled via carousel.comp
ATC animated widget is controlled using the (DEBUG, EVAL...) statements in the .ngc files.

The trick is carousel needs a pocket number, and the widget needs to be moved via steps.  Its like managing two separate ATCs at the same time.

Now I've got to figure out why carousel isn't turning on/off at the right times, and getting the widget to move in the right direction the correct number of steps to stay synchronized with the real thing.

Still, this feels like actual progress.
The following user(s) said Thank You: tommylight

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

More
23 Jul 2022 05:51 #248095 by spumco
Replied by spumco on topic ATC Project - (Bamma-Jamma!)
I got it.
  1. Probe Basic
  2. Carousel.comp
  3. No geneva mechanism
  4. Any tool number in any pocket.

Lots still to do:
  • Get everything aligned properly
  • Testing
  • Try to break it
  • Recover from mid-toolchange estops & faults
  • Speed everything up so I don't have 45 second tool changes
  • More testing
  • Testing with actual tools
  • Clean up all the hal & .ngc files
  • Yet more testing
Will post config & notes when everything's tidied up.  Then its time to attack the Probe Basic-vertical ui headache...

Much obliged to everyone for all the help.
The following user(s) said Thank You: tommylight, pommen, besriworld, GuiHue

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

More
11 Aug 2022 10:00 - 11 Aug 2022 11:55 #249497 by GuiHue
Replied by GuiHue on topic ATC Project - (Bamma-Jamma!)
Hi spumco,

I'm slowly catching up with the project. Carousel.comp seems to work just fine for the time being (index, 2 sensors, 16 pockets - need to work on mechanical alignment). I am now in the process of leaving behind gmoccapy as probe_screen does not work in python3 anymore.

I have looked at the source of probe_basic. If I understand it correctly, the interaction of the macros with the python based GUI visualization are done using (DEBUG, EVAL(...statement...)). The relation of toolnumber to pocketnumber is done using numbered parameters and takes place in macros. the ATC widget merely does visualization. Can you confirm this?

Seems straightforward then. There is just one more thing. I do not want to use numbered variables to track pocket numbers but rather the pocket number of the tooltable. Does anyone know, if the prolog statement forwards the correct pocket numbers within 2.9? This used to be a source of major headaches.

Thank You.

Best Regards
Guido
Last edit: 11 Aug 2022 11:55 by GuiHue.

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

More
11 Aug 2022 20:21 #249551 by spumco
Replied by spumco on topic ATC Project - (Bamma-Jamma!)
[Sorry, been a bit absent in the past few weeks. Landed a bid for some turning work that's been a time-suck.]

Can you confirm this?

Yes, you have it exactly right as far as I've been able to work out.  Persistent variables are added to the .var file which represent pocket numbers.  All association with tool numbers are done through the macros.

Regarding the pocket numbers...  When LCNC is set to NONRANDOM tool changer it ignores pocket numbers.  And when it's set to RANDOM, then the spindle tool is installed in the pocket of the tool replacing it.

As I've pointed out in another post (and others have elsewhere), there is no middle ground for 'semi-random' tool changers. i.e. a carousel (or chain, or rack) where pocket number may not match tool number, but it absolutely must go back in to the same pocket it came out of.

This, I believe, is why ATC macros or ladder schemes are so complicated - they're all essentially workarounds for this LCNC blind spot.

It's also (probably) why the Probe Basic devs hide the pocket number column in the tool table tab.  With the Probe Basic scheme, there's no point in having a pocket number column which is ignored.  If you unhide it by editing the custom_config.yml file you'll see that all tools have a pocket number value of "-1".

And thus the ATC screen widget isn't just a fancy-but-superfluous feature.  It is, in fact, they only easy way to figure out what tool is in what pocket.  The only other way would be to somehow query the .var file and write those values to a constantly-updating GUI table.

Does anyone know, if the prolog statement forwards the correct pocket numbers within 2.9?

Doesn't matter if it does or not...  And when I was trying to work around the issue that's when I discovered - or at least started to digest the fact - that LCNC ignores pocket numbers.  Tool number = pocket number; Finkle is Einhorn, Einhorn is Finkle.

You can put any pocket number you want in the tool table, but LCNC will only recognize the tool number if TOOLCHANGER = NONRANDOM

An alternative is to keep track of things with tool numbers... but you must edit your tool table so you only have tools #1 through #n (n = total pockets).  To switch tools to one higher than 'n' means changing the numbers in the tool table.  This is how (some) old-school CNC machines did it: you want a new tool... you call up tool #1, replace it in the spindle with some other tool, then adjust the tool table values for #1 to match the new tool.

A glimmer of light on the horizon is the recently-created Tool Database.  There's now a demo in axis, but there's no 'standard' database GUI to use.  I believe this would be useful for ATC tool-pocket management, but I simply don't understand much about it - much less how an implementation would work.  Based on past history, I expect it to be novice-user ready in about a week to never.

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

More
12 Aug 2022 07:21 #249577 by GuiHue
Replied by GuiHue on topic ATC Project - (Bamma-Jamma!)

[Sorry, been a bit absent in the past few weeks. Landed a bid for some turning work that's been a time-suck.]


Can you confirm this?

Yes, you have it exactly right as far as I've been able to work out.  Persistent variables are added to the .var file which represent pocket numbers.  All association with tool numbers are done through the macros.

Regarding the pocket numbers...  When LCNC is set to NONRANDOM tool changer it ignores pocket numbers.  And when it's set to RANDOM, then the spindle tool is installed in the pocket of the tool replacing it.

As I've pointed out in another post (and others have elsewhere), there is no middle ground for 'semi-random' tool changers. i.e. a carousel (or chain, or rack) where pocket number may not match tool number, but it absolutely must go back in to the same pocket it came out of.

This, I believe, is why ATC macros or ladder schemes are so complicated - they're all essentially workarounds for this LCNC blind spot.

It's also (probably) why the Probe Basic devs hide the pocket number column in the tool table tab.  With the Probe Basic scheme, there's no point in having a pocket number column which is ignored.  If you unhide it by editing the custom_config.yml file you'll see that all tools have a pocket number value of "-1".

And thus the ATC screen widget isn't just a fancy-but-superfluous feature.  It is, in fact, they only easy way to figure out what tool is in what pocket.  The only other way would be to somehow query the .var file and write those values to a constantly-updating GUI table.


[code]Does anyone know, if the prolog statement forwards the correct pocket numbers within 2.9?

Doesn't matter if it does or not...  And when I was trying to work around the issue that's when I discovered - or at least started to digest the fact - that [b]LCNC ignores pocket numbers.  Tool number = pocket number; Finkle is Einhorn, Einhorn is Finkle.

You can put any pocket number you want in the tool table, but LCNC will only recognize the tool number if TOOLCHANGER = NONRANDOM

An alternative is to keep track of things with tool numbers... but you must edit your tool table so you only have tools #1 through #n (n = total pockets).  To switch tools to one higher than 'n' means changing the numbers in the tool table.  This is how (some) old-school CNC machines did it: you want a new tool... you call up tool #1, replace it in the spindle with some other tool, then adjust the tool table values for #1 to match the new tool.

A glimmer of light on the horizon is the recently-created Tool Database.  There's now a demo in axis, but there's no 'standard' database GUI to use.  I believe this would be useful for ATC tool-pocket management, but I simply don't understand much about it - much less how an implementation would work.  Based on past history, I expect it to be novice-user ready in about a week to never.[/b]
[/code]
 


Hi spumco and thanks for confirming my guesses:).

With regard to your comment to nonrandom toolchangers:

I guess I need to extent the background information:
My setup is as follows:
-Carousel for 16 tools
-No tool change arm or mechanism
-Direct placement of tool in carousel by moving the spindle accordingly
-This is on a DIY router, speed and improvement of toolchange time is not a concern:).

Basically, the carousel is a rolled up rack. This also means that I am not using a random toolchanger, since I have to go back to the pocket a tool come from, drop it off and only then am I able to pick up a new tool.

Accordingly my M6 sequence roughly works as follows:

Check if tool in spindle
No: proceed to pickup sequence
yes: drop off tool either at carousel or at manual drop off point based on pocket number
Pickup sequence: Is tool in carousel?
yes: move carousel, grab tool, done
no: move to manual pickup, grab tool, done

Based on my experience (see old setup GitHub ), a setup like the one you describe as semi random (i.e. tools must go back to pocket but toolnumber may be different from pocket number) can be realized reasonably well.

The process was as follows:
I manually edited the pocket number in the tool table within gmoccapy. This allows to change the pocketnumber independent from the toolnumber AND the sequence of the entries in the tooltable (i.e. the line number of the entry). Using the change-prolog from stdglue.py provides four variables
        self.params["tool_in_spindle"] = self.current_tool
        self.params["selected_tool"] = self.selected_tool
        self.params["current_pocket"] = self.current_pocket # this is probably nonsense
        self.params["selected_pocket"] = self.selected_pocket

Note: The comment "this is probably nonsense" is from the source directly.
current_tool is just that, the tool currently in the spindle
selected_tool is just that, the tool specified by "Tx"
current_pocket: Has been affected by bugs (I vaguely remeber that this was fixed) - In the past it would provide neither the pocket number nor the tool number but rather the line in which the entry is placed. Something you will not notice if you have sequential toolnumbers. I use a tooltable of >100 tools with substiantial gaps in the numbers (which works perfectly fine as of 2.8.x). Workaround: Handle the appropriate value with a persistent variable (see PB approach)
selected_pocket is just that, the pocket of the new tool - I have encountered instability here as well. There may be two ways of working aroudn that: 1) use "#<_hal[iocontrol.0.tool-prep-pocket]>" in macro (unstable as well at the time), 2) Get value from iocontrol.0.tool-prep-pocket using M66 and an motion.analog-input (I ain't stupid when it works)

This used to work just fine for me. I was thus thinking about maintaing that approach.
To make full use of PB's visualization capabilities, I have since understood how I can pass the relevant information to DynATC widget. Love it:). I agree with both spumco and lcvette that I could skip my old approach altogether.
>>There is a BUT comming though:
I would like to create a bit of code that allows me to manage assigning tools to pockets. I could do this manually with the aid of the visualization, but it would be great if I could just trigger a function that 1) determines if there is space in the carousel/rack 2) drops the tool right there and 3) stores the location of that tool.
This could be done using macros and the PB approach, but this is also why I wondered if I could write to the tool table from a macro (see other thread ).
The following user(s) said Thank You: spumco

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

More
24 Aug 2022 11:44 #250318 by andypugh

1) use "#<_hal[iocontrol.0.tool-prep-pocket]>" in macro (unstable as well at the time), 2) Get value from iocontrol.0.tool-prep-pocket using M66 and an motion.analog-input (I ain't stupid when it works)


To explain what is happening here, #<_hal[ioconrol..... will return the value in that HAL pin at the point that the line is _interpreted_. This might, or might not, return the right value depending on queue-busters and remapping etc.
Reading the pin with M66 will read the pin at the point that the M66 is _executed_ so is much more likely to be correct.

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

Time to create page: 0.099 seconds
Powered by Kunena Forum