FYSETC / FYSETC-SPIDER-KING

10 axis industrial grade 3D printer motherboard for VORON, ANNEX ENGINEERING,JUBILEE,HEVORT
7 stars 1 forks source link

TMC5160 Drivers Not detected #1

Open benagricola opened 1 year ago

benagricola commented 1 year ago

Using the example Klipper configs, as well as RRF, my SPIDER KING won't detect the BIG-5160 drivers I have installed in my board.

Klipper reports:

INFO:root:TMC stepper_x failed to init: Unable to write tmc spi 'stepper_x' register GLOBALSCALER
INFO:root:TMC stepper_y failed to init: Unable to write tmc spi 'stepper_y' register GLOBALSCALER
INFO:root:TMC stepper_z failed to init: Unable to write tmc spi 'stepper_z' register GLOBALSCALER

And RRF reports all drivers not present.

Additionally, the example Klipper configuration pins don't match the Pinout diagram in this repo, so I have no idea which pins are the correct ones.

The example Klipper config I'm using is this (using the pin layout from the PDF file in this repo).

[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_260035001147393532373434-if00
restart_method: command

[stepper_x]
step_pin: PG7
dir_pin: PG6
enable_pin: PE11
rotation_distance: 40
microsteps: 16
full_steps_per_rotation:200
endstop_pin: tmc5160_stepper_x:virtual_endstop
position_min: 0
position_endstop: 0
position_max: 235
homing_speed: 35
homing_retract_dist: 5
#homing_positive_dir: true

[tmc5160 stepper_x]
## Soft SPI
spi_software_mosi_pin: PE14
spi_software_miso_pin: PE13
spi_software_sclk_pin: PE12
cs_pin: PD2
diag0_pin: !PF6
interpolate: False
run_current: 0.8
#hold_current: 0.5
stealthchop_threshold: 0
sense_resistor: 0.075
driver_SGT: 1

[stepper_y]
step_pin: PG14
dir_pin: PG12
enable_pin: PG15
microsteps: 16
rotation_distance: 40
full_steps_per_rotation: 200
endstop_pin: tmc5160_stepper_y:virtual_endstop
position_min: 0
position_endstop: 0
position_max: 235
homing_speed: 35
homing_retract_dist: 5

[tmc5160 stepper_y]
## Soft SPI
spi_software_mosi_pin: PE14
spi_software_miso_pin: PE13
spi_software_sclk_pin: PE12
cs_pin: PD8
diag0_pin: !PF8
interpolate: False   #true   False 
run_current: 0.8
#hold_current: 0.5
stealthchop_threshold: 0
sense_resistor: 0.075
driver_SGT: 1

#####################################################################
#   Z Motor 
#####################################################################

[stepper_z]
step_pin: PD4
dir_pin: PD6
enable_pin: PD5
rotation_distance: 8
gear_ratio: 40:16
microsteps: 256
endstop_pin: tmc5160_stepper_z:virtual_endstop
position_endstop: 0
position_max: 235
position_min: 0
homing_speed: 7
second_homing_speed: 3
homing_retract_dist: 3

[tmc5160 stepper_z]
spi_software_mosi_pin: PE14
spi_software_miso_pin: PE13
spi_software_sclk_pin: PE12
cs_pin: PD7
diag0_pin: !PF11
interpolate: False   #true
run_current: 0.7
hold_current: 0.4
sense_resistor: 0.110
stealthchop_threshold: 0

[printer]
kinematics: cartesian
max_velocity: 200
max_accel: 1500
max_z_velocity: 10
max_z_accel: 100
square_corner_velocity: 4.0

Big5160 boards are installed in the orientation from the WIKI - With the BIG-5160 text upside-down when looking at the board from the high voltage motor connectors.

Please help work out what's wrong here, because the board won't work without drivers :)

benagricola commented 1 year ago

For anyone else finding this:

The BIG5160 drivers specifically need power on the 48V-PWR rail as well as whatever you have on PWE-IN. You can run 24v to both of these and the drivers will work fine, but you have to have both connected up, as PWE-IN does not provide power to the "High Voltage" motor drivers.

The configuration which worked great for me with standard currents (not tuned yet) is:

