Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offsets not handled correctly in Macros #327

Open
DougCoffland opened this issue Apr 2, 2022 · 1 comment
Open

Offsets not handled correctly in Macros #327

DougCoffland opened this issue Apr 2, 2022 · 1 comment

Comments

@DougCoffland
Copy link
Contributor

This problem started with V1.0.2

If an offset is set up in a macro, it causes invalid Over/Under displays. This happens when the following conditions exist.

  • No program is loaded. It actually happens even if a program is loaded, but the 'Under' condition goes away as soon is the loaded program is simulated.
  • The lower soft limit is set to 0.
  • The macro moves toward to the lower soft limit and then adjusts the offsets so that new position is 0.

Here is an example of a macro program that causes this problem.

%
G21
G90
G53 G0 X85
G92 X0
%

If I run the exact same from the play button on the Control/Auto program it does not cause 'Under' to be displayed.

Also, if I set the lower soft limit to be -85 or less, it does not display 'Under'

If I eliminate the 'G92 X0' line, it does not display 'Under'.

@jcoffland
Copy link
Member

The "fix" I made previously to make your G53test.nc work was incorrect. That caused this problem. I will revert the fix.

The problem with G53test.nc is that, at the time of simulation there is no way to know what the offsets might be in the future. Therefore, a move in absolute coordinates cannot be computed correctly. For example, if you are at 0 and tell the machine to move to 0 with G53, i.e. with in absolute coordinates, then if there is no offset, no move would occur but if there is an offset the move would be to some other position and the current and next move would change. There's just no way to tell at simulation time what a G53 move will do. So you have to resimulate any time the offsets change, which we are not doing.

Even worse, you could move in absolute coordinates and then set a coordinate system based on the new position. In this case, many moves might be altered. The same goes for any coordinate systems set before the program is run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants