diff --git a/meta-opencentauri/images/opencentauri-image-base.bb b/meta-opencentauri/images/opencentauri-image-base.bb index a2281ced..e729cb54 100644 --- a/meta-opencentauri/images/opencentauri-image-base.bb +++ b/meta-opencentauri/images/opencentauri-image-base.bb @@ -45,6 +45,7 @@ CORE_IMAGE_EXTRA_INSTALL += "\ v4l-utils \ iproute2 \ chrony \ + tmc-autotune \ " INITRAMFS_IMAGE = "core-image-tiny-initramfs" diff --git a/meta-opencentauri/recipes-apps/klipper/files/machine.cfg b/meta-opencentauri/recipes-apps/klipper/files/machine.cfg index cf82b8f9..b1a10e99 100644 --- a/meta-opencentauri/recipes-apps/klipper/files/machine.cfg +++ b/meta-opencentauri/recipes-apps/klipper/files/machine.cfg @@ -74,6 +74,9 @@ sense_resistor: 0.1 driver_sgthrs: 130 diag_pin: !PG4 +[autotune_tmc stepper_x] +motor: kelimotor-bj42d41-14v19 +sg4_thrs: 130 [stepper_y] step_pin: PE14 @@ -101,6 +104,9 @@ sense_resistor: 0.1 driver_sgthrs: 130 diag_pin: !PF6 +[autotune_tmc stepper_y] +motor: kelimotor-bj42d41-14v19 +sg4_thrs: 130 [stepper_z] step_pin: PG3 @@ -118,7 +124,6 @@ homing_retract_dist: 10 homing_retract_speed: 6 second_homing_speed: 2 - [tmc2209 stepper_z] tx_pin: PE9 uart_pin: PE6 @@ -129,6 +134,8 @@ sense_resistor: 0.1 driver_sgthrs: 130 stealthchop_threshold: 99999 +[autotune_tmc stepper_z] +motor: kelimotor-bj42d22-25v04 [extruder] step_pin: hotend:PC13 @@ -163,6 +170,9 @@ run_current: 0.7 uart_address: 3 sense_resistor: 0.1 +[autotune_tmc extruder] +motor: kelimotor-bjy36d13-04v28 + [verify_heater extruder] [thermistor hotend_thermistor] diff --git a/meta-opencentauri/recipes-data/klipper-tmc-autotune-addon/files/motor_database.cfg b/meta-opencentauri/recipes-data/klipper-tmc-autotune-addon/files/motor_database.cfg new file mode 100644 index 00000000..b3cfb90b --- /dev/null +++ b/meta-opencentauri/recipes-data/klipper-tmc-autotune-addon/files/motor_database.cfg @@ -0,0 +1,23 @@ +[motor_constants kelimotor-bj42d41-14v19] +# ELEGOO Centauri Carbon A/B +resistance: 1.1 +inductance: 0.0028 +holding_torque: 0.650 +max_current: 2.0 +steps_per_revolution: 200 + +[motor_constants kelimotor-bj42d22-25v04] +# ELEGOO Centauri Carbon Z +resistance: 2.9 +inductance: 0.0060 +holding_torque: 0.400 +max_current: 1.2 +steps_per_revolution: 200 + +[motor_constants kelimotor-bjy36d13-04v28] +# ELEGOO Centauri Carbon E +resistance: 2.0 +inductance: 0.0012 +holding_torque: 0.100 +max_current: 1.2 +steps_per_revolution: 200 \ No newline at end of file diff --git a/meta-opencentauri/recipes-data/klipper-tmc-autotune-addon/tmc-autotune_0.1.bb b/meta-opencentauri/recipes-data/klipper-tmc-autotune-addon/tmc-autotune_0.1.bb new file mode 100644 index 00000000..616c4ace --- /dev/null +++ b/meta-opencentauri/recipes-data/klipper-tmc-autotune-addon/tmc-autotune_0.1.bb @@ -0,0 +1,40 @@ +HOMEPAGE = "https://github.com/andrewmcgr/klipper_tmc_autotune" +LICENSE = "GPL-3.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=1ebbd3e34237af26da5dc08a4e440464" +SUMMARY = "TMC Autotune" +DESCRIPTION = "TMC stepper driver autotuning Klipper python extra" + +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI = " \ + git://github.com/andrewmcgr/klipper_tmc_autotune.git;protocol=https;branch=main \ + file://motor_database.cfg \ +" + +SRCREV = "3f979750b758ac95c67e19f658f60566c19fff82" + +S = "${WORKDIR}/git" + +DEPENDS = " \ + python3-native \ +" + +RDEPENDS:${PN} = " \ + klipper \ +" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + # Install klippy extras + install -d ${D}${datadir}/klipper/klippy/extras + cp ${S}/autotune_tmc.py ${S}/motor_constants.py ${D}${datadir}/klipper/klippy/extras/ + cp ${WORKDIR}/motor_database.cfg ${D}${datadir}/klipper/klippy/extras/ +} + +FILES:${PN} = " \ + ${datadir}/klipper/klippy/extras/autotune_tmc.py \ + ${datadir}/klipper/klippy/extras/motor_constants.py \ + ${datadir}/klipper/klippy/extras/motor_database.cfg \ +" \ No newline at end of file