Absolute homing

  • eduard
  • eduard's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
15 Jun 2024 14:33 #303050 by eduard
Replied by eduard on topic Absolute homing
Hey Aciera,

thanks for the help to identify this hal pin for custom homing. After a several day trial and error I didn manage to find a solution how to switch between servo homing and linuxcnc homing.
I would like to home the servo once with custom homing. The servo finding the home switch then homed.
Now at this point just commenting out the hal custom homing and ini homecomp to use absolute homing 2, without movement.

Here is the INI part:
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
SERVO_PERIOD = 1000000
#HOMING use EL8 drives internal homing. Uncomment the line below and in the HAL as well. Home the machine, then comment out.
HOMEMOD=el8_homecomp

and the HAL part:
#HOMING use EL8 drives internal homing. Uncomment the line below and in the ini as well. Home the machine, then comment out.
net x-home-request joint.0.request-custom-homing => cia402.0.home
net x-homing joint.0.is-custom-homing <= cia402.0.stat-homing
net x-homed joint.0.custom-homing-finished <= cia402.0.stat-homed

What is the solution to use a simple hal pin to switch between this two homing modes?

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

More
15 Jun 2024 16:27 #303055 by Aciera
Replied by Aciera on topic Absolute homing
What happens if you replace

net x-home-request joint.0.request-custom-homing => cia402.0.home

with

setp joint.0.request-custom-homing FALSE

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

More
15 Jun 2024 17:07 #303059 by andypugh
Replied by andypugh on topic Absolute homing
Late to the party here, but what happens if you connect halui.machine.is-on to halui.home-all, with standard absolute homing configured in the INI?

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

  • eduard
  • eduard's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
15 Jun 2024 20:04 #303073 by eduard
Replied by eduard on topic Absolute homing
This iw working now. Welcome to the party.

But still have to comment out everything about servo homing, and from the ini as well.

But now when the machine is on, everything is homed automagically.

# ABSOLUTE HOMING ON ALL AXES
# If internal homing is commented out on all drives and in the INI file (#HOMEMOD=el8_homecomp), this will home the machine when powering on.
net machine-on  halui.machine.is-on => halui.home-all
Attachments:

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

More
16 Jun 2024 10:07 - 16 Jun 2024 10:21 #303099 by Aciera
Replied by Aciera on topic Absolute homing
Just as a follow up, as you seem to have it mostly working.
Looking at the compile result of 'el8_homecomp.comp' (ie 'el8_homecomp.c') I see this 'do_homing' function:

bool do_homing(void)
{
int joint_num;
int homing_flag = 0;
bool beginning_allhomed = get_allhomed();

do_homing_sequence();
/* loop thru joints, treat each one individually */
for (joint_num = 0; joint_num < all_joints; joint_num++) {

if (!H[joint_num].joint_in_sequence) { continue; }
if (!GET_JOINT_ACTIVE_FLAG(&joints[joint_num])) { continue; }

// CUSTOM joint homing state machine for everybody:
homing_flag += custom_1joint_state_machine(joint_num);

}
if ( homing_flag > 0 ) { /* one or more joint is homing */
homing_active = 1;
} else { /* is a homing sequence in progress? */
if (sequence_state == HOME_SEQUENCE_IDLE) {
/* no, single joint only, we're done */
homing_active = 0;
}
}
// return 1 if homing completed this period
if (!beginning_allhomed && get_allhomed()) {homing_active=0; return 1;}
return 0;
}


While in my test component I get this:

bool do_homing(void)
{
int joint_num;
int homing_flag = 0;
bool beginning_allhomed = get_allhomed();

do_homing_sequence();
/* loop thru joints, treat each one individually */
for (joint_num = 0; joint_num < all_joints; joint_num++) {
if (!H[joint_num].joint_in_sequence) { continue; }
if (!GET_JOINT_ACTIVE_FLAG(&joints[joint_num])) { continue; }

if (customH[joint_num].is_custom_homing) {
// CUSTOM joint homing state machine:
homing_flag += custom_1joint_state_machine(joint_num);
} else {
// DEFAULT joint homing state machine:
homing_flag += base_1joint_state_machine(joint_num);
}
}
if ( homing_flag > 0 ) { /* one or more joint is homing */
homing_active = 1;
} else { /* is a homing sequence in progress? */
if (sequence_state == HOME_SEQUENCE_IDLE) {
/* no, single joint only, we're done */
homing_active = 0;
}
}
// return 1 if homing completed this period
if (!beginning_allhomed && get_allhomed()) {homing_active=0; return 1;}
return 0;
}

So the 'el8_homecomp.c' does not contain the switch between CUSTOM and DEFAULT homing:

if (customH[joint_num].is_custom_homing) {
// CUSTOM joint homing state machine:
homing_flag += custom_1joint_state_machine(joint_num);
} else {
// DEFAULT joint homing state machine:
homing_flag += base_1joint_state_machine(joint_num);
}

Looks like it was maybe not intended for the user to be able to choose between the homing method.
Last edit: 16 Jun 2024 10:21 by Aciera.

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

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
16 Jun 2024 11:47 #303102 by rodw
Replied by rodw on topic Absolute homing
If you read the homecomp docs, you can switch between linuxcnc homing and internal homing by a command line parameter (or an ini setting to load the same thing). You could run 2 different configs
It was never designed to mix and match methods in the one machine configuration

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

More
16 Jun 2024 12:07 - 16 Jun 2024 12:14 #303103 by Aciera
Replied by Aciera on topic Absolute homing

It was never designed to mix and match methods in the one machine configuration


Not sure what makes you think that as the homecomp doc clearly states that it is intended to enable the user to setup each joint to use the default or the custom homing routine:

This module creates input hal pins joint.n.request-custom-homing that enable an alternate joint homing state machine for requested joints.


linuxcnc.org/docs/html/man/man9/homecomp.9.html

This seems to work just fine in the testing I have done and I don't really see why it shouldn't work as homing is done for each joint.

The only reason 'el8-homecomp.comp' does not offer that option is that the author of that particular homing component decided to remove that functionality.


[edit]
That is what I meant with this comment (ie 'it' meaning 'el8-homecomp.comp'):

Looks like it was maybe not intended for the user to be able to choose between the homing method.

Last edit: 16 Jun 2024 12:14 by Aciera.

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

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
16 Jun 2024 19:41 #303123 by rodw
Replied by rodw on topic Absolute homing
Please try my cia402 homecomp.
github.com/rodw-au/cia402_homecomp/tree/main

I went back to the original homecomp code so it should work. I only get small bursts of time to work on this so I forget what is meant to be supported. (My first homecomp was obsoleted by massive changes to the framework)

Note my pin  names are different. There is a PR there to change them back to the default names which I am deliberating over accepting or not. Give me your thoughts on this.

I've had some help from scottlaird and was hoping once this is tested, it would be distributed with the hal ethercat driver.
The following user(s) said Thank You: Aciera, DPFlex

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

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
16 Jun 2024 19:47 - 16 Jun 2024 19:49 #303124 by rodw
Replied by rodw on topic Absolute homing
I commited the PR to conform with the standerd pin names which should make it easier for you to try this component. It needs testing!
Last edit: 16 Jun 2024 19:49 by rodw.

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

  • rodw
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
16 Jun 2024 20:33 #303129 by rodw
Replied by rodw on topic Absolute homing
I have checked my code and we are not doing it either!
I've added an issue to remind me to fix this.
I am out of time now until this evening.
Happy to accept a PR to correct this in the meantime.
The following user(s) said Thank You: tommylight, Aciera

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

Time to create page: 0.093 seconds
Powered by Kunena Forum