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

    retrieve the Position of an axis

    Scheduled Pinned Locked Moved
    Gcode meta commands
    3
    6
    700
    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.
    • taconiteundefined
      taconite
      last edited by

      Hello guys,

      is there an option to get the position of an axis as an actual value. In the object model there is a parameter called machinePosition (in the Move part) but I cant'get it.

      What I like to do (attention pseudo code):
      G1 Z{postion[U]+30}

      Is something like this possible?

      Thank you!

      Custom ANET A8
      Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

      All I do here is under this license: CC BY-NC-SA

      arhiundefined 1 Reply Last reply Reply Quote 0
      • arhiundefined
        arhi @taconite
        last edited by

        @taconite said in retrieve the Position of an axis:

        What I like to do (attention pseudo code):
        G1 Z{postion[U]+30}

        G91               ; relative positioning
        G0Z30             ; move Z 30mm
        G90               ; absolute positioning
        
        1 Reply Last reply Reply Quote 1
        • arhiundefined
          arhi
          last edited by

          if you insist on using conditional g-code you can do

          G90
          G0 Z{move.axes[2].userPosition + 30}
          

          but I'm not sure why would you do it, that's why the relative positioning exist

          1 Reply Last reply Reply Quote 2
          • A Former User?
            A Former User
            last edited by

            I might expand on @arhi's input and use push and pop just to ensure no undesired side effects from using relative moves.

            M120              ;push 
            G91               ; relative positioning
            G0Z30             ; move Z 30mm
            M121              ;pop
            

            That said, i think it would be possible to use move.axes[.... and he beat me to it again 👍

            1 Reply Last reply Reply Quote 2
            • taconiteundefined
              taconite
              last edited by

              @arhi @bearer
              so I tried my luck with: move.axes[3].machinePosition but the addition did not work.

              The use case is that at a certain point in a tool change macro the Z axis needs to be relative to the U axis (that's why I want to set the Position of the Z axis X mm (e.g. 30mm) from the U axis (because they have and have to have different homing positions).

              So after your suggestions I tried G1 Z{move.axes[3].userPosition+30} and now it is perfectly working.

              Thank you guys - you are the best!!!

              Custom ANET A8
              Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

              All I do here is under this license: CC BY-NC-SA

              1 Reply Last reply Reply Quote 1
              • taconiteundefined
                taconite
                last edited by taconite

                and again another object model question 🐒

                I would like to get the current status of the z-probe for an if statement

                I can find it in the object model:
                M409 K"sensors.probes[0].value"
                {"key":"sensors.probes[0].value","flags":"","result":[1000]}

                but when I try to echo the signal
                echo sensors.probes[0].value
                [array]

                I don't get the information I would like to have (whether it is 0 (not triggered) or 1000 (triggered). Could you please once more help me - thank you in advance!!

                Okay never mind!
                echo sensors.probes[0].value[0] did the job!

                Custom ANET A8
                Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

                All I do here is under this license: CC BY-NC-SA

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