How to make a tool changer move to home
17 Dec 2020 14:27 #192249
by Clive S
fired up gui. tool 1 in position . Homed then m61 q#5400 var=0 then m6t2 normal xz moved but not turret var-0 then m6t3 moved to tool 2 var=2
got the tool back to T1 position closed gui and re-opened twice var =1
entered m61 q#5400 var = 0 then m6t2 no movement var=2 status says tool 2. entered m6t3 turret moved to T2 var= 2
##############
Starting from scratch with T1 in place and homed using M6T1 to set current tool T1 show in status with var=0 then again m6t1 no movement but var=1
Replied by Clive S on topic How to make a tool changer move to home
Not sure of the order I need to do.I think we'll get it working with axis gui. See edit2 and -3 above.
So try the m61 q#5400 and report back.
fired up gui. tool 1 in position . Homed then m61 q#5400 var=0 then m6t2 normal xz moved but not turret var-0 then m6t3 moved to tool 2 var=2
got the tool back to T1 position closed gui and re-opened twice var =1
entered m61 q#5400 var = 0 then m6t2 no movement var=2 status says tool 2. entered m6t3 turret moved to T2 var= 2
##############
Starting from scratch with T1 in place and homed using M6T1 to set current tool T1 show in status with var=0 then again m6t1 no movement but var=1
Please Log in or Create an account to join the conversation.
17 Dec 2020 16:34 - 17 Dec 2020 16:39 #192257
by Aciera
Replied by Aciera on topic How to make a tool changer move to home
Ok let's just go ahead and try to implement the solution by user MaHA in edit3.
So do this:
1) in your config open folder "remap_subs" and create a new file named "last_tool.ngc" with this in it:
2) in your INI file after the [HAL] section add these two lines:
3) in your .hal file add:
4) change your toolchange.ngc in the folder "remap_subs" to this (add second to last line):
Explanation:
The line "o<last_tool> call" in the toolchange remap should call the last_tool.ngc file and that should create a file named 714.ngc in your remap_subs folder with a complete subroutine that will tell linuxcnc to change the tool to the current toolnumber without actually moving the toolchanger. This subroutine will be run the next time you home your machine and should thus change the active tool to the toolnumber called up in the last toolchange.
I hope this makes sense. I'm not sure if the file 714.ngc will actually be created in your "remap_subs" folder or in your config folder so we might need to tweak that a bit. Anyway give it a try.
So do this:
1) in your config open folder "remap_subs" and create a new file named "last_tool.ngc" with this in it:
o<last_tool> sub
(LOGOPEN,./remap_subs/714.ngc)
(LOG,o714 sub)
(LOG,M61 Q#5400)
(LOG,o714 endsub)
(LOG,M2)
(LOGCLOSE)
o<last_tool> endsub
2) in your INI file after the [HAL] section add these two lines:
[HALUI]
MDI_COMMAND = o714 call
3) in your .hal file add:
net x-is-homed halui.joint.0.is-homed halui.mdi-command-00
4) change your toolchange.ngc in the folder "remap_subs" to this (add second to last line):
o<toolchange> sub
M73
G90
G53 G0 X-1.5
M66 E0 L0
G53 G0 Z-2.5
M6 (use built in M6 behavior)
o<last_tool> call
o<toochange> endsub
Explanation:
The line "o<last_tool> call" in the toolchange remap should call the last_tool.ngc file and that should create a file named 714.ngc in your remap_subs folder with a complete subroutine that will tell linuxcnc to change the tool to the current toolnumber without actually moving the toolchanger. This subroutine will be run the next time you home your machine and should thus change the active tool to the toolnumber called up in the last toolchange.
I hope this makes sense. I'm not sure if the file 714.ngc will actually be created in your "remap_subs" folder or in your config folder so we might need to tweak that a bit. Anyway give it a try.
Last edit: 17 Dec 2020 16:39 by Aciera. Reason: noticed you don't yet have a [HALUI] section in your INI
The following user(s) said Thank You: Clive S
Please Log in or Create an account to join the conversation.
17 Dec 2020 17:20 - 17 Dec 2020 17:37 #192262
by Clive S
Replied by Clive S on topic How to make a tool changer move to home
Very well explained thanks.
Error. If I comment the line out Lcnc loads
hal:56 pin halui.joint.0.is-homed does not exist
Have I missed something? The ATC does not use joints
Error. If I comment the line out Lcnc loads
hal:56 pin halui.joint.0.is-homed does not exist
Have I missed something? The ATC does not use joints
Attachments:
Last edit: 17 Dec 2020 17:37 by Clive S. Reason: added tar
Please Log in or Create an account to join the conversation.
18 Dec 2020 06:52 - 18 Dec 2020 06:53 #192305
by Aciera
Replied by Aciera on topic How to make a tool changer move to home
Hm, that pin should exist. Can you comment that line out and look for it in Hal show after linuxcnc has started?
Maybe delete the line and retype manually.
[edit]
that is the pin that should go true once the X axis is homed and that is when we want the script to run setting the tool number to the last loaded tool
Maybe delete the line and retype manually.
[edit]
that is the pin that should go true once the X axis is homed and that is when we want the script to run setting the tool number to the last loaded tool
Last edit: 18 Dec 2020 06:53 by Aciera.
Please Log in or Create an account to join the conversation.
18 Dec 2020 09:21 #192311
by Clive S
I had already commented the line out and tried to find the pin without success.
using halmeter there are no pins starting with "h"
.
This is the pin that goes true when homed
.
Replied by Clive S on topic How to make a tool changer move to home
Hm, that pin should exist. Can you comment that line out and look for it in Hal show after linuxcnc has started?
Maybe delete the line and retype manually.
[edit]
that is the pin that should go true once the X axis is homed and that is when we want the script to run setting the tool number to the last loaded tool
I had already commented the line out and tried to find the pin without success.
using halmeter there are no pins starting with "h"
.
This is the pin that goes true when homed
.
Attachments:
Please Log in or Create an account to join the conversation.
18 Dec 2020 09:36 - 18 Dec 2020 09:37 #192314
by Aciera
Replied by Aciera on topic How to make a tool changer move to home
Hm, ok so let's use that pin then:
[edit]
What version of linuxcnc are you running?
net x-is-homed joint.0.homed halui.mdi-command-00
[edit]
What version of linuxcnc are you running?
Last edit: 18 Dec 2020 09:37 by Aciera.
Please Log in or Create an account to join the conversation.
18 Dec 2020 09:44 #192315
by Clive S
Version axis 2.8.1
error pin halui.mdi-command-00 does not exist
Sorry to be a pain
Replied by Clive S on topic How to make a tool changer move to home
Hm, ok so let's use that pin then:
net x-is-homed joint.0.homed halui.mdi-command-00
[edit]
What version of linuxcnc are you running?
Version axis 2.8.1
error pin halui.mdi-command-00 does not exist
Sorry to be a pain
Please Log in or Create an account to join the conversation.
18 Dec 2020 10:05 - 18 Dec 2020 10:08 #192316
by Aciera
Replied by Aciera on topic How to make a tool changer move to home
Well there we go again. I'm puzzled as to why your system is missing all the halui pins.
[edit]
Maybe add this to your .ini in the [HAL] section
[edit]
Maybe add this to your .ini in the [HAL] section
HALUI = halui
Last edit: 18 Dec 2020 10:08 by Aciera.
Please Log in or Create an account to join the conversation.
18 Dec 2020 10:44 #192320
by Clive S
Ok that was it.
We are getting nearer.
The gui loads ok . I used in hal "net x-is-homed halui.joint.0.is-homed halui.mdi-command-00"
Loaded the gui and homed. and only joint O homed . Then the below msg
error can't issue MDI COMMAND when not homed
So pressed home all again. Then it homed joint 1 and put the msg up homing sequence already in progress . Status bar says no tool
Replied by Clive S on topic How to make a tool changer move to home
Well there we go again. I'm puzzled as to why your system is missing all the halui pins.
[edit]
Maybe add this to your .ini in the [HAL] section
HALUI = halui
Ok that was it.
We are getting nearer.
The gui loads ok . I used in hal "net x-is-homed halui.joint.0.is-homed halui.mdi-command-00"
Loaded the gui and homed. and only joint O homed . Then the below msg
error can't issue MDI COMMAND when not homed
So pressed home all again. Then it homed joint 1 and put the msg up homing sequence already in progress . Status bar says no tool
Please Log in or Create an account to join the conversation.
18 Dec 2020 12:03 - 18 Dec 2020 12:05 #192324
by Aciera
Replied by Aciera on topic How to make a tool changer move to home
Ok let's try:
Note that there will be no script written until the first real toolchange. After the first tool change with motion on the ATC there should be a file named 714.ngc and after that you should get the tool number set after homing the machine.
[edit]
Ah and you will need to create an empty file named 714.ngc in the "remap_subs" folder otherwise it will throw an error the first time because there is no file to run.
net x-is-homed halui.joint.1.is-homed halui.mdi-command-00
Note that there will be no script written until the first real toolchange. After the first tool change with motion on the ATC there should be a file named 714.ngc and after that you should get the tool number set after homing the machine.
[edit]
Ah and you will need to create an empty file named 714.ngc in the "remap_subs" folder otherwise it will throw an error the first time because there is no file to run.
Last edit: 18 Dec 2020 12:05 by Aciera.
Please Log in or Create an account to join the conversation.
Time to create page: 0.959 seconds