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

    LIS3DH Accelerometer issues

    Scheduled Pinned Locked Moved Solved
    Duet Hardware and wiring
    4
    9
    1.2k
    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.
    • SlimShaderundefined
      SlimShader
      last edited by SlimShader

      Hi all,

      I'm looking for some advice on using the LIS3DH with Duet WiFi boards. I have several, and wanted to perform some input shaping as part of the final tune for my builds.

      I've followed the instructions here but haven't had any luck with the Duet Wifi's seeing them, with the result being:

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

      I've now made up a total of four cables ranging from a 1.5m all the way down to 100mm. These were made up with good quality USB 3.0 cables. I've tried adding resistors at the accelerometer end of the cable on the SDO conductor ranging from 100 ohm up to 1.2k all with the same results. I have also tried 4 different LIS3DH boards.

      The cable is being plugged into genuine Duet temp daughterboards (which are working fine with the PT100 sensors, so I assume are OK. The mainboards are genuine Duet Wifi.

      This is my M122 output from one of the machines:

      26/11/2021, 12:38:11	M122
      === Diagnostics ===
      RepRapFirmware for Duet 2 WiFi/Ethernet version 3.3 (2021-06-15 21:44:54) running on Duet WiFi 1.02 or later
      Board ID: 08DJM-9178L-L4MSN-6J1FG-3SN6M-9S3GR
      Used output buffers: 3 of 24 (14 max)
      === RTOS ===
      Static ram: 23876
      Dynamic ram: 75020 of which 0 recycled
      Never used RAM 15520, free system stack 184 words
      Tasks: NETWORK(ready,13.8%,244) HEAT(delaying,0.0%,314) Move(notifyWait,0.1%,338) MAIN(running,85.8%,443) IDLE(ready,0.3%,29), total 100.0%
      Owned mutexes: WiFi(NETWORK)
      === Platform ===
      Last reset 00:05:04 ago, cause: power up
      Last software reset at 2021-11-25 18:21, reason: User, GCodes spinning, available RAM 15280, slot 1
      Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a
      Error status: 0x00
      Aux0 errors 0,0,0
      Step timer max interval 0
      MCU temperature: min 11.5, current 18.1, max 18.3
      Supply voltage: min 23.9, current 24.1, max 24.3, under voltage events: 0, over voltage events: 0, power good: yes
      Heap OK, handles allocated/used 0/0, heap memory allocated/used/recyclable 0/0/0, gc cycles 0
      Driver 0: position 131111, standstill, SG min/max not available
      Driver 1: position 131111, standstill, SG min/max not available
      Driver 2: position 131111, standstill, SG min/max not available
      Driver 3: position 0, standstill, SG min/max not available
      Driver 4: position 0, standstill, SG min/max not available
      Driver 5: position 0
      Driver 6: position 0
      Driver 7: position 0
      Driver 8: position 0
      Driver 9: position 0
      Driver 10: position 0
      Driver 11: position 0
      Date/time: 2021-11-26 12:38:06
      Cache data hit count 4294967295
      Slowest loop: 4.26ms; fastest: 0.17ms
      I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0
      === Storage ===
      Free file entries: 10
      SD card 0 detected, interface speed: 20.0MBytes/sec
      SD card longest read time 2.3ms, write time 0.0ms, max retries 0
      === Move ===
      DMs created 83, maxWait 0ms, bed compensation in use: none, comp offset 0.000
      === MainDDARing ===
      Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
      === AuxDDARing ===
      Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
      === Heat ===
      Bed heaters = 0 -1 -1 -1, chamberHeaters = -1 -1 -1 -1
      Heater 1 is on, I-accum = 0.0
      === GCodes ===
      Segments left: 0
      Movement lock held by null
      HTTP is idle in state(s) 0
      Telnet is idle in state(s) 0
      File is idle in state(s) 0
      USB is idle in state(s) 0
      Aux is idle in state(s) 0
      Trigger is idle in state(s) 0
      Queue is idle in state(s) 0
      LCD is idle in state(s) 0
      Daemon is idle in state(s) 0
      Autopause is idle in state(s) 0
      Code queue is empty.
      === Filament sensors ===
      Extruder 0: pos 0.00, errs: frame 0 parity 0 ovrun 0 pol 0 ovdue 0
      === Network ===
      Slowest loop: 15.66ms; fastest: 0.00ms
      Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0), 0 sessions
      HTTP sessions: 1 of 8
      - WiFi -
      Network state is active
      WiFi module is connected to access point 
      Failed messages: pending 0, notready 0, noresp 0
      WiFi firmware version 1.26
      WiFi MAC address 84:0d:8e:b3:b8:6f
      WiFi Vcc 3.37, reset reason Turned on by main processor
      WiFi flash size 4194304, free heap 26584
      WiFi IP address 192.168.1.131
      WiFi signal strength -56dBm, mode 802.11n, reconnections 0, sleep mode modem
      Clock register 00002002
      Socket states: 0 0 0 0 0 0 0 0
      

      My wiring is based on this very useful diagram I found in the forum:
      LIS3DH.png
      I'm pretty much out of ideas now unless somebody can suggest anything else?

      My thinking now is to potentially figure out how to get the LIS3DH connected to a Raspberry Pi and somehow translate the results across to the Duet firmware if that's even possible - seems a shame to do it this way though.

      Anyway, any ideas would be much appreciated!

      Cheers

      Colin

      bernardomattiucciundefined dc42undefined 2 Replies Last reply Reply Quote 0
      • bernardomattiucciundefined
        bernardomattiucci @SlimShader
        last edited by bernardomattiucci

        @slimshader

        I think pin #8 of the Duet should be connected to pin 3V0 of the LIS3DH

        alt text

        SlimShaderundefined 1 Reply Last reply Reply Quote 1
        • SlimShaderundefined
          SlimShader @bernardomattiucci
          last edited by

          @bernardomattiucci thanks for that - there was a discussion around that on the forum and the consensus was that the 3VO pin was to be used - the VCC was for a 5v feed. I have connected via 3V0 on my setups and the board is active (i.e. the LED comes on). I haven't actually tried connecting on the VCC!

          bernardomattiucciundefined 1 Reply Last reply Reply Quote 0
          • bernardomattiucciundefined
            bernardomattiucci @SlimShader
            last edited by

            @slimshader If I'm not mistaken the duet provides 3Volt by default, but it depends on the settings (and maybe the type of card... I have wifi).
            I just finished preparing the cable. Tomorrow I plan to try the LIS3DH too.

            1 Reply Last reply Reply Quote 0
            • rjenkinsgbundefined
              rjenkinsgb
              last edited by rjenkinsgb

              For anyone finding this thread:
              I've just connected a LIS3DSH board to my machine with a Duet 3 MB6HC; one of this style sensor board from ebay:

              LIS3DSH.jpg

              I've used some very thin twisted pair stripped out of industrial cable, though the pairs from stranded-core Ethernet cable (patch cable) should be similar.

              The cable is around 5ft with a few inches of ribbon for the IDC connector spliced on with heatshrink, and it works fine.

              My wiring, using the wire labels at the accelerometer end:
              Pair 1: GND and SCL

              Pair 2: GND and SDO

              Pair 3: SDA and INT

              Pair 4: VCC (actually 3V3) and CS

              The four pairs are very loosely wrapped together to minimise crosstalk.
              That arrangement puts three of the critical signal lines with ground or power wires, and just the INT and SDA together, which I believe are the least likely ones to both be in use simultaneously.

              Note that the setup line in the accelerometer article was wrong for the Duet MB6HC;
              https://duet3d.dozuki.com/Wiki/Accelerometers
              gave this line:

              M955 P0 C"spi.cs4+spi.cs3" ; all wires connected to temp DB connector
              

              There is no spi.cs4 ?? From the 6HC connector diagram, It appeared it should be:

              M955 P0 C"spi.cs3+spi.cs2"
              

              And that is what works on my machine. I've edited it on the wiki page.

              Photos below.
              The attachment is temporary, just to prove it out - I want to be able to check the machine frame vibration as well as the carriage resonances.
              I also only had two long lengths of twisted pair left over, so the colours are doubled up..

              Accel_1.jpg

              Accel_2.jpg

              Robert J.

              Printers: Overlord pro, Kossel XL+ with Duet 6HC and "Frankentron", TronXY X5SA Pro converted to E3D toolchange with Duet 6HC and 1LC toolboards.

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

                @slimshader said in LIS3DH Accelerometer issues:

                The cable is being plugged into genuine Duet temp daughterboards (which are working fine with the PT100 sensors, so I assume are OK. The mainboards are genuine Duet Wifi.

                Are you are plugging the accelerometer cable into the top of a single PT100 daughter board that is plugged into the Duet? If so then you need to change the wiring. See the section about Duet 2 at https://duet3d.dozuki.com/Wiki/Accelerometers#Section_Direct_SPI_connection_to_a_Duet_main_board. Specifically, this bit:

                [Note: if you already have one daughter board plugged into the main board and you wish to connect to SPI.CS4 and SPI.CS3 on the top of that daughter board, the daughter board passes SPI.CS4 and SPI.CS3 to the pin positions directly above the SPI.CS2 and SPI.CS1 pins on the main board. This is so that a second daughter board stacked on top automatically uses SPI.CS4 and SPI.CS3 instead of SPI.CS2 and 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

                SlimShaderundefined 1 Reply Last reply Reply Quote 1
                • SlimShaderundefined
                  SlimShader @dc42
                  last edited by

                  @dc42 Thanks David, I think I understand what I've done wrong. So the useful diagram:

                  LIS3DH.png

                  describes a direct connection to the Duet Wifi, and in order to be able to pass through the temp daughterboard one would need to move the INT1 and CS pins to SPIO_CS1 and SPIO_CS2 pins respectively?

                  I'll give that a shot later and report back with my results.

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

                    @slimshader said in LIS3DH Accelerometer issues:

                    and in order to be able to pass through the temp daughterboard one would need to move the INT1 and CS pins to SPIO_CS1 and SPIO_CS2 pins respectively?

                    Correct.

                    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

                    SlimShaderundefined 1 Reply Last reply Reply Quote 0
                    • SlimShaderundefined
                      SlimShader @dc42
                      last edited by

                      @dc42 Thanks David, worked first time 👍

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