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

    M915: Configure motor stall detection

    Scheduled Pinned Locked Moved
    Using Duet Controllers
    4
    5
    59
    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.
    • R006undefined
      R006
      last edited by R006

      I am using a Duet 3 board with three Z-axis stepper motors connected. If any motor connector becomes disconnected, a warning message appears:
      "Driver 0.4 Phase A or B may be disconnected."
      **I would like to implement code that automatically performs the following actions when this warning is triggered:

      1. Immediately disable all motors.
      2. Display the message: "Please check Z motor connection."**

      I have tried using stall detection and created a driver-warning.g file with the following command:
      M915 Z0.2:0.4:0.5 S2 R3
      However, this approach did not work as expected. I am testing this on a table-top setup.

      @dc42 @Phaedrux

      dc42undefined droftartsundefined 2 Replies Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @R006
        last edited by

        @R006 stall detection is not relevant to detecting open-load conditions, however the driver-warning.g file should catch it if you are running a sufficiently recent version of RRF.

        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

        R006undefined 1 Reply Last reply Reply Quote 0
        • R006undefined
          R006 @dc42
          last edited by R006

          @dc42
          I am currently using RepRapFirmware version 3.6.0rc1 and testing it on a table-top setup.
          Could you please provide an example of a driver-warning file for reference?

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

            @R006 said in M915: Configure motor stall detection:

            M915 Z0.2:0.4:0.5 S2 R3

            I think this should be either M915 Z S2 R3 or M915 P0.2:0.4:0.5 S2 R3 to enable stall detection. Check it is configured correctly by sending M915 on it's own.

            EDIT2: Sorry, I overlooked that phase disconnection IS mentioned as a driver warning, not a driver error.

            According to https://docs.duet3d.com/User_manual/RepRapFirmware/Events#events it is 'driver error' that is triggered for phase disconnection, not driver warning:
            (EDIT: sorry, phase disconnection is not mentioned in the driver error section, but I would think it does count as a 'driver error' rather than 'driver warning'.)

            Driver error (e.g. over temperature shutdown, short-to-ground, or closed loop driver position difference error limit exceeded)

            The default behaviour is to "Pause print without running pause.g and inform user via message box" according to the table here https://docs.duet3d.com/User_manual/RepRapFirmware/Events#processing-events

            Create a file called 'driver-error.g' in /sys on the SD card. It could contain something like:

            Create a file called 'driver-warning.g' in /sys on the SD card. It could contain something like:

            M25 ; pause print
            M0 ; cancel job (note cancel.g will be run)
            M18 ; turn off motors
            echo "Please check motor connection on driver "^{param.B}^"."^{param.D}
            

            M0 may not be the behaviour you want, M1 or M112 might be more appropriate, or just pause. M18 will cause the motors to lose position, so will need rehoming if you want to continue with the job.

            You can use M957 to simulate an event to check it works, see https://docs.duet3d.com/User_manual/RepRapFirmware/Events#simulating-events

            To decrease the time it takes to pause a print, make sure that segmentation is enabled with M669.

            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
            • gloomyandyundefined
              gloomyandy
              last edited by

              @droftarts phase disconnection is mentioned here:

              Driver warning (e.g. over temperature warning, or phase disconnected, or closed loop driver position difference warning limit exceeded)

              on this page: https://docs.duet3d.com/User_manual/RepRapFirmware/Events#events

              So it would seem it is indeed a warning that will trigger driver-warning.g

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