[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_260035001147393532373434-if00
restart_method: command

[stepper_x]
step_pin: PG7
dir_pin: PG6
enable_pin: !PE11
microsteps: 16
rotation_distance: 40
full_steps_per_rotation: 200
endstop_pin: !PC5
position_min: 0
position_endstop: 0
position_max: 235
homing_speed: 35
homing_retract_dist: 5

[tmc5160 stepper_x]
## Soft SPI
spi_software_mosi_pin: PE14
spi_software_miso_pin: PE13
spi_software_sclk_pin: PE12
cs_pin: PD2
diag1_pin: PF6
interpolate: False   #true   False 
run_current: 0.8
#hold_current: 0.5
stealthchop_threshold: 0
sense_resistor: 0.075
driver_SGT: -64

[stepper_y]
step_pin: PG14
dir_pin: PG12
enable_pin: !PG15
microsteps: 16
rotation_distance: 40
full_steps_per_rotation: 200
endstop_pin: !PC4
position_min: 0
position_endstop: 0
position_max: 235
homing_speed: 35
homing_retract_dist: 5

[tmc5160 stepper_y]
## Soft SPI
spi_software_mosi_pin: PE14
spi_software_miso_pin: PE13
spi_software_sclk_pin: PE12
cs_pin: PD8
diag1_pin: PF8
interpolate: False   #true   False 
run_current: 0.8
#hold_current: 0.5
stealthchop_threshold: 0
sense_resistor: 0.075
driver_SGT: -64

#####################################################################
#   Z Motor 
#####################################################################

[stepper_z]
step_pin: PD4
dir_pin: PD6
enable_pin: !PD5
rotation_distance: 8
gear_ratio: 40:16
microsteps: 256
endstop_pin: !PB6
position_endstop: 0
position_max: 235
position_min: 0
homing_speed: 7
second_homing_speed: 3
homing_retract_dist: 3

[tmc5160 stepper_z]
spi_software_mosi_pin: PE14
spi_software_miso_pin: PE13
spi_software_sclk_pin: PE12
cs_pin: PD7
diag1_pin: PF11
interpolate: False   #true
run_current: 0.7
hold_current: 0.4
sense_resistor: 0.075
stealthchop_threshold: 0
sense_resistor: 0.075
driver_SGT: -64

[printer]
kinematics: cartesian
max_velocity: 200
max_accel: 1500
max_z_velocity: 10
max_z_accel: 100

[display_status]
[pause_resume]
[virtual_sdcard]
path = /home/bagricola/klipper/blah

[board_pins]
aliases:
    # EXP1 header
    EXP1_1=PC9, EXP1_3=PC12, EXP1_5=PC10, EXP1_7=PG4, EXP1_9=<GND>,
    EXP1_2=PA8, EXP1_4=PD0, EXP1_6=PC11, EXP1_8=PE7, EXP1_10=<5V>,
    # EXP2 header
    EXP2_1=PA6, EXP2_3=PC6, EXP2_5=PC7, EXP2_7=PB10,  EXP2_9=<GND>,
    EXP2_2=PA5, EXP2_4=PA4, EXP2_6=PA7, EXP2_8=<RST>, EXP2_10=<5V>,

[display]
lcd_type: uc1701
cs_pin: EXP1_3
a0_pin: EXP1_4
rst_pin: EXP1_5
contrast: 63
encoder_pins: ^EXP2_5, ^EXP2_3
click_pin: ^!EXP1_2
spi_software_miso_pin: EXP2_1
spi_software_mosi_pin: EXP2_6
spi_software_sclk_pin: EXP2_2

[output_pin beeper]
pin: EXP1_1

[neopixel fysetc_mini12864]
pin: EXP1_6
chain_count: 3
color_order: RGB
initial_RED: 0.4
initial_GREEN: 0.4
initial_BLUE: 0.4

[delayed_gcode setdisplayneopixel]
initial_duration: 1
gcode:
        SET_LED LED=fysetc_mini12864 RED=1 GREEN=1 BLUE=1 INDEX=1 TRANSMIT=0
        SET_LED LED=fysetc_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
        SET_LED LED=fysetc_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=3 

[menu]

[gcode_button emergency_stop]
pin: !PF14
press_gcode:
    M117 "Emergency Stop Pressed!"
    SET_LED LED=fysetc_mini12864 RED=1 GREEN=0 BLUE=0 INDEX=1
    M112

This is using BIG5160 drivers in the 1, 2 and 4 motor positions, X,Y and Z endstops in IO0, IO1 and IO2, the LED + RGB screen plugged into EXP1 and EXP2, and a normally-closed e-stop button on IO5.