How to make a tool changer move to home
07 Jan 2021 17:45 #194381
by Aciera
Replied by Aciera on topic How to make a tool changer move to home
I'm fairly busy with other projects. I'll try to have a look at it in the next few days.
The following user(s) said Thank You: Clive S
Please Log in or Create an account to join the conversation.
07 Jan 2021 17:48 #194383
by Clive S
Thanks there is no hurry at all.
I have plenty of other things to get on with.
Replied by Clive S on topic How to make a tool changer move to home
I'm fairly busy with other projects. I'll try to have a look at it in the next few days.
Thanks there is no hurry at all.
I have plenty of other things to get on with.
Please Log in or Create an account to join the conversation.
08 Jan 2021 07:38 - 08 Jan 2021 07:56 #194472
by Aciera
Replied by Aciera on topic How to make a tool changer move to home
Had a quick look. I'm really out of my depth here (again) but I'll take a stab anyway. This seems to come from the bowels of halui.cc and, if I'm looking at the right thing, it seems to want to send an mdi command while it's not in MDI mode? Not sure what "%d" stands for.
This is from axis.py and it seems to use MANUAL mode when homing all joints:
I wonder if it's trying to run the MDI command (o714 call) while doing the 'home_all_joints' thing.
[edit]
Maybe comment out the line 23 in your .hal and try again just to be sure:
If that makes the problem go away, you could uncomment line 23 again and try to increase the delay for calling the MDI command (.hal, line 19):
to something like this:
If that works you could then lower the delay again to find the minimal delay necessary.
[edit again]
Just noticed we seem to have the wrong axis on .hal lines 22,23:
shouldn't we be using this (since Z is the last to home):
So maybe if you change this then all will be resolved.
Warning: Spoiler!
static int sendMdiCommand(int n)
{
EMC_TASK_PLAN_EXECUTE emc_task_plan_execute_msg;
if (updateStatus()) {
return -1;
}
if (!halui_sent_mdi) {
// There is currently no MDI command from halui executing, we're
// currently starting the first one. Record what the Task mode is,
// so we can restore it when all the MDI commands finish.
halui_old_mode = emcStatus->task.mode;
}
// switch to MDI mode if needed
if (emcStatus->task.mode != EMC_TASK_MODE_MDI) {
if (sendMdi() != 0) {
rtapi_print("halui: %s: failed to Set Mode MDI\n", __func__);
return -1;
}
if (updateStatus() != 0) {
rtapi_print("halui: %s: failed to update status\n", __func__);
return -1;
}
if (emcStatus->task.mode != EMC_TASK_MODE_MDI) {
rtapi_print("halui: %s: switched mode, but got %d instead of mdi\n", __func__, emcStatus->task.mode);
return -1;
}
}
rtapi_strxcpy(emc_task_plan_execute_msg.command, mdi_commands[n]);
if (emcCommandSend(emc_task_plan_execute_msg)) {
rtapi_print("halui: %s: failed to send mdi command %d\n", __func__, n);
return -1;
}
halui_sent_mdi = 1;
return 0;
}
{
EMC_TASK_PLAN_EXECUTE emc_task_plan_execute_msg;
if (updateStatus()) {
return -1;
}
if (!halui_sent_mdi) {
// There is currently no MDI command from halui executing, we're
// currently starting the first one. Record what the Task mode is,
// so we can restore it when all the MDI commands finish.
halui_old_mode = emcStatus->task.mode;
}
// switch to MDI mode if needed
if (emcStatus->task.mode != EMC_TASK_MODE_MDI) {
if (sendMdi() != 0) {
rtapi_print("halui: %s: failed to Set Mode MDI\n", __func__);
return -1;
}
if (updateStatus() != 0) {
rtapi_print("halui: %s: failed to update status\n", __func__);
return -1;
}
if (emcStatus->task.mode != EMC_TASK_MODE_MDI) {
rtapi_print("halui: %s: switched mode, but got %d instead of mdi\n", __func__, emcStatus->task.mode);
return -1;
}
}
rtapi_strxcpy(emc_task_plan_execute_msg.command, mdi_commands[n]);
if (emcCommandSend(emc_task_plan_execute_msg)) {
rtapi_print("halui: %s: failed to send mdi command %d\n", __func__, n);
return -1;
}
halui_sent_mdi = 1;
return 0;
}
This is from axis.py and it seems to use MANUAL mode when homing all joints:
Warning: Spoiler!
def home_all_joints(event=None):
if not manual_ok(): return
ensure_mode(linuxcnc.MODE_MANUAL)
isHomed = all_homed()
doHoming=True
if isHomed:
doHoming=prompt_areyousure(_("Warning"),_("Joint is already homed, are you sure you want to re-home?"))
if doHoming:
go_home(-1)
if not manual_ok(): return
ensure_mode(linuxcnc.MODE_MANUAL)
isHomed = all_homed()
doHoming=True
if isHomed:
doHoming=prompt_areyousure(_("Warning"),_("Joint is already homed, are you sure you want to re-home?"))
if doHoming:
go_home(-1)
I wonder if it's trying to run the MDI command (o714 call) while doing the 'home_all_joints' thing.
[edit]
Maybe comment out the line 23 in your .hal and try again just to be sure:
# net x-is-homed-dly <= delay.homed.out => halui.mdi-command-00
If that makes the problem go away, you could uncomment line 23 again and try to increase the delay for calling the MDI command (.hal, line 19):
setp delay.homed.on-delay 2.0
to something like this:
setp delay.homed.on-delay 10.0
If that works you could then lower the delay again to find the minimal delay necessary.
[edit again]
Just noticed we seem to have the wrong axis on .hal lines 22,23:
net x-is-homed <= halui.joint.0.is-homed => delay.homed.in
net x-is-homed-dly <= delay.homed.out => halui.mdi-command-00
shouldn't we be using this (since Z is the last to home):
net z-is-homed <= halui.joint.1.is-homed => delay.homed.in
net z-is-homed-dly <= delay.homed.out => halui.mdi-command-00
So maybe if you change this then all will be resolved.
Last edit: 08 Jan 2021 07:56 by Aciera.
The following user(s) said Thank You: Clive S
Please Log in or Create an account to join the conversation.
08 Jan 2021 11:31 #194477
by Clive S
As usual you were not out of your depth . I should have noticed that myself.
That was the problem.
I have attached my config for the Boxford 125 tool changer for the benefit of others.
Replied by Clive S on topic How to make a tool changer move to home
net x-is-homed <= halui.joint.0.is-homed => delay.homed.in
net x-is-homed-dly <= delay.homed.out => halui.mdi-command-00
shouldn't we be using this (since Z is the last to home):
net z-is-homed <= halui.joint.1.is-homed => delay.homed.in
net z-is-homed-dly <= delay.homed.out => halui.mdi-command-00
So maybe if you change this then all will be resolved.
As usual you were not out of your depth . I should have noticed that myself.
That was the problem.
I have attached my config for the Boxford 125 tool changer for the benefit of others.
Attachments:
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
Time to create page: 0.087 seconds