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.
The following user(s) said Thank You: RotarySMP

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

More
26 Aug 2024 15:12 #308711 by RotarySMP
Hi Guys,

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
 
Attachments:

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

More
27 Aug 2024 01:12 - 27 Aug 2024 01:25 #308751 by spumco
Mark - you're running a LCNC version pre-joint/axis?

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?
Last edit: 27 Aug 2024 01:25 by spumco.

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

More
27 Aug 2024 03:06 - 27 Aug 2024 03:12 #308755 by hmnijp
could you use Switchable kinematics ?

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

 
 
Attachments:
Last edit: 27 Aug 2024 03:12 by hmnijp.

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

More
27 Aug 2024 08:20 #308778 by rodw
Using separate configs, the only thing needed is to change the coordinates statement in the ini file eg XYYZ to YXXZ which I did on a machine yesterday.
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.
The following user(s) said Thank You: RotarySMP, Masiwood123

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

More
27 Aug 2024 16:01 - 27 Aug 2024 16:10 #308821 by RotarySMP
Thanks guys. I was following Andys instructions, and didn't rename all the signals names, as I figured the more I changed the more I would screw up, but it didn't help and I still ended up tied in knots. :)

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
Last edit: 27 Aug 2024 16:10 by RotarySMP.

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

Time to create page: 0.105 seconds
Powered by Kunena Forum