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

Is there a way to debug accelerometer connection issues?

Scheduled Pinned Locked Moved Solved
Beta Firmware
7
27
2.1k
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
    OwenD @dc42
    last edited by 30 Apr 2021, 09:26

    @dc42 said in Is there a way to debug accelerometer connection issues?:

    If the INT pin is not connected then the accelerometer will still be detected, but collecting data won't work.

    What SPI clock rate did you use when testing it with the Arduino? Duet uses 4MHz.

    I don't rightly know.
    I just followed this tutorial and set it for software SPI.
    https://learn.adafruit.com/adafruit-lis3dh-triple-axis-accelerometer-breakout/arduino
    I was able to get data from both the acceldemo and tap demo.

    In your photos, the VIN pin of the sensor breakout board does not appear to be connected, so the board will not receive power in the correct manner (unless there is another VIN pin on the other side).

    VIN is connected (red wire) , it's just that I only had 4pin housings so it's just a single wire straight onto the header pin.
    It's a bit hard to see in the photo.
    The LED on the breakout board lights up indicating it's powered up.

    undefined 1 Reply Last reply 30 Apr 2021, 10:07 Reply Quote 0
    • undefined
      dc42 administrators @OwenD
      last edited by 30 Apr 2021, 10:07

      OK, I see the pin connection now. Is that the newer version of the Adafruit board? What is the pin between GND and SDA (white wire)?

      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 undefined 2 Replies Last reply 30 Apr 2021, 10:15 Reply Quote 0
      • undefined
        dc42 administrators @dc42
        last edited by dc42 30 Apr 2021, 10:15

        PS - you initially had this according to the error message:

        M955 P0 C"spi.cs4+spi.cs3" ; configure accelerometer

        but your config.g has this:

        M955 P0 C"spi.cs3+spi.cs4" ; configure accelerometer

        Which are you using? I think spi.cs3+spi.cs4 is correct for your wiring scheme.

        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 30 Apr 2021, 21:12 Reply Quote 0
        • undefined
          SIam @dc42
          last edited by 30 Apr 2021, 10:22

          @dc42 the white wire is the SCL pin

          Hypercube-Evolution-Hybrid, Piezo Orion, Orbiter
          Duet WiFi 1.02 or later + DueX5
          RepRapFirmware for Duet 2 WiFi/Ethernet 3.4.0beta4 (2021-09-27 11:30:36)
          Duet WiFi Server: 1.26
          Duet Web Control 3.4.0beta4 (2021-09-27)

          1 Reply Last reply Reply Quote 0
          • undefined
            OwenD @dc42
            last edited by 30 Apr 2021, 21:12

            @dc42 said in Is there a way to debug accelerometer connection issues?:

            PS - you initially had this according to the error message:

            M955 P0 C"spi.cs4+spi.cs3" ; configure accelerometer

            but your config.g has this:

            M955 P0 C"spi.cs3+spi.cs4" ; configure accelerometer

            Which are you using? I think spi.cs3+spi.cs4 is correct for your wiring scheme.

            I had originally tried M955 P0 C"spi.cs3+spi.cs4" per my config.
            When I was running out of ideas, I tried reversing it. I must have picked up the error message from the latter.

            This breakout board has QT connections available. Otherwise it's identical.

            OK, I see the pin connection now. Is that the newer version of the Adafruit board? What >is the pin between GND and SDA (white wire)?

            The pin between VIN and GND says 3V. I had been using VIN, but as that would be 5V on the arduino and 3V on the duet, I just tried again using the 3V pin.
            Same result. Unit powers up, but is not found.
            LIS3DH.jpg

            Data sheet
            https://cdn-learn.adafruit.com/assets/assets/000/085/846/original/lis3dh.pdf?1576396666

            Schematic
            https://learn.adafruit.com/assets/94435

            The data sheet says that the CS pin must be brought low to enable SPI and it defaults to I2C
            Could this be the issue?

            undefined 1 Reply Last reply 30 Apr 2021, 21:25 Reply Quote 0
            • undefined
              dc42 administrators @OwenD
              last edited by 30 Apr 2021, 21:25

              Have you tried using a different Duet pin to connect CS to? E.g. spi.cs1

              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 30 Apr 2021, 21:55 Reply Quote 0
              • undefined
                OwenD @dc42
                last edited by OwenD 30 Apr 2021, 21:55

                @dc42 said in Is there a way to debug accelerometer connection issues?:

                Have you tried using a different Duet pin to connect CS to? E.g. spi.cs1

                Just tried it.
                Moved green wire (CS) to spi.cs1
                IMG-1860.jpg

                Same result.
                Screenshot_2021-05-01 3Dprinter.png

                On a side note, there seem to be two wiring diagrams floating around.
                One says it's CS1 and the other CS0

                https://d17kynu4zpq5hy.cloudfront.net/igi/duet3d/JPWtqVWwLBxCAKyP.huge

                https://d17kynu4zpq5hy.cloudfront.net/igi/duet3d/vqBUAZPsxMC5tRgt.huge

                The one that says CS0 can be found here
                https://duet3d.dozuki.com/Guide/2.)+Wiring+your+Duet+2+WiFi-Ethernet/9

                1 Reply Last reply Reply Quote 0
                • undefined
                  OwenD
                  last edited by 30 Apr 2021, 22:17

                  OK.
                  I just tried wiring directly to the LIS3DH using 150mm jumpers and it works!
                  Screenshot_2021-05-01 3Dprinter(1).png

                  Strange that the other cable works on an arduino.

                  Would it be better to use cable that has twisted pairs?
                  I thought the shielded cable would be a good option.

                  undefined 1 Reply Last reply 30 Apr 2021, 22:58 Reply Quote 0
                  • undefined
                    Diamondback @OwenD
                    last edited by 30 Apr 2021, 22:58

                    @owend What kind of cable are you using? Another user and I had good success with USB 3 cables (mine is 3m long).

                    undefined undefined 2 Replies Last reply 30 Apr 2021, 23:06 Reply Quote 0
                    • undefined
                      OwenD @Diamondback
                      last edited by 30 Apr 2021, 23:06

                      @diamondback
                      I was using 9 core shielded
                      https://www.altronics.com.au/p/w2712-9-core-shielded-data-cable/

                      I'm about to try some CAT5 data cable (4 x twisted pairs)
                      I'll report back.

                      undefined 1 Reply Last reply 30 Apr 2021, 23:09 Reply Quote 0
                      • undefined
                        Diamondback @OwenD
                        last edited by Diamondback 30 Apr 2021, 23:09

                        @owend Ok, I tried single twisted pairs first, ie basically the inner part of CAT 5 cable without any shielding, and that didn't work for me. The USB cable is both twisted and shielded multiple times, I connected all the shielding to GND as well.

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          OwenD
                          last edited by OwenD 30 Apr 2021, 23:43

                          Success!
                          For me a piece pf CAT5E cable worked.
                          I'm reasonable confident the connections on the first cable are sound.
                          Perhaps a better choice would be the USB cables suggested or maybe CAT6 shielded cables?

                          Now I have some data...
                          Just have to work out what to do with it 🙄

                          undefined undefined 2 Replies Last reply 30 Apr 2021, 23:54 Reply Quote 0
                          • undefined
                            Diamondback @OwenD
                            last edited by 30 Apr 2021, 23:54

                            @owend said in Is there a way to debug accelerometer connection issues?:

                            Success!
                            For me a piece pf CAT5E cable worked.
                            I'm reasonable confident the connections on the first cable are sound.
                            Perhaps a better choice would be the USB cables suggested or maybe CAT6 shielded cables?

                            Now I have some data...
                            Just have to work out what to do with it 🙄

                            Awesome! 👏

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              zapta @OwenD
                              last edited by 1 May 2021, 01:27

                              @owend said in Is there a way to debug accelerometer connection issues?:

                              Perhaps a better choice would be the USB cables suggested or maybe CAT6 shielded cables?

                              An oscilloscope would allow you to look at the signals and see if they are missing or distorted.

                              undefined 1 Reply Last reply 1 May 2021, 01:31 Reply Quote 0
                              • undefined
                                OwenD @zapta
                                last edited by 1 May 2021, 01:31

                                @zapta said in Is there a way to debug accelerometer connection issues?:

                                An oscilloscope would allow you to look at the signals and see if they are missing or distorted.

                                True. But out of the reach of many of us.
                                In my original post topic I was hoping that RRF could somehow self diagnose communication on each pin.
                                It seems like it's going to be pretty critical to get cables just right for this to work.

                                undefined 1 Reply Last reply 1 May 2021, 04:15 Reply Quote 0
                                • undefined
                                  zapta @OwenD
                                  last edited by 1 May 2021, 04:15

                                  @owend said in Is there a way to debug accelerometer connection issues?:

                                  True. But out of the reach of many of us.

                                  That's correct. Digital oscilloscope prices went down very significantly but it's still a significant amount of money.

                                  I was hoping that RRF could somehow self diagnose communication on each pin.

                                  Let's see if future generations of Duet boards will have an accelerometer connector that will work out of the box with the optional Duetcelerometer module. 😉

                                  undefined 1 Reply Last reply 1 May 2021, 08:09 Reply Quote 0
                                  • undefined
                                    dc42 administrators @zapta
                                    last edited by 1 May 2021, 08:09

                                    I have made the accelerometer SPI clock frequency configurable and reduced the default from 4MHz to 2MHz. I expect this will make it easier to obtain a connection. These changes will be in RRF 3.3RC1.

                                    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
                                    • undefined
                                      clownsrache
                                      last edited by clownsrache 5 Jan 2021, 13:57 1 May 2021, 13:56

                                      What kind of issue do i have?

                                      1.5.2021, 15:42:23: M955 P0 C"spi.cs2+spi.cs3": Accelerometer 0:0 with orientation 20 samples at 1344Hz with 10-bit resolution

                                      M956 P124.0 S10 A0

                                      1.5.2021, 15:45:43: M98 P"0:/macros/ACC": Error: Response timeout: CAN addr 124, req type 4014, RID=0

                                      undefined 1 Reply Last reply 1 May 2021, 14:08 Reply Quote 0
                                      • undefined
                                        dc42 administrators @clownsrache
                                        last edited by 1 May 2021, 14:08

                                        @clownsrache after sending that M955 command, what does M955 without parameters respond with?

                                        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 1 May 2021, 14:09 Reply Quote 0
                                        • undefined
                                          dc42 administrators @dc42
                                          last edited by 1 May 2021, 14:09

                                          RRF 3.3RC1 with configurable accelerometer SPI frequency is now available at https://github.com/Duet3D/RepRapFirmware/releases/tag/3.3RC1.

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