Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    CNC Coordinate Systems

    Scheduled Pinned Locked Moved
    CNC
    8
    45
    7.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dc42undefined
      dc42 administrators
      last edited by

      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.

      Duet WiFi hardware designer and firmware engineer
      Please do not ask me for Duet support via PM or email, use the forum
      http://www.escher3d.com, https://miscsolutions.wordpress.com

      1 Reply Last reply Reply Quote 0
      • Danalundefined
        Danal
        last edited by

        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.

        Delta / Kossel printer fanatic

        1 Reply Last reply Reply Quote 1
        • Danalundefined
          Danal
          last edited by

          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'.

          Delta / Kossel printer fanatic

          1 Reply Last reply Reply Quote 0
          • Danalundefined
            Danal
            last edited by

            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".

            Delta / Kossel printer fanatic

            1 Reply Last reply Reply Quote 1
            • dc42undefined
              dc42 administrators
              last edited by

              Thanks. I'll probably follow the Smoothieware format in a future firmware release.

              Duet WiFi hardware designer and firmware engineer
              Please do not ask me for Duet support via PM or email, use the forum
              http://www.escher3d.com, https://miscsolutions.wordpress.com

              1 Reply Last reply Reply Quote 0
              • Danalundefined
                Danal
                last edited by

                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).

                Delta / Kossel printer fanatic

                1 Reply Last reply Reply Quote 0
                • Danalundefined
                  Danal
                  last edited by

                  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.

                  Delta / Kossel printer fanatic

                  1 Reply Last reply Reply Quote 0
                  • dc42undefined
                    dc42 administrators
                    last edited by

                    I've added this to the list of thing to look into for the next firmware version.

                    Duet WiFi hardware designer and firmware engineer
                    Please do not ask me for Duet support via PM or email, use the forum
                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                    1 Reply Last reply Reply Quote 0
                    • Catalin_ROundefined
                      Catalin_RO
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • Danalundefined
                        Danal
                        last edited by

                        @Catalin_RO:

                        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.

                        Delta / Kossel printer fanatic

                        1 Reply Last reply Reply Quote 0
                        • dc42undefined
                          dc42 administrators
                          last edited by dc42

                          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?

                          Duet WiFi hardware designer and firmware engineer
                          Please do not ask me for Duet support via PM or email, use the forum
                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                          mwintermundefined 1 Reply Last reply Reply Quote 0
                          • Ryan Lockundefined
                            Ryan Lock
                            last edited by

                            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.

                            1 Reply Last reply Reply Quote 0
                            • Catalin_ROundefined
                              Catalin_RO
                              last edited by

                              Option C sounds best compromise to me as well!

                              1 Reply Last reply Reply Quote 0
                              • dc42undefined
                                dc42 administrators
                                last edited by

                                Thanks, both of you. I'll add the workplace coordinate settings to the M500 saved parameters.

                                Duet WiFi hardware designer and firmware engineer
                                Please do not ask me for Duet support via PM or email, use the forum
                                http://www.escher3d.com, https://miscsolutions.wordpress.com

                                Danalundefined 1 Reply Last reply Reply Quote 0
                                • Danalundefined
                                  Danal @dc42
                                  last edited by

                                  @dc42 said in CNC Coordinate Systems:

                                  Thanks, both of you. I'll add the workplace coordinate settings to the M500 saved parameters.

                                  Fantastic!

                                  I did not respond quickly enough... option (c) is indeed what I would have voted.

                                  Delta / Kossel printer fanatic

                                  1 Reply Last reply Reply Quote 0
                                  • Ryan Lockundefined
                                    Ryan Lock
                                    last edited by

                                    @dc42 Thanks for making them changes. I have tested it out and it all works as expected.

                                    One other thing i have noticed is that when pausing a file, and then resuming it, the machine goes back to machine coordinates and forgets which work coordinate system it was in. The way to solve this is to select the work coordinate system at the start of the resume.g file. Selecting the work system through the g-code console while in pause mode doesn't work, it has to be set in resume.g as far as i can see.

                                    The effect of this is that the pause button can only practically be used in one coordinate system. As to use it in the others would require the resume file to be changed to select the correct one before resuming.

                                    I am sure that before i upgraded the Duet to the latest firmware version it used to remember the work coordinate system when paused.

                                    Ryan

                                    dc42undefined 1 Reply Last reply Reply Quote 0
                                    • dc42undefined
                                      dc42 administrators @Ryan Lock
                                      last edited by dc42

                                      @ryan-lock said in CNC Coordinate Systems:

                                      One other thing i have noticed is that when pausing a file, and then resuming it, the machine goes back to machine coordinates and forgets which work coordinate system it was in. The way to solve this is to select the work coordinate system at the start of the resume.g file. Selecting the work system through the g-code console while in pause mode doesn't work, it has to be set in resume.g as far as i can see.

                                      The effect of this is that the pause button can only practically be used in one coordinate system. As to use it in the others would require the resume file to be changed to select the correct one before resuming.

                                      I am sure that before i upgraded the Duet to the latest firmware version it used to remember the work coordinate system when paused.

                                      I am surprised by that, because I don't recall making any changes in that area. In fact, I expect the pause.g and resume.g files to use the current workplace coordinates, which of course means that you would probably need to use G53 before all the movement commands in those files except for any G1 R1 moves at the end of resume.g. Anyway, I'll test it before I do another 2.02RC.

                                      PS - are you sure that you don't have any commands in pause.g that reset the coordinate offsets to zero?

                                      Duet WiFi hardware designer and firmware engineer
                                      Please do not ask me for Duet support via PM or email, use the forum
                                      http://www.escher3d.com, https://miscsolutions.wordpress.com

                                      1 Reply Last reply Reply Quote 0
                                      • resamundefined
                                        resam
                                        last edited by

                                        sounds like the same problem I reported here: https://forum.duet3d.com/topic/7940/firmware-2-02rc5-now-available/7

                                        @dc42 in RRF, when you call resume.g to run DoFileMacro, there is this line:
                                        gb.MachineState().useMachineCoordinatesSticky = true; // running a system macro e.g. homing or tool change, so don't use workplace coordinates

                                        Not sure if thats the actual problem - but something to know about.

                                        Related question: is pause+resume aware of "relative positioning" and "relative extrusion" and does it reset the correct state as it was before pausing? While paused the user could have changed it to move around...

                                        1 Reply Last reply Reply Quote 0
                                        • dc42undefined
                                          dc42 administrators
                                          last edited by dc42

                                          Thanks @resam, that explains it. I now remember making that change so that homing wouldn't be messed up by workplace coordinates.

                                          • To fix it, I think I could change it so as not to apply that sticky G53 in the case of running resume.g. That would mean that if resume.g does any moves apart from ones to restore the original position (e.g. wiping the nozzle on a FDM printer), they would need to be prefixed by G53. Does that sound a reasonable solution?

                                          • An alternative would be to record all restore point coordinates in machine coordinates, and to use machine coordinates always when the R parameter is used on a G1 command.

                                          In answer to your other question, whenever a macro file is run the relative/absolute movement and extrusion states are remembered at the start and restored at the end.

                                          Duet WiFi hardware designer and firmware engineer
                                          Please do not ask me for Duet support via PM or email, use the forum
                                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                                          1 Reply Last reply Reply Quote 0
                                          • resamundefined
                                            resam
                                            last edited by

                                            I don't really know what G53 and G54 do - and I don't think I want to bother with them in a 3d-printing task (I guess I can only speak for 3d-printing use cases, as I don't run CNC-style jobs). Most people I believe already have difficulties with G90/G91.

                                            In my case, I just want to move the head to to a parking position during pause, and move back to the last position on resume.

                                            I wasn't even aware that RRF already provides this hard-coded - I assumed it has to be specified in resume.g - thats also what the examples did, so I copied it. I will try to remove my G1 R1 ... commands from my resume.g at let the firmware do it.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA