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

    Accelerometer on toolboard 1.1

    Scheduled Pinned Locked Moved Solved
    Duet Hardware and wiring
    2
    7
    203
    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.
    • ketirangeundefined
      ketirange
      last edited by

      Hi, i have a custom made toolboard based on toolboard v1.1, where INT1 from accelerometer is connected to PA19. When trying to run input shaping plugin i got a "Failed to start accelerometer data collection : INT1 error". I have noticed that this pin changed from PA19 to PA00 in the newest toolboard, and so changed the Duet3Expansion firmware. Adding a diode as suggested in other topics is not that easy because it is a custom board, so i wanted to change this pin in firmware.

      I have changed "Lis3dhInt1Pin" Pin to PortAPin(19) in config/TOOL1Lc.h, and the error went away, but a data acquisition is still not working. Im sending a M956 P20.0 S1000 A1 X and the code executes with no errors. Then i move X axis and check for results. The data file looks like this:

      Screenshot from 2024-10-25 09-29-28.png

      Now if i want to send same code again i get an error saying: M956: Accelerometer is already collecting data.

      My guess is that a interrupt is not properly set up, and toolboard cant detect it resulting in never ending measurement. I will be very thankful if someone could help with this problem.

      Same thing happens when i use input shaping plugin.

      Hardware: Duet6XD and custom Toolboard based on v1.1
      Software: RRF 3.4.6 and DSF 3.4.6

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @ketirange
        last edited by

        @ketirange have you enabled the pullup resistor on PA19?

        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

        ketirangeundefined 1 Reply Last reply Reply Quote 0
        • ketirangeundefined
          ketirange @dc42
          last edited by

          @dc42 Yes, i have following line in StartCollecting method:
          ceef864d-e5b2-4e3a-890f-068f9f93f8b1-image.png

          dc42undefined 1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @ketirange
            last edited by

            @ketirange does your pin table allocate the
            correct EXINT number uniquely to the pin used for the accelerometer interrupt?

            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

            ketirangeundefined 1 Reply Last reply Reply Quote 0
            • ketirangeundefined
              ketirange @dc42
              last edited by ketirange

              @dc42 I have made following changes (also, im using TOOL1LC build configuration. if this is relevant):
              4655974a-9846-48de-af51-30a0f000f9ae-image.png

              line 139 - Changed pin to PA19
              line 166 - Change pin tab

              dc42undefined 1 Reply Last reply Reply Quote 0
              • dc42undefined
                dc42 administrators @ketirange
                last edited by dc42

                @ketirange on line 166, Exint 14 is not valid for PA19. That pin can only use Exint 3, see section 6.1 of the SAMC21 datasheet. However, on the TOOL1LC Exint 3 is already allocated to PB3.

                Currently the TOOL1LC expansion firmware does not use the interrupt on PB3, so you would get away with changing the value for PB3 to be Nx, then you could use Exint3 for PA19. However, future firmware versions might use the PB3 interrupt. PB3 is the DIAG output from the TMC2209, used to indicate stalls.

                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

                ketirangeundefined 1 Reply Last reply Reply Quote 0
                • ketirangeundefined
                  ketirange @dc42
                  last edited by

                  @dc42 Thank you for your help, changing to Exint 3 did the trick, and now accelerometer is working fine. I wil keep in mind the PB3 conflict.

                  1 Reply Last reply Reply Quote 0
                  • dc42undefined dc42 marked this topic as a question
                  • dc42undefined dc42 has marked this topic as solved
                  • First post
                    Last post
                  Unless otherwise noted, all forum content is licensed under CC-BY-SA