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

Object model help please

Scheduled Pinned Locked Moved Solved
General Discussion
6
21
924
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
    appjaws
    last edited by 23 Feb 2021, 15:33

    I want to print using the UV carriage split from XY so I can reduced the amount of movement and vibration of the UV carriage. I have a script that converts the gcode file but I still need to maintain the machine as combined for all the macros, G29, G30, G32, pause etc.
    If I have homed XUYV and then combined XU YV, the printer works( this is how I have run for years) However, if I then uncombine them, X and Y show the correct position but U and V show 0 so the machine crashes.
    A work around is to make the U position the same as the X and the V position the same as Y.
    I have tried the following but I just get an error.
    move.axes[3].machinePosition = move.axes[0].machinePosition
    Error: Bad command: move.axes[3].machinePosition = move.axes[0].machinePosition
    Error: Bad command: move.axes[3].machinePosition = move.axes[0].machinePosition
    Error: Bad command: move.axes[3].machinePosition = move.axes[0].machinePosition
    Error: Bad command: move.axes[3].machinePosition = move.axes[0].machinePosition

    move.axes[4].machinePosition = move.axes[1].machinePosition

    I obviously have something wrong, can anybody please show me what the command should be.

    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

    undefined undefined 2 Replies Last reply 23 Feb 2021, 16:24 Reply Quote 0
    • undefined
      deckingman @appjaws
      last edited by deckingman 23 Feb 2021, 16:24

      @appjaws Hi again Paul,

      I'm a bit confused - I thought we'd got this all worked out and that you were up and running. You even modified my python script to tweak the behaviour how you wanted it.

      Can you explain a bit more what the problem is? Send me an email if you like.

      Meanwhile, an alternative solution is what I do, and never combine the axes. It does mean modifying homing, pause, and other macros but it's not too much work. Happy to share mine if it helps.

      Ian
      https://somei3deas.wordpress.com/
      https://www.youtube.com/@deckingman

      undefined 1 Reply Last reply 23 Feb 2021, 16:59 Reply Quote 0
      • undefined
        appjaws @deckingman
        last edited by 23 Feb 2021, 16:59

        @deckingman Yes I tweaked the script some more and it works great, I have been operating in fully split mode for sometime now. The problem with having the machine split all the time is G29 and fault conditions do not work. So I thought if I operated the machine in XU YV combined mode but split for just the print task, everything would work.
        I soon realised that the UV positions are not updated with the XY moves when M584 X0 U3 Y1 V4 Z7:8:9 E2:5:6 P5 is actioned to split the carriages.
        So all that needs to happen is to be able to make the U position the same as X and the V position the same as Y when the drives are split.

        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

        undefined 1 Reply Last reply 23 Feb 2021, 18:33 Reply Quote 0
        • undefined
          deckingman @appjaws
          last edited by 23 Feb 2021, 18:33

          @appjaws Hmm. Not sure I fully understand the problem still - that's just me being thick.

          But a couple of suggestions...........

          If you combine the axes as soon as they have been homed, then XU and YV will be the same. So if you always home before doing mesh compensation, that should work. Or is that not practical (I don't use G29 myself).?

          Macros that might get called while the axes are split for printing, such as pause or cancel, are a bit more tricky - I chose to change the macros to incorporate UV moves where previously only XY moves were used). Can you use G92 to set position? What I mean is something along the lines of read the X position, then do G92 Unnn (where nnn is the X position)? Dunno - just throwing ideas around....

          Ian
          https://somei3deas.wordpress.com/
          https://www.youtube.com/@deckingman

          undefined 1 Reply Last reply 24 Feb 2021, 09:59 Reply Quote 0
          • undefined
            OwenD @appjaws
            last edited by 23 Feb 2021, 20:00

            @appjaws
            You can't just assign the value directly through the object model.
            You could do something like

            G92 U{move.axis[0].machinePosition}

            I know little about your setup type, but that should achieve what you're asking.

            undefined 1 Reply Last reply 24 Feb 2021, 09:48 Reply Quote 1
            • undefined
              appjaws @OwenD
              last edited by 24 Feb 2021, 09:48

              @OwenD said in Object model help please:

              G92 U{move.axis[0].machinePosition}

              Thank you for your help but that didn't work, U remained at 0

              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

              undefined 1 Reply Last reply 24 Feb 2021, 10:33 Reply Quote 0
              • undefined
                appjaws @deckingman
                last edited by 24 Feb 2021, 09:59

                @deckingman Thank you, I think I have a work around, Move to X0 Y0 then split the drives so XYUV are all at 0 then start to print.

                A command that would update U and V with X and Y position would be more elegant as indicated by @OwenD, but that didn't work.

                I suppose that the firmware could be modified so that the firmware knew that if multiple carriages are used then the position of all drives should be updated for G29 and fault conditions.

                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

                undefined 1 Reply Last reply 24 Feb 2021, 10:15 Reply Quote 0
                • undefined
                  deckingman @appjaws
                  last edited by 24 Feb 2021, 10:15

                  @appjaws What do you have in pause.g and cancel.g and stop.? I got caught out because I have my machine set up to move the carriage to the back of the machine if I cancel a print. I forgot that cancel.g only had XY moves so the first time I cancelled a print, it moved the XY gantry but not the UV gantry (and then I swore - loudly and prolifically 🙂 ).

                  I added UV moves to cancel.g - you might want to do the same (and any other such files - I can't think of any other way around that).

                  I can't help with the G29 thing (other than to say use a bed that's flat and level, then you don't need to run it) 🙂

                  Ian
                  https://somei3deas.wordpress.com/
                  https://www.youtube.com/@deckingman

                  undefined 1 Reply Last reply 24 Feb 2021, 10:21 Reply Quote 0
                  • undefined
                    appjaws @deckingman
                    last edited by 24 Feb 2021, 10:21

                    @deckingman Ha Ha. I don't have a stop.g or cancel.g so I assume the machine just uses whatever is the default.
                    What have you in your stop and cancel and where are they located?
                    Thanks for the 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

                    undefined 1 Reply Last reply 24 Feb 2021, 13:41 Reply Quote 0
                    • undefined
                      OwenD @appjaws
                      last edited by 24 Feb 2021, 10:33

                      @appjaws said in Object model help please:

                      @OwenD said in Object model help please:

                      G92 U{move.axis[0].machinePosition}

                      Thank you for your help but that didn't work, U remained at 0

                      What were you expecting it to be?
                      If you move X to the position and type move.axes[0].machinePosition into the console what do you get?
                      Are you sure all moves are finished before that command? M400 may be required prior.

                      undefined 1 Reply Last reply 24 Feb 2021, 10:39 Reply Quote 0
                      • undefined
                        appjaws @OwenD
                        last edited by 24 Feb 2021, 10:39

                        @OwenD said in Object model help please:

                        move.axes[0].machinePosition

                        I would have expected the U move position to be updated with the X position but your suggestion of G92 U{move.axis[0].machinePosition} didn't update U which remained ar 0.

                        This is what I get from the console
                        move.axes[0].machinePosition
                        Error: Bad command: move.axes[0].machinePosition
                        Error: Bad command: move.axes[0].machinePosition

                        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

                        undefined 1 Reply Last reply 24 Feb 2021, 10:42 Reply Quote 0
                        • undefined
                          OwenD @appjaws
                          last edited by 24 Feb 2021, 10:42

                          @appjaws
                          Apologies
                          Should be
                          echo move.axes[0].machinePositiion
                          It should return where X is at the time. If that's 0 then I'd expect G92 U... to set it thus

                          undefined 1 Reply Last reply 24 Feb 2021, 10:53 Reply Quote 0
                          • undefined
                            appjaws @OwenD
                            last edited by 24 Feb 2021, 10:53

                            @OwenD said in Object model help please:

                            echo move.axes[0].machinePositiion

                            echo move.axes[0].machinePositiion
                            Error: meta command: unknown value 'machinePositiion'

                            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

                            undefined jay_s_ukundefined 2 Replies Last reply 24 Feb 2021, 10:55 Reply Quote 0
                            • undefined
                              OwenD @appjaws
                              last edited by 24 Feb 2021, 10:55

                              @appjaws
                              😂 can't win. Try without the extra "i" in position
                              One finger typing on a phone here.. gimme a break

                              undefined 1 Reply Last reply 24 Feb 2021, 11:22 Reply Quote 0
                              • jay_s_ukundefined
                                jay_s_uk @appjaws
                                last edited by 24 Feb 2021, 10:55

                                @appjaws theres too many i's in Position

                                Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                                1 Reply Last reply Reply Quote 0
                                • undefined
                                  appjaws @OwenD
                                  last edited by 24 Feb 2021, 11:22

                                  @OwenD Thanks again.
                                  Yes that worked but then why isn't G92 U{move.axis[0].machinePosition} working?

                                  just realised that axes is spelt axes not with an i

                                  So G92 U{move.axes[0].machinePosition} works.
                                  Will do some testing, thanks

                                  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 undefined 2 Replies Last reply 24 Feb 2021, 13:17 Reply Quote 1
                                  • T3P3Tonyundefined
                                    T3P3Tony administrators
                                    last edited by 24 Feb 2021, 12:52

                                    @appjaws if you are running at least DWC 3.2 then navigate to

                                    Settings->general->plugins and turn on "Object Model Browser"

                                    then you can explore the object model as it is on your board. (use refresh to update to see things change). use echo <object model key, value> as you have done with the move.axes[0].machinePosition to check you have a specific path correct. then you can use that in commands of meta commands as you need.

                                    www.duet3d.com

                                    1 Reply Last reply Reply Quote 0
                                    • fcwiltundefined
                                      fcwilt @appjaws
                                      last edited by 24 Feb 2021, 13:17

                                      @appjaws said in Object model help please:

                                      just realised that axes is spelt axes not with an i

                                      You likely know this but I will mention it just to be sure. Axis is singular, Axes is plural.

                                      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 0
                                      • undefined
                                        deckingman @appjaws
                                        last edited by 24 Feb 2021, 13:41

                                        @appjaws said in Object model help please:

                                        @deckingman Ha Ha. I don't have a stop.g or cancel.g so I assume the machine just uses whatever is the default.
                                        What have you in your stop and cancel and where are they located?
                                        Thanks for the help

                                        Hi Paul,

                                        Looks like your getting the help you need with object model commands.

                                        Ref pause.g, cancel.g etc. These macros all go in the sys folder (along with the homing macros, tool change macros etc). They might or might not be "auto generated" so they might or might not exist. They might also exist but be empty of any commands.

                                        "pause.g" runs if you hit the pause button during a print in DWC (or otherwise send pause command). What you do inside that macro is entirely up to you. Similarly, cancel.g runs if you hit cancel (after already having paused the print).

                                        Here is an example of my cancel.g

                                        G10 ; retract
                                        M98 P"0:/macros/ToolTemps/ToolTemps0.g" ; set the tool temperatures to zero
                                        G91 ; set relative
                                        G1 Z5 F240 ; move bed down 5mm
                                        G90 ; back to absolute
                                        G1 X165 U165 A165 Y300 V300 B300 F9000 ; move to rear
                                        M140 S0 ; turn off bed
                                        M106 S0 ; turn off part fan

                                        Note the additional UV commands that I had to add (and also AB commands in my case).

                                        So check those files, and if they contain any XY moves, then make sure to add UV moves to those lines. It's not much work and will save you having nasty experiences like I had when I stupidly forgot about them.

                                        Ian
                                        https://somei3deas.wordpress.com/
                                        https://www.youtube.com/@deckingman

                                        1 Reply Last reply Reply Quote 1
                                        • undefined
                                          OwenD @appjaws
                                          last edited by 24 Feb 2021, 19:52

                                          @appjaws
                                          Apologies again.
                                          Yes, should be axes, not axis.
                                          Not sure if that was me or autocorrect
                                          As stated above, always check the exact syntax using the object model browser.
                                          e.g. "machinePosition" would work, but "machineposition" would not.

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