Basic Information:
Printer Model: Creality Ender 3 v3 SE
MCU / Printerboard: Default Creality Mainboard v4.2.7
Host / SBC Raspberry Pi 4B
klippy.log (62.6 KB)
Describe your issue:
I have gone through the documented steps to enable UART on the Pi and have managed to test it successfully from command line test scripts provided at GitHub - Chr157i4n/TMC2209_Raspberry_Pi: this is a Python library to drive a stepper motor with a Trinamic TMC2209 stepper driver and a Raspberry Pi. My setup includes 2 stepper motors (Creality 42-40) and 2 stepper drivers (BigTreeTech tmc2209). What I want to do is have Klipper control these steppers through the rpi mcu using the GPIO pins and including support for UART to allow for sensorless homing.
The short description of this effort is to enable a color-changing system with a 3D printed version of the 3D Chameleon. One stepper switches the colors and the other pushes the filament to and from the extruder.
Here is what I’ve configured so far:
[mcu rpi]
serial: /tmp/klipper_host_mcu
[tmc2209 manual_stepper stepper_selector]
uart_pin: rpi:gpio15
tx_pin: rpi:gpio14 # tested both with and without this line
stealthchop_threshold: 9999
run_current: 0.800
# hold_current: 0.500
sense_resistor: 0.110
diag_pin: ^rpi:gpio6
driver_SGTHRS: 255
interpolate: True
[manual_stepper stepper_selector]
step_pin: rpi:gpio16
dir_pin: !rpi:gpio20
enable_pin: !rpi:gpio21
endstop_pin: tmc2209_stepper_selector:virtual_endstop
microsteps: 16
full_steps_per_rotation: 200
rotation_distance: 40
After racking my brain on this for several hours, I found what seems to happen is klipper takes over the UART pins 14 and 15 and turns them into INPUT/OUTPUT pins. I see this from raspi-gpio.
Immediately upon reboot:
GPIO 14: level=1 fsel=4 alt=0 func=TXD0 pull=NONE
GPIO 15: level=1 fsel=4 alt=0 func=RXD0 pull=UP
After enabling the above block in my printer.cfg:
GPIO 14: level=0 fsel=0 func=INPUT pull=NONE
GPIO 15: level=0 fsel=0 func=INPUT pull=UP
I also observed that the above-mentioned command line scripts could no longer read the UART pins as well.
Running a DUMP_TMC command on this stepper, it can’t read the UART registers, I assume because klipper disabled the uart configuration on these pins:
12:44 PM
Unable to read tmc uart 'stepper_selector' register GCONF
12:44 PM
========== Queried registers ==========
12:44 PM
SGTHRS: 000000ff sgthrs=255
12:44 PM
TPOWERDOWN: 00000014 tpowerdown=20
12:44 PM
COOLCONF: 00000000
12:44 PM
TCOOLTHRS: 00000000
12:44 PM
TPWMTHRS: 00000001 tpwmthrs=1
12:44 PM
IHOLD_IRUN: 00081919 ihold=25 irun=25 iholddelay=8
12:44 PM
SLAVECONF: 00000200 senddelay=2
12:44 PM
========== Write-only registers ==========
12:44 PM
DUMP_TMC stepper=stepper_selector
Am I just way off in my configuration? I assume they need to be configured as manual steppers so they’re not tied to the printer kinematics. I’m able to move both steppers through klipper if I don’t use the tmc2209 section, but without it, I can’t leverage the endstop information from UART.
Thanks for any help you can provide!