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

    Teaser for today - can you guess the answer?

    Scheduled Pinned Locked Moved
    General Discussion
    9
    21
    844
    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.
    • deckingmanundefined
      deckingman @JoergS5
      last edited by

      @JoergS5 said in Teaser for today - can you guess the answer?:

      A command which resets homing like M584, M18, M501, tool changes?

      Nope

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

      1 Reply Last reply Reply Quote 0
      • deckingmanundefined
        deckingman
        last edited by

        OK, I'll make it easy for you. Below is the offending homeall.g file with the error present.

        I'd like to keep this "teaser" going for a little while longer so when you spot my mistake, reply with something like "found it in "n" seconds/minutes/hours".

        Herewith the file...........

        ; homeall.g
        
        T0 P0; select a tool - any one will do - don't run tool change macros
        
        ; check if tool is hot, if not start to heat it to 140 deg C
        
        if sensors.analog[1].lastReading < 140
        	M568 P0 S140
        	M291 P"Hot end set to 140 deg C" R"Homing Macro" S1 T10
        
        ; Lift Z (lower bed) relative to current position
        
        G91; relative
        G1 Z5 F600 ; move bed down 5mm
        
        ;check if X or Y endstops are already triggered
        
        if sensors.endstops[0].triggered 
        	G1 X10 F3600 ; if sensor tiggererd, move away 10mm relative then......
        	M400; wait for move to finish then.......
        	if sensors.endstops[0].triggered; .....check again  
        		abort "X endstop already triggered after moving away from end stop - aborting" ; abort if still triggered. 
        
        if sensors.endstops[1].triggered 
        	G1 Y-10 F3600 ; if sensor tiggererd, move away 10mm then......
        	M400; wait for move to finish then.......
        	if sensors.endstops[1].triggered; .....check again  
        		abort "Y endstop already triggered after moving away from end stop - aborting" ; abort if still triggered. 
        
        ; reduce motor currents to 25% for X and Y
        
        M400 ; wait for any moves to finish (shouldn't be any)
        M913 X25 Y25
        
        G1 Y420 X-420 H1 F4800 ; move until one or other end stops trigger
        
        G1 Y 420 H1 F4800; course home Y 
        
        G1 Y-10 F600; Go back a few mm
        
        G1 Y50 F360 H1 ; fine home Y 
        
        
        G1 X-420 H1 F4800; course home X (80mm/sec)
        
        G1 X10 F600 ; Go back a few mm
        
        G1 X-40 F360 H1 ; fine home X 
        
        
        ; fast move to centre
        G90; set to absolute coordinates 
        
        M400 ; wait for any moves to finish (shouldn't be any)
        M913 X0 Y0; restore motor currents for fast move  
        G1 X0 Y0 F5400; move to the centre of the bed
        
        
        ;***Now home Z****
        
        M400 ; wait for moves to finish
        G91; back to relative
        
        ; now do homing at high speed until slotted opto triggers
        M98 P"0:/macros/FastJogZ.g" ; run macro which moves 80mm at high speed and repeats until trigger
        
        ; check if end stop already triggered
        if sensors.endstops[2].triggered ; if it is triggered..... 
        	G1 Z10 F300;... then move down 10mm.......
        	M400; wait for move to finish, then ......
        	if sensors.endstops[2].triggered ; ........check again if it is triggered..... 
        		abort "Z endstop already triggered after moving away from stop - aborting"; ........and abort if it still is
        
        ; reduce motor currents to 50% for Z 
        M400 ; wait for any moves to finish (shouldn't be any)
        M913 Z50 
        
        ; check agin if tool is still at or above 140 deg C, if not heat it
        if sensors.analog[1].lastReading < 140
        	M568 P0 S140
        	M291 P"Hot end below 140, so set to 140 deg C" R"Z Homing Macro" S1 T10
        
        ; now wait for temp to get to 140 or above
        
        while sensors.analog[1].lastReading < 140
        	M291 P"Waiting for hot end to heat" R"Z Homing Macro" S1 T4
        	G4 S4
        
        ; FAST home Z 
        G1 Z-120 F300 H1 ; should be within about 80mm so 120mm more than enough
        M400 ; wait for moves to finish
        
        G1 Z5 F300 ; lower bed again
        
        ; SLOW home Z
        G1 Z-10 F60 H1
        
        ; set offset 
        G91 ; relative
        G1 Z{global.z_offset} ;slightly lower
        G4 P100; .1 sec delay
        G92 Z0 ; set new zero
        
        ; lower bed again
        G90 ;absolute
        G1 Z5 F300
        
        M400 ; wait for moves to finish then restore motor currents to 100% for Z
        M913 Z100; restore Z motor current 
        
        M568 P0 S0; set hot end temp back to zero 
        

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

        jay_s_ukundefined o_lampeundefined droftartsundefined 3 Replies Last reply Reply Quote 0
        • jay_s_ukundefined
          jay_s_uk @deckingman
          last edited by

          @deckingman found it (assuming my DM was correct) as I scrolled down the homeall

          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
          • o_lampeundefined
            o_lampe @deckingman
            last edited by

            @deckingman #MeToo
            There were some gcodes I'm not familiar with and had to read up

            1 Reply Last reply Reply Quote 0
            • droftartsundefined
              droftarts administrators @deckingman
              last edited by

              @deckingman #methree ah yes, saw it pretty quickly once you’d posted the homeall.g.

              Ian

              Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

              1 Reply Last reply Reply Quote 0
              • deckingmanundefined
                deckingman
                last edited by

                In case anyone is still scratching their head, if one restores the motor current to zero instead of 100% ( M913 X0 Y0 instead of M913 X100 Y100 ), then any following G1 move will result in no physical movement of the motors. But the firmware doesn't "know" this and so reports the motor positions as being their latest commanded position -in this case 0,0 which is the centre of the bed although the print head remained in the left rear corner.

                In my defence, the reason it took my about 10 minutes to find my error was that I changed the printer origin at the same time as I started to change my homing files from a CoreXYUV machine to a simple CoreXY. So "origin" was at the forefront of my limited mental capacity. That's my feeble excuse and I'm sticking to it.

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

                SJIundefined 1 Reply Last reply Reply Quote 2
                • SJIundefined
                  SJI @deckingman
                  last edited by

                  @deckingman would that then constitute as a bug 🤔

                  deckingmanundefined oliofundefined 2 Replies Last reply Reply Quote 0
                  • deckingmanundefined
                    deckingman @SJI
                    last edited by

                    @SJI said in Teaser for today - can you guess the answer?:

                    @deckingman would that then constitute as a bug 🤔

                    Only in the sense that the firmware isn't idiot proof - but then what is? I suppose one could make the case that the firmware shouldn't allow users to set zero motor current - maybe default to a pre-determined minimum. But who decides what that minimum should be and is there a minimum that would suit every machine? - probably not. There are other commands that would give zero motor current (e.g. M906) and yet more that would likely result in no motor movement when a G1 is sent, such as zero maximum speed (M203), zero acceleration (M201) etc. And one could also make a similar case for things like fans where setting the maximum speed to zero (M106 Pn X0) would result in the fan not turning when commanded to do so. So I'd say that once you start looking at making things idiot proof whilst allowing users to make changes to their configurations, you end up going down an infinitely deep and infinitely complex rabbit hole.

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

                    o_lampeundefined 1 Reply Last reply Reply Quote 0
                    • o_lampeundefined
                      o_lampe @deckingman
                      last edited by o_lampe

                      @deckingman IMHO M913 X0 should flag the axis as not homed, just like M84 X (disable motors) does.
                      But the examples you gave wouldn't risk loosing position. They only disable motion, like M92 X0.

                      deckingmanundefined 1 Reply Last reply Reply Quote 0
                      • deckingmanundefined
                        deckingman @o_lampe
                        last edited by

                        @o_lampe said in Teaser for today - can you guess the answer?:

                        @deckingman IMHO M913 X0 should flag the axis as not homed, just like M84 X (disable motors) does...............................

                        What about M913 X1? It's unlikely that 1% motor current would be sufficient to drive a motor (depending on a number of factors) so should that also flag any axes as not homed? If so then what about 2% current, or 3 or 4? You'd also need to apply the same criteria to M906 and probably M917. I think you can see where I'm going with this but I have more important things to think about right now.

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

                        1 Reply Last reply Reply Quote 0
                        • oliofundefined
                          oliof @SJI
                          last edited by

                          @SJI no, its open loop control after all.

                          <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                          1 Reply Last reply Reply Quote 0
                          • bidenntrumppundefined
                            bidenntrumpp
                            last edited by

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