Once again, I thank you for your response Aciera, you have got the focus of your two responses right, although I am still not clear about the best way to configure everything.
As for my first question and your first answer, that is exactly my question, how to return home the extra joints, in this case they would be home designs with a min limit switch shared with a home switch and it also has a maximum limit switch for the three axes. X A B, all these signals are defined in the motion controller, so this is what I mean when I say that the extra joints would be controlled in part by the motion controller, if it works that way of course.
I have been reading several threads on the forum and it is mentioned that all this can be done using only hal as you mention before, but I can't find any example, especially Andypugh seems to be quite familiar with how to do it, although I have no other way to contact him that is not in the forum.
Attached I leave some photos of the user interface, the idea would be to simply establish a measurement in X of the angles on the right and left heads, press play and the machine positions itself.
I also leave a url about a video of a machine in operation,
Greetings to everyone, if you have any idea how to do this, thank you in advance.