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

    variable (height) to calculate average trigger height

    Scheduled Pinned Locked Moved
    Gcode meta commands
    2
    2
    177
    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.
    • appjawsundefined
      appjaws
      last edited by

      I would like to have a variable (height) that would be incremented by the Z probe value, move.axes[2].userPosition, 10 times and then I would need to calculate the average, (height/10) but limit this result to 3 decimal places and then update G31 in the config file.
      How is a variable defined?
      Is this possible? If so could you show an example please.

      Thanks for any help

      appjaws - Core XYUV Duet Ethernet Duex5
      firmware 3.5.0-rc.4 Web Interface 3.5.0-rc.4
      Ormerod 1-converted to laser engraver, Duet wifi
      OpenSCAD version 2024.03.18
      Simplify3D 5.1.2

      fcwiltundefined 1 Reply Last reply Reply Quote 0
      • fcwiltundefined
        fcwilt @appjaws
        last edited by

        @appjaws said in variable (height) to calculate average trigger height:

        I would like to have a variable (height) that would be incremented by the Z probe value, move.axes[2].userPosition, 10 times and then I would need to calculate the average, (height/10) but limit this result to 3 decimal places and then update G31 in the config file.
        How is a variable defined?
        Is this possible? If so could you show an example please.

        Thanks for any help

        Hi,

        Currently variables are not implemented.

        You can use existing properties of "dummy" objects that you create.

        You cannot set a property value directly, you have to use a command that will achieve the desired result.

        So if you created, as an example, a dummy axis, A you could use the following to set its userPosition property.

        • Reset to zero: G90 G1 A0

        • Increment by current Z position: G91 G1 A{ move.axes[2].userPosition}

        But I don't know how you would update the trigger height in the G31 command in the config file.

        Frederick

        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

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