Basic Information:
Printer Model: Modix Big Meter
MCU / Printerboard: BTT Octopus Max EZ/STM32H723x
Host / SBC: BTT Pi 2
klippy.log: logs&cfg.zip (54.2 KB)
Describe your issue:
I’ve got a rather strange issue in attempting to set up a BigTreeTech Octopus Max EZ with EZ5160 (TMC5160 clone) drivers in my company’s Modix Big Meter.
I managed to set up the config so that I was able to get the steppers moving, and all was going great…until I made a small change to the config (unrelated to the issue - I was tweaking driver direction polarity, so the two x carriage motors move together) and then saved the config and restarted the mainboard. All of a sudden, the STM32 completely lost contact with every single driver.
After a good few hours of research, I realized these drivers from BTT have an abysmal failure rate, so I was fairly suspicious of this – but after seeing as every single driver had lost comms through SPI, I became even more confused. Running DUMP_TMC on each driver yielded the same result - no response from the EZ5160, MISO stays high at 3.3v and all registers read back FFFFFFFF as a result. See the traces from my oscilloscope below when I passed G28 into the console (note that the trigger isn’t configured correctly and the data is bit shifted right by one position as a result - it should start with the 1 in position 38):
As you can see above, after the first 40 bits, the clock goes high for ~1µs and then resumes oscillating, but there is no response from MISO. From what I can understand reading the TMC5160 datasheet, bit 39 is 1 (read/write selecting write), bits 38-31 define the register (0x00 corresponding to GCONF), bit 8 enables diag1 on motor stall (for sensorless home), and lastly bit 3 enables multistep_filt for stealthchop optimization w/ external step source. I assume the second 8-byte block is supposed to be the response from the 5160 reading back that these were set correctly.
The thing that’s got me scratching my head with this is the fact that if the Octopus is powered off for around 45 minutes and then powered on, every single driver works fine. I can read all the data from DUMP_TMC, I can even move the steppers (although I still have some bugs to work out with configuring sensorless homing) but the moment I FIRMWARE_RESET or power cycle the board, every single driver plays dead.
I’m running soft SPI, here’s a snippet of how one of the two x steppers is configured:
[stepper_x]
step_pin: PC13
dir_pin: PC14
enable_pin: !PE6
microsteps: 16
rotation_distance: 40
endstop_pin: tmc5160_stepper_x:virtual_endstop
position_endstop: 0
position_max: 1100
homing_speed: 20
[tmc5160 stepper_x]
#uart_pin: PG14
#spi_speed: 4000000
cs_pin: PG14
#spi_bus: spi4
spi_software_miso_pin: PE13
spi_software_mosi_pin: PE14
spi_software_sclk_pin: PE12
interpolate: true
sense_resistor: 0.075
diag1_pin: ^!PF0
driver_SGT: -16
run_current: 0.800
stealthchop_threshold: 0
I’ve tried hardware SPI, I’ve tried many different SPI speeds, I’ve tried disabling the SD card and LCD (which are on the same spi4 bus) with a static_digital_output:
[static_digital_output disable_display_sdcard_expdhdr]
pins: PE11, PB12, PF14
No change. I’m not entirely sure where in the Klipper firmware soft SPI is configured and in what mode it is operating; I’m still pretty new to the C language, embedded development, and protocols and whatnot. I was unable to get a scope view of the drivers working today, but I promise they do work after sitting off for a long enough time. I will update this post on Monday if I have any success then. TIA!