-
That leaves the extended codes at the very end of the string that are the actual machine position (G53). There is no "marlin compatible" answer here, because Marlin has no concept of multiple coordinate systems (does not support G54 and friends). This is new ground for Duet/RepRap, recently added to the M114 response.
In order to make it more parseable, I'd like to offer that it should be:
[c]X:123 Y:456 Z:789 E0:123456 Count 932854 3459 2345 983456 MX:15.55 MY:789.45 MZ:13.78 ME0:753.15 [/c]
Or similar.
That would make it MUCH easier for Chilippepr, CNCjs, etc. to add proper support for parsing this output.
.
.
And, is there a JSON equivalent to the M114 text output? If so, of course, it should be 'similar'. -
dc42, I know you've been busy pushing a release… now that is been a day or two, any further thoughts on:
X:123 Y:456 Z:789 E0:123456 Count 932854 3459 2345 983456 MX:15.55 MY:789.45 MZ:13.78 ME0:753.15
-
My suggestion is to use M408 instead of M114. It provides both machine and work coordinates, and a lot of other data that may be useful in the HMI.
Or why not modify Duet Web Control to be more CNC-friendly? It displays user coordinates, but it also has access to machine coordinates.
-
I agree that M408 would be better for HMI/Console than M114. I will investigate changing CNCjs to have a "Duet/RepRap" tab in addition to its existing tabs. However, I don't know how active they are, and/or how receptive to pull requests.
DWC being CNC friendly is interesting. I'll think about that seriously.
At the same time, M408 is further evidence that M114 is not correctly aligned with the actual philosophy of NIST standard model of coordinate systems. Further, M114 and M408 are in conflict with each other:
M408 returns work coordinates in the "pos:" block, which is equivalent to M114 "X:". M114 does the opposite.
M408 returns machine coordinates in the "machine:" block, and this is equivalent to M114… well, nothing by de-facto standard... it would be most aligned with M114 returning "mx:" or similar.
Thanks for your consideration.
-
Busy days for me, so I will be brief. The CNCjs guy is pretty friendly as we already did some debug in order to see why the GUI was not sending commands to Duet unless I manually issued M114 commands through a menu in it. So there might be an improvement on this matter in the version anyway.
-
My take is that as NIST doesn't define M114, and Marlin doesn't support workspace coordinates, what M114 is supposed to return on a CNC system is not defined.
Does anyone know what Smoothieware returns in response to M114 when workplace coordinate offsets are in use? Does LinuxCNC support M114?
-
I understand your perspective that NIST doesn't define responses, not M114 nor anything else.
What it does define is that a CNC machine is always in one of the work coordinate systems. It is literally not possible for a controller to be "in" the machine coordinate system; in particular, G53 overrides only the line on which it occurs. Therefore, a controller should never return anything but the work coordinate that represents its current position (unless explicitly marked as machine in a separate field).
And, I'd also note that M114 and M408 are in conflict with each other.
Dave, it is certainly possible for an HMI/Console to parse any response, in any pre-agreed fashion. Formally, any "Interface Contract" will work as long as it is stable. However, that does not make the response correct. M114, as seen by a human at a serial terminal, is wrong as it stands.
-
Catalin, good to hear about CNCjs. I'll look at doing a fork and a Duet/RepRap tab. As Dave pointed out, that will most likely use the M408 JSON response. (If I do it, it certainly will).
Dave: Would you have a preference regarding the "short name" of the tab in the CNCjs GUI? "Duet", "Duet3D", "RepRap", or something else?
-
M114 and M408 are not in conflict, because they don't use the same labels.
I don't plan to change how M114 behaves until I know how other CNC firmwares that support M114 behave.
-
Dave, you asked about LinuxCNC and M114 M408. It does not support any G or M command that returns a response, primarily because the displays are all "built in". The displays can be "skinned" to user preference… and almost all of those skins have the current work coordinate displayed quite large, and the machine displayed small or not at all. Example (white numbers are labeled "Current Position", aqua blue numbers "Machine Coords"):
My interpretation of this is "neutral", because the motion controller and the display are not separate, there is no "message format" to follow.
-
M114 responses, Work or Machine, by firmware:
NIST - Does not specify M114 (or any other way to solicit a coordinate position response).
NIST does document "Parameters" to read the state of the controller. NIST further documents which "Parameter" sets contain work coordinates for the various G54 and onward states (5221 onward). NIST also documents a separate parameter that selects which set is active (5220). NIST further states: It is an error for the value of parameter 5220 to be anything but a whole number between one and nine. (corresponding to G54 through G59.1).
Any hypothetical DRO/HMI/Console interfaces to the NIST controller would need to read the parameters, and it should be noted there are not parameters (documented) for absolute machine coordinates. So any hypothetical "Tell me your position" response would have to read 5220 and use it to decide with group of 5221 onward to display… put simply, it could only respond with "Work". Per NIST documentation, it is not possible to respond with anything else. Machine coordinates can only be "back calculated" from the currently active offset.
My interpretation of this is "Work" should be displayed, because it is the only thing that NIST 'externalizes'.
-
M114 responses, Work or Machine, by firmware (continued):
Marlin - N/A, does not have the concept of Work vs. Machine.
Smoothieware - M114 shows Work. M114.2 shows Machine.
Repetier - N/A does not have concept of Work vs. Machine.
GRBL - Does not support M114. ? can be set to return one of W or M. ?? returns both, and a matrix of all offsets.
TinyG - Does not support M114. JSON and/or Text responses can be configured to return Work, Machine, or both. When configured to return Work and/or Machine JSON uses POSX: and MPOX:, respectively. Text responses return a large block of text, with "X Position: nnn.nnn" on a line by itself, etc. These are work positions. A different line has the currently active coordinate systems (G54, etc).
Summary (skipping the N/A):
Smoothie: G54 Yes. M114 Yes. M114 returns work. (M114.2 returns machine).
TinyG: G54 Yes. M114 No. TinyG does have its own status and/or response formats, both text and JSON. They all return Work in the "POSX" or "X: Position" fields. They all can be configured to return machine, in fields such as MPOX:.
Even more summarized: All firmwares that do respond, always return work in the "normally named" fields, and only return machine in subset commands or fields who's names start with "M".
-
Thanks. I'll probably follow the Smoothieware format in a future firmware release.
-
Dave,
I've checked G10 L2 and L20, using M408 S1 for response, on Release 1.21 (final), combined with various G1 and G0 moves. Everything appears to behave correctly in every scenario I could think of to test (I did not do a rigorous analysis of test cases).
-
However…
Per NIST standard documentation, work offsets are supposed to be persistent, including across reboots and power cycles. In the case of Duet3D/RepRap, they are not.
In case you are wondering, persistence is an important feature for CNC machinists, because the various G55, G56, etc. are quite often used for "Fixtures" that are mounted to the CNC bed for extended periods of time (weeks or months). Having to "re-find" or "re-touch" fixtures every time the machine is reset would be quite contrary to the way people are accustomed to operating.
-
I've added this to the list of thing to look into for the next firmware version.
-
While agreeing on the advantages of persistent work offsets, I don't really miss it with Duet3D. One could write extremely simple one liners with the G10 L20 Pn codes. Having them stored as macros also simplifies usage a lot as those macros can have meaningful names, usually much better than a Post-It on the machine telling the operator that "G56 is for round fixture in right-rear corner"…
As already mentioned in the other thread (https://www.duet3d.com/forum/thread.php?id=5006) I have re-connected the Duet3D to my WorkBee and did a lot of movement tests, including a camera for finding X/Y on workpiece and a movable tool finder for Z. I simply removed all predefined macros and added three of my own that do all the tricks.
-
While agreeing on the advantages of persistent work offsets, I don't really miss it with Duet3D. One could write extremely simple one liners with the G10 L20 Pn codes. Having them stored as macros also simplifies usage a lot as those macros can have meaningful names, usually much better than a Post-It on the machine telling the operator that "G56 is for round fixture in right-rear corner"….
That works great if you are willing to transcribe coordinates into the macros. When I mount a fixture, and switch to G55 (or whatever), I then Z Probe it, and use an edge finder to touch the edges (usually the edges of the stock in the fixture, not the fixture itself).
Anyway… Once the physical part is done, I hit the "Zero Work Coordinates" button and it is now "saved". No human errors copying long numbers from the DRO to the macro.
-
What do you all think should be the mechanism for saving coordinate systems to the SD card?
(a) Automatically save them whenever they are changed. This could result excessive wear on the SD card if they are changed frequently.
(b) Save them whenever a job is paused.
(c) Save them when you ask to save them explicitly, using M500 or a similar command.
(d) Something else?
-
Option C would be best in my opinion. If a user wants the coordinate system to autosave, they can setup macros to send the command and then autosave.