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

    Trouble with External Driver (TMC2208)

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    3
    5
    208
    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.
    • mead_wyundefined
      mead_wy
      last edited by mead_wy

      Howdy folks,

      I've been using my Duet Wifi for ~6 years now, and it's been great. I recently switched printers, and after dealing with the stock controller I decided to toss the old controller and use the duet wifi, which I much prefer. Things were pretty straightforward, and all axes work as expected. Unfortunately, over the course of the last six years it seems like age or user error have managed to roast the E0 driver. When using the driver, the motor does not turn smoothly and will not turn under load (tested with multiple motors). I'm using a dual Z motors for the build plate, so E1 is tied up by Z2 (I need to run them independently). As such, I'm attempting to use a TMC2208 with an expansion board like this.

      I believe I've got everything wired correctly to use the E2 drive on the expansion header, but to review:

      1. DIR on the expansion board -> E2_DIR (pin 6 on expansion header)
      2. STEP on the expansion board -> E2_STEP (pin 5 on the expansion header)
      3. EN on the expansion board -> E2_EN (pin 7 on the expansion header)
      4. Vin on the expansion board -> +3.3V (pin 3 on the expansion header)
      5. G on the expansion board -> GND (pin 42 on the expansion header)
        (pin 2 is tied up by BLTouch)
      6. POS(+) and NEG(-) on the expansion board are wired to the PSU.
      7. The microstepping switches are all set to 1, which I believe indicates 16x microstepping(the board documentation is non-existent, but this is consistent with other expansion boards I've seen)

      Below is my config.g file. I think I must be missing something, I've followed the directions here. I assume the old documentation is deprecated regarding soldering the SPI pins as it looks like SPI is supported for external drivers now given the commands in the current documentation for M569. Any help would be appreciated. Thanks!

      ; Configuration file for Duet WiFi (firmware version 3.3)
      ; executed by the firmware on start-up
      ;
      ; generated by RepRapFirmware Configuration Tool v3.3.10 on Fri Jun 03 2022 19:55:50 GMT-0600 (Mountain Daylight Time)
      
      ; General preferences
      G90                                             ; send absolute coordinates...
      M83                                             ; ...but relative extruder moves
      M550 P"sapphire"                           ; set printer name
      M669 K1                                         ; select CoreXY mode
      
      ; Network
      M552 S1                                         ; enable network
      M586 P0 S1                                      ; enable HTTP
      M586 P1 S0                                      ; disable FTP
      M586 P2 S0                                      ; disable Telnet
      
      ; Drives
      M569 P0 S1                                      ; physical drive 0 goes forwards
      M569 P1 S1                                      ; physical drive 1 goes forwards
      M569 P2 S0                                      ; physical drive 2 (z1) goes backwards
      M569 P3 S0                                      ; physical drive 3 (old extruder drive) goes forwards
      M569 P4 S0                                      ; physical drive 4 (z2) goes backwards
      M569 P5 R1 T5:5:10:0					   		; physical drive 5 (new extruder drive) goes forwards
      M584 X0 Y1 Z2:4 E5                              ; set drive mapping
      M671 X-30:310 Y0:0 S5	 						; leadscrews at left (connected to Z) and right (connected to E1) of X axis
      M350 X16 Y16 Z16:16 I1                      ; configure microstepping with interpolation
      M92 X80.30 Y80.30 Z400.00 E409.00:400.00        ; set steps per mm
      M566 X1000.00 Y1000.00 Z200.00:200.00 E3000.00  ; set maximum instantaneous speed changes (mm/min)
      M203 X6000.00 Y6000.00 Z300.00:300.00 E7200.00  ; set maximum speeds (mm/min)
      M201 X1000.00 Y1000.00 Z500.00:500.00 E1000.00  ; set accelerations (mm/s^2)
      M906 X800 Y800 Z800:800 I30             	    ; set motor currents (mA) and motor idle factor in per cent
      M84 S30                                         ; Set idle timeout
      
      ; Axis Limits
      M208 X0 Y0 Z0 S1                                ; set axis minima
      M208 X270 Y275 Z300 S0                          ; set axis maxima
      
      ; Endstops
      M574 X2 S1 P"!xstop"                            ; configure switch-type (e.g. microswitch) endstop for low end on X via pin xstop
      M574 Y1 S1 P"!ystop"                            ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin ystop
      M574 Z1 S0 P"zstop+e1stop"						; configure switch-type (e.g. microswitch) endstop for low end on Z via pin ystop
      M574 Z1 S2 P"zstop+e1stop"						; Define Z to use Probe. Home to Min
      M591 P1 C"e0stop" S1 D0 						; filament monitor connected to E0 endstop
      
      ; Z-Probe
      M950 S0 C"exp.heater7"                          ; create servo pin 0 for BLTouch
      M558 P9 C"^zprobe.in" H3  F120 T7200            ; set Z probe type to bltouch and the dive height + speeds
      G31 P500 X-27.11 Y31.48 Z0.79                   ; set Z probe trigger value, offset and trigger height
      M557 X30:310 Y-30:295 S20                        ; define mesh grid
      
      ; Heaters
      M308 S0 P"bedtemp" Y"thermistor" T100000 B4138  ; configure sensor 0 as thermistor on pin bedtemp
      M950 H0 C"bedheat" T0                           ; create bed heater output on bedheat and map it to sensor 0
      M307 H0 R0.320 K0.305:0.000 D5.04 E1.35 S1.00 B0; enable bang-bang mode for the bed heater and set PWM limit
      M140 H0                                         ; map heated bed to heater 0
      M143 H0 S120                                    ; set temperature limit for heater 0 to 120C
      M308 S1 P"e0temp" Y"thermistor" T100000 B4138   ; configure sensor 1 as thermistor on pin e2temp
      M950 H1 C"e0heat" T1                            ; create nozzle heater output on 20heat and map it to sensor 1
      M307 H1 R2.406 K0.408:0.000 D4.79 E1.35 S1.00 B0 V24.2M143 H1 S280    
      ; BLTouch - Heaters
      M307 H7 A-1 C-1 D-1 							; Disable the 7th Heater to free up PWM channel 5 on the Duex board.; set temperature limit for heater 1 to 280C
      
      ; Fans
      M950 F0 C"fan0" Q500                            ; create fan 0 on pin fan0 and set its frequency
      M106 P0 S0 H-1                                  ; set fan 0 value. Thermostatic control is turned off
      M950 F1 C"fan1" Q500                            ; create fan 1 on pin fan1 and set its frequency
      M106 P1 S1 H1 T45                               ; set fan 1 value. Thermostatic control is turned on
      
      ; Tools
      M563 P0 S"Extruder" D0 H1 F0                 	; define tool 0
      G10 P0 X0 Y0 Z0                                 ; set tool 0 axis offsets
      G10 P0 R0 S0                                    ; set initial tool 0 active and standby temperatures to 0C
      
      ; Custom settings are not defined
      T0
      
      droftartsundefined 1 Reply Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @mead_wy
        last edited by

        @mead_wy Those boards are meant for A4988 or DRV8825 drivers, so there's no UART or SPI control of the driver. Usually, TMC2208 drivers expect this, so I think you DO need to short some of the extra pins. Looking at the datasheet https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2202_TMC2208_TMC2224_datasheet_rev1.13.pdf it seems that the 2208 only has three pins for configuration: MS1, MS2 (for microstepping) and PDN_UART (usually for UART, but for automatic standstill current reduction when shorted in Standalone STEP/DIR Driver, Legacy Mode).

        So check what the MS1, MS2 and MS3 switches are actually doing on the board. MS1 and MS2 should be the microstepping, but I don't know about MS3. If you have a pinout of your 2208 driver board, you should be able to match it up and check it with the pinout of an A4988 board like the Stepstick to check.

        Finally, it might be worth playing with the enable signal. In the datasheet, 2.2 Signal descriptions TMC2208 it says:

        Enable not input. The power stage becomes switched off (all motor outputs floating) when this pin becomes driven to a high level.

        So perhaps it is enable low rather than high.

        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

        mead_wyundefined 1 Reply Last reply Reply Quote 0
        • mrehorstdmdundefined
          mrehorstdmd
          last edited by

          The board description says logic level 5V, you're trying to drive it with 3.3V.

          https://drmrehorst.blogspot.com/

          mead_wyundefined 1 Reply Last reply Reply Quote 0
          • mead_wyundefined
            mead_wy @mrehorstdmd
            last edited by

            @mrehorstdmd 3.3V vs 5V didn't make a difference unfortunately, that would've been easy

            1 Reply Last reply Reply Quote 0
            • mead_wyundefined
              mead_wy @droftarts
              last edited by

              @droftarts Thanks for the reply, and you helped me figure this out. I turned MS3 to off and EN to low. It's working now. Appreciate the help!

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