Hi all,
I have been able to get my printer mostly working with klipper and octoprint. The last 2 things I want to irpn out is fan control and UART connection for tmc2209s.
With my current config (shown bellow) I can use my printer as intended except for my part cooling fans which always stay on even if I hit fan off in octoprint. Does anyone have suggestions on how I can get my fans under control?
[stepper_x]
step_pin: PC11
dir_pin: !PB6
enable_pin: !PC12
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA3
position_endstop: 0
position_max: 300
homing_speed: 50
[stepper_y]
step_pin: PB5
dir_pin: !PB4
enable_pin: !PC12
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC9
position_endstop: 0
position_max: 300
homing_speed: 50
[stepper_z]
step_pin: PB3
dir_pin: PA15
enable_pin: !PC12
microsteps: 16
rotation_distance: 4
endstop_pin: probe:z_virtual_endstop # enable to use BLTouch
position_min: -5 # enable to use BLTouch
position_max: 400
[safe_z_home] # enable for BLTouch
home_xy_position: 150, 150
speed: 100
z_hop: 10
z_hop_speed: 5
[bltouch] # enable for BLTouch
sensor_pin: ^PA1
control_pin: PA11
x_offset: -44
y_offset: -16
z_offset: 3.35
speed: 3.0
[bed_mesh] # enable for BLTouch
speed: 100
mesh_min: 0, 0
mesh_max: 176, 204 # bed size - bltouch x_offset, y_offset
algorithm: bicubic
probe_count: 3,3
fade_start: 1
fade_end: 10
fade_target: 0
[gcode_macro M851]
gcode:
G28
probe_calibrate
[gcode_macro G32]
gcode:
G28
delta_calibrate
G1 X0 Y0 F4200
save_config
[gcode_macro G29]
gcode:
G28
bed_mesh_calibrate
G1 X0 Y0 Z15 F4200
save_config
[extruder]
step_pin: PB15
dir_pin: !PB14
enable_pin: !PC12
microsteps: 16
rotation_distance: 33.683
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB12
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PB0
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250
[heater_bed]
heater_pin: PB13
sensor_type: ATC Semitec 104GT-2
sensor_pin: PB1
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
[multi_pin my_fan]
pins: PA9,PA10
[fan]
pin: multi_pin:my_fan
[heater_fan hotend_fan]
pin :PA8
[mcu]
serial:/dev/serial0
baud = 115200
restart_method: command
#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
Also, my motors are not as silent as I'd like them to be. I believe its because the current stand alone implementation doesn't use stealth chop. Does anyone know how I can fill out the sections bellow to get uart set up? I tried setting all the uart_pin sections to PB10, but klipper doesnt like that PB10 is shared like that.
[tmc2209 stepper_x]
uart_pin: ????
run_current: 0.800
hold_current: 0.800
diag_pin:
stealthchop_threshold: 999999
[tmc2209 stepper_y]
uart_pin: ????
run_current: 0.800
hold_current: 0.800
diag_pin:
stealthchop_threshold: 999999
[tmc2209 stepper_z]
uart_pin: ????
run_current: 0.800
hold_current: 0.800
diag_pin:
stealthchop_threshold: 999999
[tmc2209 extruder]
uart_pin: ????
run_current: 0.600
diag_pin:
stealthchop_threshold: 999999
If you have any documentation or other forums/communities that might be useful for me to check out please let me know!
yes,you can use other free pins, like PA2,just connect to the TX0 not the TX with one wire and maybe no other soldering.
it's no problem fans work with 12V, actually,i'm not familiar with configure of Klipper, or you can use multimeter to see if there have some high level voltage on the PA9 and PA10
Thanks for the speedy response. Apologies that mine is so late.
Is there any particular reason the Tx pin needs to be tied to PB6? I just looked through the schematic for the PandaPi 2.9 and the STM32F103xC datasheet and page 32 indicates that pin PA2 could also be used as a UART Tx.
Since I'm not using a second hotend, could I just use a wire jumper from that pin to the Tx bus that the drivers are on? If I need that 100 ohm resistor called out on X_DIR in the schematic, I'm sure I can solder one along the jumper between PA2 and TX0.
Also, the way that I have configured my klipper config makes all 3 fans respond to M106 S200 without the additional P argument (see bellow).
I should note that I'm using a 12v power supply to run this PandaPi. Is there a possibility that a tolerance stack up on the individual fan circuits could bias a component around the 12 volt range?
I know the possibility of that last scenario happening is slim to none, but I cant understand why PB7 would make only fan3 behave as expected while PA9 and PA10 don't affect fans 1 and 2 at all. I would think they would either all work or none would work given my config.
I am not sure how klipper responds for M106, but for marlin the M106 can only control one fan at a time, M106 S200 will only open the FAN0, and M106 P1 S200 will open the second FAN2.
Hi, I have not try this uart mode on klipper before,will try it as soon as possible,
here we can use PB6 as the uart Tx pin. but PB6 is used for dir_pin of X axis by default, so we just need to switch the driver connector to the E1,plug the X driver into the E1 socket,also need to change the X sterpper pin number in the printer.cfg.
for example:
[stepper_x] step_pin: PB2 dir_pin: !PC6 enable_pin: !PC12 microsteps: 16 rotation_distance: 40 endstop_pin: ^PA3 position_endstop: 0 position_max: 300 homing_speed: 50 [tmc2209 stepper_x] tx_pin: PB6 uart_address: 0 run_current: 0.580 hold_current: 0.500 stealthchop_threshold: 250 [stepper_y] step_pin: PB5 dir_pin: PB4 enable_pin: !PC12 microsteps: 16 rotation_distance: 40 endstop_pin: ^PC9 position_endstop: 0 position_max: 235 homing_speed: 50 [tmc2209 stepper_y] tx_pin: PB6 uart_address: 2 run_current: 0.580 hold_current: 0.500 stealthchop_threshold: 250
also needs one wire to connect the TX0 and PB6(X_DIR) together as the following image shown.
here is the schematic of PandaPiV2.9 PandaPi/Schematic_PandaPi_V29_2022-02.pdf at master · markniu/PandaPi (github.com)
Ok, I have found an example configuration of uart mode using the "uart_adress" parameter (see bellow). I imagine I need to set the "tx_pin" to PB10 as called out on the pin map here, but I have no idea where the UART pin is.
Can anyone offer insight?
[stepper_x] step_pin: PB13 dir_pin: !PB12 enable_pin: !PB14 microsteps: 16 rotation_distance: 40 endstop_pin: ^PC0 position_endstop: 350 position_max: 350 homing_speed: 100 [tmc2209 stepper_x] uart_pin: PC11 tx_pin: PC10 uart_address: 0 run_current: 0.580 hold_current: 0.500 stealthchop_threshold: 250 [stepper_y] step_pin: PB10 dir_pin: !PB2 enable_pin: !PB11 microsteps: 16 rotation_distance: 40 endstop_pin: ^PC1 position_endstop: 350 position_max: 350 homing_speed: 100 [tmc2209 stepper_y] uart_pin: PC11 tx_pin: PC10 uart_address: 2 run_current: 0.580 hold_current: 0.500 stealthchop_threshold: 250
I still do not know what is going on with my fans at this point.