Is there an easy way to swap axes?

More
13 Oct 2015 09:16 #63728 by JasonF
Occasionally I run my mill with the spindle rotated 90 degrees on its mount, so that the spindle is oriented horizontally, making z = x and x = -z. This is when I'm working on the top of a "tall" part that need lots of clearance in the -z direction.

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 or Create an account to join the conversation.

More
13 Oct 2015 15:25 #63734 by cncbasher
easy way is to make a second configuration ,

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

More
13 Oct 2015 19:13 #63745 by andypugh

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 or Create an account to join the conversation.

More
13 Oct 2015 20:25 #63752 by JasonF
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.

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

More
14 Oct 2015 00:20 #63757 by andypugh

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 or Create an account to join the conversation.

Time to create page: 0.150 seconds
Powered by Kunena Forum