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

G-code magic for advanced homing?

Scheduled Pinned Locked Moved
Gcode meta commands
5
24
1.2k
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
    littlehobbyshop @monster
    last edited by 11 Apr 2020, 23:43

    @monster What version of DWC are you running?

    It may be you have an older version of DWC. Initially when pressing tab it was putting in the wrong indentation. In that case you either need to update DWC and redo those indented lines with the tab key or replace those tabbed indents with 4x spaces.

    BLV MGN Cube w/Hemera, K8200, Sunlu S8

    1 Reply Last reply Reply Quote 0
    • undefined
      monster
      last edited by 12 Apr 2020, 00:06

      @littlehobbyshop
      Version:
      Board: Duet 3 MB6HC (MB6HC)
      DSF Version: 1.2.4.0
      Firmware: RepRapFirmware for Duet 3 MB6HC v0.6 or 1.0 3.0 (2020-01-03b3)

      @bot
      That axis gets unhomed I did figure out. That is sad.
      But hey, how come both parts of IF are executed - that is quite a feature 😂
      I tested it now with messages (which aren't working correctly them-self) and with sounds. Seems like IF is out of scope 😞
      I guess what is left is what you said "tell the toolhead to go to the X10 Y10 position at the beginning of the homing script."
      But then again once home requested it might be invalidated by unhoming all. I need to test it...

      undefined undefined 2 Replies Last reply 12 Apr 2020, 00:07 Reply Quote 1
      • undefined
        bot @monster
        last edited by 12 Apr 2020, 00:07

        @monster Ha! You're right, it might not be able to make any move whatsoever because of the unhomed flag.

        *not actually a robot

        1 Reply Last reply Reply Quote 0
        • undefined
          littlehobbyshop
          last edited by 12 Apr 2020, 00:10

          @monster did you try replacing those indents with 4 spaces?

          BLV MGN Cube w/Hemera, K8200, Sunlu S8

          undefined 1 Reply Last reply 12 Apr 2020, 00:15 Reply Quote 0
          • undefined
            monster
            last edited by 12 Apr 2020, 00:10

            @bot hold on a sec! This part I already know! Basically if it homed before that my command in homing subroutine go to X10 Y10 works! So perhaps it is unhomed but still knows where is 10,10....
            Bit weird though.

            undefined 1 Reply Last reply 12 Apr 2020, 00:13 Reply Quote 0
            • undefined
              bot @monster
              last edited by bot 4 Dec 2020, 00:13 12 Apr 2020, 00:13

              @monster That is very interesting. So it moves to X10 Y10 if homed, and then continues with the script? But it omits the X10 Y10 movement if not homed?

              Perhaps, as you say, it's not getting flagged as unhomed right away, and you need to indent the script as @littlehobbyshop says.

              *not actually a robot

              undefined 1 Reply Last reply 12 Apr 2020, 00:18 Reply Quote 0
              • undefined
                monster @littlehobbyshop
                last edited by 12 Apr 2020, 00:15

                @littlehobbyshop said in G-code magic for advanced homing?:

                @monster did you try replacing those indents with 4 spaces?

                Nope:

                if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
                M300 S300 P200
                else
                M300 S100 P200

                This plays (via webui) S100 sound

                if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
                M300 S300 P200
                ;else
                ; M300 S100 P200

                and this plays S300 sound

                1 Reply Last reply Reply Quote 0
                • undefined
                  monster @bot
                  last edited by 12 Apr 2020, 00:18

                  @bot said in G-code magic for advanced homing?:

                  @monster That is very interesting. So it moves to X10 Y10 if homed, and then continues with the script? But it omits the X10 Y10 movement if not homed?

                  Perhaps, as you say, it's not getting flagged as unhomed right away, and you need to indent the script as @littlehobbyshop says.

                  Not exactly.
                  If homed before then it goes to 10,10 and then by relative moving goes to 0,0
                  if not homed then (i believe) it takes that X10 Y10 to move 10mm in opposite direction (away from end swithces) and then by relative moving still gets parked on 0,0

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    monster
                    last edited by monster 4 Dec 2020, 01:44 12 Apr 2020, 00:25

                    @littlehobbyshop is there way to see a value of variable?
                    display it in message?
                    or much better would be to display it in log?
                    something like
                    "log move.axes[0].homed"
                    by anychance?


                    edited
                    found this https://duet3d.dozuki.com/Wiki/Gcode#Section_M409_Query_object_model
                    but
                    Capture.PNG

                    undefined 1 Reply Last reply 12 Apr 2020, 06:39 Reply Quote 0
                    • undefined
                      deckingman @monster
                      last edited by 12 Apr 2020, 06:39

                      @monster This does beg the question, if an axis is homed, why do you want to home it again? Or am I missing something?

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

                      undefined 1 Reply Last reply 12 Apr 2020, 13:04 Reply Quote 0
                      • undefined
                        dc42 administrators @monster
                        last edited by dc42 4 Dec 2020, 10:41 12 Apr 2020, 10:39

                        @monster said in G-code magic for advanced homing?:

                        Version:
                        Board: Duet 3 MB6HC (MB6HC)
                        DSF Version: 1.2.4.0
                        Firmware: RepRapFirmware for Duet 3 MB6HC v0.6 or 1.0 3.0 (2020-01-03b3)

                        GCode meta commands are not yet supported by DSF, so for now on Duet 3 they only work in standalone mode. You need one of the RRF 3.01 release candidates to use them, but you are running 3.0. That's also why your m409 command doesn't work.

                        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

                        undefined 1 Reply Last reply 12 Apr 2020, 13:07 Reply Quote 0
                        • undefined
                          monster @deckingman
                          last edited by 12 Apr 2020, 13:04

                          @deckingman said in G-code magic for advanced homing?:

                          @monster This does beg the question, if an axis is homed, why do you want to home it again? Or am I missing something?

                          Well, this is good question ofc 😄
                          Answers rather "creative" 🙂

                          • Let's say I powered printer up, pushed home button.
                            After that a print would like to re-home it before starting - that is reasonable.
                          • Or I simply ordered heads to move and now want to re-park them

                          There might be few more ideas why but of course you may say that they are not very needed and can be worked around, that is true.
                          So I guess best answer I could give is - why not? :)))) Just for sake of exercise on printer control 😛

                          1 Reply Last reply Reply Quote 0
                          • undefined
                            monster @dc42
                            last edited by 12 Apr 2020, 13:07

                            @dc42 said in G-code magic for advanced homing?:

                            GCode meta commands are not yet supported by DSF, so for now on Duet 3 they only work in standalone mode. You need one of the RRF 3.01 release candidates to use them, but you are running 3.0. That's also why your m409 command doesn't work.

                            Is there a good way not to miss actual release?

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              dc42 administrators
                              last edited by 12 Apr 2020, 13:22

                              Yes, go to https://github.com/dc42/RepRapFirmware and click on Watch.

                              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
                              20 out of 24
                              • First post
                                20/24
                                Last post
                              Unless otherwise noted, all forum content is licensed under CC-BY-SA