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

CNC workplace coordinates

Scheduled Pinned Locked Moved
CNC
6
44
6.8k
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.
  • undefined
    dc42 administrators
    last edited by 13 Mar 2018, 22:04

    @Danal:

    I just did a very quick check on a Duet with nothing physically attached to it.

    It does appear that G10 L2 Pn X…Y...Z... followed by a G54 command indeed changes the reported coordinates, and does so "properly". I would note that the GUI does NOT update when the G54 is sent, but does update at the next move (G1).

    I'll have the interface update the user coordinates immediately in the next RC.

    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
    • undefined
      Danal
      last edited by 14 Mar 2018, 01:18

      @dc42:

      I'll have the interface update the user coordinates immediately in the next RC.

      You are a gentleman and a scholar!!

      Delta / Kossel printer fanatic

      1 Reply Last reply Reply Quote 0
      • undefined
        dc42 administrators
        last edited by 14 Mar 2018, 17:26

        I've realised that both PanelDue and DuetWebControl currently display the coordinates in machine space, not in user space. I think they should be displayed in user space instead, or possibly DWC could display both. Those of you who use CNC workspace coordinates, do you agree that the only or primary coordinates should be displayed in user space - in other words, in the coordinate system that is used when interpreting the parameters of G0/G1/G2/G3 commands? This would mean:

        • If you send G1 X123 Y321 and this is a valid command that doesn't breach machine limits, at the end of the move the coordinates displayed will be X123 Y321 no matter what coordinate system you are in (until you change to a different one);
        • When you use any of G53..G59 to switch to a different coordinate system, the displayed coordinates will change if the new coordinate system has a different origin from the previous one.

        M114 returns the coordinates in machine space, followed by "User:" and then the coordinates in user space. I propose to leave this as-is, unless it is definitely going to cause issues for those using Octoprint or similar.

        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
        • undefined
          Catalin_RO
          last edited by 14 Mar 2018, 21:35

          The following applications show both:

          • https://github.com/Denvi/Candle - top-right area, two columns for each axis
          • https://github.com/cncjs/cncjs - top-right area, two columns for each axis
          • https://winder.github.io/ugs_website/ - bottom-left area, work with larger digits and machine with smaller ones, underneath
          • https://github.com/vlachoudis/bCNC - top-left area, WPos and MPos rows, just under the "Not connected" red label

          If both work and machine coordinates are displayed, after issuing G53..G59 M114 should immediately return the new work coordinates. As for how it reports the work coordinates, leave it as it is, especially in order not to break backward compatibility.

          If DWC could display both, it would be great, at least when the firmware is set to CNC mode.

          1 Reply Last reply Reply Quote 0
          • undefined
            Danal
            last edited by 15 Mar 2018, 16:48

            All GUIs that I've ever seen show the "Work Coordinate System" that is active. Some also show machine coordinates, some show machine as an option or secondary display.

            This is true of software, as per the excellent examples given above, and of older controls that had physical panels. Sort of "in between" are some of the very original PC software for CNC, like MACH3, that attempted to look like an old controller. Showed work in a big display, and machine as an option.

            @dc42:

            Those of you who use CNC workspace coordinates, do you agree that the only or primary coordinates should be displayed in user space - in other words, in the coordinate system that is used when interpreting the parameters of G0/G1/G2/G3 commands?

            Yes. Always WCS in the primary display

            M114 returns the coordinates in machine space, followed by "User:" and then the coordinates in user space. I propose to leave this as-is, unless it is definitely going to cause issues for those using Octoprint or similar.

            Yes, status should always send both. TinyG had (has) options to configure status for either, and it is very challenging to make Chilipeppr work correctly.

            Delta / Kossel printer fanatic

            1 Reply Last reply Reply Quote 0
            • undefined
              Danal
              last edited by 15 Mar 2018, 16:51

              And a clarification, triggered by one of Dave's notes:

              G53 is NOT modal. It applies only to the line on which it appears. It DOES NOT (should not) switch the "work coordinate system" to match machine coordinates. Whatever "prior" WCS was in use stays in force. (First boot ever, that would be G54). This also means it is not useful "by itself" and the response and/or status reports should not change if it is used by itself.

              Note that this is in the NIST standard; however, the section on G53 does not say this… A careful read of the modality table will verify that G53 is not modal, by standard.

              G54 through G59 are modal, and responses and/or status should change their Workspace coordinate system to match the one just activated.

              Given that M114 returns both machine and work coordinates, always, what I'm really saying is that G53 does NOT switch WCS in a modal/sticky fashion, and G54 onward ARE modal/sticky.

              Delta / Kossel printer fanatic

              1 Reply Last reply Reply Quote 0
              • undefined
                dc42 administrators
                last edited by 15 Mar 2018, 17:36

                @Danal:

                And a clarification, triggered by one of Dave's notes:

                G53 is NOT modal. It applies only to the line on which it appears. It DOES NOT (should not) switch the "work coordinate system" to match machine coordinates. Whatever "prior" WCS was in use stays in force. (First boot ever, that would be G54). This also means it is not useful "by itself" and the response and/or status reports should not change if it is used by itself.

                Note that this is in the NIST standard; however, the section on G53 does not say this… A careful read of the modality table will verify that G53 is not modal, by standard.

                G54 through G59 are modal, and responses and/or status should change their Workspace coordinate system to match the one just activated.

                Given that M114 returns both machine and work coordinates, always, what I'm really saying is that G53 does NOT switch WCS in a modal/sticky fashion, and G54 onward ARE modal/sticky.

                That's interesting, and not what I had expected. Are you saying that once I have selected a WCS, there is no way I can go back to the native machine coordinates, except by setting the offsets of some WCS to all zeros and then switching to that WCS?

                Please note, one aspect in which RRF does not follow the NIST standard is how it handles multiple commands on the same line. RRF does this:

                • F is not a command, it is a parameter to other commands, in particular the feed rate on G0-G3 commands (for which it is 'sticky').
                • T is a command when it is the first non-whitespace character on a line. Otherwise it is a parameter.
                • You can have multiple G and M commands on the same line. Each G or M character that is not within double quote characters or in a comment and is either at the start of a line or preceded by white space is the start of a new command. Multiple commands on the same line are executed in left to right order.

                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
                • undefined
                  Danal
                  last edited by 15 Mar 2018, 22:22

                  @dc42:

                  That's interesting, and not what I had expected. Are you saying that once I have selected a WCS, there is no way I can go back to the native machine coordinates, except by setting the offsets of some WCS to all zeros and then switching to that WCS?

                  Correct. There is no way to put an NIST standard CNC into "machine coordinates" on a permanent basis. It can only be in G53 "one line at a time". The command:

                  G53 G0 X…Y...Z...

                  is valid and would move to those machine coordinates. As a side note, this seems compatible with the general way multi-commands on one line are handled now, with the clarification that G53 must not affect succeeding lines.

                  And, to be super clear the statement "...once I have selected..." is a non-sequitur. There is always a WCS active. It just so happens that a "freshly deployed" machine will be in G54 and the offsets will be zero, so it will 'appear' as though it is in G53.

                  This is made clear in the verbiage surrounding Table 4 in the NIST standard. Specifically these subsets:

                  @NIST:

                  The modal groups for G codes are:
                  group 12 = {G54, G55, G56, G57, G58, G59, G59.1, G59.2, G59.3} coordinate system selection
                  In addition to the above modal groups, there is a group for non-modal G codes:
                  group 0 = {G4, G10, G28, G30, G53, G92, G92.1, G92.2, G92.3}

                  Two explicit things here:

                  First, the table itself shows G53 to be non-modal, Group 0.

                  Second, it shows all of G54-G59.3 to be in the same group, and makes the following statement about all groups, just after the table (underline mine):

                  @NIST:

                  For several modal groups, when a machining center is ready to accept commands, one member of
                  the group must be in effect. There are default settings for these modal groups. When the
                  machining center is turned on or otherwise re-initialized, the default values are automatically in
                  effect.

                  That statement confirms my statement "A freshly deployed machine is actually in G54 with no offsets". Also, see next post (this one is getting too long).

                  Delta / Kossel printer fanatic

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    Danal
                    last edited by 15 Mar 2018, 22:24

                    Directly from the standard, underlines and bolding mine:

                    3.2.2 Coordinate Systems
                    In the RS274/NGC language view, a machining center has an absolute coordinate system and nine program coordinate systems.

                    …snip...

                    You can select one of the nine systems by using G54, G55, G56, G57, G58, G59, G59.1, G59.2, or G59.3 (see Section 3.5.13). It is not possible to select the absolute coordinate system directly.

                    …snip...

                    You can make straight moves in the absolute machine coordinate system by using G53 with either G0 or G1. See Section 3.5.12.

                    …snip....

                    Delta / Kossel printer fanatic

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      dc42 administrators
                      last edited by 15 Mar 2018, 22:43

                      Thanks. I can easily change the firmware to make the G54 WCS the default. Making G53 non-modal is a lot harder and will probably have to wait until the 1.22 release though.

                      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
                      • undefined
                        Danal
                        last edited by 16 Mar 2018, 18:34

                        That's great!

                        If a given piece Gcode is somehow dependent on G53 not being modal, a quick insert of G54 (or whatever) after the G53 G0 X… line would be a very easy bypass.

                        Delta / Kossel printer fanatic

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          dc42 administrators
                          last edited by 16 Mar 2018, 18:49

                          Please try firmware 1.21RC5. I believe that workspace coordinates are working correctly in it (including G53 being non-model), with the caveat that this command:

                          G53 G1 Xnn Ynn …

                          will work correctly; whereas this:

                          G1 G53 Xnn Ynn

                          will not.

                          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
                          • undefined
                            Danal
                            last edited by 16 Mar 2018, 20:25

                            @dc42:

                            Please try firmware 1.21RC5. I believe that workspace coordinates are working correctly in it (including G53 being non-model), with the caveat that this command:

                            G53 G1 Xnn Ynn …

                            will work correctly; whereas this:

                            G1 G53 Xnn Ynn

                            will not.

                            I will give it a try later today.

                            Interesting case you have with "G53 G1 coords" vs. "G1 G53 coords". I can sort of see the technical parsing assumptions behind both being valid… at the same time, I've never seen a CAM generated line, or a human generated line of the "G1 G53 ..." variety. Personally, I'd be OK with not covering that case.

                            Delta / Kossel printer fanatic

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              Danal
                              last edited by 16 Mar 2018, 20:30

                              Hmmmm…. The following would also be valid:

                              [[language]]
                              G54
                              G1
                              Xnnn Ynnn ;Moves to currently active G54 Work Coordinates
                              G53 Xnnn Ynnn ;Moves to machine coordinates
                              Xnnn Ynnn ;Moves to currently active G54 Work Coordinates.
                              G55
                              Xnnn Ynnn ;Moves to currently active G55 Work Coordinates.

                              And so forth. G1 stays active until another Group1 command is executed.

                              And, I HAVE seen CAM generated code that looks something like that. Therefore, I take back what I said… eventually, the modalities would need to be correct.

                              Delta / Kossel printer fanatic

                              1 Reply Last reply Reply Quote 0
                              • undefined
                                Danal
                                last edited by 19 Mar 2018, 21:06

                                New thread that re-summarizes a ton of things about CNC coordinates here:

                                https://www.duet3d.com/forum/thread.php?pid=42850

                                Delta / Kossel printer fanatic

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