Configurate Slave Axis
- mwe
- Offline
- New Member
-
- Posts: 8
- Thank you received: 0

Does anyone have this two drives one axis set up working on a gantry router? Which I suspect would be the most common situation. I wont have anything I could test with until I have a project that needs/forces me to put the router together. (Stored, space limitations) It had a central screw driving the gantry. But that is going away, many issues. So I am while the winter is slowing things down, I am getting up to speed on LinuxCNC. I have to remember that change too.

Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23377
- Thank you received: 4966
Does anyone have this two drives one axis set up working on a gantry router?
I don't, but many people do.
You can experiment with how it "feels" using the supplied sample configs.
Please Log in or Create an account to join the conversation.
- viesturs.lacis
- Offline
- Premium Member
-
- Posts: 109
- Thank you received: 4
Does anyone have this two drives one axis set up working on a gantry router?
I have built/retrofitted 2 gantry machines for myself and built 3 gantry machines for my customers. What kind of advice is needed?
Basically setting up LInuxCNC for gantry machine is easy. The only difference is loading appropriate kinematics module. Gantrykins is already included, but you always can create your own module to have whatever axis <--> joint mappings you need.
For gantrykins this might be useful to take a look at:
linuxcnc.org/docs/html/man/man9/gantrykins.9.html
Using gantrykins is not that easy. There are several things to take into account for safe use of the machine:
1) pay _special_ attention to remember to switch to world mode after homing not to accidentaly jog machine in joint mode only one of the gantry joints, which, depending on machine, can cause some damage;
2) executing MDI commands by triggering HALUI pins will leave machine in joint mode after command is completed; see previous point for potential consequences; switching to world mode is always available.
I myself have done these mistakes so many times that now I check for 3 times that machine is in correct mode after any of these 2 actions - homing or mdi though halui.
I think that there was something else, but these are things that annoy me most.
Other than that gantrykins does its job nicely.
Please Log in or Create an account to join the conversation.
- mwe
- Offline
- New Member
-
- Posts: 8
- Thank you received: 0

Please Log in or Create an account to join the conversation.
- Clive S
- Offline
- Platinum Member
-
- Posts: 2245
- Thank you received: 482
Using gantrykins is not that easy. There are several things to take into account for safe use of the machine:
1) pay _special_ attention to remember to switch to world mode after homing not to accidentaly jog machine in joint mode only one of the gantry joints, which, depending on machine, can cause some damage;
2) executing MDI commands by triggering HALUI pins will leave machine in joint mode after command is completed; see previous point for potential consequences; switching to world mode is always available.:
This alone would put me off if it can't be solved with Linuxcnc as it is an accident waiting to happen. It has to be automatic surely

Please Log in or Create an account to join the conversation.
- Rick G
-
- Offline
- Junior Member
-
- Posts: 26
- Thank you received: 155
I just slave the two axis together in hal, I have solid stops that can be checked to make sure it has not drifted and the machine is parked against them when shutting down.
Rick G
Please Log in or Create an account to join the conversation.
- viesturs.lacis
- Offline
- Premium Member
-
- Posts: 109
- Thank you received: 4
Thanks for the input. I have looked at gantrykins and understand basically what is going on but need more reading to get a grip on how it plugs into EMC as a whole.
I am not sure that I understand, what you mean by "how it plugs into LinuxCNC as a whole". In you main HAL file you need to load gantrykins kinematics module instead of trivkins or whatever else there is. It looks like this:
loadrt gantrykins
And then it needs axis to joints mappings be specified, This example would assign joints 1, 3 and 4 to Y axis, joint 0 for X and joint 2 for Z:
setp gantrykins.joint-0 0
setp gantrykins.joint-1 1
setp gantrykins.joint-2 2
setp gantrykins.joint-3 1
setp gantrykins.joint-4 1
I have not looked over joints_axes4, maybe that will wait till I understand more. It just seems to me you wouldn't have to switch to joint mode. home, and then back to Cartesian mode all manually. If joints_axes4 does this home and sync two axis thing automatically then that is the place to start. I sill have much to learn before that point.
I have not tried joints_axes branch, but I can tell for sure - for nontrivial kinematics homing is done in joint mode only. There are options to switch to world mode before homing etc, but homing itself is done in joint mode only. Main feature of joints_axes branch is clearing out the joint vs axis concept, HAL pin names have changed to better describe their actual meaning etc. But AFAIK it does not change basic concept, how LinuxCNC operates.
It is possible to switch to world mode automatically after successful homing of all joints, Andy Pugh shared some tweaks to Axis GUI script to add another HAL pin and then few HAL modules were used to watch axis.n.is-homed pins.
This alone would put me off if it can't be solved with Linuxcnc as it is an accident waiting to happen.
I totally agree that it is not nice and I would like that fixed. Unfortunately I am not a programmer, so I am not able to do that myself.
It just seems to me that I missed a point, where another alternatives to LinuxCNC were mentioned that can map more than 1 joint to a single axis and still treat them as separate joints, when they have to be homed etc. I am not aware of such alternatives that would cost less than few thousand eur.
And there are many aspects, how cnc machine tool can be dangerous and asking for accident, if used carelesly and without paying proper attention.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23377
- Thank you received: 4966
This alone would put me off if it can't be solved with Linuxcnc as it is an accident waiting to happen. It has to be automatic surely2) executing MDI commands by triggering HALUI pins will leave machine in joint mode after command is completed; see previous point for potential consequences; switching to world mode is always available.:
..Clive
It is a bug. I have tried to track it down, bit with no luck so far.
If running an MDI command is a reliable way to trigger the bug then that is a good start towards finding out where it is happening.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
- Posts: 23377
- Thank you received: 4966
It is a bug. I have tried to track it down, bit with no luck so far.
Well, I am closer. It's a HALUI bug!
I had previously tested with _only_ halui as a user interface and exonerated Axis and the other GUIs. I had not previously noticed that it doesn't happen without halui loaded.
To demonstrate: Start the gantry/gantry config. Home the joints, switch to world mode.
Switch to MDI mode (click the tab, or F5).
Switch to Manual mode (click the tab, or F3).
It's all good.
Close the config. Add "HALUI = halui" to the [HAL] section of the INI and repeat the test.
Now switching from MDI to manual drops you in to Joint mode.
Watch this space, now I know where to look it might be an easy fix. Or it might not.
So, it is possible to avoid this bug if you don't use Halui.
Also, in Joints_axes4 "Gentrivkins" is a remappable trivial kinematics that doesn't force the system into "Joint" mode.
Please Log in or Create an account to join the conversation.
- Clive S
- Offline
- Platinum Member
-
- Posts: 2245
- Thank you received: 482
Well, I am closer. It's a HALUI bug!
Well the cage as surely been rattled, I will be watching this space.
Andy a big THANK YOU for taking the time to look at this. If this can get done it will be a great help to a lot of people on here.

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