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

    Accelerometer Usage

    Scheduled Pinned Locked Moved
    Beta Firmware
    25
    191
    19.9k
    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.
    • dc42undefined
      dc42 administrators @CCS86
      last edited by

      @ccs86 said in Accelerometer Usage:

      Is it possible to log at faster than 1344 Hz? The sensor seems to be capable of 5000 Hz, but the "S" parameter doesn't seem to work in the M955 command. I have only ever gotten 1344 Hz and 400 Hz replies in the console.

      In theory the code support 5kHz, but it's unlikely to work when using a direct SPI connection. The LIS3DSH supports 1600Hz instead of 1344Hz.

      Also, DWC seems to infer a sampling rate of 1331 Hz, while RRF says 1344 Hz. Only a 1% difference, but I'm guessing it shifts the analysis result slightly. Not sure whether DWC is accurately sensing a 1331 Hz logging rate, on a desired 1344 Hz. Or, if it should be changed to match.

      The sensor data rate is only approximate (the manufacturer told me +/-20% AFAIR), so RRF measures it and includes the actual data rate in the .csv file.

      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

      CCS86undefined 1 Reply Last reply Reply Quote 0
      • CCS86undefined
        CCS86 @dc42
        last edited by

        @dc42 said in Accelerometer Usage:

        @ccs86 said in Accelerometer Usage:

        Somewhat off topic, but this is wild. Here is the analysis of X at 5k / 10k / 15k accel. I did not expect such a big difference when increasing accel to 15k. Makes me suspicious:

        If the time taken to accelerate or decelerate is about half the period of ringing, that will tend to suppress the ringing. That is how DAA worked. I suggest you calculate the acceleration/deceleration time, i.e. the feed rate of your test move in mm/sec divided by the acceleration.

        Is that calculation only valid with jerk set to zero, or do you think it holds?

        1 Reply Last reply Reply Quote 0
        • CCS86undefined
          CCS86 @dc42
          last edited by CCS86

          @dc42 said in Accelerometer Usage:

          @ccs86 said in Accelerometer Usage:

          Is it possible to log at faster than 1344 Hz? The sensor seems to be capable of 5000 Hz, but the "S" parameter doesn't seem to work in the M955 command. I have only ever gotten 1344 Hz and 400 Hz replies in the console.

          In theory the code support 5kHz, but it's unlikely to work when using a direct SPI connection. The LIS3DSH supports 1600Hz instead of 1344Hz.

          Also, DWC seems to infer a sampling rate of 1331 Hz, while RRF says 1344 Hz. Only a 1% difference, but I'm guessing it shifts the analysis result slightly. Not sure whether DWC is accurately sensing a 1331 Hz logging rate, on a desired 1344 Hz. Or, if it should be changed to match.

          The sensor data rate is only approximate (the manufacturer told me +/-20% AFAIR), so RRF measures it and includes the actual data rate in the .csv file.

          @dc42

          Is there a reason that we can't set a specific sampling rate with the "S" parameter, as documented?

          and do you have any thoughts on the erroneous spike data I posted above?

          dc42undefined 1 Reply Last reply Reply Quote 0
          • A Former User?
            A Former User
            last edited by

            I discovered in my setup that attaching the accelerometer directly to the coils of a driven stepper motor produces less than useful results.

            noise.png

            A Former User? 1 Reply Last reply Reply Quote 1
            • dc42undefined
              dc42 administrators @CCS86
              last edited by

              @ccs86 said in Accelerometer Usage:

              Is there a reason that we can't set a specific sampling rate with the "S" parameter, as documented?

              The accelerometer chip only supports a few specific sampling rates. You can specify the S parameter and the firmware will pick the nearest available one. Send M955 P# where #is the accelerometer ID to find which one has been selected.

              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

              CCS86undefined 1 Reply Last reply Reply Quote 0
              • A Former User?
                A Former User @A Former User
                last edited by A Former User

                @94v0 said in Accelerometer Usage:

                I discovered in my setup that attaching the accelerometer directly to the coils of a driven stepper motor produces less than useful results.

                That wasn't the problem, the combination of Mini5+ and LIS3DSH does seem to be pretty sensitive to the quality of the wiring. I thought I'd get away with some shielded DB9 cable, but there's obviously a lot being coupled along the length.

                I think the CAT6a I have has individual shielding on the pairs, I'm going to try that and see how it goes. Unfortunately my tool board is a 1.0 so I didn't get this sensor connected to the CAN bus like everything else.

                nasty.png

                I guess the most optimal solution is to make an absolutely minimal version of the SAMMYC21 development board with the LIS3DSH and CAN transceiver on board, drop the pin headers and the USB UART side of things.

                dc42undefined 1 Reply Last reply Reply Quote 0
                • A Former User?
                  A Former User
                  last edited by A Former User

                  Digikey and Mouser have quite literally no stock of that chip, and only a couple of thousand expected before 2022 across all the variants. Other than scalpers selling them in 2 quantity for $20 each, that's not really an option sadly.

                  mouser.png

                  1 Reply Last reply Reply Quote 0
                  • dc42undefined
                    dc42 administrators @A Former User
                    last edited by

                    @94v0 I updated the accelerometer wiki page recently with details of the cables I used, which are 1m long and work with the Duet 3 Mini. I think the secret is to keep the CS wire away from the other signal wires.

                    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
                    • CCS86undefined
                      CCS86 @dc42
                      last edited by

                      @dc42 said in Accelerometer Usage:

                      @ccs86 said in Accelerometer Usage:

                      Is there a reason that we can't set a specific sampling rate with the "S" parameter, as documented?

                      The accelerometer chip only supports a few specific sampling rates. You can specify the S parameter and the firmware will pick the nearest available one. Send M955 P# where #is the accelerometer ID to find which one has been selected.

                      It looks like the sensor does jump from:

                      HR / normal (1.344 kHz);

                      to

                      Low-power mode (5.376 kHz)

                      Have you tried that highest rate? I can't get RRF to go above the 1344 Hz

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

                        @ccs86 I haven't tried the higher sampling rate. My guess is that you won't be able to use that rate except for very short sampling times, without getting overrun errors. The resolution at that speed is only 8-bit, which may not be sufficient. The LIS3DSH does 1600Hz @ 16 bit resolution.

                        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

                        CCS86undefined 1 Reply Last reply Reply Quote 0
                        • CCS86undefined
                          CCS86 @dc42
                          last edited by

                          @dc42 said in Accelerometer Usage:

                          @ccs86 I haven't tried the higher sampling rate. My guess is that you won't be able to use that rate except for very short sampling times, without getting overrun errors. The resolution at that speed is only 8-bit, which may not be sufficient. The LIS3DSH does 1600Hz @ 16 bit resolution.

                          Cool. I actually was able to get some logs at 8-bit 5376 Hz. I'm not sure the loss in resolution is worth the increased sampling rate, with these low magnitude vibrations.

                          Are we any closer to testing input shaper on Maestro hardware?

                          1 Reply Last reply Reply Quote 0
                          • A Former User?
                            A Former User
                            last edited by

                            I'm a bit curious if these "LIS3DSH" boards being sold on aliexpress, ebay, adafruit and others are actually using a LIS3DSH. The chip is no longer manufactured, there's only a small number of them in stock on digikey and practically nowhere else and for much greater cost than the breakout boards are.

                            dc42undefined o_lampeundefined 2 Replies Last reply Reply Quote 0
                            • dc42undefined
                              dc42 administrators @A Former User
                              last edited by

                              @94v0 said in Accelerometer Usage:

                              I'm a bit curious if these "LIS3DSH" boards being sold on aliexpress, ebay, adafruit and others are actually using a LIS3DSH. The chip is no longer manufactured, there's only a small number of them in stock on digikey and practically nowhere else and for much greater cost than the breakout boards are.

                              The one I purchased definitely has a LIS3DSH on it.

                              According to the ST web site, the chip is still being manufactured but only in response to volume orders. Worldway claims to have 10000 of them.

                              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
                              • Sotidiiundefined
                                Sotidii
                                last edited by

                                Duet 3 Mini 5+ (Mini5plus)
                                Sammy-C21

                                G1 X-50 G4 S2 M956 P124.0 S1000 A0 G4 P10 G1 X50 F3600

                                Error: M956: Accelerometer is already collecting data ((

                                1 Reply Last reply Reply Quote 0
                                • o_lampeundefined
                                  o_lampe @A Former User
                                  last edited by o_lampe

                                  @94v0 said in Accelerometer Usage:

                                  I'm a bit curious if these "LIS3DSH" boards being sold on aliexpress, ebay, adafruit and others are actually using a LIS3DSH. The chip is no longer manufactured, there's only a small number of them in stock on digikey and practically nowhere else and for much greater cost than the breakout boards are.

                                  I ordered the last LIS3DSH board listed on ebay.de, will report what the label says when it arrives. In China you can still get them for less than 2$ each...

                                  With all the wiring issues mentioned here and there, I want to point out (again) that there's a Blutooth version of the LIS3DH board....maybe an option for SBC users?

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

                                    There are still some LID3dSH board available in UK, e.g. https://www.ebay.co.uk/itm/272706183865.

                                    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

                                    gloomyandyundefined 1 Reply Last reply Reply Quote 0
                                    • gloomyandyundefined
                                      gloomyandy @dc42
                                      last edited by

                                      I bought one from this listing: https://www.ebay.co.uk/itm/313603433596 came within a few days and seems to be a LID3dSH.

                                      tekkydaveundefined 1 Reply Last reply Reply Quote 0
                                      • jbergeneundefined
                                        jbergene
                                        last edited by jbergene

                                        Hello
                                        I have connected the Adafruit LIS3DH exactly as mentioned on the Accelerometer page, to my duet 2.

                                        I Get "M955 P0 C"spi.cs4+spi.cs3"
                                        Error: M955: Accelerometer not found on specified port"

                                        I have tried switching MISO and MOSI, and Cs3 and cs4 ports to just check against myself.

                                        I have also quadruple checked the wiring and its exactly the same. Wire length is 500mm. (bl touch extension wires)

                                        However many images I see on this post is people have wired the VIN instead of 3v?

                                        Web control, firwmare etc are all the latest beta 3.4.

                                        2021-08-15 12_37_10-MessageCenterUI.png

                                        DIY-O-Sphereundefined jbergeneundefined 2 Replies Last reply Reply Quote 0
                                        • DIY-O-Sphereundefined
                                          DIY-O-Sphere @jbergene
                                          last edited by DIY-O-Sphere

                                          @jbergene said in Accelerometer Usage:

                                          M955 P0 C"spi.cs3+spi.cs4

                                          I had a LIS3DH working with 3,3V
                                          It seams that you have swaped in and out....
                                          I also had that wrong with my first attempt....

                                          M955 P0 C"spi.cs4+spi.cs3
                                          

                                          (UTC+1)

                                          jbergeneundefined 1 Reply Last reply Reply Quote 0
                                          • jbergeneundefined
                                            jbergene @DIY-O-Sphere
                                            last edited by

                                            @diy-o-sphere ah sorry my bad, i have tried swapping this too without success. Just forgot to edit the text. my bad

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