How to make a tool changer move to home

More
5 years 10 months ago #192249 by Clive S

Aciera wrote: I think we'll get it working with axis gui. See edit2 and -3 above.

So try the m61 q#5400 and report back.

Not sure of the order I need to do.


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 to join the conversation.

More
5 years 10 months ago #192257 by Aciera
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:
Code:
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:
Code:
[HALUI] MDI_COMMAND = o714 call

3) in your .hal file add:
Code:
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):
Code:
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.

Please Log in to join the conversation.

More
5 years 10 months ago #192262 by Clive S
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

Attachment not found

Please Log in to join the conversation.

More
5 years 10 months ago #192305 by Aciera
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

Please Log in to join the conversation.

More
5 years 10 months ago #192311 by Clive S

Aciera wrote: 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"

Attachment not found


.
This is the pin that goes true when homed
.

Attachment not found

Please Log in to join the conversation.

More
5 years 10 months ago #192314 by Aciera
Hm, ok so let's use that pin then:
Code:
net x-is-homed joint.0.homed halui.mdi-command-00


[edit]
What version of linuxcnc are you running?

Please Log in to join the conversation.

More
5 years 10 months ago #192315 by Clive S

Aciera wrote: Hm, ok so let's use that pin then:

Code:
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 to join the conversation.

More
5 years 10 months ago #192316 by Aciera
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
Code:
HALUI = halui

Please Log in to join the conversation.

More
5 years 10 months ago #192320 by Clive S

Aciera wrote: 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

Code:
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 to join the conversation.

More
5 years 10 months ago #192324 by Aciera
Ok let's try:
Code:
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.

Please Log in to join the conversation.

Time to create page: 0.549 seconds
Powered by Kunena Forum