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

Triggers within homing files

Scheduled Pinned Locked Moved
General Discussion
2
12
606
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
    Ntrack
    last edited by Ntrack 22 Jan 2020, 15:51

    I am trying to write a homing file which will home the axis if an endstop is not triggered. It homes the axis but it also gives an error in the console : G28 U Error: Homing failed . The relevant files are:
    HomeU.g

    M574 V2 S1 p"zstop" ; configure mmu2 filament feeder endstops at max end active-high
    M574 A2 S1 P"!e0stop" ; configure false extruder axis endstop at max end active-low
    M581 P"!zstop" T8 C0
    M582 T8
    M581 P"nil" T8 C0
    M581 P"zstop" T11 C0 ; activate trigger 11 on rising edge
    M582 T11 ; check filament sensor to confirm selector is unloaded
    M581 P"nil" T11 C0 ; deactivate trigger 11
    ;M581 P"!e0stop" T12 C0 ; activate trigger 6 on rising edge
    ;M582 T12 ; check filament sensor to confirm extruder is unloaded
    ;M581 P"nil" T12 C0 ; deactivate trigger 6

    Trigger8.g

    M913 U50 ; reduce motor current to 50% to prevent bad noises
    M915 U S5 F0 ; set stall parameters
    G91 ; use relative positioning
    G1 H1 U5 F2000 ; move out 5mm
    G1 H1 U-100 F1000 ; move carriage to home
    G90 ; back to absolute positioning
    M400 ; make sure everything has stopped before we reset the motor currents
    M913 U100 ; motor currents back to normal

    Trigger11.g

    M584 P3
    M291 P"Stuff happens. homing axis not allowed" S2

    I am running RepRapFirmware for Duet 2 WiFi/Ethernet 3.01-beta1+1 (2020-01-15b2) so it may be a bug but also it might be something wrong in these files.

    1 Reply Last reply Reply Quote 0
    • undefined
      Danal
      last edited by 22 Jan 2020, 18:29

      What are the mechanics, and what is the Goal?

      Delta / Kossel printer fanatic

      1 Reply Last reply Reply Quote 0
      • undefined
        Ntrack
        last edited by Ntrack 22 Jan 2020, 18:36

        I'm running prusa's mmu2 on a cartesian printer with the duet. The goal is to disallow the homing of the selector axis if filament is fed through the selector.

        First M581 command will home the axis if the filament is not detected, the second M581 will hide the mmu axes and send the message.

        1 Reply Last reply Reply Quote 0
        • undefined
          Danal
          last edited by 22 Jan 2020, 18:46

          Got it. Thank you.

          Have you seen the new RRF3 conditional gcode? I believe it would be perfect for this.

          https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands

          Delta / Kossel printer fanatic

          1 Reply Last reply Reply Quote 0
          • undefined
            Ntrack
            last edited by 22 Jan 2020, 18:55

            Yes, that's the ultimate goal but it will be a steep learning curve for me. Last time I checked I couldn't find anything related to endstops states.

            1 Reply Last reply Reply Quote 0
            • undefined
              Danal
              last edited by 22 Jan 2020, 19:21

              Fair point, it is very early in the release of conditionals.

              The endstops will (should?) be in the object model. I don't have a machine accessible right now, but I believe they are down the "machine" > "sensors" part of the tree.

              Delta / Kossel printer fanatic

              1 Reply Last reply Reply Quote 0
              • undefined
                Ntrack
                last edited by 22 Jan 2020, 19:30

                I can't see any machine part of the tree. I might be doing it wrong, I'm just running M409 in DWC and paste the return here .

                1 Reply Last reply Reply Quote 0
                • undefined
                  Danal
                  last edited by 22 Jan 2020, 21:03

                  M409 F"V" will get a much larger result.

                  Delta / Kossel printer fanatic

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    Ntrack
                    last edited by 22 Jan 2020, 21:36

                    No luck either, M409 F"v" returns:

                    {"key":"","flags":"V","result":{"boards":[{"firmwareFileName":"Duet2CombinedFirmware.bin","firmwareVersion":"3.01-beta1+1","iapFileNameSD":"Duet2CombinedIAP.bin","mcuTemp":{"current":43.0,"max":43.4,"min":42.2},"name":"Duet 2 WiFi","shortName":"2WiFi","vIn":{"current":24.2,"max":24.3,"min":24.1}}],"heat":{"coldExtrudeTemperature":160.0,"coldRetractTemperature":90.0,"heaters":[{"current":25.0,"sensor":0,"state":"Off"},{"current":25.0,"sensor":1,"state":"Off"}],"sensors":[{"lastReading":25.0,"name":"","type":"Thermistor"},{"lastReading":25.0,"name":"","type":"Thermistor"}]},"job":{"file":{"filament":[],"firstLayerHeight":0.0,"generatedBy":"","height":0.0,"lastModified":"28115-10-29T03:41:51","layerHeight":0.0,"numLayers":0,"printTime":0,"simulatedTime":0,"size":0},"lastFileName":"","layer":0,"timesLeft":{"filament":0.0,"file":0.0,"layer":0.0}},"move":{"axes":[{"homed":false,"letter":"X","max":247.0,"min":0.0,"userPosition":0.000,"visible":true},{"homed":false,"letter":"Y","max":210.0,"min":0.0,"userPosition":0.000,"visible":true},{"homed":false,"letter":"Z","max":200.9,"min":0.0,"userPosition":0.002,"visible":true},{"homed":false,"letter":"U","max":75.0,"min":0.0,"userPosition":0.000,"visible":true},{"homed":false,"letter":"V","max":1000.0,"min":-1000.0,"userPosition":0.000,"visible":true},{"homed":false,"letter":"W","max":78.0,"min":0.0,"userPosition":0.000,"visible":true},{"homed":false,"letter":"A","max":1000.0,"min":-1000.0,"userPosition":0.000,"visible":true}],"calibrationDeviation":{"deviation":0.000,"mean":0.000},"currentMove":{"requestedSpeed":0.0,"topSpeed":0.0},"daa":{"enabled":false,"minimumAcceleration":10.0,"period":0.0},"idle":{"factor":0.3,"timeout":50000},"initialDeviation":{"deviation":0.000,"mean":0.000},"meshDeviation":{"deviation":0.000,"mean":0.000},"printingAcceleration":600.0,"speedFactor":100.0,"travelAcceleration":3000.0},"network":{"interfaces":[{"actualIP":"192.168.0.12","firmwareVersion":null,"gateway":"0.0.0.0","subnet":"0.255.255.255","type":"wifi"}]},"state":{"currentTool":-1,"machineMode":"FFF","status":"Idle","upTime":42}}}
                    
                    1 Reply Last reply Reply Quote 0
                    • undefined
                      Danal
                      last edited by 23 Jan 2020, 02:55

                      Hmmm.... I'm near a machine now, and I don't see any signs of endstops in the object module either.

                      Let me keep looking.

                      Delta / Kossel printer fanatic

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        Ntrack
                        last edited by 23 Jan 2020, 15:52

                        I found them running the latest beta.

                        1 Reply Last reply Reply Quote 1
                        • undefined
                          Ntrack
                          last edited by Ntrack 23 Jan 2020, 17:42

                          I am almost there with the homing file using conditional code.

                          if sensors.endstops[4].triggered && state.status.idle
                          M291 P"MMU loaded. Selector homing not allowed.Please unload MMU manually." S2
                          if sensors.endstops[4].triggered && state.status.printing
                          M25
                          M291 P"MMU loaded. Selector homing not allowed.Please unload MMU manually." S2
                          else
                          M913 U50 ; reduce motor current to 50% to prevent bad noises
                          M915 U S5 F0 ; set stall parameters
                          G91 ; use relative positioning
                          G1 H1 U5 F2000 ; move out 5mm
                          G1 H1 U-100 F1000 ; move carriage to home
                          G90 ; back to absolute positioning
                          M400 ; make sure everything has stopped before we reset the motor currents
                          M913 U100 ; motor currents back to normal

                          But , obviously is not working because state.status.idle is not the correct way of expressing the value of state.status.

                          Here is the state tree. Surely this is trivial for anyone who is used to any type of coding, not for me unfortunately.

                          Edit: state.status == "Idle" .

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