Sporadic Erroneous Automatic Toolchange Behaviour

More
02 May 2024 20:02 #299593 by Bassblaster
Hi Guys,

I have some trouble with my automatic revolver toolchanger on my lathe. If I set something like M6 T3 and then M6 T1 in MDI it should swich from tool 3 to tool 1. This works 80% of the time. However, randomly, sometimes it just doesn't move but still thinks that it changed the tool. However in my variable #4999 the tool has not been updated correctly in this erroneous case. I think that it maybe just somehow aborts in the middle of the change subroutine before moving or saving the tool, but I get no error messages or so... Also it actually never displays the current tool offset in Gmoccapy, but that is not my biggest problem.

For the toolchanger I just did a simple remap with this code:
REMAP = M6 modalgroup=6 ngc=sub_progs/toolchange

o<sub_progs/toolchange> sub
#4001 = 1 (distance to travel per tool pocket)
#4002 = 0 (calculated distance to travel)
#4003 = 0.4 (distance to lock turret)
#4004 = 0.2 (Aditional tolerance to clear the rachet)
M61 Q#4999 (stores the tool in spindle)
o100 if [#<_selected_pocket> GT 7]
    (DEBUG,STOP: Werkzeugtasche größer 7!)
    (DEBUG,Überprüfe eingegebene Tasche in der Werkzeugtabelle, maximal 7)
    M0
o100 endif
o101 if [#<_selected_tool> EQ #<_current_tool>]
    (DEBUG,Werkzeug bereits eingewechselt)
o101 elseif [#<_selected_pocket> GT #<_current_pocket>]
    #4002 = [[#<_selected_pocket> - #<_current_pocket> ] * #4001]
    G91
    G00 B-#4002
    G00 B-#4004
    G00 B#4003
    M6 G43
    G90
o101 else
    #4002 = [[#<_current_pocket> - #<_selected_pocket> ] * #4001]
    G91
    G00 B-[[8*#4001]-#4002]
    G00 B-#4004
    G00 B#4003
    M6 G43
    G90
o101 endif
#4999 = #<_current_tool>
o<sub_progs/toolchange> endsub
m2

Has anybody encountered similar problems or has an idea? I tried updating and writing a new hal and ini, but that changed nothing...
Attachments:

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

More
04 May 2024 09:53 #299708 by andypugh
I don't advocate using a B axis for a toolchanger, I feel there is a danger of getting out of synch.

That said, is it possible that the B axis is configured to take the shortest path (WRAPPED_ROTARY) or that the G-code is setting the mode to incremental?

Your G-code sub probably needs to ensure that the mode is set to absolute, and then restore it after the change, even if this is not the problem.

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

More
05 May 2024 15:06 #299815 by Bassblaster
Replied by Bassblaster on topic Sporadic Erroneous Automatic Toolchange Behaviour
Hmm, can you elaborate on what getting out of sync means? It is not set to shortest path, but I do use G91 for the movement of the revolver itself. In the end of the programm I set G90 again, but it is not executed in the erroneous case...
If not by a b-axis, then what is the common way to drive a stepper motor on the revolver? I thought this is necessary in order to use one of the pwmgen's on my mesa 7i96.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum