Button to switch between coordinate systems

Moderators: TomKerekes, dynomotion

Post Reply
gui_marchioro
Posts: 57
Joined: Sun Aug 21, 2022 11:22 pm

Button to switch between coordinate systems

Post by gui_marchioro » Sun Nov 06, 2022 5:01 pm

Hello,

In my CNC machine there are two tables, each of them should have its own coordinate system as shown in the picture below.
tablesCoordinateSystems.png
tablesCoordinateSystems.png (8.11 KiB) Viewed 522 times
I would like to implement a way of switch these two coordinates systems through a button. I first thought that G5X would solve my problem, but then I realize that it would just offset the system, and actually what I need is to reverse the direction of X axis.

Does anyone know a way of reversing an axis direction through C or maybe G code?

Sincerely,
Guilherme
Last edited by gui_marchioro on Sun Nov 06, 2022 5:18 pm, edited 1 time in total.

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Button to switch coordinate system

Post by TomKerekes » Sun Nov 06, 2022 5:12 pm

Hi Guilherme,

May I ask why don't you keep the Axis in the standard Cartesian directions and create the proper GCode to do whatever you need to do?

Maybe you could explain what the machine needs to do?

You could create an MCode to execute a C Program that reverses the direction of the KFLOP Axis. But then the GCode Viewer and Jog Buttons wouldn't probably work correctly.
Regards,

Tom Kerekes
Dynomotion, Inc.

gui_marchioro
Posts: 57
Joined: Sun Aug 21, 2022 11:22 pm

Re: Button to switch between coordinate systems

Post by gui_marchioro » Mon Nov 07, 2022 12:52 pm

Hello Tom,

Alright, let me explain.

The idea to reverse the axis direction is that the same G code program could be executed on Table 1 and Table 2 (See image below). That is a commom feature in wood working cnc machines.
tablesCoordinateSystems-example.png
tablesCoordinateSystems-example.png (10.9 KiB) Viewed 517 times
In the origin of coordinate systems from table 1 and 2, there is a spot to place and fix the wood material.

When button 1 is pressed the machine executes the program on table 1. Meanwhile the operator will be placing the material on table 2. When the work is done on table 1, the operator press button 2 and the program is executed on table 2.

Sincerely,
Guilherme

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Button to switch between coordinate systems

Post by TomKerekes » Mon Nov 07, 2022 5:51 pm

Hi Guilherme,

It seems to me that would result in a horizontally flipped result. Like this:

flip.png
flip.png (8.85 KiB) Viewed 508 times
I suppose for symetrical patterns it works.

All I can think of is what I said earlier.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply