- Posts: 2
- Thank you received: 0
Is there an easy way to swap axes?
Is there an easy way to take the existing configuration and tell linuxcnc to just swap the axes as above, without having to individually reassign the homing switches and backlash configuration and all that?
Thanks
- J
Please Log in to join the conversation.
Please Log in to join the conversation.
JasonF wrote: Is there an easy way to take the existing configuration and tell linuxcnc to just swap the axes as above, without having to individually reassign the homing switches and backlash configuration and all that?
I recently did this myself.
I copied the INI file to a new name in the same config directory.
My config has several HAL files, and most of those are shared. I made a renamed copy of the one that defines the axis motor setups and left the rest unchanged.
Doing it this way leaves you with two alternate configs that share tool tables, any macros and remaps, etc.
In the new INI file change the reference to the axis HAL in the [HAL] section.
In my case X remained as X, but Y and Z swapped.
In the INI I changed [AXIS_1] to [AXIS_2] and vice-versa. I then cut and pasted the sections to put them in the right order. I don't think this is necessary.
This way the limits and tuning for each motor stay with each motor.
The only thing you probably want to change inside each INI section is the homing sequence number.
Then, in the HAL file, swap the header comments for Y and Z (if any) then swap any axis.N numbers (motor-position-cmd, motor-position-fb, limit-sw-in, home-sw-in)
Leave the PID and stepgen numbers the same, _only_ change the axis.N numbers.
You can, if you want, change the signal names to match the new axis letters, but it might actually be less error-prone not to.
If you save the files and start LinuxCNC you should now have a new config that you can pick from the config picker.
The config should work just as well as the original config, except that jogs and G-code move different motors.
But... There is one remaining problem, you will have a left-handed coordinate system. You will need to swap the direction of one of your axes. In my case I swapped the new-Y (old Z) so that Y+ was table downwards.
If you have a stepper system this is just a case of negating the stepgen scale and changing the homing directions and the axis limits. For a servo system you also need to reverse the encoder scale and PWM scale. I amusing the 8i20 and Resolvers, reversing the axis took me several iterations, but if you get it wrong all that happens is a following error.
Please Log in to join the conversation.
I was hoping there was a 5 minute solution instead of a few hour solution.
Please Log in to join the conversation.
JasonF wrote: That's the approach I started to take, but it just seemed like too much work.
I was hoping there was a 5 minute solution instead of a few hour solution.
It shouldn't take more than 15 minutes to get the left-handed config. It is just text-editor work.
Please Log in to join the conversation.
A bit of serious thread necro here
I have my Maho MH400E configured as a vertical mill, and am trying to set up a second INI and HAL with it configured to use the horizontal spindle. For this I need to switch Z and Y, and negate one.
I have something messed up, and spent a couple of evenings trying to trouble shoot it, but cant see the issue. The MH400E HAL and ini work fine, the Horizontal hal and Ini load without error, but cause a Y axis error as son as I push the start button.
I would appreciate if anyone can spot my (probably dumb) mistake. Thanks.
Cheers,
Mark
Please Log in to join the conversation.
EDIT:
I'm not familiar with pre-joint/axis configs, but one thing I noticed in your HAL files is that it looks like there's a mismatch between the INI and HAL axis numbers.
Vertical:
INI - Y is axis_1
INI - Z is axis_2
HAL - Y is axis_1
HAL - Z is axis_2
Horizontal
INI - Z is axis_1
INI - Y is axis_2
HAL - Z is axis_2
HAL - Y is axis_1
Make sense?
Please Log in to join the conversation.
for example you can run the millturn configuration - it rotates the Z axis on 90 degrees.
linuxcnc.org/docs/html/motion/switchkins.html
linuxcnc.org/docs/html/man/man9/millturn.9.html
Attachment not found
Please Log in to join the conversation.
But stupidly, pncconf and stepconf set all of the signals to axes instead of joints.What I do is to relabel the signals to avoid confusion eg x-home becomes 0-home. I made 162 changes.
I have thought of modifying pncconf to select between joint based and axes based configs.
Please Log in to join the conversation.
Is switchkins useable with LinuxCNC 2.7? I have never updated the Maho to a Joints based version, as I am afraid of breaking a working system. I have that gearbox comp working and am loath risking bricking the machine.
Cheers,
Mark
Please Log in to join the conversation.
