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
[1.1.x] CNC_COORDINATE_SYSTEMS #8200
[1.1.x] CNC_COORDINATE_SYSTEMS #8200
Conversation
bd852cb
to
5375fac
Compare
3bb327a
to
348d689
Compare
Hello, I've seen your implementation and its different from how real world CNC works. The first bigger difference is that internally they work everytime with native system positions... |
Correct me if I'm missing the meaning…. Internally to Marlin, the On Cartesian robots the I've been wanting to alter Planner and Stepper so that workspace offsets are stripped before going to the planner on Cartesians, but it's a middle-sized job. The macros So, are you saying that when we set the workspace to be at X100 Y100 in the machine space, we must still use |
daf4b01
to
ef70bc9
Compare
Item 1Well I'll try to explain but be patient, English is not my language and is not so easy to understand and to explain. Item 2Underneath software works always in machine space (so you never need to touch software limits) when you ask for a G0 firmware should add to passed values the current origin offsets 100,100) and pass new positions to the engine (not sure if it is the so called planner). Probably this change everything in Marlin since, as you said, it always worked using "working space" positions as base for everything while "real world" machine works in reverse mode. "working space" is at high level, the user level. For a 3d printer, where usually you have home at negative X,Y values (endstop position) is like you have a predefined origin to "-X_MIN,-Y_MIN" so you bed corner is the user selected origin (an implicit G54). Note that in "real world" machines when you set an origin to be active, also manual movements are related to such origin since often this is also the origin of the item where you have to work on. |
To your first point (which I've labeled "Item 1" above) that seems to describe how Marlin works… At least, from the user perspective there is no difference. The min/max positions are set in machine space in the configuration, and these numbers apply when in native machine space. When you change the coordinate system or use So, for example, if your |
It would indeed be possible to change the way Marlin works so that There's a lot of code in Marlin that manages movement within the "logical" space. It would be a very interesting exercise to try and make everything work in native machine space. I suspect it would make the code smaller and more efficient. But it's a huge task, not for the timid. |
ef70bc9
to
b7a3c65
Compare
Well this is what normaly doesn't happen. When you use G92 or G5x you don't need to change endstop limits. They should stay fixed (they are always related to machine space). Go on with path already present. Don't worry and thanks again for all your efforts you put in this project |
How much work? We'll see as I give it a trial run….
|
3c04b3a
to
5d5db4d
Compare
Note that now endstop limits are not in range of machine space, they are in range of bed. |
This is true. It was made into the default because, when printing, moves are constrained within the soft endstop range to prevent extruding off the bed. So, they are no longer just a safety feature to prevent the machine from hurting itself. |
If soft endstops are -10, -10, then after |
Anyway… The new PRs #8229 and #8234 take your point to heart and will have the machine operate in native space at the high level, making the code much more efficient! And, the soft endstops (and other coordinate values) will be in native space too, so they don't have to be tweaked in response to |
I think this implies the lower levels of the firmware (like the bed leveling systems) no longer need to operate in the LOGICAL space, right? They can just use the native coordinates of the machine, right? What I'm thinking is the mesh for various bed leveling systems should always be in machine coordinates. And by the time the various movement() routines need to do something or provide a correction, they are being given the RAW coordinates and can just use what they get. Right? |
Correct. Everything internal will be in native machine space from now on. However, when reporting XYZ position output to serial (as with |
de26ae9
to
2b63250
Compare
@thinkyhead ok about intrinsec security on endstop for 3dprinters but in CNC world machine should be still enable do move back from 0,0 (I think about waterjet, laser, plasma and milling machines) |
If the endstops describe the bed... And the work piece is smaller than the bed (because it fits on the bed)... Why can't the endstop logic stay the same? |
@Roxy-3D sorry forget to say 0,0 after apply G92 |
endstops must be in machine coords at all times. they define absolute limits of movement. 0,0 can be a limit, but it can also be moved and placed wherever you like within the endstops. I own a 4x8ft cnc. currently with my machine, I will run a home operation which resets work coords to machine coords after finding where the endstops are. I think jog the machine to the location I want 0,0 to be, and reset the XY coords. This only changes the work coords. I then jog down unto my table or workpiece and reset Z to 0. depending on what I'm doing, Z will either go positive (0 on table) or negative (0 on work piece) |
It's what I'm saying endstop are absolute positions on machine space (usually 0,0 is min but not always) but in 3d printers is different. |
f640062
to
e42d0ed
Compare
b0ac3d6
to
8a0634e
Compare
|
8a0634e
to
8ab3685
Compare
@thinkyhead look at this https://www.thingiverse.com/thing:2487484 |
Continuing our expansion of support for CNC, this PR provides the G-codes
G53
andG54
-G59.3
. In order to be able to support CNC-style G-code aParser::chain
method was added. This allows the use ofG53
in front ofG0
orG1
to do a single move in the machine native coordinate space.Also adds
G92.1
to reset the current workspace back to native machine space.See
Reference: #3208