Similar to, but different from, Marlin, end stops, and position report - possible bug?
This is roughly the same question, but I'm trying to understand the endstops hit response from Marlin.
I'm working on a prototype machine that has min and max endstops on X, Y.
How can I get the real position after hitting the max endstops? The reported position is either what I told the machine to move to, or if SW endstops are enabled, whatever the config value for max X, Y are.
When the endstops hit message comes in it provides a number after the X or Y but I can't figure out how it's related to anything in the FW config or the physical printer.
- Bed/max sizes (X, Y) set to 500
- Endstops enabled
- Move w/
- Ymax endstop triggered ~161
echo:endstops hit: Y:0.00
X:0.00 Y:250.00 Z:0.00 E:0.00 Count A:25147 B:25147 Z:0
So the counts are (likely) correct (CoreYX machine), they're zero after homing to minimum position, but using them to determine the physical position seems sketchy.
Now: If I continue...
- Move w/
echo:endstops hit: X:157.31
echo:endstops hit: Y:-265.55
Here's the thing: those values are roughly what I expect the X, Y max values to be, except (a) they're reversed, e.g., IRL the ~Y at Ymax endstop is around 161, and Xmax endstop is around 265.
- Flipping the X/Y values somehow (and inverting X, probably because I'm doing something weird to try to track this down)?
- Should I instead do some CoreYX math to attempt to get the physical position based on stepper counts?
What is happening here?